2023-07-30 17:04:15 +07:00
( function ( l , r ) { if ( ! l || l . getElementById ( 'livereloadscript' ) ) return ; r = l . createElement ( 'script' ) ; r . async = 1 ; r . src = '//' + ( self . location . host || 'localhost' ) . split ( ':' ) [ 0 ] + ':35729/livereload.js?snipver=1' ; r . id = 'livereloadscript' ; l . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( r ) } ) ( self . document ) ;
import { S as SvelteElement , i as init , a as attribute _to _object , b as insert _dev , s as safe _not _equal , d as dispatch _dev , v as validate _slots , w as validate _store , x as component _subscribe , o as onMount , e as globals , y as empty , n as noop , p as detach _dev , A as validate _each _argument , f as element , B as text , h as space , j as add _location , k as attr _dev , u as src _url _equal , z as set _custom _element _data , l as append _dev , C as set _data _dev , D as destroy _each } from './index-998178c7.js' ;
import { w as writable } from './index-f9998ce7.js' ;
import { loadLocaleContent , getData } from '../../../../../../../../../js/libraries/serverTools.js' ;
import { addMarkersEntries , translate } from '../../../../../../../../../js/libraries/mapTools.js' ;
import { addCoopPinContent } from '../../../../../../../../../js/mapFuncs.js' ;
import '../../../../../../../../../js/components/map-component.js' ;
/* src\cooperatives-component.svelte generated by Svelte v3.52.0 */
const { Object : Object _1 , console : console _1 } = globals ;
const file = "src\\cooperatives-component.svelte" ;
function get _each _context ( ctx , list , i ) {
const child _ctx = ctx . slice ( ) ;
child _ctx [ 12 ] = list [ i ] [ 0 ] ;
child _ctx [ 3 ] = list [ i ] [ 1 ] ;
return child _ctx ;
}
function get _each _context _1 ( ctx , list , i ) {
const child _ctx = ctx . slice ( ) ;
child _ctx [ 15 ] = list [ i ] ;
return child _ctx ;
}
// (64:4) {#if $loaded==3}
function create _if _block ( ctx ) {
let div1 ;
let div0 ;
let h1 ;
let t0 _value = /*$content*/ ctx [ 1 ] . cooperatives + "" ;
let t0 ;
let t1 ;
let img ;
let img _src _value ;
let t2 ;
let p0 ;
let t3 _value = /*$content*/ ctx [ 1 ] . p1 + "" ;
let t3 ;
let t4 ;
let h3 ;
let t5 _value = /*$content*/ ctx [ 1 ] . subheading1 + "" ;
let t5 ;
let t6 ;
let map _component ;
let map _component _callback _value ;
let t7 ;
let p1 ;
let t8 _value = /*$content*/ ctx [ 1 ] [ "map-prompt" ] + "" ;
let t8 ;
let t9 ;
let each _value = Object . entries ( /*entriesByCountry*/ ctx [ 0 ] ) ;
validate _each _argument ( each _value ) ;
let each _blocks = [ ] ;
for ( let i = 0 ; i < each _value . length ; i += 1 ) {
each _blocks [ i ] = create _each _block ( get _each _context ( ctx , each _value , i ) ) ;
}
const block = {
c : function create ( ) {
div1 = element ( "div" ) ;
div0 = element ( "div" ) ;
h1 = element ( "h1" ) ;
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
img = element ( "img" ) ;
t2 = space ( ) ;
p0 = element ( "p" ) ;
t3 = text ( t3 _value ) ;
t4 = space ( ) ;
h3 = element ( "h3" ) ;
t5 = text ( t5 _value ) ;
t6 = space ( ) ;
map _component = element ( "map-component" ) ;
t7 = space ( ) ;
p1 = element ( "p" ) ;
t8 = text ( t8 _value ) ;
t9 = space ( ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
add _location ( h1 , file , 66 , 16 , 2019 ) ;
attr _dev ( img , "id" , "coops-img" ) ;
if ( ! src _url _equal ( img . src , img _src _value = "/img/common/coops.svg" ) ) attr _dev ( img , "src" , img _src _value ) ;
attr _dev ( img , "alt" , "coops" ) ;
add _location ( img , file , 67 , 16 , 2069 ) ;
attr _dev ( p0 , "class" , "description" ) ;
add _location ( p0 , file , 68 , 16 , 2147 ) ;
add _location ( h3 , file , 69 , 16 , 2205 ) ;
set _custom _element _data ( map _component , "id" , "map" ) ;
set _custom _element _data ( map _component , "callback" , map _component _callback _value = /*func*/ ctx [ 10 ] ) ;
add _location ( map _component , file , 70 , 16 , 2254 ) ;
attr _dev ( p1 , "id" , "add-prompt" ) ;
add _location ( p1 , file , 71 , 16 , 2377 ) ;
attr _dev ( div0 , "id" , "text-container" ) ;
add _location ( div0 , file , 65 , 12 , 1976 ) ;
attr _dev ( div1 , "id" , "container" ) ;
add _location ( div1 , file , 64 , 8 , 1942 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , div1 , anchor ) ;
append _dev ( div1 , div0 ) ;
append _dev ( div0 , h1 ) ;
append _dev ( h1 , t0 ) ;
append _dev ( div0 , t1 ) ;
append _dev ( div0 , img ) ;
append _dev ( div0 , t2 ) ;
append _dev ( div0 , p0 ) ;
append _dev ( p0 , t3 ) ;
append _dev ( div0 , t4 ) ;
append _dev ( div0 , h3 ) ;
append _dev ( h3 , t5 ) ;
append _dev ( div0 , t6 ) ;
append _dev ( div0 , map _component ) ;
append _dev ( div0 , t7 ) ;
append _dev ( div0 , p1 ) ;
append _dev ( p1 , t8 ) ;
append _dev ( div0 , t9 ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div0 , null ) ;
}
} ,
p : function update ( ctx , dirty ) {
if ( dirty & /*$content*/ 2 && t0 _value !== ( t0 _value = /*$content*/ ctx [ 1 ] . cooperatives + "" ) ) set _data _dev ( t0 , t0 _value ) ;
if ( dirty & /*$content*/ 2 && t3 _value !== ( t3 _value = /*$content*/ ctx [ 1 ] . p1 + "" ) ) set _data _dev ( t3 , t3 _value ) ;
if ( dirty & /*$content*/ 2 && t5 _value !== ( t5 _value = /*$content*/ ctx [ 1 ] . subheading1 + "" ) ) set _data _dev ( t5 , t5 _value ) ;
if ( dirty & /*$content*/ 2 && map _component _callback _value !== ( map _component _callback _value = /*func*/ ctx [ 10 ] ) ) {
set _custom _element _data ( map _component , "callback" , map _component _callback _value ) ;
}
if ( dirty & /*$content*/ 2 && t8 _value !== ( t8 _value = /*$content*/ ctx [ 1 ] [ "map-prompt" ] + "" ) ) set _data _dev ( t8 , t8 _value ) ;
if ( dirty & /*Object, entriesByCountry, $content, getAddress, console, getCountry*/ 771 ) {
each _value = Object . entries ( /*entriesByCountry*/ ctx [ 0 ] ) ;
validate _each _argument ( each _value ) ;
let i ;
for ( i = 0 ; i < each _value . length ; i += 1 ) {
const child _ctx = get _each _context ( ctx , each _value , i ) ;
if ( each _blocks [ i ] ) {
each _blocks [ i ] . p ( child _ctx , dirty ) ;
} else {
each _blocks [ i ] = create _each _block ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div0 , null ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value . length ;
}
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( div1 ) ;
destroy _each ( each _blocks , detaching ) ;
}
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _if _block . name ,
type : "if" ,
source : "(64:4) {#if $loaded==3}" ,
ctx
} ) ;
return block ;
}
// (76:24) {#each entries as entry}
function create _each _block _1 ( ctx ) {
let t0 _value = console . log ( /*entry*/ ctx [ 15 ] ) + "" ;
let t0 ;
let t1 ;
let div2 ;
let div1 ;
let div0 ;
let p0 ;
let b0 ;
let t2 _value = /*$content*/ ctx [ 1 ] . name + "" ;
let t2 ;
let t3 ;
let t4 _value = /*entry*/ ctx [ 15 ] . name + "" ;
let t4 ;
let t5 ;
let p1 ;
let b1 ;
let t6 _value = /*$content*/ ctx [ 1 ] . location + "" ;
let t6 ;
let t7 ;
let t8 _value = /*getAddress*/ ctx [ 9 ] ( /*entry*/ ctx [ 15 ] ) + "" ;
let t8 ;
let t9 ;
let p2 ;
let b2 ;
let t10 _value = /*$content*/ ctx [ 1 ] . market + "" ;
let t10 ;
let t11 ;
let t12 _value = /*entry*/ ctx [ 15 ] . market + "" ;
let t12 ;
let t13 ;
let p3 ;
let b3 ;
let t14 _value = /*$content*/ ctx [ 1 ] . workers + "" ;
let t14 ;
let t15 ;
let t16 _value = /*entry*/ ctx [ 15 ] . workers + "" ;
let t16 ;
let t17 ;
let p4 ;
let b4 ;
let t18 _value = /*$content*/ ctx [ 1 ] . status + "" ;
let t18 ;
let t19 ;
let t20 _value = /*entry*/ ctx [ 15 ] . status + "" ;
let t20 ;
let t21 ;
let p5 ;
let b5 ;
let t22 _value = /*$content*/ ctx [ 1 ] . website + "" ;
let t22 ;
let t23 ;
let a0 ;
let t24 _value = /*entry*/ ctx [ 15 ] . website + "" ;
let t24 ;
let a0 _href _value ;
let t25 ;
let p6 ;
let b6 ;
let t26 _value = /*$content*/ ctx [ 1 ] . contact + "" ;
let t26 ;
let t27 ;
let a1 ;
let t28 _value = /*entry*/ ctx [ 15 ] . contact + "" ;
let t28 ;
let a1 _href _value ;
let t29 ;
let picture ;
let source0 ;
let source0 _srcset _value ;
let t30 ;
let source1 ;
let source1 _srcset _value ;
let t31 ;
let img ;
let t32 ;
let p7 ;
let b7 ;
let t33 _value = /*$content*/ ctx [ 1 ] . description + "" ;
let t33 ;
let t34 ;
let t35 _value = /*entry*/ ctx [ 15 ] . description + "" ;
let t35 ;
const block = {
c : function create ( ) {
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
div2 = element ( "div" ) ;
div1 = element ( "div" ) ;
div0 = element ( "div" ) ;
p0 = element ( "p" ) ;
b0 = element ( "b" ) ;
t2 = text ( t2 _value ) ;
t3 = text ( ": " ) ;
t4 = text ( t4 _value ) ;
t5 = space ( ) ;
p1 = element ( "p" ) ;
b1 = element ( "b" ) ;
t6 = text ( t6 _value ) ;
t7 = text ( ": " ) ;
t8 = text ( t8 _value ) ;
t9 = space ( ) ;
p2 = element ( "p" ) ;
b2 = element ( "b" ) ;
t10 = text ( t10 _value ) ;
t11 = text ( ": " ) ;
t12 = text ( t12 _value ) ;
t13 = space ( ) ;
p3 = element ( "p" ) ;
b3 = element ( "b" ) ;
t14 = text ( t14 _value ) ;
t15 = text ( ": " ) ;
t16 = text ( t16 _value ) ;
t17 = space ( ) ;
p4 = element ( "p" ) ;
b4 = element ( "b" ) ;
t18 = text ( t18 _value ) ;
t19 = text ( ": " ) ;
t20 = text ( t20 _value ) ;
t21 = space ( ) ;
p5 = element ( "p" ) ;
b5 = element ( "b" ) ;
t22 = text ( t22 _value ) ;
t23 = text ( ": " ) ;
a0 = element ( "a" ) ;
t24 = text ( t24 _value ) ;
t25 = space ( ) ;
p6 = element ( "p" ) ;
b6 = element ( "b" ) ;
t26 = text ( t26 _value ) ;
t27 = text ( ": " ) ;
a1 = element ( "a" ) ;
t28 = text ( t28 _value ) ;
t29 = space ( ) ;
picture = element ( "picture" ) ;
source0 = element ( "source" ) ;
t30 = space ( ) ;
source1 = element ( "source" ) ;
t31 = space ( ) ;
img = element ( "img" ) ;
t32 = space ( ) ;
p7 = element ( "p" ) ;
b7 = element ( "b" ) ;
t33 = text ( t33 _value ) ;
t34 = text ( ": " ) ;
t35 = text ( t35 _value ) ;
add _location ( b0 , file , 80 , 43 , 2928 ) ;
add _location ( p0 , file , 80 , 40 , 2925 ) ;
add _location ( b1 , file , 81 , 43 , 3013 ) ;
add _location ( p1 , file , 81 , 40 , 3010 ) ;
add _location ( b2 , file , 82 , 43 , 3109 ) ;
add _location ( p2 , file , 82 , 40 , 3106 ) ;
add _location ( b3 , file , 83 , 43 , 3198 ) ;
add _location ( p3 , file , 83 , 40 , 3195 ) ;
add _location ( b4 , file , 84 , 43 , 3289 ) ;
add _location ( p4 , file , 84 , 40 , 3286 ) ;
add _location ( b5 , file , 85 , 43 , 3378 ) ;
attr _dev ( a0 , "href" , a0 _href _value = /*entry*/ ctx [ 15 ] . website ) ;
attr _dev ( a0 , "target" , "_blank" ) ;
attr _dev ( a0 , "rel" , "noreferrer" ) ;
add _location ( a0 , file , 85 , 70 , 3405 ) ;
add _location ( p5 , file , 85 , 40 , 3375 ) ;
add _location ( b6 , file , 86 , 43 , 3528 ) ;
attr _dev ( a1 , "href" , a1 _href _value = /*entry*/ ctx [ 15 ] . contact ) ;
attr _dev ( a1 , "target" , ";_blank;" ) ;
attr _dev ( a1 , "rel" , "noreferrer" ) ;
add _location ( a1 , file , 86 , 70 , 3555 ) ;
add _location ( p6 , file , 86 , 40 , 3525 ) ;
add _location ( div0 , file , 79 , 36 , 2878 ) ;
attr _dev ( source0 , "srcset" , source0 _srcset _value = "/img/coops/" + /*entry*/ ctx [ 15 ] . logo + ".webp" ) ;
add _location ( source0 , file , 89 , 40 , 3766 ) ;
attr _dev ( source1 , "srcset" , source1 _srcset _value = "/img/coops/" + /*entry*/ ctx [ 15 ] . logo + ".png" ) ;
add _location ( source1 , file , 90 , 40 , 3858 ) ;
attr _dev ( img , "class" , "coop-logo" ) ;
attr _dev ( img , "alt" , "logo" ) ;
add _location ( img , file , 91 , 40 , 3949 ) ;
add _location ( picture , file , 88 , 36 , 3715 ) ;
attr _dev ( div1 , "class" , "img-general-info" ) ;
add _location ( div1 , file , 78 , 32 , 2810 ) ;
add _location ( b7 , file , 94 , 35 , 4108 ) ;
add _location ( p7 , file , 94 , 32 , 4105 ) ;
attr _dev ( div2 , "class" , "location-info" ) ;
add _location ( div2 , file , 77 , 28 , 2749 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , t0 , anchor ) ;
insert _dev ( target , t1 , anchor ) ;
insert _dev ( target , div2 , anchor ) ;
append _dev ( div2 , div1 ) ;
append _dev ( div1 , div0 ) ;
append _dev ( div0 , p0 ) ;
append _dev ( p0 , b0 ) ;
append _dev ( b0 , t2 ) ;
append _dev ( b0 , t3 ) ;
append _dev ( p0 , t4 ) ;
append _dev ( div0 , t5 ) ;
append _dev ( div0 , p1 ) ;
append _dev ( p1 , b1 ) ;
append _dev ( b1 , t6 ) ;
append _dev ( b1 , t7 ) ;
append _dev ( p1 , t8 ) ;
append _dev ( div0 , t9 ) ;
append _dev ( div0 , p2 ) ;
append _dev ( p2 , b2 ) ;
append _dev ( b2 , t10 ) ;
append _dev ( b2 , t11 ) ;
append _dev ( p2 , t12 ) ;
append _dev ( div0 , t13 ) ;
append _dev ( div0 , p3 ) ;
append _dev ( p3 , b3 ) ;
append _dev ( b3 , t14 ) ;
append _dev ( b3 , t15 ) ;
append _dev ( p3 , t16 ) ;
append _dev ( div0 , t17 ) ;
append _dev ( div0 , p4 ) ;
append _dev ( p4 , b4 ) ;
append _dev ( b4 , t18 ) ;
append _dev ( b4 , t19 ) ;
append _dev ( p4 , t20 ) ;
append _dev ( div0 , t21 ) ;
append _dev ( div0 , p5 ) ;
append _dev ( p5 , b5 ) ;
append _dev ( b5 , t22 ) ;
append _dev ( b5 , t23 ) ;
append _dev ( p5 , a0 ) ;
append _dev ( a0 , t24 ) ;
append _dev ( div0 , t25 ) ;
append _dev ( div0 , p6 ) ;
append _dev ( p6 , b6 ) ;
append _dev ( b6 , t26 ) ;
append _dev ( b6 , t27 ) ;
append _dev ( p6 , a1 ) ;
append _dev ( a1 , t28 ) ;
append _dev ( div1 , t29 ) ;
append _dev ( div1 , picture ) ;
append _dev ( picture , source0 ) ;
append _dev ( picture , t30 ) ;
append _dev ( picture , source1 ) ;
append _dev ( picture , t31 ) ;
append _dev ( picture , img ) ;
append _dev ( div2 , t32 ) ;
append _dev ( div2 , p7 ) ;
append _dev ( p7 , b7 ) ;
append _dev ( b7 , t33 ) ;
append _dev ( b7 , t34 ) ;
append _dev ( p7 , t35 ) ;
} ,
p : function update ( ctx , dirty ) {
if ( dirty & /*entriesByCountry*/ 1 && t0 _value !== ( t0 _value = console . log ( /*entry*/ ctx [ 15 ] ) + "" ) ) set _data _dev ( t0 , t0 _value ) ;
if ( dirty & /*$content*/ 2 && t2 _value !== ( t2 _value = /*$content*/ ctx [ 1 ] . name + "" ) ) set _data _dev ( t2 , t2 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t4 _value !== ( t4 _value = /*entry*/ ctx [ 15 ] . name + "" ) ) set _data _dev ( t4 , t4 _value ) ;
if ( dirty & /*$content*/ 2 && t6 _value !== ( t6 _value = /*$content*/ ctx [ 1 ] . location + "" ) ) set _data _dev ( t6 , t6 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t8 _value !== ( t8 _value = /*getAddress*/ ctx [ 9 ] ( /*entry*/ ctx [ 15 ] ) + "" ) ) set _data _dev ( t8 , t8 _value ) ;
if ( dirty & /*$content*/ 2 && t10 _value !== ( t10 _value = /*$content*/ ctx [ 1 ] . market + "" ) ) set _data _dev ( t10 , t10 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t12 _value !== ( t12 _value = /*entry*/ ctx [ 15 ] . market + "" ) ) set _data _dev ( t12 , t12 _value ) ;
if ( dirty & /*$content*/ 2 && t14 _value !== ( t14 _value = /*$content*/ ctx [ 1 ] . workers + "" ) ) set _data _dev ( t14 , t14 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t16 _value !== ( t16 _value = /*entry*/ ctx [ 15 ] . workers + "" ) ) set _data _dev ( t16 , t16 _value ) ;
if ( dirty & /*$content*/ 2 && t18 _value !== ( t18 _value = /*$content*/ ctx [ 1 ] . status + "" ) ) set _data _dev ( t18 , t18 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t20 _value !== ( t20 _value = /*entry*/ ctx [ 15 ] . status + "" ) ) set _data _dev ( t20 , t20 _value ) ;
if ( dirty & /*$content*/ 2 && t22 _value !== ( t22 _value = /*$content*/ ctx [ 1 ] . website + "" ) ) set _data _dev ( t22 , t22 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t24 _value !== ( t24 _value = /*entry*/ ctx [ 15 ] . website + "" ) ) set _data _dev ( t24 , t24 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && a0 _href _value !== ( a0 _href _value = /*entry*/ ctx [ 15 ] . website ) ) {
attr _dev ( a0 , "href" , a0 _href _value ) ;
}
if ( dirty & /*$content*/ 2 && t26 _value !== ( t26 _value = /*$content*/ ctx [ 1 ] . contact + "" ) ) set _data _dev ( t26 , t26 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t28 _value !== ( t28 _value = /*entry*/ ctx [ 15 ] . contact + "" ) ) set _data _dev ( t28 , t28 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && a1 _href _value !== ( a1 _href _value = /*entry*/ ctx [ 15 ] . contact ) ) {
attr _dev ( a1 , "href" , a1 _href _value ) ;
}
if ( dirty & /*entriesByCountry*/ 1 && source0 _srcset _value !== ( source0 _srcset _value = "/img/coops/" + /*entry*/ ctx [ 15 ] . logo + ".webp" ) ) {
attr _dev ( source0 , "srcset" , source0 _srcset _value ) ;
}
if ( dirty & /*entriesByCountry*/ 1 && source1 _srcset _value !== ( source1 _srcset _value = "/img/coops/" + /*entry*/ ctx [ 15 ] . logo + ".png" ) ) {
attr _dev ( source1 , "srcset" , source1 _srcset _value ) ;
}
if ( dirty & /*$content*/ 2 && t33 _value !== ( t33 _value = /*$content*/ ctx [ 1 ] . description + "" ) ) set _data _dev ( t33 , t33 _value ) ;
if ( dirty & /*entriesByCountry*/ 1 && t35 _value !== ( t35 _value = /*entry*/ ctx [ 15 ] . description + "" ) ) set _data _dev ( t35 , t35 _value ) ;
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( t0 ) ;
if ( detaching ) detach _dev ( t1 ) ;
if ( detaching ) detach _dev ( div2 ) ;
}
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _each _block _1 . name ,
type : "each" ,
source : "(76:24) {#each entries as entry}" ,
ctx
} ) ;
return block ;
}
// (73:16) {#each Object.entries(entriesByCountry) as [name,entries]}
function create _each _block ( ctx ) {
let h4 ;
let t0 _value = /*getCountry*/ ctx [ 8 ] ( /*name*/ ctx [ 12 ] ) + "" ;
let t0 ;
let t1 ;
let div ;
let t2 ;
let each _value _1 = /*entries*/ ctx [ 3 ] ;
validate _each _argument ( each _value _1 ) ;
let each _blocks = [ ] ;
for ( let i = 0 ; i < each _value _1 . length ; i += 1 ) {
each _blocks [ i ] = create _each _block _1 ( get _each _context _1 ( ctx , each _value _1 , i ) ) ;
}
const block = {
c : function create ( ) {
h4 = element ( "h4" ) ;
t0 = text ( t0 _value ) ;
t1 = space ( ) ;
div = element ( "div" ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . c ( ) ;
}
t2 = space ( ) ;
attr _dev ( h4 , "class" , "country-name" ) ;
add _location ( h4 , file , 73 , 20 , 2522 ) ;
attr _dev ( div , "class" , "country-block" ) ;
add _location ( div , file , 74 , 20 , 2592 ) ;
} ,
m : function mount ( target , anchor ) {
insert _dev ( target , h4 , anchor ) ;
append _dev ( h4 , t0 ) ;
insert _dev ( target , t1 , anchor ) ;
insert _dev ( target , div , anchor ) ;
for ( let i = 0 ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . m ( div , null ) ;
}
append _dev ( div , t2 ) ;
} ,
p : function update ( ctx , dirty ) {
if ( dirty & /*entriesByCountry*/ 1 && t0 _value !== ( t0 _value = /*getCountry*/ ctx [ 8 ] ( /*name*/ ctx [ 12 ] ) + "" ) ) set _data _dev ( t0 , t0 _value ) ;
if ( dirty & /*Object, entriesByCountry, $content, getAddress, console*/ 515 ) {
each _value _1 = /*entries*/ ctx [ 3 ] ;
validate _each _argument ( each _value _1 ) ;
let i ;
for ( i = 0 ; i < each _value _1 . length ; i += 1 ) {
const child _ctx = get _each _context _1 ( ctx , each _value _1 , i ) ;
if ( each _blocks [ i ] ) {
each _blocks [ i ] . p ( child _ctx , dirty ) ;
} else {
each _blocks [ i ] = create _each _block _1 ( child _ctx ) ;
each _blocks [ i ] . c ( ) ;
each _blocks [ i ] . m ( div , t2 ) ;
}
}
for ( ; i < each _blocks . length ; i += 1 ) {
each _blocks [ i ] . d ( 1 ) ;
}
each _blocks . length = each _value _1 . length ;
}
} ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( h4 ) ;
if ( detaching ) detach _dev ( t1 ) ;
if ( detaching ) detach _dev ( div ) ;
destroy _each ( each _blocks , detaching ) ;
}
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _each _block . name ,
type : "each" ,
source : "(73:16) {#each Object.entries(entriesByCountry) as [name,entries]}" ,
ctx
} ) ;
return block ;
}
// (63:0) {#key $loaded}
function create _key _block ( ctx ) {
let if _block _anchor ;
let if _block = /*$loaded*/ ctx [ 2 ] == 3 && create _if _block ( ctx ) ;
const block = {
c : function create ( ) {
if ( if _block ) if _block . c ( ) ;
if _block _anchor = empty ( ) ;
} ,
m : function mount ( target , anchor ) {
if ( if _block ) if _block . m ( target , anchor ) ;
insert _dev ( target , if _block _anchor , anchor ) ;
} ,
p : function update ( ctx , dirty ) {
if ( /*$loaded*/ ctx [ 2 ] == 3 ) {
if ( if _block ) {
if _block . p ( ctx , dirty ) ;
} else {
if _block = create _if _block ( ctx ) ;
if _block . c ( ) ;
if _block . m ( if _block _anchor . parentNode , if _block _anchor ) ;
}
} else if ( if _block ) {
if _block . d ( 1 ) ;
if _block = null ;
}
} ,
d : function destroy ( detaching ) {
if ( if _block ) if _block . d ( detaching ) ;
if ( detaching ) detach _dev ( if _block _anchor ) ;
}
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _key _block . name ,
type : "key" ,
source : "(63:0) {#key $loaded}" ,
ctx
} ) ;
return block ;
}
function create _fragment ( ctx ) {
let previous _key = /*$loaded*/ ctx [ 2 ] ;
let key _block _anchor ;
let key _block = create _key _block ( ctx ) ;
const block = {
c : function create ( ) {
key _block . c ( ) ;
key _block _anchor = empty ( ) ;
this . c = noop ;
} ,
l : function claim ( nodes ) {
throw new Error ( "options.hydrate only works if the component was compiled with the `hydratable: true` option" ) ;
} ,
m : function mount ( target , anchor ) {
key _block . m ( target , anchor ) ;
insert _dev ( target , key _block _anchor , anchor ) ;
} ,
p : function update ( ctx , [ dirty ] ) {
if ( dirty & /*$loaded*/ 4 && safe _not _equal ( previous _key , previous _key = /*$loaded*/ ctx [ 2 ] ) ) {
key _block . d ( 1 ) ;
key _block = create _key _block ( ctx ) ;
key _block . c ( ) ;
key _block . m ( key _block _anchor . parentNode , key _block _anchor ) ;
} else {
key _block . p ( ctx , dirty ) ;
}
} ,
i : noop ,
o : noop ,
d : function destroy ( detaching ) {
if ( detaching ) detach _dev ( key _block _anchor ) ;
key _block . d ( detaching ) ;
}
} ;
dispatch _dev ( "SvelteRegisterBlock" , {
block ,
id : create _fragment . name ,
type : "component" ,
source : "" ,
ctx
} ) ;
return block ;
}
function instance ( $$self , $$props , $$invalidate ) {
let $content ;
let $loaded ;
let { $$slots : slots = { } , $$scope } = $$props ;
validate _slots ( 'cooperatives-component' , slots , [ ] ) ;
let loaded = writable ( 0 ) ;
validate _store ( loaded , 'loaded' ) ;
component _subscribe ( $$self , loaded , value => $$invalidate ( 2 , $loaded = value ) ) ;
let content = writable ( { } ) ;
validate _store ( content , 'content' ) ;
component _subscribe ( $$self , content , value => $$invalidate ( 1 , $content = value ) ) ;
let entries ;
let entriesByCountry ;
let locale = loadLocaleContent ( content , "cooperatives-component" , loaded ) ;
loadLocaleContent ( content , "countries" , loaded ) ;
let callback = response => {
$$invalidate ( 3 , entries = JSON . parse ( response ) ) ;
$$invalidate ( 0 , entriesByCountry = { } ) ;
for ( let g of entries ) {
let country = g . country ;
if ( g . contact == null ) {
g . contact = "https://discord.gg/Qk8KUk787z" ;
}
if ( country in entriesByCountry ) {
entriesByCountry [ country ] . push ( g ) ;
} else {
$$invalidate ( 0 , entriesByCountry [ country ] = [ g ] , entriesByCountry ) ;
}
}
loaded . update ( val => {
return val + 1 ;
} ) ;
} ;
getData ( "/assets/cooperatives.json" , callback ) ;
function mapCallback ( createMap , content , locale ) {
let map = createMap ( [ 22 , 0 ] , 2 ) ;
addMarkersEntries ( entries , entriesByCountry , map , content , locale , addCoopPinContent , "blue" ) ;
}
function getCountry ( x ) {
return locale == "en" ? x : translate ( $content , x ) ;
}
function getAddress ( g ) {
let location = [ g . country , g . state , g . town ] . filter ( x => x != null ) ;
return location . map ( x => locale == "en" ? x : translate ( $content , x ) ) . join ( ", " ) ;
}
onMount ( ( ) => {
} ) ;
const writable _props = [ ] ;
Object _1 . keys ( $$props ) . forEach ( key => {
if ( ! ~ writable _props . indexOf ( key ) && key . slice ( 0 , 2 ) !== '$$' && key !== 'slot' ) console _1 . warn ( ` <cooperatives-component> was created with unknown prop ' ${ key } ' ` ) ;
} ) ;
const func = createMap => mapCallback ( createMap , $content , locale ) ;
$$self . $capture _state = ( ) => ( {
onMount ,
writable ,
loadLocaleContent ,
getData ,
addMarkersEntries ,
translate ,
addCoopPinContent ,
loaded ,
content ,
entries ,
entriesByCountry ,
locale ,
callback ,
mapCallback ,
getCountry ,
getAddress ,
$content ,
$loaded
} ) ;
$$self . $inject _state = $$props => {
if ( 'loaded' in $$props ) $$invalidate ( 4 , loaded = $$props . loaded ) ;
if ( 'content' in $$props ) $$invalidate ( 5 , content = $$props . content ) ;
if ( 'entries' in $$props ) $$invalidate ( 3 , entries = $$props . entries ) ;
if ( 'entriesByCountry' in $$props ) $$invalidate ( 0 , entriesByCountry = $$props . entriesByCountry ) ;
if ( 'locale' in $$props ) $$invalidate ( 6 , locale = $$props . locale ) ;
if ( 'callback' in $$props ) callback = $$props . callback ;
} ;
if ( $$props && "$$inject" in $$props ) {
$$self . $inject _state ( $$props . $$inject ) ;
}
return [
entriesByCountry ,
$content ,
$loaded ,
entries ,
loaded ,
content ,
locale ,
mapCallback ,
getCountry ,
getAddress ,
func
] ;
}
class Cooperatives _component extends SvelteElement {
constructor ( options ) {
super ( ) ;
this . shadowRoot . innerHTML = ` <style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#coops-img{position:absolute;width:10.5rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}.img-general-info{display:flex;align-content:center;width:100%;justify-content:space-between;gap:3rem;align-items:center}.img-general-info>:first-child{flex:none}.coop-logo{position:relative;right:0;max-height:6rem;max-width:100%}.country-name{margin-bottom:1rem}.country-block{margin-bottom:2rem}.location-info{position:relative;margin-bottom:2rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:0.5rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}h1{margin-bottom:1rem;font-size:2.2rem;text-align:center}h3{margin-top:1rem;margin-bottom:1rem}#container{margin:auto;max-width:800px;margin-top:1rem;margin-bottom:4rem}#container p{text-align:justify}@media only screen and (max-width: 600px){.img-general-info{display:flex;flex-direction:column-reverse;align-content:left;width:100%;gap:1rem;align-items:left;margin-bottom:0rem}.img-general-info>:nth-child(2){width:max-content}.img-general-info>:nth-child(1){width:100%}}</style> ` ;
init (
this ,
{
target : this . shadowRoot ,
props : attribute _to _object ( this . attributes ) ,
customElement : true
} ,
instance ,
create _fragment ,
safe _not _equal ,
{ } ,
null
) ;
if ( options ) {
if ( options . target ) {
insert _dev ( options . target , this , options . anchor ) ;
}
}
}
}
customElements . define ( "cooperatives-component" , Cooperatives _component ) ;
export { Cooperatives _component as default } ;