From b609202f5c5fc0c396fe8377fe9bac2aebba4a7c Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Wed, 30 Sep 2026 01:30:49 +0000 Subject: [PATCH] Keep the UPG-100 status badge off the map credits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The badge sat at bottom:10px right:10px, z-index 5: the corner both engines keep their attribution in. It won every hit point of the OpenStreetMap credit on both engines in English and Arabic. In Arabic the list panel mirrors onto that corner, so the badge also covered the panel's pin note, and the panel itself lay over the top of the credit line. - The badge sits at the inline end (right in English, left in Arabic), 6px above --upg-credit-floor: 30px for the tallest single-line credit (the Mapbox wordmark) plus the lift LegendMobile gives the engine corners on a phone. z-index 1 keeps it under the engine corners, and it takes no pointer events. - On phones (max-width 767px) it is hidden. It always sat under the collapsed legend sheet there (0 of 15 of its points visible), so this keeps what a phone showed. - The batch HUD, which stacks above the badge, follows it. - The desktop legend panel ends above the credit band where a credit shares its corner: Arabic on both engines (the attribution) and Mapbox in English (the wordmark). MapLibre in English is unchanged. The rule is scoped to the desktop slot; unscoped, it collapsed the phone sheet's panel on Mapbox. Measured on a local serve of the upg-100-mfe leaf, 1440 and 390, both engines, en and ar. Credit hit points before, at 1440: OpenStreetMap 0/15 in all four cases; the Mapbox wordmark 5/15 in English; in Arabic on MapLibre every credit was 0/15. After: every credit 15/15, except '© Mapbox' in Arabic, whose right-to-left box spans the whole credit line and whose points go only to the neighbouring credit links. At 390 all credits are 15/15 before and after, and the sheet's panel is unchanged (48px). --- .../my-upg-100-list/upg-100-list.vue | 44 ++++++++++++++++--- public/dx-maps/doxa-maps-spa/manifest.json | 12 ++--- public/dx-maps/manifest.json | 12 ++--- .../my-upg-100-list/my-upg-100-list.js | 2 +- .../my-upg-100-list/poster-wall/index.html | 2 +- .../my-upg-100-list/upg-100-list/index.html | 2 +- .../my-upg-100-list/upg-100-mfe/index.html | 2 +- 7 files changed, 54 insertions(+), 22 deletions(-) diff --git a/plugin-designs/my-upg-100-list/upg-100-list.vue b/plugin-designs/my-upg-100-list/upg-100-list.vue index 097fc7d3c..e3932886e 100644 --- a/plugin-designs/my-upg-100-list/upg-100-list.vue +++ b/plugin-designs/my-upg-100-list/upg-100-list.vue @@ -535,9 +535,26 @@ useShadowStyles( // The bottom-sheet owns the people-group card on mobile — see the // .upg-detail-desktop-slot comment in the template. '.upg-detail-desktop-slot{display:none}}' + - '.upg-status{position:absolute;bottom:10px;right:10px;z-index:5;' + - 'font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);' + + // ★ THE MAP CREDITS ARE A LICENCE TERM, AND THIS BADGE SAT ON THEM. bottom:10px + right:10px is the + // corner both engines put their attribution in, and at z-index 5 the badge won every hit point of + // '© OpenStreetMap' on both engines in en and ar; in Arabic the list panel mirrors onto that corner + // too, so it also covered the panel's pin note (measured on 29634ed07, card + // FIX-UPG100-STATUS-BADGE-COVERS-THE-MAP-ATTRIBUTION). + // --upg-credit-floor is the top of the credit band: 30px, the tallest single-line credit (the Mapbox + // wordmark, 23px + its 6px margin; the attribution line and the compact "i" are shorter), plus the + // lift LegendMobile already gives the engine corners on a phone (the collapsed sheet, or the + // gallery's menu button), read from the same two variables so whatever stacks on it moves with them. + // The badge sits above that floor at the INLINE END: the right in English, the left in Arabic, where + // the panel is not. z-index 1 keeps it under the engine corners (z 2-3), so a credit that grows (the + // compact "i" expanded on a narrow map) paints over the badge, never under it; and it takes no clicks. + '.upg-root{--upg-credit-floor:calc(max(min(var(--legend-sheet-h,0px),48px),var(--map-fab-clearance,0px)) + 30px)}' + + '.upg-status{position:absolute;bottom:calc(var(--upg-credit-floor) + 6px);inset-inline-end:10px;z-index:1;' + + 'pointer-events:none;font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);' + 'padding:6px 10px;border-radius:8px}' + + // On a phone the collapsed legend sheet owns the bottom edge, and the badge always sat UNDER it (at 390, + // 0 of its 15 points visible, both engines, en and ar), so it was never seen there. That stays true, now + // on purpose instead of by accident: lifting it above the sheet would put new chrome on the phone map. + '@media(max-width:767px){.upg-status{display:none}}' + // slice 13 §1c: detail-panel wrapper. The SemanticTreeLegend lives top-LEFT // (.stl-panel left:8px) in THIS profile and the MapToolbar floats top-RIGHT; // so the detail panel slides in from the RIGHT edge, starting below the @@ -555,10 +572,12 @@ useShadowStyles( '@media(max-width:480px){.upg-detail-panel{top:auto;left:8px;right:8px;' + 'width:auto;height:55vh}}' + // ── 09b shift-select tool: the land-division HUD (sits ABOVE the status badge, - // bottom-right). Shows "N territories · TOTAL UUPG" live + a Copy/Clear bar that + // at the same inline end, so it follows the badge off the credit band: the badge's + // top is the floor + 6 + its 22px, and 2px more is the gap this HUD always kept). + // Shows "N territories · TOTAL UUPG" live + a Copy/Clear bar that // only appears when something is selected. (No backticks anywhere in this string // — a stray one closes the JS template literal and blanks the whole stylesheet.) - '.upg-hud{position:absolute;bottom:34px;right:10px;z-index:6;min-width:150px;' + + '.upg-hud{position:absolute;bottom:calc(var(--upg-credit-floor) + 30px);inset-inline-end:10px;z-index:6;min-width:150px;' + 'font:11px/1.35 ui-monospace,monospace;color:#e5e7eb;' + 'background:rgba(10,20,16,.92);border:1px solid rgba(110,231,183,.35);' + 'border-radius:10px;padding:8px 10px;box-shadow:0 4px 16px rgba(0,0,0,.4)}' + @@ -597,7 +616,7 @@ useShadowStyles( 'font:12px/1 ui-monospace,monospace;padding:0 8px;border-radius:8px}' + // R1.2 mobile sizing: at ≤480px the HUD spans the bottom edge (above the status // badge) so the Batch button + swatches + Copy never overlap the legend/toolbar. - '@media(max-width:480px){.upg-hud{left:8px;right:8px;min-width:0;bottom:30px;' + + '@media(max-width:480px){.upg-hud{left:8px;right:8px;min-width:0;bottom:calc(var(--upg-credit-floor) + 30px);' + 'max-height:48vh;overflow:auto}}' + // ── Batch Select toggle — the ONLY local rule left is the emerald ON state ─── // ARCHIVED 2026-07-30: this profile used to hand-roll the whole button skin @@ -672,6 +691,18 @@ useShadowStyles( // embedded. Verify in a constrained host, never on the bare leaf. '.stl-panel{--stl-top:8px!important}' + '.upg-root:has(.mapboxgl-ctrl-geocoder) .stl-panel{--stl-top:58px!important}' + + // ★ …AND IT ENDS ABOVE THE CREDIT BAND WHERE A CREDIT SHARES ITS CORNER. The panel sits at the inline + // START, 12px off the map's bottom. In Arabic that is the bottom-RIGHT, the corner both engines keep + // their attribution in (they do not mirror it), so the panel lay over the top of the credit line; on + // Mapbox in English it is the bottom-LEFT, over the Mapbox wordmark (5 of 15 hit points visible, + // measured on 29634ed07). Those two cases give up the credit band (the same 30px as + // --upg-credit-floor); MapLibre in English has no credit in that corner, so its panel is unchanged. + // Same max-height formula as SemanticTreeLegend's own cap, one term longer, so --stl-top still drives both. + // ⚠ DESKTOP SLOT ONLY. The phone's bottom sheet renders a .stl-panel too, and '100%' there is the 48px + // collapsed sheet: 48 - 8 - 12 - 30 is negative, the panel collapsed to nothing and the sheet lost its + // "My UPG 100 List" title on Mapbox (measured at 390 on the first build of this fix, then scoped here). + '[dir="rtl"] .upg-legend-desktop-slot .stl-panel,.upg-root:has(.mapboxgl-ctrl-logo) .upg-legend-desktop-slot .stl-panel{' + + 'max-height:calc(100% - var(--stl-top,60px) - 12px - 30px)!important}' + // ── RTL: WHAT THE LIBRARY DOES NOT DO ────────────────────────────────────── // ⚠ THE TWO POSITION RULES THAT USED TO LIVE HERE ARE GONE, deleted deliberately rather than left as a @@ -2982,7 +3013,8 @@ onBeforeUnmount(() => { @clear="onGeocoderClear" /> diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json index 64f35eb9d..77165b27a 100644 --- a/public/dx-maps/doxa-maps-spa/manifest.json +++ b/public/dx-maps/doxa-maps-spa/manifest.json @@ -880,7 +880,7 @@ "bundle": "my-upg-100-list", "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "output": "dx-maps/my-upg-100-list/my-upg-100-list.js", - "integrity": "sha384-mToL5K/00/I+6BOifS2B62ckiuzrVCl0EDeGk2o8N0ugAWOcxm9VZIMPTBt8SE/G", + "integrity": "sha384-U56ot6UHqPvWKXAW9It4pUDdOySGPVgMCdjhwnP/NlNypvfK8IpUindi+N/RA0v3", "elements": [ "my-upg-100-list-map" ], @@ -903,7 +903,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -919,8 +919,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -936,8 +936,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json index 64f35eb9d..77165b27a 100644 --- a/public/dx-maps/manifest.json +++ b/public/dx-maps/manifest.json @@ -880,7 +880,7 @@ "bundle": "my-upg-100-list", "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "output": "dx-maps/my-upg-100-list/my-upg-100-list.js", - "integrity": "sha384-mToL5K/00/I+6BOifS2B62ckiuzrVCl0EDeGk2o8N0ugAWOcxm9VZIMPTBt8SE/G", + "integrity": "sha384-U56ot6UHqPvWKXAW9It4pUDdOySGPVgMCdjhwnP/NlNypvfK8IpUindi+N/RA0v3", "elements": [ "my-upg-100-list-map" ], @@ -903,7 +903,7 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n" + "script": "\n\n\n" } }, { @@ -919,8 +919,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } }, { @@ -936,8 +936,8 @@ "scriptUrl": "./my-upg-100-list/my-upg-100-list.js", "embed": { "iframe": "", - "script": "\n\n\n\n\n\n", - "scriptMapbox": "\n\n\n\n\n\n" + "script": "\n\n\n\n\n\n", + "scriptMapbox": "\n\n\n\n\n\n" } } ] diff --git a/public/dx-maps/my-upg-100-list/my-upg-100-list.js b/public/dx-maps/my-upg-100-list/my-upg-100-list.js index e4554b1d4..2a42e368e 100644 --- a/public/dx-maps/my-upg-100-list/my-upg-100-list.js +++ b/public/dx-maps/my-upg-100-list/my-upg-100-list.js @@ -865,7 +865,7 @@ .geo-root, .mapboxgl-ctrl-geocoder, .maplibregl-ctrl-geocoder { transition: none !important; animation: none !important; } } `,"geocoder-skin");const{t:n,locale:r}=zt(),i=e,s=te(()=>/^pk\./.test(String(i.accessToken||""))),l=te(()=>i.placeholder||(i.provider==="maplibre"&&!s.value?n("search.placeholderNoPlaces"):n("search.placeholder"))),c=o,u={"&":"&","<":"<",">":">",'"':""","'":"'"};function d(z){return String(z??"").replace(/[&<>"']/g,U=>u[U])}function p(z){return z==null?"":typeof z=="string"?z:typeof z=="object"?z.label||z.value||"":String(z)}const y={"people-group":"people","doxa-people-group":"peopleGroup","doxa-affinity-bloc":"bloc","doxa-cluster":"cluster","doxa-country":"country","doxa-region":"region","doxa-language-family":"family","doxa-language":"languageKind","doxa-dialect":"dialect","doxa-religion":"religionKind"};function v(z){const U=y[z];if(!U)return"";const D=n("search.kinds."+U);return`${d(D)}`}function $(z){var E;if(!z)return"";const U=z.place_type||[];if(U.includes("doxa-section-header"))return`
${d(((E=z.properties)==null?void 0:E.headerLabel)||z.text||"")}
`;if(U.includes("people-group")){const ce=z.properties||{},fe=p(ce.name)||p(ce.displayName)||p(z.text)||"",xe=p(ce.countryName)||p(ce.country)||p(ce.countryIso)||"",Se=p(ce.language)||p(ce.primaryLanguage)||p(ce.languageFamily)||"",Le=p(ce.religionName)||p(ce.religion)||"",Ne=n("search.labels.place"),ke=n("search.labels.language"),ye=n("search.labels.religion"),ot=[];return xe&&ot.push(`${d(Ne)} ${d(xe)}`),Se&&ot.push(`${d(ke)} ${d(Se)}`),Le&&ot.push(`${d(ye)} ${d(Le)}`),`
${v("people-group")}${d(fe)}
`+(ot.length?`
${ot.join("")}
`:"")}const D=U.find(ce=>ce.startsWith("doxa-"));if(D){const ce=z.properties||{},fe=d(p(ce.label)||z.text||""),xe=Number(ce.count)||0,Se=xe?` ${xe}`:"";return`
${v(D)}${fe}${Se}
`}return`
${d(z.place_name||z.text||"")}
`}const f=qe("dataStore",null),_=qe("mapStore",null),x=qe("uiStore",null);function w(){return _?_.selectedFamily?{kind:"family",key:_.selectedFamily}:_.selectedLanguage?{kind:"language",key:_.selectedLanguage}:null:null}const{search:g}=cP({dataStore:f,dataSourceId:i.dataSourceId||void 0,getActiveFilter:w,getActiveContext:()=>i.activeContext||null}),b=Da(null),k=$e(null),L={mapbox:ha.mapboxGeocoderCss.url,maplibre:ha.maplibreGeocoderCss.url},S=ha.maplibreGeocoderJs.url,C=ha.mapboxGeocoderJs.url;function Z(z,U){const D=L[U]||L.mapbox;if(z.querySelector(`link[href="${D}"]`))return;const E=document.createElement("link");E.rel="stylesheet",E.href=D,Pr(E,D),z.prepend(E)}async function J(z,U){if(typeof window<"u"&&window[U]||typeof document>"u")return;const D=document.querySelector(`script[src="${z}"]`);if(D){if(window[U])return;await new Promise(E=>{D.addEventListener("load",E,{once:!0}),D.addEventListener("error",E,{once:!0})});return}await new Promise(E=>{const ce=document.createElement("script");ce.src=z,Pr(ce,z),ce.async=!0,ce.addEventListener("load",E,{once:!0}),ce.addEventListener("error",E,{once:!0}),document.head.appendChild(ce)})}function I(z=document){let U=z.activeElement;for(;U&&U.shadowRoot&&U.shadowRoot.activeElement;)U=U.shadowRoot.activeElement;return U}function P(z){const U=z==null?void 0:z._onKeyDown;typeof U=="function"&&(z._onKeyDown=function(D){const E=I();return!E||E===D.target||typeof E.value!="string"?U.call(z,D):U.call(z,new Proxy(D,{get(ce,fe){if(fe==="target"||fe==="srcElement")return E;const xe=Reflect.get(ce,fe);return typeof xe=="function"?xe.bind(ce):xe}}))})}async function le(){await J(C,"MapboxGeocoder")}async function X(){if(typeof window<"u"&&window.MaplibreGeocoder||typeof document>"u")return;const z=document.querySelector(`script[src="${S}"]`);if(z){if(window.MaplibreGeocoder)return;await new Promise(U=>{z.addEventListener("load",U,{once:!0}),z.addEventListener("error",U,{once:!0})});return}await new Promise((U,D)=>{const E=document.createElement("script");E.src=S,E.async=!1,E.addEventListener("load",U,{once:!0}),E.addEventListener("error",()=>D(new Error("[GeocoderComponent] Failed to load MapLibre geocoder")),{once:!0}),document.head.appendChild(E)})}function T(z,U){return async D=>{const E={features:[]};if(!/^pk\./.test(String(z||""))||!(D!=null&&D.query))return E;try{const ce=Array.isArray(D.language)?D.language[0]:D.language||U()||"en",fe=new URLSearchParams({access_token:z,autocomplete:"true",limit:String(D.limit||5)});ce&&fe.set("language",ce);const xe=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(D.query)}.json?${fe.toString()}`,Se=await fetch(xe);if(!Se.ok)return E;const Le=await Se.json();return Le&&Array.isArray(Le.features)?Le:E}catch{return E}}}To(async()=>{var ce,fe,xe,Se,Le;const z=i.provider==="maplibre";if(z){if(await X(),typeof MaplibreGeocoder>"u"){console.error("[GeocoderComponent] MaplibreGeocoder global unavailable.");return}}else if(typeof MapboxGeocoder>"u"&&(await le(),typeof MapboxGeocoder>"u")){console.error("[GeocoderComponent] MapboxGeocoder global unavailable.");return}const U=i.mapInstance;if(!i.standalone&&!U)return;const D=i.standalone?(fe=(ce=k.value)==null?void 0:ce.getRootNode)==null?void 0:fe.call(ce):(Le=(Se=(xe=U.getContainer)==null?void 0:xe.call(U))==null?void 0:Se.getRootNode)==null?void 0:Le.call(Se);D instanceof ShadowRoot&&Z(D,i.provider);const E={marker:!1,flyTo:!i.standalone,trackProximity:!i.standalone,placeholder:l.value,language:r.value||"en",localGeocoder:g,limit:20,zoom:6,render:$};if(z){const Ne=typeof maplibregl<"u"?maplibregl:void 0,ke={forwardGeocode:T(i.accessToken,()=>r.value)};b.value=new MaplibreGeocoder(ke,{...E,maplibregl:Ne,showResultsWhileTyping:!0,reverseGeocode:!1})}else b.value=new MapboxGeocoder({accessToken:i.accessToken,mapboxgl,...E});if(P(b.value),b.value.on("result",Ne=>{var ye,ot,It,M,j,F,ae,ge,ue,R,V,m,h,G,Q,be,re,O,K,we,Te,Je,Tt,_t,Yt,qt,xt,Lt,io,wo;const ke=Ne==null?void 0:Ne.result;ke&&((ye=ke.place_type)!=null&&ye.includes("doxa-section-header")||(_&&(_.selectedRegion=null,_.selectedResource=null,_.selectedAffinityBlock=null,_.selectedDialect=null),x&&((ot=x.setPrayerFilter)==null||ot.call(x,null),(It=x.setEngagementFilter)==null||It.call(x,null),(M=x.setAdoptionFilter)==null||M.call(x,null),(j=x.setReligionFilter)==null||j.call(x,null)),(F=ke.properties)!=null&&F._allDataSection&&_&&(_.selectedFamily=null,_.selectedLanguage=null),c("result",Ne),(ae=ke.place_type)!=null&&ae.includes("people-group")&&ke.feature?c("people-group-result",{type:"Feature",properties:ke.properties||ke.feature,geometry:ke.geometry||{type:"Point",coordinates:ke.center}}):((ge=ke.place_type)!=null&&ge.includes("doxa-country")||(ue=ke.place_type)!=null&&ue.includes("doxa-region")||(R=ke.place_type)!=null&&R.includes("doxa-language-family")||(V=ke.place_type)!=null&&V.includes("doxa-language")||(m=ke.place_type)!=null&&m.includes("doxa-dialect")||(h=ke.place_type)!=null&&h.includes("doxa-religion")||(G=ke.place_type)!=null&&G.includes("doxa-affinity-bloc")||(Q=ke.place_type)!=null&&Q.includes("doxa-cluster")||(be=ke.place_type)!=null&&be.includes("doxa-people-group"))&&c("aggregate-result",{kind:ke.place_type[0].replace(/^doxa-/,""),label:((re=ke.properties)==null?void 0:re.label)||ke.text,count:((O=ke.properties)==null?void 0:O.count)||0,memberIds:((K=ke.properties)==null?void 0:K.memberIds)||[],bounds:((we=ke.properties)==null?void 0:we.bounds)||null,center:ke.center,originalLabels:((Te=ke.properties)==null?void 0:Te.originalLabels)||null,familyDerived:((Je=ke.properties)==null?void 0:Je.familyDerived)||"",baseLang:((Tt=ke.properties)==null?void 0:Tt.baseLang)||"",dialectLabel:((_t=ke.properties)==null?void 0:_t.dialectLabel)||"",slug:((Yt=ke.properties)==null?void 0:Yt.slug)||null,id:ke.id||null,blocCode:((qt=ke.properties)==null?void 0:qt.blocCode)||"",blocLabel:((xt=ke.properties)==null?void 0:xt.blocLabel)||"",clusterCode:((Lt=ke.properties)==null?void 0:Lt.clusterCode)||"",clusterLabel:((io=ke.properties)==null?void 0:io.clusterLabel)||"",peopleGroupCode:((wo=ke.properties)==null?void 0:wo.peopleGroupCode)||"",properties:ke.properties||null})))}),b.value.on("clear",()=>c("clear")),b.value.on("error",Ne=>c("error",Ne)),i.standalone){if(k.value){const Ne={on(){},off(){},fire(){},getContainer:()=>k.value,getZoom:()=>0,getCenter:()=>({lng:0,lat:0}),getBounds:()=>null,flyTo(){},fitBounds(){},addControl(){},removeControl(){},hasControl:()=>!1};try{const ke=b.value.onAdd(i.mapInstance||Ne);ke&&k.value.appendChild(ke)}catch(ke){c("error",ke)}}}else U.addControl(b.value,"top-left"),ne()});function ne(){var U,D;const z=(D=(U=b.value)==null?void 0:U.container)==null?void 0:D.parentElement;z&&(z.classList.add("dg-search-band"),z.classList.toggle("dg-search-band--dark",!!i.isDark))}return st(()=>i.isDark,()=>ne()),st(l,z=>{var E,ce;const U=b.value;if(!U)return;const D=U._inputEl||((ce=(E=U.container)==null?void 0:E.querySelector)==null?void 0:ce.call(E,"input.mapboxgl-ctrl-geocoder--input"));D&&(D.placeholder=z,D.setAttribute("placeholder",z)),U.options&&(U.options.placeholder=z)}),st(r,z=>{const U=b.value;U!=null&&U.options&&(U.options.language=z||"en")}),go(()=>{var z,U;if(b.value){try{i.standalone?(U=(z=b.value).onRemove)==null||U.call(z):i.mapInstance&&i.mapInstance.removeControl(b.value)}catch{}b.value=null}}),t({geocoder:b}),(z,U)=>e.standalone?(q(),se("div",{key:0,ref_key:"standaloneContainer",ref:k,class:"dg-standalone-geocoder"},null,512)):pn(z.$slots,"default",{},void 0,void 0,1)}},dP=["mapbox","maplibre"],pP="auto";function Qh(e){return e&&typeof e=="object"&&"value"in e&&!("provider"in e)&&!("profile"in e)?e.value:e}function gP(e,{token:t}={}){const o=Qh(e);return hP(o)||"maplibre"}function hP(e){const t=Qh(e),o=t==null?void 0:t.provider,a=typeof location<"u"?new URLSearchParams(location.search).get("provider"):void 0,n=typeof window<"u"?window.MAP_PROVIDER:void 0,r=String(o||a||n||pP).toLowerCase().trim();return dP.includes(r)?r:""}const fP="rgba(120, 128, 134, 0.28)",ef="36px",tf=()=>{};function mP(e,t={}){const{enabled:o=!0}=t;if(!o||!e)return tf;const a=Array.from(e.querySelectorAll(".map-scroll-edge"));if(!a.length)return tf;const n=x=>x.classList.contains("map-scroll-edge--left");for(const x of a)x.style.background=`linear-gradient(${n(x)?"to right":"to left"}, ${fP} ${ef}, transparent ${ef})`,x.style.opacity="0",x.style.transition="opacity 0.16s ease",x.style.userSelect="none",x.style.webkitUserSelect="none";const r=x=>{x.style.opacity="1"},i=x=>{x.style.opacity="0"},s=()=>a.find(x=>!n(x))||null,l=new Set;let c=!1,u=null;const d=()=>{for(const x of a)l.has(x)||i(x)},p=()=>{const x=s();x&&(r(x),u&&clearTimeout(u),u=setTimeout(d,250))},y=()=>p(),v=x=>{if(!(x.touches&&x.touches.length===1))return;const w=x.target;w&&w.classList&&w.classList.contains("map-scroll-edge")||p()},$=()=>{u&&clearTimeout(u),d()};e.addEventListener("wheel",y,{passive:!0}),e.addEventListener("touchmove",v,{passive:!0}),e.addEventListener("touchend",$,{passive:!0}),e.addEventListener("touchcancel",$,{passive:!0});const f=()=>{c||p()};typeof window<"u"&&window.addEventListener("scroll",f,{passive:!0});const _=[];for(const x of a){const w=()=>{l.add(x),r(x)},g=()=>{l.delete(x),i(x)},b=()=>{c=!0,r(x)},k=()=>{c=!1,i(x)};x.addEventListener("mouseenter",w),x.addEventListener("mouseleave",g),x.addEventListener("touchstart",b,{passive:!0}),x.addEventListener("touchend",k,{passive:!0}),_.push(()=>{x.removeEventListener("mouseenter",w),x.removeEventListener("mouseleave",g),x.removeEventListener("touchstart",b),x.removeEventListener("touchend",k)})}return function(){u&&(clearTimeout(u),u=null),e.removeEventListener("wheel",y),e.removeEventListener("touchmove",v),e.removeEventListener("touchend",$),e.removeEventListener("touchcancel",$),typeof window<"u"&&window.removeEventListener("scroll",f);for(const w of _)w();for(const w of a)i(w)}}const bP=Object.fromEntries([{id:"midnight-glow",label:"Midnight Glow",mood:"the prayer-map dark — pins glow like embers",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"night",maplibre:"https://tiles.openfreemap.org/styles/fiord",bestFor:["doxa-simple-map","my-upg-100-list"]},{id:"daylight",label:"Daylight",mood:"the same Standard world, lights on",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"day",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["doxa-research-map","gospel-resources"]},{id:"dawn",label:"Dawn",mood:"soft warm horizon — hopeful, quiet",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"dawn",maplibre:"https://tiles.openfreemap.org/styles/positron",bestFor:["doxa-simple-map"]},{id:"dusk",label:"Dusk",mood:"blue hour — calm contrast for bright pins",mapbox:"mapbox://styles/mapbox/standard",lightPreset:"dusk",maplibre:"https://tiles.openfreemap.org/styles/fiord",bestFor:["my-upg-100-list"]},{id:"paper",label:"Paper",mood:"near-white minimal — data reads like print",mapbox:"mapbox://styles/mapbox/light-v11",maplibre:"https://tiles.openfreemap.org/styles/positron",bestFor:["research-dashboard","cities-internet"]},{id:"ink",label:"Ink",mood:"near-black minimal — maximum pin contrast",mapbox:"mapbox://styles/mapbox/dark-v11",maplibre:"https://tiles.openfreemap.org/styles/dark",bestFor:["my-upg-100-list","cities-internet"]},{id:"streetlife",label:"Street Life",mood:"full street detail — city-scale work",mapbox:"mapbox://styles/mapbox/streets-v12",maplibre:"https://tiles.openfreemap.org/styles/bright",bestFor:["cities-internet","key-cities"]},{id:"terrain",label:"Terrain",mood:"relief + parks — where people actually live",mapbox:"mapbox://styles/mapbox/outdoors-v12",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["doxa-research-map","country-posters"]},{id:"satellite",label:"Satellite",mood:"imagery — the real ground",mapbox:"mapbox://styles/mapbox/satellite-v9",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["country-posters"]},{id:"hybrid",label:"Hybrid",mood:"imagery + labels — orientation without losing ground truth",mapbox:"mapbox://styles/mapbox/satellite-streets-v12",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["key-cities"]},{id:"wayfinder-day",label:"Wayfinder Day",mood:"high-legibility navigation palette",mapbox:"mapbox://styles/mapbox/navigation-day-v1",maplibre:"https://tiles.openfreemap.org/styles/liberty",bestFor:["gospel-resources"]},{id:"wayfinder-night",label:"Wayfinder Night",mood:"dark navigation — dashboards at night",mapbox:"mapbox://styles/mapbox/navigation-night-v1",maplibre:"https://tiles.openfreemap.org/styles/fiord",bestFor:["research-dashboard"]},{id:"galaxy",label:"Galaxy",mood:"the day side of Earth floating in space — normal land, blue oceans, black void behind the sphere",mapbox:"mapbox://styles/mapbox/standard",maplibre:"https://tiles.versatiles.org/assets/styles/colorful/style.json",bestFor:["research-dashboard","my-upg-100-list"]}].map(e=>[e.id,e]));function xc(e,t="mapbox"){if(typeof e!="string"||!e)return{style:void 0,lightPreset:void 0,paint:void 0};const o=bP[e];return o?t==="maplibre"?{style:o.maplibre,lightPreset:void 0,paint:o.paint}:{style:o.mapbox,lightPreset:o.lightPreset,paint:o.paint}:/^(mapbox:\/\/|https?:\/\/)/.test(e)?{style:e,lightPreset:void 0,paint:void 0}:{style:void 0,lightPreset:void 0,paint:void 0}}const of={mapbox:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.3.0/mapbox-gl-rtl-text.js",maplibre:"https://cdn.jsdelivr.net/npm/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js"};function $P(e){return!!e&&typeof window<"u"&&e===window.maplibregl}function _P(e){if(typeof window>"u")return!1;const t=e?[e]:[window.maplibregl,window.mapboxgl].filter(Boolean);let o=!1;for(const a of t)if(!(!a||!a.setRTLTextPlugin))try{if($P(a)){if(a.getRTLTextPluginStatus&&a.getRTLTextPluginStatus()!=="unavailable")continue;const n=a.setRTLTextPlugin(of.maplibre,!0);n&&n.catch&&n.catch(()=>{})}else a.setRTLTextPlugin(of.mapbox,null,!0);o=!0}catch{}return o}const Ln={mapbox:{global:"mapboxgl",js:ha.mapboxGlJs.url,css:ha.mapboxGlCss.url},maplibre:{global:"maplibregl",js:ha.maplibreGlJs.url,css:ha.maplibreGlCss.url}};function Pc(e){var o;const t=((o=Ln[e])==null?void 0:o.global)||Ln.mapbox.global;return typeof window<"u"?window[t]:void 0}function af(e){return(Ln[e]||Ln.mapbox).css||null}async function yP(e){const t=Ln[e]||Ln.mapbox;if(Pc(e)||typeof document>"u")return;if(!document.querySelector(`link[href="${t.css}"]`)){const a=document.createElement("link");a.rel="stylesheet",a.href=t.css,Pr(a,t.css),document.head.appendChild(a)}const o=document.querySelector(`script[src="${t.js}"]`);if(o){if(Pc(e))return;await new Promise(a=>{o.addEventListener("load",a,{once:!0}),o.addEventListener("error",a,{once:!0})});return}await new Promise((a,n)=>{const r=document.createElement("script");r.src=t.js,Pr(r,t.js),r.async=!1,r.addEventListener("load",a,{once:!0}),r.addEventListener("error",()=>n(new Error(`[useMapInstance] Failed to load ${e} engine script`)),{once:!0}),document.head.appendChild(r)})}async function vP(e,t){if(!e)return;const o=e.getRootNode();if(!(o instanceof ShadowRoot))return;const a=i=>new Promise(s=>setTimeout(s,i)),n=o.querySelector(`link[href="${t}"]`);if(n){if(n.sheet)return;await Promise.race([new Promise(i=>{n.addEventListener("load",i,{once:!0}),n.addEventListener("error",i,{once:!0})}),a(2e3)]);return}const r=document.createElement("link");r.rel="stylesheet",r.href=t,Pr(r,t),await Promise.race([new Promise(i=>{r.addEventListener("load",i,{once:!0}),r.addEventListener("error",i,{once:!0}),o.prepend(r)}),a(2e3)])}const kP=["country_code","wagf_region","wagf_block","primary_language","religion","imb_gsec"];function wP(e){return e==null?{value:null,label:null}:typeof e=="object"?{value:e.value??null,label:e.label??null}:{value:e,label:null}}function xP(e){if(e==null||typeof e!="object")return e;const t={...e};for(const o of kP)if(o in t){const{value:a,label:n}=wP(t[o]);t[o]=a,n!=null&&(t[`${o}_label`]=n)}return t}function Sc(e){return Array.isArray(e)?e.map(xP):[]}function Ac(e){return Array.isArray(e)?e:e&&typeof e=="object"?e.posts||e.data||e.records||e.results||e.items||[]:[]}const PP={"andean-caribbean":"#f9a51f","asia-china-tibet-autonomous-region":"#00f0c8","asia-china-yunnan-province":"#22ddff","asia-frontier-nas-a":"#ff1744","asia-india-andhra-pradesh":"#22ddff","asia-india-assam":"#22ddff","asia-india-chhattisgarh":"#536dfe","asia-india-gujarat":"#536dfe","asia-india-karnataka":"#536dfe","asia-india-kerala":"#2196ff","asia-india-madhya-pradesh":"#2196ff","asia-india-maharashtra":"#2196ff","asia-india-odisha":"#2196ff","asia-india-rajasthan":"#22ddff","asia-india-tamil-nadu":"#7c4dff","asia-india-uttarakhand":"#536dfe","asia-india-west-bengal":"#22ddff",brazil:"#f4c57b","central-africa":"#c20001",deaf:"#18ffff","east-africa":"#ef3410",europe:"#34cb74",laos:"#7c4dff","maghreb-egypt":"#602f74","mainland-se-asia-philippines":"#ff1744","middle-east-core":"#bc8bd0","oceania-indonesia":"#ee892f","southern-africa-islands":"#e75556",sudan:"#e69e93","uncovered-central-asia":"#ff8a00","uncovered-himalaya":"#ff6d00","uncovered-japan":"#ffc400","uncovered-mongolia":"#76ff03","uncovered-nas-a":"#ff1744","uncovered-nepal":"#ffea00","uncovered-sa-west":"#ff1744","uncovered-scatter":"#eeff41","west-africa":"#edcac9"};function SP(e,t){const o=PP[e];return typeof o=="string"&&o?o:t}const Xa={ABW:"Aruba",IND:"India",AFG:"Afghanistan",AGO:"Angola",ALB:"Albania",AND:"Andorra",ARE:"United Arab Emirates",ARM:"Armenia",ASM:"American Samoa",ATG:"Antigua and Barbuda",AZE:"Azerbaijan",BEN:"Benin",BFA:"Burkina Faso",BGD:"Bangladesh",BGR:"Bulgaria",BHR:"Bahrain",BHS:"Bahamas",BIH:"Bosnia and Herzegovina",BLM:"Saint Barthélemy",BLR:"Belarus",BMU:"Bermuda",BOL:"Bolivia",BRA:"Brazil",BRB:"Barbados",BRN:"Brunei",BTN:"Bhutan",CAF:"Central African Republic",CHN:"China",CIV:"Côte d'Ivoire",CMR:"Cameroon",COD:"DR Congo",COG:"Congo",COK:"Cook Islands",COL:"Colombia",COM:"Comoros",CUB:"Cuba",CUW:"Curaçao",CYM:"Cayman Islands",CYP:"Cyprus",CZE:"Czechia",DJI:"Djibouti",DMA:"Dominica",DZA:"Algeria",ECU:"Ecuador",EGY:"Egypt",ERI:"Eritrea",ESP:"Spain",ETH:"Ethiopia",FIN:"Finland",FJI:"Fiji",FRO:"Faroe Islands",FSM:"Micronesia",GAB:"Gabon",GEO:"Georgia",GGY:"Guernsey",GHA:"Ghana",GIN:"Guinea",GLP:"Guadeloupe",GMB:"Gambia",GNB:"Guinea-Bissau",GNQ:"Equatorial Guinea",GRC:"Greece",GRD:"Grenada",GUF:"French Guiana",GUM:"Guam",GUY:"Guyana",IDN:"Indonesia",IRN:"Iran",IRQ:"Iraq",ISL:"Iceland",ISR:"Israel",JAM:"Jamaica",JOR:"Jordan",JPN:"Japan",KAZ:"Kazakhstan",KEN:"Kenya",KGZ:"Kyrgyzstan",KHM:"Cambodia",KIR:"Kiribati",KWT:"Kuwait",LAO:"Laos",LBN:"Lebanon",LBR:"Liberia",LBY:"Libya",LCA:"Saint Lucia",LIE:"Liechtenstein",LKA:"Sri Lanka",LUX:"Luxembourg",MAR:"Morocco",MDV:"Maldives",MHL:"Marshall Islands",MLI:"Mali",MLT:"Malta",MMR:"Myanmar",MNE:"Montenegro",MNG:"Mongolia",MNP:"Northern Mariana Islands",MOZ:"Mozambique",MRT:"Mauritania",MSR:"Montserrat",MUS:"Mauritius",MWI:"Malawi",MYS:"Malaysia",MYT:"Mayotte",NAM:"Namibia",NCL:"New Caledonia",NER:"Niger",NGA:"Nigeria",NIU:"Niue",NPL:"Nepal",NZL:"New Zealand",OMN:"Oman",PAK:"Pakistan",PAN:"Panama",PER:"Peru",PHL:"Philippines",PLW:"Palau",PNG:"Papua New Guinea",PRK:"North Korea",PRY:"Paraguay",PSE:"Palestine",PYF:"French Polynesia",QAT:"Qatar",RUS:"Russia",SAU:"Saudi Arabia",SDN:"Sudan",SEN:"Senegal",SHN:"Saint Helena",SLB:"Solomon Islands",SLE:"Sierra Leone",SMR:"San Marino",SOM:"Somalia",SSD:"South Sudan",STP:"São Tomé and Príncipe",SUR:"Suriname",SWE:"Sweden",SWZ:"Eswatini",SYR:"Syria",TCA:"Turks and Caicos Islands",TCD:"Chad",TGO:"Togo",THA:"Thailand",TJK:"Tajikistan",TON:"Tonga",TUN:"Tunisia",TUR:"Turkey",TZA:"Tanzania",UGA:"Uganda",USA:"United States",UZB:"Uzbekistan",VCT:"Saint Vincent and the Grenadines",VEN:"Venezuela",VGB:"British Virgin Islands",VIR:"U.S. Virgin Islands",VNM:"Vietnam",VUT:"Vanuatu",WLF:"Wallis and Futuna",WSM:"Samoa",YEM:"Yemen",ZAF:"South Africa",ZMB:"Zambia",ZWE:"Zimbabwe"},nf=Object.freeze(Object.defineProperty({__proto__:null,ISO3_NAME:Xa},Symbol.toStringTag,{value:"Module"})),qi={"Andaman and Nicobar Islands":9,"Andhra Pradesh":81,"Arunāchal Pradesh":7,Assam:15,Bihār:18,Chandīgarh:1,Chhattīsgarh:24,Delhi:1,"Dādra and Nagar Haveli and Damān and Diu":1,Goa:5,Gujarāt:90,Haryāna:4,"Himāchal Pradesh":20,"Jammu and Kashmīr":33,Jhārkhand:9,Karnātaka:81,Kerala:72,Ladākh:6,Lakshadweep:1,"Madhya Pradesh":33,Mahārāshtra:54,Manipur:5,Meghālaya:2,Odisha:64,Puducherry:5,Punjab:4,Rājasthān:48,Sikkim:1,"Tamil Nādu":64,Telangāna:26,Tripura:11,"Uttar Pradesh":23,Uttarākhand:7,"West Bengal":30,"Gansu Province":3,"Guangxi Zhuang Autonomous Region":6,"Guizhou Province":34,"Hainan Province":3,"Heilongjiang Province":2,"Hunan Province":5,"Inner Mongolia Autonomous Region":3,"Qinghai Province":3,"Sichuan Province":12,"Tibet Autonomous Region":13,"Xinjiang Uyghur Autonomous Region":7,"Yunnan Province":61},rf={ABW:1,AFG:21,AGO:10,ALB:1,AND:1,ARE:2,ARM:1,ASM:1,ATG:1,AZE:3,BEN:9,BFA:8,BGD:3,BGR:1,BHR:2,BHS:1,BIH:1,BLM:1,BLR:1,BMU:1,BOL:1,BRA:103,BRB:1,BRN:5,BTN:13,CAF:1,CHN:154,CIV:2,CMR:8,COD:9,COG:2,COK:1,COL:27,COM:3,CUB:1,CUW:1,CYM:1,CYP:1,CZE:1,DJI:1,DMA:1,DZA:17,ECU:1,EGY:3,ERI:8,ESP:1,ETH:29,FIN:1,FJI:1,FRO:1,FSM:1,GAB:2,GEO:1,GGY:1,GHA:1,GIN:13,GLP:1,GMB:3,GNB:3,GNQ:1,GRC:1,GRD:1,GUF:2,GUM:1,GUY:1,IDN:36,IRN:20,IRQ:8,ISL:1,ISR:4,JAM:1,JOR:3,JPN:6,KAZ:1,KEN:5,KGZ:2,KHM:1,KIR:1,KWT:1,LAO:95,LBN:4,LBR:2,LBY:15,LCA:1,LIE:1,LKA:1,LUX:1,MAR:4,MDV:1,MHL:1,MLI:13,MLT:1,MMR:7,MNE:1,MNG:1,MNP:1,MOZ:4,MRT:3,MSR:1,MUS:1,MWI:1,MYS:12,MYT:1,NAM:6,NCL:1,NER:2,NGA:38,NIU:1,NPL:34,NZL:1,OMN:7,PAK:24,PAN:1,PER:10,PHL:1,PLW:1,PNG:1,PRK:1,PRY:1,PSE:4,PYF:1,QAT:3,RUS:21,SAU:3,SDN:105,SEN:1,SHN:1,SLB:1,SLE:2,SMR:1,SOM:9,SSD:22,STP:1,SUR:2,SWE:2,SWZ:1,SYR:5,TCA:1,TCD:53,TGO:6,THA:8,TJK:3,TON:1,TUN:2,TUR:3,TZA:16,UGA:6,USA:3,UZB:1,VCT:1,VEN:6,VGB:1,VIR:1,VNM:16,VUT:1,WLF:1,WSM:1,YEM:9,ZAF:2,ZMB:6,ZWE:3};function sf(e){const t={...Xa};for(const o of e||[]){const a=o&&o.country_code,n=o&&o.country_code_label;a&&n&&(t[a]=n)}return t}function lf(e,t={}){if(!e||typeof e!="object")return null;const o=t.nameMap||Xa;if(e.shapeName){const a=String(e.shapeName),n=Object.prototype.hasOwnProperty.call(qi,a)?qi[a]:null;return{key:"adm1:"+a,name:a,count:n,kind:"adm1"}}if(e.iso3){const a=String(e.iso3),n=o[a]||Xa[a]||a,r=Object.prototype.hasOwnProperty.call(rf,a)?rf[a]:null;return{key:"adm0:"+a,name:n,count:r,kind:"adm0"}}return null}function AP(e,t={}){const o=Array.isArray(e)?e:[],a=o.map(l=>l.name),n=o.reduce((l,c)=>l+(Number(c.count)||0),0),r=t&&typeof t.color=="string"&&t.color?t.color:"",i=a.join(", ")+" — "+n+" UUPG"+(r?" · "+r:""),s=o.map(l=>l.name+" "+(Number(l.count)||0)).join(", ");return i+` -`+s}function Cn(e){return String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().trim()}function LP(e){return Cn(e).split(/[\s,;]+/).filter(Boolean)}function CP(e={}){const{records:t=[],leafZones:o=[],adm1Counts:a={},iso3Names:n={},countryNameMap:r=null}=e,i=[],s=new Set;for(const c of t){if(!c)continue;const u=c.slug;if(!u||s.has(u))continue;const d=Number(c.latitude),p=Number(c.longitude);if(!Number.isFinite(d)||!Number.isFinite(p))continue;const y=c.name||u;s.add(u),i.push({label:y,kind:"pg",target:{type:"pg",slug:u,lng:p,lat:d},_hay:Cn(y)})}for(const c of o){if(!c)continue;const u=c.zoneKey||c.id,d=c.label||u;u&&i.push({label:d,kind:"zone",target:{type:"zone",zoneId:u},_hay:Cn(d)})}for(const c of Object.keys(a))i.push({label:c,kind:"territory",target:{type:"territory",shapeName:c},_hay:Cn(c)});const l=r||n;for(const c of Object.keys(n)){const u=l&&l[c]||n[c]||c;i.push({label:u,kind:"territory",target:{type:"territory",shapeName:c,iso3:!0},_hay:Cn(u)})}return i}const TP={zone:0,territory:1,pg:2};function EP(e={}){const{records:t=[],leafZones:o=[],adm1Counts:a={},iso3Names:n={},countryNameMap:r=null,centroidFor:i=null}=e,s=[];for(const u of t)u&&s.push(u);const l=(u,d,p)=>!d||!Number.isFinite(d[0])||!Number.isFinite(d[1])?null:{name:u,slug:p.__synthSlug,latitude:d[1],longitude:d[0],...p};for(const u of o){if(!u)continue;const d=u.zoneKey||u.id,p=u.label||d;if(!d)continue;const y=typeof i=="function"?i($=>$&&$.properties&&$.properties.zoneKey===d):null,v=l(p,y,{__upgKind:"zone",__zoneId:d,__synthSlug:`__zone__${d}`});v&&s.push(v)}for(const u of Object.keys(a)){const d=typeof i=="function"?i(y=>y&&y.properties&&y.properties.shapeName===u):null,p=l(u,d,{__upgKind:"territory",__shapeName:u,__synthSlug:`__terr__${u}`});p&&s.push(p)}const c=r||n;for(const u of Object.keys(n)){const d=c&&c[u]||n[u]||u,p=typeof i=="function"?i(v=>v&&v.properties&&v.properties.iso3===u):null,y=l(d,p,{__upgKind:"territory",__shapeName:u,__synthSlug:`__terr__${u}`});y&&s.push(y)}return s}function cf(e,t,o={}){const a=o.limit??8,n=LP(t);if(!n.length)return[];const r=n[0],i=[];for(const s of e){let l=!0;for(const d of n)if(!s._hay.includes(d)){l=!1;break}if(!l)continue;const c=s._hay.startsWith(r)?0:1,u=s._hay===Cn(t)?-1:0;i.push({e:s,starts:c,exact:u,kr:TP[s.kind]??9,len:s._hay.length})}return i.sort((s,l)=>s.exact-l.exact||s.starts-l.starts||s.kr-l.kr||s.len-l.len),i.slice(0,a).map(s=>s.e)}const Zi=new Set;function MP(e,t){var n,r;const o=e.getSource(t);if(!o)return[];let a=o._data??((r=(n=o.serialize)==null?void 0:n.call(o))==null?void 0:r.data);if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.geojson!==void 0)a=a.geojson;else if(a.url!==void 0)return Zi.has(t)||(Zi.add(t),console.warn(`[pin-selection] source "${t}" is remote (url); its features cannot be read locally, so nothing can be selected from it.`)),[]}return a?Array.isArray(a==null?void 0:a.features)?a.features:(a==null?void 0:a.type)==="Feature"?[a]:(a&&typeof a=="object"&&!Zi.has(t)&&(Zi.add(t),console.warn(`[pin-selection] source "${t}": unrecognised data shape {${Object.keys(a).join(",")}} — nothing can be selected from it; this is NOT a confirmed empty source.`)),[]):[]}const NP={class:"upg-root"},RP={key:0,class:"upg-map-err"},FP={class:"upg-legend-desktop-slot"},IP={class:"upg-legend-mobile-slot"},OP={class:"upg-detail-desktop-slot"},DP={key:4,class:"upg-hud"},zP={class:"upg-hud-hint"},GP={key:0,class:"upg-hud-head"},jP={class:"upg-hud-total"},BP={key:1,class:"upg-hud-names"},HP={key:2,class:"upg-hud-actions"},UP=["disabled"],WP=["disabled"],KP=["disabled"],VP={key:3,class:"upg-hud-flash"},YP={class:"upg-status"},Lc="upg-search",uf=1,qP="people-groups",df=8,pf=123,ZP=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"upg-100-list",setup(e){const t=bg(()=>ft(()=>Promise.resolve().then(()=>vx),void 0)),o=qe("mapboxToken",$e("")),a=qe("profileConfig",$e(null));let n=null,r=null,i=null;function s(){var A,B;return((A=a.value)==null?void 0:A.instanceId)||((B=a.value)==null?void 0:B.profile)||"upg-100-list"}const l=gP(a),c=l==="maplibre",u=te(()=>{var A;return((A=a==null?void 0:a.value)==null?void 0:A.search)===!1?!1:l==="mapbox"}),d=te(()=>{var B;const A=(B=a.value)==null?void 0:B.edgeScrollAffordance;return A==null?!0:!(A===!1||A==="false")}),p=qe("dataStore",null),y=qe("uiStore",null),v=$e(null),$=$e(""),f=$e(""),_=Da([]),x=$e(null),w=Da(null),g=$e(!1),b=Z1("my-upg-100-list");b.theme.value="light",J1(b);const k=$e([]),L=te(()=>k.value.reduce((A,B)=>A+(Number(B.count)||0),0)),S=te(()=>k.value.length),C=$e("");let Z=null;const J=$e(!1);function I(A){const B=A===void 0?!J.value:!!A;return B===J.value||(J.value=B,E&&(E.getCanvas().style.cursor=""),h()),B}function P(){I()}st([J,g],()=>{po(()=>H())});function le(A){if(!A)return;const B=k.value,W=B.findIndex(he=>he.key===A.key);W>=0?k.value=B.filter((he,Re)=>Re!==W):k.value=[...B,A],h(),C.value=""}const X=$e(""),T=$e("");function ne(A){const B=/^#?([0-9a-fA-F]{6})$/.exec(String(A||"").trim());if(!B)return;const W="#"+B[1].toLowerCase();X.value=X.value===W?"":W,h()}const z=$e(null),U=te(()=>[{id:"upg100Region",label:ye("tabs.upg100Region"),info:ye("legend.tabInfo.upg100Region")},{id:"upg100Zone",label:ye("tabs.upg100Zone"),info:ye("legend.tabInfo.upg100Zone")}]);let D=[],E=null,ce=null,fe=[],xe=null,Se=null,Le=null;const Ne=typeof window<"u"&&window.MAP_APP_API_URL||void 0||"",{locale:ke,t:ye}=zt();let ot="";st(()=>Zt(),()=>{($.value===""||$.value===ot)&&($.value=ot=ye("legend.loadingData"))},{immediate:!0});function It(A){const B={zone_affinity_A017:ye("poster.zone_deaf")},W=A?Wg(A):void 0;return{deafCount:pf,...A?{records:A}:{},title:he=>Ml(he,B,{byCode:W,countryName:Ri,locale:Zt()}),regionTitle:he=>Cl[he]?ye(`poster.${Cl[he]}`):he}}let M=null;function j(A){return A!==void 0&&(M=A),Tl(Me(),It(M))}st(()=>Zt(),()=>{if(!_.value.length)return;_.value=j();const A=new Map(_r(_.value).map(B=>[B.id,B.label]));for(const B of fe)A.has(B.id)&&(B.label=A.get(B.id));O&&K(O)});const F=te(()=>ye("legend.title.upg100List")),ae=te(()=>ye("legend.title.batchSelect")),ge=te(()=>ye("search.upg100Placeholder"));Ht(`.upg-root{position:absolute;inset:0;background:#0a1410;color:#e5e7eb;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}.upg-map{position:absolute;inset:0}.upg-map-err{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);z-index:1;pointer-events:none;text-align:center;padding:0 24px;font:13px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#9aa7b8}.upg-map-err strong{display:block;font-size:14px;color:#cbd5e1;margin-bottom:4px}.map-scroll-edge{position:absolute;top:0;bottom:0;width:40px;z-index:2;touch-action:pan-y;pointer-events:auto;background:transparent}.map-scroll-edge--left{left:0}.map-scroll-edge--right{right:0}.upg-legend-desktop-slot{--stl-top:8px}.upg-legend-mobile-slot{display:none}@media(max-width:767px){.upg-legend-mobile-slot{display:block}.upg-legend-desktop-slot{display:none}.upg-detail-desktop-slot{display:none}}.upg-status{position:absolute;bottom:10px;right:10px;z-index:5;font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);padding:6px 10px;border-radius:8px}.upg-detail-panel{position:absolute;top:60px;right:8px;bottom:10px;width:340px;max-width:calc(100vw - 16px);z-index:6;background:#fff;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.45);overflow:hidden;display:flex;flex-direction:column;animation:upgPanelIn .18s ease}.upg-detail-panel.dark{background:#1a1a2e}@keyframes upgPanelIn{from{transform:translateX(16px);opacity:0}to{transform:translateX(0);opacity:1}}@media(max-width:480px){.upg-detail-panel{top:auto;left:8px;right:8px;width:auto;height:55vh}}.upg-hud{position:absolute;bottom:34px;right:10px;z-index:6;min-width:150px;font:11px/1.35 ui-monospace,monospace;color:#e5e7eb;background:rgba(10,20,16,.92);border:1px solid rgba(110,231,183,.35);border-radius:10px;padding:8px 10px;box-shadow:0 4px 16px rgba(0,0,0,.4)}.upg-hud-head{display:flex;align-items:baseline;gap:6px;white-space:nowrap}.upg-hud-total{font-size:15px;font-weight:700;color:#6ee7b7}.upg-hud-band{margin-inline-start:auto;font-size:9px;color:#9aa7b8}.upg-hud-band.ok{color:#6ee7b7}.upg-hud-names{margin-top:5px;max-height:84px;overflow:auto;font-size:10px;color:#cbd5e1;line-height:1.45;word-break:break-word}.upg-hud-actions{display:flex;gap:6px;margin-top:7px}.upg-hud-btn{flex:1;cursor:pointer;border:1px solid rgba(110,231,183,.4);background:rgba(16,185,129,.18);color:#d1fae5;font:12px/1 ui-monospace,monospace;padding:0 10px;min-height:40px;border-radius:8px}.upg-hud-btn:hover{background:rgba(16,185,129,.32)}.upg-hud-btn.clear{background:rgba(148,163,184,.12);border-color:rgba(148,163,184,.4);color:#cbd5e1}.upg-hud-flash{margin-top:5px;font-size:9px;color:#6ee7b7;min-height:11px}.upg-hud-hint{margin-top:4px;font-size:9px;color:#64748b}.upg-hud-swatches{display:flex;gap:6px;margin-top:7px;align-items:center;flex-wrap:wrap}.upg-swatch{width:40px;height:40px;border-radius:9px;cursor:pointer;padding:0;border:1px solid rgba(255,255,255,.3)}.upg-swatch.active{outline:2px solid #fff;outline-offset:1px}.upg-hex{width:84px;min-height:40px;background:rgba(148,163,184,.12);border:1px solid rgba(148,163,184,.4);color:#cbd5e1;font:12px/1 ui-monospace,monospace;padding:0 8px;border-radius:8px}@media(max-width:480px){.upg-hud{left:8px;right:8px;min-width:0;bottom:30px;max-height:48vh;overflow:auto}}.map-toolbar .mcb.upg-batch-on{background:#10b981!important;color:#04241a!important;box-shadow:0 0 0 2px rgba(52,211,153,.45),0 1px 4px rgba(0,0,0,0.2)!important}.map-toolbar .mcb.upg-batch-on.dark{border-color:#34d399!important}.upg-batch-row{position:relative;background:rgba(16,185,129,.16)!important;opacity:1!important;box-shadow:inset 3px 0 0 0 #10b981}.upg-batch-row .stl-name{color:#065f46!important;font-weight:700}.stl-panel[data-theme="dark"] .upg-batch-row .stl-name,.upg-batch-row.dark .stl-name{color:#6ee7b7!important}.upg-batch-row .stl-dot{box-shadow:0 0 0 2px #10b981}.mapboxgl-ctrl-top-left{top:12px!important;left:8px!important;width:380px!important;max-width:380px!important;z-index:1200!important}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:0!important;float:none!important}.stl-panel{--stl-top:8px!important}.upg-root:has(.mapboxgl-ctrl-geocoder) .stl-panel{--stl-top:58px!important}[dir="rtl"] .upg-detail-panel{right:auto!important;left:8px!important}.dg-main{font:13px/1.3 ui-monospace,monospace}.dg-meta{margin-top:2px;font-size:11px;color:#475569;display:flex;flex-wrap:wrap;gap:8px}.dg-field strong{font-weight:700}.dg-section-header-item{padding:4px 8px;font:10px/1.2 ui-monospace,monospace;letter-spacing:.06em;text-transform:uppercase;color:#94a3b8;pointer-events:none}`);function ue(A){const B=[];for(const W of A)B.push(W.zoneKey,SP(W.zoneKey,W.color));return["match",["get","zoneKey"],...B,"#9ca3af"]}function R(){if(E.getSource("tapestry")&&E.getLayer("tapestry-fill")&&E.getLayer("tapestry-line"))return;E.getSource("tapestry")||E.addSource("tapestry",{type:"geojson",data:ce});const A=g.value?.45:.3,B=g.value?.65:.45;if(E.getLayer("tapestry-fill")||E.addLayer({id:"tapestry-fill",type:"fill",source:"tapestry",paint:{"fill-color":xe,"fill-opacity":["case",["==",["get","zoneKey"],"deaf"],A,B]}}),E.getLayer("tapestry-line")||E.addLayer({id:"tapestry-line",type:"line",source:"tapestry",paint:{"line-color":xe,"line-width":1.2,"line-opacity":.9}}),Po){const W=Po;po(()=>{Po===W&&tn(W)})}}function V(){!E||!E.getSource("tapestry")||E.getLayer("upg-sel-fill")||(E.addLayer({id:"upg-sel-fill",type:"fill",source:"tapestry",filter:["boolean",!1],paint:{"fill-color":"#f59e0b","fill-opacity":.28}}),E.addLayer({id:"upg-sel-line",type:"line",source:"tapestry",filter:["boolean",!1],paint:{"line-color":"#fbbf24","line-width":2.4,"line-opacity":.95}}))}function m(){const A=[],B=[],W=[];for(const Re of k.value)Re.kind==="adm1"?A.push(Re.name):Re.kind==="adm0"?B.push(Re.key.slice(5)):Re.kind==="zone"&&W.push(Re.key.slice(5));const he=[];return A.length&&he.push(["in",["get","shapeName"],["literal",A]]),B.length&&he.push(["in",["get","iso3"],["literal",B]]),W.length&&he.push(["in",["get","zoneKey"],["literal",W]]),he.length?he.length===1?he[0]:["any",...he]:["boolean",!1]}function h(){if(H(),!E||!E.getLayer("upg-sel-fill"))return;const A=J.value?m():["boolean",!1];E.setFilter("upg-sel-fill",A),E.setFilter("upg-sel-line",A);const B=X.value;E.setPaintProperty("upg-sel-fill","fill-color",B||"#f59e0b"),E.setPaintProperty("upg-sel-fill","fill-opacity",B?.55:.28),E.setPaintProperty("upg-sel-line","line-color",B||"#fbbf24")}let G=null,Q=!1;function be(){if(!(!E||!E.getLayer("tapestry-fill"))){if(G)try{E.off("click","tapestry-fill",G)}catch{}G=A=>{const B=A&&A.features&&A.features[0];if(B&&J.value){const W=lf(B.properties,{nameMap:Z});if(!W){console.warn("[batch-select] clicked feature has no shapeName/iso3",B.properties);return}W.count==null&&console.warn("[batch-select] no UUPG count for territory",W.name,B.properties),le(W)}},E.on("click","tapestry-fill",G),Q||(E.on("mouseenter","tapestry-fill",()=>{E&&(E.getCanvas().style.cursor=J.value?"crosshair":"")}),E.on("mouseleave","tapestry-fill",()=>{E&&(E.getCanvas().style.cursor="")}),Q=!0)}}function re(){k.value=[],C.value="",X.value="",T.value="",h()}let O=null;function K(A){if(O=A,p&&typeof p.cacheSourceData=="function"){const B=EP({records:A,leafZones:fe,adm1Counts:qi,iso3Names:Xa,countryNameMap:Z,centroidFor:W=>{const he=xt(W);return he?[(he[0][0]+he[1][0])/2,(he[0][1]+he[1][1])/2]:null}});p.cacheSourceData(Lc,{normalizedData:B})}D=CP({records:A,leafZones:fe,adm1Counts:qi,iso3Names:Xa,countryNameMap:Z}),typeof window<"u"&&(window.__UPG_SEARCH__={size:()=>D.length,counts:()=>{const B={pg:0,zone:0,territory:0};for(const W of D)B[W.kind]=(B[W.kind]||0)+1;return B},query:B=>cf(D,B,{limit:df}).map(W=>({label:W.label,kind:W.kind,target:W.target})),select:B=>{const W=cf(D,B,{limit:df})[0];return W?(Tt(W.target),{label:W.label,kind:W.kind,target:W.target}):null},feedSize:()=>{const B=p&&p.sources&&p.sources[Lc];return B&&Array.isArray(B.features)&&B.features.length||0},localGeocoder:B=>{const W=z.value&&z.value.geocoder,he=W&&W.options&&W.options.localGeocoder;return he?he(B).map(Re=>Re&&Re.place_name):null}},n=window.__UPG_SEARCH__,(window.__UPG_SEARCHES__||(window.__UPG_SEARCHES__={}))[s()]=window.__UPG_SEARCH__)}function we(A){const B=A&&A.properties||{},W=B.__upgKind;if(W==="zone")Yt(B.__zoneId);else if(W==="territory")qt(B.__shapeName);else{const he=A&&A.geometry,Re=he&&Array.isArray(he.coordinates)?he.coordinates:null;Re&&Number.isFinite(Re[0])&&Number.isFinite(Re[1])&&E&&E.flyTo({center:[Re[0],Re[1]],zoom:6,duration:800}),_t(B.slug)}}function Te(A){if(!A||!E)return;const B=new Set(A.memberIds||[]);if(!B.size)return;let W=[];try{W=E.querySourceFeatures("upg").filter(rt=>{const Ce=rt.properties||{};return B.has(Ce.slug)||B.has(Ce.id)||B.has(Ce.peopleGroupId)})}catch{return}if(!W.length)return;let he=180,Re=90,Ye=-180,ht=-90,Ue=!1;for(const rt of W){const Ce=rt.geometry&&rt.geometry.coordinates;!Array.isArray(Ce)||!Number.isFinite(Ce[0])||!Number.isFinite(Ce[1])||(Ce[0]Ye&&(Ye=Ce[0]),Ce[1]ht&&(ht=Ce[1]),Ue=!0)}Ue&&E.fitBounds([[he,Re],[Ye,ht]],{padding:60,duration:800,maxZoom:6})}function Je(){fa(null),y&&typeof y.selectPeopleGroup=="function"&&y.selectPeopleGroup(null)}function Tt(A){!A||!E||(A.type==="pg"?(Number.isFinite(A.lng)&&Number.isFinite(A.lat)&&E.flyTo({center:[A.lng,A.lat],zoom:6,duration:800}),_t(A.slug)):A.type==="zone"?Yt(A.zoneId):A.type==="territory"&&qt(A.shapeName))}function _t(A){if(!A||!y||typeof y.selectPeopleGroup!="function")return;const W=MP(E,"upg").find(he=>he.properties&&he.properties.slug===A);W&&y.selectPeopleGroup(W)}function Yt(A){if(!A||!E||!ce)return;const B=xt(W=>W.properties&&W.properties.zoneKey===A);B&&E.fitBounds(B,{padding:40,duration:800,maxZoom:6})}function qt(A){if(!A||!E||!ce)return;const B=xt(W=>{const he=W.properties||{};return he.shapeName===A||he.iso3===A});B&&E.fitBounds(B,{padding:40,duration:800,maxZoom:6})}function xt(A){let B=180,W=90,he=-180,Re=-90,Ye=!1;const ht=Ue=>{if(typeof Ue[0]=="number"){const[rt,Ce]=Ue;rthe&&(he=rt),CeRe&&(Re=Ce),Ye=!0;return}for(const rt of Ue)ht(rt)};for(const Ue of ce.features)A(Ue)&&ht(Ue.geometry.coordinates);return Ye?[[B,W],[he,Re]]:null}function Lt(A){const B=new Set,W=he=>{he.children&&he.children.length?he.children.forEach(W):B.add(he.zoneKey??he.id)};return W(A),B}let io=null;function wo(A){if(![...Lt(A)].length)return;const W=[],he=Ue=>{Ue.children&&Ue.children.length?Ue.children.forEach(he):W.push(Ue)};he(A);const Re=k.value,Ye=new Set(Re.filter(Ue=>Ue.kind==="zone").map(Ue=>Ue.key));if(W.every(Ue=>Ye.has("zone:"+(Ue.zoneKey??Ue.id)))){const Ue=new Set(W.map(rt=>"zone:"+(rt.zoneKey??rt.id)));k.value=Re.filter(rt=>!Ue.has(rt.key))}else{const Ue=W.filter(rt=>!Ye.has("zone:"+(rt.zoneKey??rt.id))).map(rt=>({key:"zone:"+(rt.zoneKey??rt.id),name:rt.label||rt.id,count:Number(rt.count)||0,kind:"zone"}));k.value=[...Re,...Ue]}h(),C.value=""}function Tn(){const A=new Set;for(const B of k.value)B.kind==="zone"&&A.add(B.key.slice(5));return A}function En(){const A=new Map,B=W=>{const he=Lt(W);W.label&&A.set(W.label,he),W.children&&W.children.length&&W.children.forEach(B)};for(const W of _.value)B(W);return A}function H(){if(typeof document>"u")return;const A=document.querySelector("my-upg-100-list-map"),W=(A&&A.shadowRoot||document).querySelectorAll(".stl-row");if(!W.length)return;if(!J.value){W.forEach(ht=>ht.classList.remove("upg-batch-row"));return}const he=Tn(),Re=En(),Ye=g.value;W.forEach(ht=>{const Ue=ht.querySelector(".stl-name"),rt=Ue?Ue.textContent.trim():"",Ce=rt&&Re.get(rt),tt=!!(Ce&&Ce.size&&[...Ce].every(Pt=>he.has(Pt)));ht.classList.toggle("upg-batch-row",tt),ht.classList.toggle("dark",tt&&Ye)})}let oe=null;function Ee(){if(typeof document>"u"||oe)return;const A=document.querySelector("my-upg-100-list-map"),W=(A&&A.shadowRoot||document).querySelector(".stl-rows");W&&(oe=new MutationObserver(()=>{requestAnimationFrame(()=>H())}),oe.observe(W,{childList:!0,subtree:!0}))}Xt("onSemanticTreeSelect",fa),Xt("onLegendExport",De),Xt("legendExportCards",!0);async function De(A){const B=x.value;if(!B)return;const[W,he]=String(A).split(":");if(!Ze.value){Ze.value=!0,nt.value=W==="packet"?"packet":W==="cards"?"cards":"poster";try{if(W==="packet"){await Fe(B,he||"full");return}const Re=et().find(Ye=>Ye.id===B)||{id:B};if(W==="cards"){const Ye=et().find(ht=>ht.id===B);Ye&&await Y.printCardDeck(await Ge(Ye));return}await Y.printPoster(Re)}finally{Ze.value=!1,nt.value=""}}}const Y=Ag({t:(A,B,W)=>typeof W=="number"?ye(A,B,W):ye(A,B),records:A=>ve(A),lang:()=>Zt(),label:A=>(A==null?void 0:A.label)||(A==null?void 0:A.id)||"",assetsBase:()=>ua(a.value),iso3Names:()=>Xa,sheet:(A,B)=>me(A,B),sets:()=>fetch(`${ua(a.value)}/tables/near-neighbors.json`).then(A=>A.ok?A.json():null).catch(()=>null),downloadPrefix:"doxa-upg-100"});let ie="";st(Y.exportState,A=>{if(!A){ie&&$.value===ie&&($.value=""),ie="";return}if(A.phase==="error"){ie="",_e(ye("messages.packetFailed",{reason:A.message}),4e3);return}ie=A.phase==="done"?"":`${A.message}…`,$.value=ie});const ee=Ig({apiBase:()=>Ne,lang:()=>Zt(),profileConfig:a,evaluate:(A,B)=>Ca(A,B)});async function ve(A){if(!Ne)throw Qt("wall.hud.noApi","no people-groups service is configured");return ee(A.selector)}const me=Bg({allRecords:()=>ee.all(),assetsBase:()=>ua(a.value),profileConfig:a});function Oe(A,B,W){A.value=B,setTimeout(()=>{A.value===B&&(A.value="")},W)}const _e=(A,B)=>Oe($,A,B);async function Fe(A,B="full"){const W=et().find(Re=>Re.id===A);if(!W)return;const he=await Ge(W);await Y.printPacket(he,{variant:B,funnel:await gt()})}async function Ge(A){try{const[{zoneTitle:B},{countryName:W},he]=await Promise.all([ft(()=>Promise.resolve().then(()=>B1),void 0),ft(()=>Promise.resolve().then(()=>Fl),void 0),Ni(ua(a.value))]),Re={...he.en||{},...he[Zt()]||{}},Ye=B(A,Re,{countryName:W,locale:Zt()});return Ye?{...A,label:Ye}:A}catch{return A}}function Me(){return Al(vn(a))}function Ie(){const A=Me();return[...A.lists||[],...A.asia_lists||[],...A.uncovered_lists||[]]}function et(){const A=Ie(),B=new Set(A.map(W=>W.id));return[...A,...R1(Me(),{deafCount:pf}).filter(W=>!B.has(W.id))]}async function gt(){var A;try{const B=(await ft(async()=>{const{default:Ye}=await Promise.resolve().then(()=>Ef);return{default:Ye}},void 0)).default;if(!B||!Array.isArray(B.steps)||!B.steps.length)return null;const W=vn(a),he=Number(B.steps[B.steps.length-1].groups)||0;if(W===fr)return{...B,listCount:et().length,listTotal:he};let Re=0;try{const Ye=ua(a.value),ht=await fetch(`${Ye}/people-groups/lists/${W}.json`);if(ht.ok){const Ue=await ht.json();Re=Number((A=Ue==null?void 0:Ue.counts)==null?void 0:A.doxa)||(Array.isArray(Ue==null?void 0:Ue.slugs)?Ue.slugs.length:0)}}catch{}return{...B,listTotal:Re,listId:W,listLabel:(yg(W)||{}).label||W}}catch{return null}}const Ze=$e(!1),nt=$e("");function so(){const A=k.value.filter(W=>W.kind==="zone").map(W=>String(W.key).replace(/^zone:/,"")),B=new Map(et().map(W=>[W.id,W]));return A.map(W=>B.get(W)).filter(Boolean)}async function xo(){const A=await Ni(ua(a.value));return{...A.en||{},...A[Zt()]||{}}}function lo(A,B){return A?String(A).replace(/\{(\w+)\}/g,(W,he)=>B[he]!=null?String(B[he]):W):null}function qo(){return k.value.filter(A=>A.kind==="adm0").map(A=>String(A.key).replace(/^adm0:/,"")).filter(Boolean)}function co(){return k.value.filter(A=>A.kind==="adm1").map(A=>A.name||String(A.key).replace(/^adm1:/,""))}async function fo(){const A=so(),B=qo(),W=co();if(!A.length&&!B.length)throw W.length?Qt("upgMap.selectionAdm1NoData","no people-group data for {names} — select the country instead",{names:yl(W,{locale:Zt()})}):Qt("upgMap.nothingSelected","nothing is selected");if(!Ne)throw Qt("wall.hud.noApi","no people-groups service is configured");const Re=await fetch(`${Ne}/api/people-groups/list?fields=${Fg}&lang=${Zt()}`,{cache:"no-store"});if(!Re.ok)throw Qt("wall.hud.fetchFailed","could not load the people groups ({status})",{status:Re.status});const Ye=Sc(await Ei(Ac(await Re.json()),a)),{evaluate:ht}=await ft(async()=>{const{evaluate:Xe}=await Promise.resolve().then(()=>Dg);return{evaluate:Xe}},void 0),Ue=new Set;for(const Xe of A)if(Xe.selector&&Xe.selector.type==="pg_slugs")for(const So of Xe.selector.values||[])Ue.add(So);else for(const So of ht(Xe.selector,Ye))Ue.add(So);if(B.length)for(const Xe of ht({type:"country_codes",values:B},Ye))Ue.add(Xe);const rt=(await Promise.all(A.map(Ge))).map(Xe=>Xe.label||Xe.id),Ce=k.value.filter(Xe=>Xe.kind==="adm0").map(Xe=>Xe.name),tt=[...rt,...Ce],Pt=await xo(),uo=(Xe,So)=>lo(Pt.zone_join,{a:Xe,b:So})??`${Xe} + ${So}`;return{id:"selection",label:tt.length<=3?tt.reduce(uo):lo(Pt.zone_join_more,{a:tt.slice(0,2).reduce(uo),n:tt.length-2})??`${tt.slice(0,2).join(" + ")} +${tt.length-2} more`,count:Ue.size,selector:{type:"pg_slugs",values:[...Ue]}}}async function Nt(){if(!Ze.value){Ze.value=!0,nt.value="packet";try{const A=await fo(),B=so(),W=B.length===1?B[0].id:null,he=await gt();await Y.printPacket({...A,mapId:W},{funnel:he&&B.length===1?he:he?{...he,listCount:0}:null})}catch(A){_e(ye("messages.selectionPacketFailed",{reason:mr(A,ye).slice(0,90)}),4e3)}finally{Ze.value=!1,nt.value=""}}}async function Et(){if(!Ze.value){Ze.value=!0,nt.value="cards";try{await Y.printCardDeck(await fo())}catch(A){_e(ye("upgMap.selectionCardsFailed",{reason:mr(A,ye).slice(0,90)}),4e3)}finally{Ze.value=!1,nt.value=""}}}async function Ro(){if(!Ze.value){Ze.value=!0,nt.value="poster";try{const A=so();if(!A.length)throw qo().length||co().length?Qt("upgMap.selectionPosterNeedsZone","posters exist per territory on the legend — use Prayer list for a map selection"):Qt("upgMap.nothingSelected","nothing is selected");if(A.length>1){_e(ye("messages.posterOneTerritory",{count:A.length}),5e3);return}await Y.printPoster(A[0])}catch(A){_e(ye("messages.selectionPosterFailed",{reason:mr(A,ye).slice(0,90)}),4e3)}finally{Ze.value=!1,nt.value=""}}}function Zt(){const A=ke&&(ke.value??ke);return typeof A=="string"&&A||"en"}function fa(A){if(!E||!E.getLayer("tapestry-fill"))return!1;if(J.value)return A&&wo(A),!0;if(!A)return io=null,x.value=null,E.setFilter("tapestry-fill",null),E.setFilter("tapestry-line",null),E.setPaintProperty("upg-pins","circle-opacity",1),!0;io=A;const B=[...Lt(A)];x.value=B.length===1?B[0]:A.id??null;const W=["in",["get","zoneKey"],["literal",B]];E.setFilter("tapestry-fill",W),E.setFilter("tapestry-line",W),E.getLayer("upg-pins")&&E.setPaintProperty("upg-pins","circle-opacity",["case",["in",["get","zoneKey"],["literal",B]],.95,.05]);const he=xt(Re=>B.includes(Re.properties.zoneKey));return he&&E.fitBounds(he,{padding:40,duration:700,maxZoom:6}),!0}function Lr(){E&&(typeof Le=="function"&&Le(),ce&&(R(),V(),be(),h(),x.value&&E.getLayer("tapestry-fill")&&fa(io)))}function Ra(){E&&(g.value=!g.value,b.theme.value=g.value?"dark":"light",E.setStyle(g.value?xc("ink",l).style||"mapbox://styles/mapbox/dark-v11":xc("paper",l).style||"mapbox://styles/mapbox/light-v11"),E.once("style.load",Lr))}function Cr(){!E||!E.getLayer("upg-pins")||(E.on("click","upg-pins",A=>{const B=A&&A.features&&A.features[0];B&&y&&typeof y.selectPeopleGroup=="function"&&y.selectPeopleGroup(B)}),E.on("mouseenter","upg-pins",()=>{E&&(E.getCanvas().style.cursor="pointer")}),E.on("mouseleave","upg-pins",()=>{E&&(E.getCanvas().style.cursor="")}))}let Zo=null,Po,Fo=null;function Mn(A,B){var W,he,Re;try{const Ye=(Re=(he=(W=v.value)==null?void 0:W.getRootNode)==null?void 0:he.call(W))==null?void 0:Re.host;if(!Ye)return;Ye.setAttribute("data-doxa-select-zone-state",A),B&&Ye.setAttribute("data-doxa-select-zone-applied",String(B))}catch{}}function tn(A){if(!A)return fa(null),Po=void 0,Mn("cleared",""),!0;const B=Tr(_.value,A);return B?fa(B)?(Po=void 0,Mn("applied",A),!0):(Po=A,Mn("applied-but-no-selection",A),!1):(Po=A,Mn("unresolved",A),!1)}function Nn(A){var W;const B=((W=A==null?void 0:A.detail)==null?void 0:W.listId)??null;tn(B)}function Tr(A,B){for(const W of A||[]){if((W.zoneKey||W.id)===B)return W;const he=W.children&&Tr(W.children,B);if(he)return he}return null}function Oc(){const A=Me(),B=j(null);_.value=B,fe=_r(B);const W={};for(const he of A.lists||[])W[he.id]=he.selector;for(const he of A.asia_lists||[])W[he.id]=he.selector;for(const he of A.uncovered_lists||[])W[he.id]=he.selector;W.deaf=$r;for(const he of fe)he.selector=W[he.id];xe=ue(fe)}async function Rn(){if(Ne)try{const B=await fetch(`${Ne}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${Zt()}`,{cache:"no-store"});if(!B.ok)throw new Error(`list ${B.status}`);const W=Sc(await Ei(Ac(await B.json()),a));Z=sf(W),_.value=j(W)}catch{}}To(async()=>{var Re,Ye,ht,Ue,rt;Oc();try{await yP(l)}catch{}const A=Pc(l);A&&_P(A);const B=(o==null?void 0:o.value)||((Re=a==null?void 0:a.value)==null?void 0:Re.tk)||"";if(!A){console.warn(`[upg-100-list] ${l} engine global is missing — refusing to substitute another engine. A page that asked for the keyless engine must not silently receive the token-gated one.`),$.value=`⚠ ${ye("messages.engineNotLoaded")}`,f.value=ye("messages.engineNotLoadedDetail",{engine:c?"MapLibre":"Mapbox"}),Rn();return}if(!c){if(!B){$.value=`⚠ ${ye("messages.noMapboxToken")}`,f.value=ye("messages.noMapboxTokenDetail"),Rn();return}A.accessToken=B}try{const Ce=af(l);Ce&&await vP(v.value,Ce)}catch{}try{const Ce=!c&&v.value&&v.value.getRootNode();if(Ce instanceof ShadowRoot){const tt=af("mapbox");if(tt&&!Ce.querySelector(`link[href="${tt}"]`)){const Pt=document.createElement("link");Pt.rel="stylesheet",Pt.href=tt,Ce.prepend(Pt)}}}catch{}E=new A.Map({container:v.value,style:xc("paper",l).style||"mapbox://styles/mapbox/light-v11",center:[35,20],zoom:1.5,projection:"mercator"}),w.value=E,Se=mP(((Ye=v.value)==null?void 0:Ye.parentElement)||null,{enabled:d.value}),typeof window<"u"&&(window.__UPG_MAP__=E,r=E,(window.__UPG_MAPS__||(window.__UPG_MAPS__={}))[s()]=E),window.__UPG_SELECT__={get list(){return k.value.map(Ce=>({...Ce}))},get total(){return L.value},get count(){return S.value},get color(){return X.value},get batchMode(){return J.value},setColor:Ce=>ne(Ce),setBatchMode:Ce=>I(Ce),clipboardText:()=>AP(k.value,{color:X.value}),clear:()=>re(),toggleByProps:Ce=>{const tt=lf(Ce,{nameMap:Z});return tt?(le(tt),{...tt}):null},toggleLegendRow:Ce=>{const tt=uo=>{for(const pt of uo){if(pt.label===Ce||pt.id===Ce)return pt;if(pt.children&&pt.children.length){const Xe=tt(pt.children);if(Xe)return Xe}}return null},Pt=tt(_.value);return Pt?(wo(Pt),{label:Pt.label,zoneKeys:[...Lt(Pt)]}):null},markedLegendRows:()=>{if(typeof document>"u")return[];const Ce=document.querySelector("my-upg-100-list-map");return[...(Ce&&Ce.shadowRoot||document).querySelectorAll(".stl-row.upg-batch-row .stl-name")].map(Pt=>Pt.textContent.trim())},highlightFeatureCount:()=>{if(!E||!ce||!E.getLayer("upg-sel-fill"))return-1;const Ce=new Set,tt=new Set,Pt=new Set;for(const pt of k.value)pt.kind==="zone"?Ce.add(pt.key.slice(5)):pt.kind==="adm1"?tt.add(pt.name):pt.kind==="adm0"&&Pt.add(pt.key.slice(5));let uo=0;for(const pt of ce.features){const Xe=pt.properties||{};(Ce.has(Xe.zoneKey)||tt.has(Xe.shapeName)||Pt.has(Xe.iso3))&&uo++}return uo},zoneKeysForRow:Ce=>{const tt=uo=>{for(const pt of uo){if(pt.label===Ce||pt.id===Ce)return pt;if(pt.children&&pt.children.length){const Xe=tt(pt.children);if(Xe)return Xe}}return null},Pt=tt(_.value);return Pt?[...Lt(Pt)]:null}},i=window.__UPG_SELECT__,(window.__UPG_SELECTS__||(window.__UPG_SELECTS__={}))[s()]=window.__UPG_SELECT__;try{$.value=ye("messages.loadingBoundaries");const Ce=Qe=>`${ua(a.value)}/boundaries/${Qe}`,tt=Qe=>fetch(Ce(Qe)).then(Ut=>{if(!Ut.ok)throw new Error(`boundary fetch ${Ut.status} ${Qe}`);return Ut.json()});if(!Ne)throw new Error("No API base configured — set window.MAP_APP_API_URL or VITE_API_BASE_URL. Failing closed (no default host).");const uo=fetch(`${Ne}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${Zt()}`).then(Qe=>{if(!Qe.ok)throw new Error(`list ${Qe.status}`);return Qe.json()}),pt={adm0:tt("world-adm0-web.geojson"),adm1Chn:tt("gb-CHN-ADM1.geojson"),adm1Ind:tt("gb-IND-ADM1-web.geojson")};$.value=ye("messages.fetchingUupgs",{n:2106});const Xe=Sc(await Ei(Ac(await uo),a));Z=sf(Xe),_.value=j(Xe);const So=[],Jo={},{evaluate:Dc}=await ft(async()=>{const{evaluate:Qe}=await Promise.resolve().then(()=>Dg);return{evaluate:Qe}},void 0);for(const Qe of fe)if(Qe.selector&&Qe.selector.type==="pg_slugs")for(const Ut of Qe.selector.values||[])Ut in Jo||(Jo[Ut]=Qe.zoneKey);else try{for(const Ut of Dc(Qe.selector,Xe))Ut in Jo||(Jo[Ut]=Qe.zoneKey)}catch(Ut){console.warn("zone selector skipped",Qe.id,Ut&&Ut.message)}for(const Qe of Xe){const Ut=Number(Qe.latitude),Hc=Number(Qe.longitude);!isFinite(Ut)||!isFinite(Hc)||So.push({type:"Feature",geometry:{type:"Point",coordinates:[Hc,Ut]},properties:{slug:Qe.slug,zoneKey:Jo[Qe.slug]||"",name:Qe.name||Qe.slug||"",population:Qe.population??0,countryName:Qe.country_code_label||"",country:Qe.country_code||""}})}const zc=Oa({type:"FeatureCollection",features:So});Le=()=>{if(!(E.getSource("upg")&&E.getLayer("upg-pins"))){if(E.getSource("upg")||E.addSource("upg",{type:"geojson",data:zc}),E.getLayer("upg-pins")){Cr();return}E.addLayer({id:"upg-pins",type:"circle",source:"upg",paint:{"circle-radius":["interpolate",["linear"],["zoom"],1,5,4,6.5,8,9],"circle-color":xe,"circle-opacity":1,"circle-stroke-width":["interpolate",["linear"],["zoom"],1,1.8,8,2],"circle-stroke-color":"rgba(15,20,25,0.9)"}}),Cr()}};const Er=()=>{try{Lr()}catch(Qe){console.warn("early pin paint skipped",Qe&&Qe.message)}};E.isStyleLoaded()?Er():E.once("style.load",Er),$.value=ye("messages.loadingBoundaries");const[Gc,jc]=await Promise.all([pt.adm0,pt.adm1Chn]),fA=await pt.adm1Ind,{tapestry:mA,perZone:bA}=G1(fe,{records:Xe,adm0:Gc,adm1Ind:fA,adm1Chn:jc});ce=Oa(mA),K(Xe);let Bc=!0;const Fn=()=>{Bc&&(Bc=!1,E.off("style.load",Fn),E.off("idle",Fn),Lr())};if(E.isStyleLoaded())Fn();else{E.once("style.load",Fn),E.once("idle",Fn);const Qe=setInterval(()=>{if(!Bc||!E){clearInterval(Qe);return}let Ut=!1;try{Ut=E.isStyleLoaded()}catch{clearInterval(Qe);return}Ut&&(clearInterval(Qe),Fn())},120);setTimeout(()=>clearInterval(Qe),15e3)}const Df=[...bA.entries()].filter(([Qe])=>Qe!=="deaf"),$A=Df.filter(([,Qe])=>Qe>=1).length;$.value=ye("messages.mapStatusCounts",{polys:ce.features.length,zones:$A,total:Df.length,pins:So.length})}catch(Ce){console.warn("[upg-100-list] map data failed:",Ce),$.value="⚠ "+ye("upgMap.mapDataFailed")}let W=0;const he=()=>{const Ce=typeof document<"u"&&document.querySelector("my-upg-100-list-map"),tt=Ce&&Ce.shadowRoot||(typeof document<"u"?document:null);if(tt&&tt.querySelector(".stl-rows")){Ee(),H();return}W++<40&&setTimeout(he,250)};he();{const Ce=(rt=(Ue=(ht=v.value)==null?void 0:ht.getRootNode)==null?void 0:Ue.call(ht))==null?void 0:rt.host;if(Ce){Zo=Nn,Ce.addEventListener("doxa:select-zone",Zo);const tt=Ce.getAttribute("select-zone");tt&&tn(tt),Fo=new MutationObserver(()=>{tn(Ce.getAttribute("select-zone")||null)}),Fo.observe(Ce,{attributes:!0,attributeFilter:["select-zone"]})}}});const as=()=>{var A,B,W;try{return((W=(B=(A=v.value)==null?void 0:A.getRootNode)==null?void 0:B.call(A))==null?void 0:W.host)||null}catch{return null}};return st([_,w],()=>{po(()=>{var B;const A=((B=as())==null?void 0:B.getAttribute("select-zone"))||Po||null;A&&tn(A)})}),go(()=>{var A,B,W;if(Fo==null||Fo.disconnect(),Fo=null,Zo){const he=(W=(B=(A=v.value)==null?void 0:A.getRootNode)==null?void 0:B.call(A))==null?void 0:W.host;he==null||he.removeEventListener("doxa:select-zone",Zo),Zo=null}if(oe){try{oe.disconnect()}catch{}oe=null}if(Se){try{Se()}catch{}Se=null}if(E&&(E.remove(),E=null),ce=null,typeof window<"u"){const he=s();try{window.__UPG_SEARCHES__&&delete window.__UPG_SEARCHES__[he],window.__UPG_MAPS__&&delete window.__UPG_MAPS__[he],window.__UPG_SELECTS__&&delete window.__UPG_SELECTS__[he],window.__UPG_SEARCH__===n&&delete window.__UPG_SEARCH__,window.__UPG_MAP__===r&&delete window.__UPG_MAP__,window.__UPG_SELECT__===i&&delete window.__UPG_SELECT__}catch{}}}),(A,B)=>{var W;return q(),se("div",NP,[N("div",{ref_key:"mapEl",ref:v,class:"upg-map"},null,512),f.value?(q(),se("div",RP,[N("strong",null,pe(de(ye)("messages.mapUnavailable")),1),Rt(pe(f.value),1)])):Pe("",!0),d.value?(q(),se(Ke,{key:1},[B[0]||(B[0]=N("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),B[1]||(B[1]=N("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1))],64)):Pe("",!0),w.value&&u.value?(q(),mt(uP,{key:2,ref_key:"geocoderRef",ref:z,"map-instance":w.value,"access-token":de(o)||((W=de(a))==null?void 0:W.tk)||"","data-source-id":Lc,"is-dark":g.value,placeholder:ge.value,"active-context":qP,onPeopleGroupResult:we,onAggregateResult:Te,onClear:Je},null,8,["map-instance","access-token","is-dark","placeholder"])):Pe("",!0),w.value?(q(),mt(Ox,{key:3,"has-geocoder":u.value},{default:_o(()=>[dt(zx,{map:w.value,"is-dark":g.value},null,8,["map","is-dark"]),dt(Gx,{map:w.value,"is-dark":g.value},null,8,["map","is-dark"]),dt(jx,{map:w.value,"is-dark":g.value},null,8,["map","is-dark"]),dt(Ux,{"map-container":v.value,"is-dark":g.value},null,8,["map-container","is-dark"]),dt(Kx,{"is-dark":g.value,onToggle:Ra},null,8,["is-dark"]),dt(Ja,{"is-dark":g.value,active:J.value,class:je({"upg-batch-on":J.value}),"aria-pressed":J.value?"true":"false",title:ae.value,onClick:P},{default:_o(()=>[...B[2]||(B[2]=[N("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[N("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),N("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),N("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),N("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})],-1)])]),_:1},8,["is-dark","active","class","aria-pressed","title"])]),_:1},8,["has-geocoder"])):Pe("",!0),N("div",FP,[_.value.length?(q(),mt(Qg,{key:0,nodes:_.value,tabs:U.value,"default-tab":uf,columns:["count","pop"],title:F.value,"export-enabled":!0,"export-cards":!0,onSelect:fa,onExport:De},null,8,["nodes","tabs","title"])):Pe("",!0)]),N("div",IP,[_.value.length?(q(),mt(Ix,{key:0,"legend-type":"upg-100",nodes:_.value,tabs:U.value,"default-tab":uf,columns:["count","pop"],"column-label":"UPG 100",title:F.value,"is-dark":g.value,"popup-action":"pray"},null,8,["nodes","tabs","title","is-dark"])):Pe("",!0)]),N("div",OP,[de(y)&&de(y).selectedPeopleGroup?(q(),se("div",{key:0,class:je(["upg-detail-panel pg-detail-root",{dark:g.value}])},[dt(de(t),{peopleGroup:de(y).selectedPeopleGroup,dark:g.value,action:"pray"},null,8,["peopleGroup","dark"])],2)):Pe("",!0)]),J.value?(q(),se("div",DP,[N("div",zP,pe(de(ye)("messages.tapTerritoriesHint")),1),S.value?(q(),se("div",GP,[N("span",null,pe(de(ye)("messages.territoriesSelected",{count:S.value}))+" ·",1),N("span",jP,pe(L.value)+" UUPG",1),N("span",{class:je(["upg-hud-band",{ok:L.value>=50&&L.value<=100}])},pe(L.value>=50&&L.value<=100?de(ye)("messages.bandInRange"):de(ye)("messages.bandOutOfRange")),3)])):Pe("",!0),S.value?(q(),se("div",BP,pe(de(yl)(k.value.map(he=>he.name),{locale:Zt()})),1)):Pe("",!0),S.value?(q(),se("div",HP,[N("button",{class:je(["upg-hud-btn make",{"is-busy":nt.value==="packet"}]),disabled:Ze.value,onClick:Nt},pe(nt.value==="packet"?de(ye)("buttons.working"):de(ye)("buttons.prayerList")),11,UP),N("button",{class:je(["upg-hud-btn make",{"is-busy":nt.value==="poster"}]),disabled:Ze.value,onClick:Ro},pe(nt.value==="poster"?de(ye)("buttons.working"):de(ye)("buttons.posterMap")),11,WP),N("button",{class:je(["upg-hud-btn make",{"is-busy":nt.value==="cards"}]),disabled:Ze.value,onClick:Et},pe(nt.value==="cards"?de(ye)("buttons.working"):de(ye)("buttons.cardDeck")),11,KP),N("button",{class:"upg-hud-btn clear",onClick:re},pe(de(ye)("buttons.clearSelection")),1)])):Pe("",!0),S.value?(q(),se("div",VP,pe(C.value),1)):Pe("",!0)])):Pe("",!0),N("div",YP,pe($.value),1)])}}}},Symbol.toStringTag,{value:"Module"})),JP=` +`+s}function Cn(e){return String(e??"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().trim()}function LP(e){return Cn(e).split(/[\s,;]+/).filter(Boolean)}function CP(e={}){const{records:t=[],leafZones:o=[],adm1Counts:a={},iso3Names:n={},countryNameMap:r=null}=e,i=[],s=new Set;for(const c of t){if(!c)continue;const u=c.slug;if(!u||s.has(u))continue;const d=Number(c.latitude),p=Number(c.longitude);if(!Number.isFinite(d)||!Number.isFinite(p))continue;const y=c.name||u;s.add(u),i.push({label:y,kind:"pg",target:{type:"pg",slug:u,lng:p,lat:d},_hay:Cn(y)})}for(const c of o){if(!c)continue;const u=c.zoneKey||c.id,d=c.label||u;u&&i.push({label:d,kind:"zone",target:{type:"zone",zoneId:u},_hay:Cn(d)})}for(const c of Object.keys(a))i.push({label:c,kind:"territory",target:{type:"territory",shapeName:c},_hay:Cn(c)});const l=r||n;for(const c of Object.keys(n)){const u=l&&l[c]||n[c]||c;i.push({label:u,kind:"territory",target:{type:"territory",shapeName:c,iso3:!0},_hay:Cn(u)})}return i}const TP={zone:0,territory:1,pg:2};function EP(e={}){const{records:t=[],leafZones:o=[],adm1Counts:a={},iso3Names:n={},countryNameMap:r=null,centroidFor:i=null}=e,s=[];for(const u of t)u&&s.push(u);const l=(u,d,p)=>!d||!Number.isFinite(d[0])||!Number.isFinite(d[1])?null:{name:u,slug:p.__synthSlug,latitude:d[1],longitude:d[0],...p};for(const u of o){if(!u)continue;const d=u.zoneKey||u.id,p=u.label||d;if(!d)continue;const y=typeof i=="function"?i($=>$&&$.properties&&$.properties.zoneKey===d):null,v=l(p,y,{__upgKind:"zone",__zoneId:d,__synthSlug:`__zone__${d}`});v&&s.push(v)}for(const u of Object.keys(a)){const d=typeof i=="function"?i(y=>y&&y.properties&&y.properties.shapeName===u):null,p=l(u,d,{__upgKind:"territory",__shapeName:u,__synthSlug:`__terr__${u}`});p&&s.push(p)}const c=r||n;for(const u of Object.keys(n)){const d=c&&c[u]||n[u]||u,p=typeof i=="function"?i(v=>v&&v.properties&&v.properties.iso3===u):null,y=l(d,p,{__upgKind:"territory",__shapeName:u,__synthSlug:`__terr__${u}`});y&&s.push(y)}return s}function cf(e,t,o={}){const a=o.limit??8,n=LP(t);if(!n.length)return[];const r=n[0],i=[];for(const s of e){let l=!0;for(const d of n)if(!s._hay.includes(d)){l=!1;break}if(!l)continue;const c=s._hay.startsWith(r)?0:1,u=s._hay===Cn(t)?-1:0;i.push({e:s,starts:c,exact:u,kr:TP[s.kind]??9,len:s._hay.length})}return i.sort((s,l)=>s.exact-l.exact||s.starts-l.starts||s.kr-l.kr||s.len-l.len),i.slice(0,a).map(s=>s.e)}const Zi=new Set;function MP(e,t){var n,r;const o=e.getSource(t);if(!o)return[];let a=o._data??((r=(n=o.serialize)==null?void 0:n.call(o))==null?void 0:r.data);if(a&&typeof a=="object"&&!Array.isArray(a)){if(a.geojson!==void 0)a=a.geojson;else if(a.url!==void 0)return Zi.has(t)||(Zi.add(t),console.warn(`[pin-selection] source "${t}" is remote (url); its features cannot be read locally, so nothing can be selected from it.`)),[]}return a?Array.isArray(a==null?void 0:a.features)?a.features:(a==null?void 0:a.type)==="Feature"?[a]:(a&&typeof a=="object"&&!Zi.has(t)&&(Zi.add(t),console.warn(`[pin-selection] source "${t}": unrecognised data shape {${Object.keys(a).join(",")}} — nothing can be selected from it; this is NOT a confirmed empty source.`)),[]):[]}const NP={class:"upg-root"},RP={key:0,class:"upg-map-err"},FP={class:"upg-legend-desktop-slot"},IP={class:"upg-legend-mobile-slot"},OP={class:"upg-detail-desktop-slot"},DP={key:4,class:"upg-hud"},zP={class:"upg-hud-hint"},GP={key:0,class:"upg-hud-head"},jP={class:"upg-hud-total"},BP={key:1,class:"upg-hud-names"},HP={key:2,class:"upg-hud-actions"},UP=["disabled"],WP=["disabled"],KP=["disabled"],VP={key:3,class:"upg-hud-flash"},YP={class:"upg-status"},Lc="upg-search",uf=1,qP="people-groups",df=8,pf=123,ZP=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"upg-100-list",setup(e){const t=bg(()=>ft(()=>Promise.resolve().then(()=>vx),void 0)),o=qe("mapboxToken",$e("")),a=qe("profileConfig",$e(null));let n=null,r=null,i=null;function s(){var A,B;return((A=a.value)==null?void 0:A.instanceId)||((B=a.value)==null?void 0:B.profile)||"upg-100-list"}const l=gP(a),c=l==="maplibre",u=te(()=>{var A;return((A=a==null?void 0:a.value)==null?void 0:A.search)===!1?!1:l==="mapbox"}),d=te(()=>{var B;const A=(B=a.value)==null?void 0:B.edgeScrollAffordance;return A==null?!0:!(A===!1||A==="false")}),p=qe("dataStore",null),y=qe("uiStore",null),v=$e(null),$=$e(""),f=$e(""),_=Da([]),x=$e(null),w=Da(null),g=$e(!1),b=Z1("my-upg-100-list");b.theme.value="light",J1(b);const k=$e([]),L=te(()=>k.value.reduce((A,B)=>A+(Number(B.count)||0),0)),S=te(()=>k.value.length),C=$e("");let Z=null;const J=$e(!1);function I(A){const B=A===void 0?!J.value:!!A;return B===J.value||(J.value=B,E&&(E.getCanvas().style.cursor=""),h()),B}function P(){I()}st([J,g],()=>{po(()=>H())});function le(A){if(!A)return;const B=k.value,W=B.findIndex(he=>he.key===A.key);W>=0?k.value=B.filter((he,Re)=>Re!==W):k.value=[...B,A],h(),C.value=""}const X=$e(""),T=$e("");function ne(A){const B=/^#?([0-9a-fA-F]{6})$/.exec(String(A||"").trim());if(!B)return;const W="#"+B[1].toLowerCase();X.value=X.value===W?"":W,h()}const z=$e(null),U=te(()=>[{id:"upg100Region",label:ye("tabs.upg100Region"),info:ye("legend.tabInfo.upg100Region")},{id:"upg100Zone",label:ye("tabs.upg100Zone"),info:ye("legend.tabInfo.upg100Zone")}]);let D=[],E=null,ce=null,fe=[],xe=null,Se=null,Le=null;const Ne=typeof window<"u"&&window.MAP_APP_API_URL||void 0||"",{locale:ke,t:ye}=zt();let ot="";st(()=>Zt(),()=>{($.value===""||$.value===ot)&&($.value=ot=ye("legend.loadingData"))},{immediate:!0});function It(A){const B={zone_affinity_A017:ye("poster.zone_deaf")},W=A?Wg(A):void 0;return{deafCount:pf,...A?{records:A}:{},title:he=>Ml(he,B,{byCode:W,countryName:Ri,locale:Zt()}),regionTitle:he=>Cl[he]?ye(`poster.${Cl[he]}`):he}}let M=null;function j(A){return A!==void 0&&(M=A),Tl(Me(),It(M))}st(()=>Zt(),()=>{if(!_.value.length)return;_.value=j();const A=new Map(_r(_.value).map(B=>[B.id,B.label]));for(const B of fe)A.has(B.id)&&(B.label=A.get(B.id));O&&K(O)});const F=te(()=>ye("legend.title.upg100List")),ae=te(()=>ye("legend.title.batchSelect")),ge=te(()=>ye("search.upg100Placeholder"));Ht(`.upg-root{position:absolute;inset:0;background:#0a1410;color:#e5e7eb;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}.upg-map{position:absolute;inset:0}.upg-map-err{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);z-index:1;pointer-events:none;text-align:center;padding:0 24px;font:13px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#9aa7b8}.upg-map-err strong{display:block;font-size:14px;color:#cbd5e1;margin-bottom:4px}.map-scroll-edge{position:absolute;top:0;bottom:0;width:40px;z-index:2;touch-action:pan-y;pointer-events:auto;background:transparent}.map-scroll-edge--left{left:0}.map-scroll-edge--right{right:0}.upg-legend-desktop-slot{--stl-top:8px}.upg-legend-mobile-slot{display:none}@media(max-width:767px){.upg-legend-mobile-slot{display:block}.upg-legend-desktop-slot{display:none}.upg-detail-desktop-slot{display:none}}.upg-root{--upg-credit-floor:calc(max(min(var(--legend-sheet-h,0px),48px),var(--map-fab-clearance,0px)) + 30px)}.upg-status{position:absolute;bottom:calc(var(--upg-credit-floor) + 6px);inset-inline-end:10px;z-index:1;pointer-events:none;font:10px/1 ui-monospace,monospace;color:#9aa7b8;background:rgba(10,14,21,.82);padding:6px 10px;border-radius:8px}@media(max-width:767px){.upg-status{display:none}}.upg-detail-panel{position:absolute;top:60px;right:8px;bottom:10px;width:340px;max-width:calc(100vw - 16px);z-index:6;background:#fff;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.45);overflow:hidden;display:flex;flex-direction:column;animation:upgPanelIn .18s ease}.upg-detail-panel.dark{background:#1a1a2e}@keyframes upgPanelIn{from{transform:translateX(16px);opacity:0}to{transform:translateX(0);opacity:1}}@media(max-width:480px){.upg-detail-panel{top:auto;left:8px;right:8px;width:auto;height:55vh}}.upg-hud{position:absolute;bottom:calc(var(--upg-credit-floor) + 30px);inset-inline-end:10px;z-index:6;min-width:150px;font:11px/1.35 ui-monospace,monospace;color:#e5e7eb;background:rgba(10,20,16,.92);border:1px solid rgba(110,231,183,.35);border-radius:10px;padding:8px 10px;box-shadow:0 4px 16px rgba(0,0,0,.4)}.upg-hud-head{display:flex;align-items:baseline;gap:6px;white-space:nowrap}.upg-hud-total{font-size:15px;font-weight:700;color:#6ee7b7}.upg-hud-band{margin-inline-start:auto;font-size:9px;color:#9aa7b8}.upg-hud-band.ok{color:#6ee7b7}.upg-hud-names{margin-top:5px;max-height:84px;overflow:auto;font-size:10px;color:#cbd5e1;line-height:1.45;word-break:break-word}.upg-hud-actions{display:flex;gap:6px;margin-top:7px}.upg-hud-btn{flex:1;cursor:pointer;border:1px solid rgba(110,231,183,.4);background:rgba(16,185,129,.18);color:#d1fae5;font:12px/1 ui-monospace,monospace;padding:0 10px;min-height:40px;border-radius:8px}.upg-hud-btn:hover{background:rgba(16,185,129,.32)}.upg-hud-btn.clear{background:rgba(148,163,184,.12);border-color:rgba(148,163,184,.4);color:#cbd5e1}.upg-hud-flash{margin-top:5px;font-size:9px;color:#6ee7b7;min-height:11px}.upg-hud-hint{margin-top:4px;font-size:9px;color:#64748b}.upg-hud-swatches{display:flex;gap:6px;margin-top:7px;align-items:center;flex-wrap:wrap}.upg-swatch{width:40px;height:40px;border-radius:9px;cursor:pointer;padding:0;border:1px solid rgba(255,255,255,.3)}.upg-swatch.active{outline:2px solid #fff;outline-offset:1px}.upg-hex{width:84px;min-height:40px;background:rgba(148,163,184,.12);border:1px solid rgba(148,163,184,.4);color:#cbd5e1;font:12px/1 ui-monospace,monospace;padding:0 8px;border-radius:8px}@media(max-width:480px){.upg-hud{left:8px;right:8px;min-width:0;bottom:calc(var(--upg-credit-floor) + 30px);max-height:48vh;overflow:auto}}.map-toolbar .mcb.upg-batch-on{background:#10b981!important;color:#04241a!important;box-shadow:0 0 0 2px rgba(52,211,153,.45),0 1px 4px rgba(0,0,0,0.2)!important}.map-toolbar .mcb.upg-batch-on.dark{border-color:#34d399!important}.upg-batch-row{position:relative;background:rgba(16,185,129,.16)!important;opacity:1!important;box-shadow:inset 3px 0 0 0 #10b981}.upg-batch-row .stl-name{color:#065f46!important;font-weight:700}.stl-panel[data-theme="dark"] .upg-batch-row .stl-name,.upg-batch-row.dark .stl-name{color:#6ee7b7!important}.upg-batch-row .stl-dot{box-shadow:0 0 0 2px #10b981}.mapboxgl-ctrl-top-left{top:12px!important;left:8px!important;width:380px!important;max-width:380px!important;z-index:1200!important}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:0!important;float:none!important}.stl-panel{--stl-top:8px!important}.upg-root:has(.mapboxgl-ctrl-geocoder) .stl-panel{--stl-top:58px!important}[dir="rtl"] .upg-legend-desktop-slot .stl-panel,.upg-root:has(.mapboxgl-ctrl-logo) .upg-legend-desktop-slot .stl-panel{max-height:calc(100% - var(--stl-top,60px) - 12px - 30px)!important}[dir="rtl"] .upg-detail-panel{right:auto!important;left:8px!important}.dg-main{font:13px/1.3 ui-monospace,monospace}.dg-meta{margin-top:2px;font-size:11px;color:#475569;display:flex;flex-wrap:wrap;gap:8px}.dg-field strong{font-weight:700}.dg-section-header-item{padding:4px 8px;font:10px/1.2 ui-monospace,monospace;letter-spacing:.06em;text-transform:uppercase;color:#94a3b8;pointer-events:none}`);function ue(A){const B=[];for(const W of A)B.push(W.zoneKey,SP(W.zoneKey,W.color));return["match",["get","zoneKey"],...B,"#9ca3af"]}function R(){if(E.getSource("tapestry")&&E.getLayer("tapestry-fill")&&E.getLayer("tapestry-line"))return;E.getSource("tapestry")||E.addSource("tapestry",{type:"geojson",data:ce});const A=g.value?.45:.3,B=g.value?.65:.45;if(E.getLayer("tapestry-fill")||E.addLayer({id:"tapestry-fill",type:"fill",source:"tapestry",paint:{"fill-color":xe,"fill-opacity":["case",["==",["get","zoneKey"],"deaf"],A,B]}}),E.getLayer("tapestry-line")||E.addLayer({id:"tapestry-line",type:"line",source:"tapestry",paint:{"line-color":xe,"line-width":1.2,"line-opacity":.9}}),Po){const W=Po;po(()=>{Po===W&&tn(W)})}}function V(){!E||!E.getSource("tapestry")||E.getLayer("upg-sel-fill")||(E.addLayer({id:"upg-sel-fill",type:"fill",source:"tapestry",filter:["boolean",!1],paint:{"fill-color":"#f59e0b","fill-opacity":.28}}),E.addLayer({id:"upg-sel-line",type:"line",source:"tapestry",filter:["boolean",!1],paint:{"line-color":"#fbbf24","line-width":2.4,"line-opacity":.95}}))}function m(){const A=[],B=[],W=[];for(const Re of k.value)Re.kind==="adm1"?A.push(Re.name):Re.kind==="adm0"?B.push(Re.key.slice(5)):Re.kind==="zone"&&W.push(Re.key.slice(5));const he=[];return A.length&&he.push(["in",["get","shapeName"],["literal",A]]),B.length&&he.push(["in",["get","iso3"],["literal",B]]),W.length&&he.push(["in",["get","zoneKey"],["literal",W]]),he.length?he.length===1?he[0]:["any",...he]:["boolean",!1]}function h(){if(H(),!E||!E.getLayer("upg-sel-fill"))return;const A=J.value?m():["boolean",!1];E.setFilter("upg-sel-fill",A),E.setFilter("upg-sel-line",A);const B=X.value;E.setPaintProperty("upg-sel-fill","fill-color",B||"#f59e0b"),E.setPaintProperty("upg-sel-fill","fill-opacity",B?.55:.28),E.setPaintProperty("upg-sel-line","line-color",B||"#fbbf24")}let G=null,Q=!1;function be(){if(!(!E||!E.getLayer("tapestry-fill"))){if(G)try{E.off("click","tapestry-fill",G)}catch{}G=A=>{const B=A&&A.features&&A.features[0];if(B&&J.value){const W=lf(B.properties,{nameMap:Z});if(!W){console.warn("[batch-select] clicked feature has no shapeName/iso3",B.properties);return}W.count==null&&console.warn("[batch-select] no UUPG count for territory",W.name,B.properties),le(W)}},E.on("click","tapestry-fill",G),Q||(E.on("mouseenter","tapestry-fill",()=>{E&&(E.getCanvas().style.cursor=J.value?"crosshair":"")}),E.on("mouseleave","tapestry-fill",()=>{E&&(E.getCanvas().style.cursor="")}),Q=!0)}}function re(){k.value=[],C.value="",X.value="",T.value="",h()}let O=null;function K(A){if(O=A,p&&typeof p.cacheSourceData=="function"){const B=EP({records:A,leafZones:fe,adm1Counts:qi,iso3Names:Xa,countryNameMap:Z,centroidFor:W=>{const he=xt(W);return he?[(he[0][0]+he[1][0])/2,(he[0][1]+he[1][1])/2]:null}});p.cacheSourceData(Lc,{normalizedData:B})}D=CP({records:A,leafZones:fe,adm1Counts:qi,iso3Names:Xa,countryNameMap:Z}),typeof window<"u"&&(window.__UPG_SEARCH__={size:()=>D.length,counts:()=>{const B={pg:0,zone:0,territory:0};for(const W of D)B[W.kind]=(B[W.kind]||0)+1;return B},query:B=>cf(D,B,{limit:df}).map(W=>({label:W.label,kind:W.kind,target:W.target})),select:B=>{const W=cf(D,B,{limit:df})[0];return W?(Tt(W.target),{label:W.label,kind:W.kind,target:W.target}):null},feedSize:()=>{const B=p&&p.sources&&p.sources[Lc];return B&&Array.isArray(B.features)&&B.features.length||0},localGeocoder:B=>{const W=z.value&&z.value.geocoder,he=W&&W.options&&W.options.localGeocoder;return he?he(B).map(Re=>Re&&Re.place_name):null}},n=window.__UPG_SEARCH__,(window.__UPG_SEARCHES__||(window.__UPG_SEARCHES__={}))[s()]=window.__UPG_SEARCH__)}function we(A){const B=A&&A.properties||{},W=B.__upgKind;if(W==="zone")Yt(B.__zoneId);else if(W==="territory")qt(B.__shapeName);else{const he=A&&A.geometry,Re=he&&Array.isArray(he.coordinates)?he.coordinates:null;Re&&Number.isFinite(Re[0])&&Number.isFinite(Re[1])&&E&&E.flyTo({center:[Re[0],Re[1]],zoom:6,duration:800}),_t(B.slug)}}function Te(A){if(!A||!E)return;const B=new Set(A.memberIds||[]);if(!B.size)return;let W=[];try{W=E.querySourceFeatures("upg").filter(rt=>{const Ce=rt.properties||{};return B.has(Ce.slug)||B.has(Ce.id)||B.has(Ce.peopleGroupId)})}catch{return}if(!W.length)return;let he=180,Re=90,Ye=-180,ht=-90,Ue=!1;for(const rt of W){const Ce=rt.geometry&&rt.geometry.coordinates;!Array.isArray(Ce)||!Number.isFinite(Ce[0])||!Number.isFinite(Ce[1])||(Ce[0]Ye&&(Ye=Ce[0]),Ce[1]ht&&(ht=Ce[1]),Ue=!0)}Ue&&E.fitBounds([[he,Re],[Ye,ht]],{padding:60,duration:800,maxZoom:6})}function Je(){fa(null),y&&typeof y.selectPeopleGroup=="function"&&y.selectPeopleGroup(null)}function Tt(A){!A||!E||(A.type==="pg"?(Number.isFinite(A.lng)&&Number.isFinite(A.lat)&&E.flyTo({center:[A.lng,A.lat],zoom:6,duration:800}),_t(A.slug)):A.type==="zone"?Yt(A.zoneId):A.type==="territory"&&qt(A.shapeName))}function _t(A){if(!A||!y||typeof y.selectPeopleGroup!="function")return;const W=MP(E,"upg").find(he=>he.properties&&he.properties.slug===A);W&&y.selectPeopleGroup(W)}function Yt(A){if(!A||!E||!ce)return;const B=xt(W=>W.properties&&W.properties.zoneKey===A);B&&E.fitBounds(B,{padding:40,duration:800,maxZoom:6})}function qt(A){if(!A||!E||!ce)return;const B=xt(W=>{const he=W.properties||{};return he.shapeName===A||he.iso3===A});B&&E.fitBounds(B,{padding:40,duration:800,maxZoom:6})}function xt(A){let B=180,W=90,he=-180,Re=-90,Ye=!1;const ht=Ue=>{if(typeof Ue[0]=="number"){const[rt,Ce]=Ue;rthe&&(he=rt),CeRe&&(Re=Ce),Ye=!0;return}for(const rt of Ue)ht(rt)};for(const Ue of ce.features)A(Ue)&&ht(Ue.geometry.coordinates);return Ye?[[B,W],[he,Re]]:null}function Lt(A){const B=new Set,W=he=>{he.children&&he.children.length?he.children.forEach(W):B.add(he.zoneKey??he.id)};return W(A),B}let io=null;function wo(A){if(![...Lt(A)].length)return;const W=[],he=Ue=>{Ue.children&&Ue.children.length?Ue.children.forEach(he):W.push(Ue)};he(A);const Re=k.value,Ye=new Set(Re.filter(Ue=>Ue.kind==="zone").map(Ue=>Ue.key));if(W.every(Ue=>Ye.has("zone:"+(Ue.zoneKey??Ue.id)))){const Ue=new Set(W.map(rt=>"zone:"+(rt.zoneKey??rt.id)));k.value=Re.filter(rt=>!Ue.has(rt.key))}else{const Ue=W.filter(rt=>!Ye.has("zone:"+(rt.zoneKey??rt.id))).map(rt=>({key:"zone:"+(rt.zoneKey??rt.id),name:rt.label||rt.id,count:Number(rt.count)||0,kind:"zone"}));k.value=[...Re,...Ue]}h(),C.value=""}function Tn(){const A=new Set;for(const B of k.value)B.kind==="zone"&&A.add(B.key.slice(5));return A}function En(){const A=new Map,B=W=>{const he=Lt(W);W.label&&A.set(W.label,he),W.children&&W.children.length&&W.children.forEach(B)};for(const W of _.value)B(W);return A}function H(){if(typeof document>"u")return;const A=document.querySelector("my-upg-100-list-map"),W=(A&&A.shadowRoot||document).querySelectorAll(".stl-row");if(!W.length)return;if(!J.value){W.forEach(ht=>ht.classList.remove("upg-batch-row"));return}const he=Tn(),Re=En(),Ye=g.value;W.forEach(ht=>{const Ue=ht.querySelector(".stl-name"),rt=Ue?Ue.textContent.trim():"",Ce=rt&&Re.get(rt),tt=!!(Ce&&Ce.size&&[...Ce].every(Pt=>he.has(Pt)));ht.classList.toggle("upg-batch-row",tt),ht.classList.toggle("dark",tt&&Ye)})}let oe=null;function Ee(){if(typeof document>"u"||oe)return;const A=document.querySelector("my-upg-100-list-map"),W=(A&&A.shadowRoot||document).querySelector(".stl-rows");W&&(oe=new MutationObserver(()=>{requestAnimationFrame(()=>H())}),oe.observe(W,{childList:!0,subtree:!0}))}Xt("onSemanticTreeSelect",fa),Xt("onLegendExport",De),Xt("legendExportCards",!0);async function De(A){const B=x.value;if(!B)return;const[W,he]=String(A).split(":");if(!Ze.value){Ze.value=!0,nt.value=W==="packet"?"packet":W==="cards"?"cards":"poster";try{if(W==="packet"){await Fe(B,he||"full");return}const Re=et().find(Ye=>Ye.id===B)||{id:B};if(W==="cards"){const Ye=et().find(ht=>ht.id===B);Ye&&await Y.printCardDeck(await Ge(Ye));return}await Y.printPoster(Re)}finally{Ze.value=!1,nt.value=""}}}const Y=Ag({t:(A,B,W)=>typeof W=="number"?ye(A,B,W):ye(A,B),records:A=>ve(A),lang:()=>Zt(),label:A=>(A==null?void 0:A.label)||(A==null?void 0:A.id)||"",assetsBase:()=>ua(a.value),iso3Names:()=>Xa,sheet:(A,B)=>me(A,B),sets:()=>fetch(`${ua(a.value)}/tables/near-neighbors.json`).then(A=>A.ok?A.json():null).catch(()=>null),downloadPrefix:"doxa-upg-100"});let ie="";st(Y.exportState,A=>{if(!A){ie&&$.value===ie&&($.value=""),ie="";return}if(A.phase==="error"){ie="",_e(ye("messages.packetFailed",{reason:A.message}),4e3);return}ie=A.phase==="done"?"":`${A.message}…`,$.value=ie});const ee=Ig({apiBase:()=>Ne,lang:()=>Zt(),profileConfig:a,evaluate:(A,B)=>Ca(A,B)});async function ve(A){if(!Ne)throw Qt("wall.hud.noApi","no people-groups service is configured");return ee(A.selector)}const me=Bg({allRecords:()=>ee.all(),assetsBase:()=>ua(a.value),profileConfig:a});function Oe(A,B,W){A.value=B,setTimeout(()=>{A.value===B&&(A.value="")},W)}const _e=(A,B)=>Oe($,A,B);async function Fe(A,B="full"){const W=et().find(Re=>Re.id===A);if(!W)return;const he=await Ge(W);await Y.printPacket(he,{variant:B,funnel:await gt()})}async function Ge(A){try{const[{zoneTitle:B},{countryName:W},he]=await Promise.all([ft(()=>Promise.resolve().then(()=>B1),void 0),ft(()=>Promise.resolve().then(()=>Fl),void 0),Ni(ua(a.value))]),Re={...he.en||{},...he[Zt()]||{}},Ye=B(A,Re,{countryName:W,locale:Zt()});return Ye?{...A,label:Ye}:A}catch{return A}}function Me(){return Al(vn(a))}function Ie(){const A=Me();return[...A.lists||[],...A.asia_lists||[],...A.uncovered_lists||[]]}function et(){const A=Ie(),B=new Set(A.map(W=>W.id));return[...A,...R1(Me(),{deafCount:pf}).filter(W=>!B.has(W.id))]}async function gt(){var A;try{const B=(await ft(async()=>{const{default:Ye}=await Promise.resolve().then(()=>Ef);return{default:Ye}},void 0)).default;if(!B||!Array.isArray(B.steps)||!B.steps.length)return null;const W=vn(a),he=Number(B.steps[B.steps.length-1].groups)||0;if(W===fr)return{...B,listCount:et().length,listTotal:he};let Re=0;try{const Ye=ua(a.value),ht=await fetch(`${Ye}/people-groups/lists/${W}.json`);if(ht.ok){const Ue=await ht.json();Re=Number((A=Ue==null?void 0:Ue.counts)==null?void 0:A.doxa)||(Array.isArray(Ue==null?void 0:Ue.slugs)?Ue.slugs.length:0)}}catch{}return{...B,listTotal:Re,listId:W,listLabel:(yg(W)||{}).label||W}}catch{return null}}const Ze=$e(!1),nt=$e("");function so(){const A=k.value.filter(W=>W.kind==="zone").map(W=>String(W.key).replace(/^zone:/,"")),B=new Map(et().map(W=>[W.id,W]));return A.map(W=>B.get(W)).filter(Boolean)}async function xo(){const A=await Ni(ua(a.value));return{...A.en||{},...A[Zt()]||{}}}function lo(A,B){return A?String(A).replace(/\{(\w+)\}/g,(W,he)=>B[he]!=null?String(B[he]):W):null}function qo(){return k.value.filter(A=>A.kind==="adm0").map(A=>String(A.key).replace(/^adm0:/,"")).filter(Boolean)}function co(){return k.value.filter(A=>A.kind==="adm1").map(A=>A.name||String(A.key).replace(/^adm1:/,""))}async function fo(){const A=so(),B=qo(),W=co();if(!A.length&&!B.length)throw W.length?Qt("upgMap.selectionAdm1NoData","no people-group data for {names} — select the country instead",{names:yl(W,{locale:Zt()})}):Qt("upgMap.nothingSelected","nothing is selected");if(!Ne)throw Qt("wall.hud.noApi","no people-groups service is configured");const Re=await fetch(`${Ne}/api/people-groups/list?fields=${Fg}&lang=${Zt()}`,{cache:"no-store"});if(!Re.ok)throw Qt("wall.hud.fetchFailed","could not load the people groups ({status})",{status:Re.status});const Ye=Sc(await Ei(Ac(await Re.json()),a)),{evaluate:ht}=await ft(async()=>{const{evaluate:Xe}=await Promise.resolve().then(()=>Dg);return{evaluate:Xe}},void 0),Ue=new Set;for(const Xe of A)if(Xe.selector&&Xe.selector.type==="pg_slugs")for(const So of Xe.selector.values||[])Ue.add(So);else for(const So of ht(Xe.selector,Ye))Ue.add(So);if(B.length)for(const Xe of ht({type:"country_codes",values:B},Ye))Ue.add(Xe);const rt=(await Promise.all(A.map(Ge))).map(Xe=>Xe.label||Xe.id),Ce=k.value.filter(Xe=>Xe.kind==="adm0").map(Xe=>Xe.name),tt=[...rt,...Ce],Pt=await xo(),uo=(Xe,So)=>lo(Pt.zone_join,{a:Xe,b:So})??`${Xe} + ${So}`;return{id:"selection",label:tt.length<=3?tt.reduce(uo):lo(Pt.zone_join_more,{a:tt.slice(0,2).reduce(uo),n:tt.length-2})??`${tt.slice(0,2).join(" + ")} +${tt.length-2} more`,count:Ue.size,selector:{type:"pg_slugs",values:[...Ue]}}}async function Nt(){if(!Ze.value){Ze.value=!0,nt.value="packet";try{const A=await fo(),B=so(),W=B.length===1?B[0].id:null,he=await gt();await Y.printPacket({...A,mapId:W},{funnel:he&&B.length===1?he:he?{...he,listCount:0}:null})}catch(A){_e(ye("messages.selectionPacketFailed",{reason:mr(A,ye).slice(0,90)}),4e3)}finally{Ze.value=!1,nt.value=""}}}async function Et(){if(!Ze.value){Ze.value=!0,nt.value="cards";try{await Y.printCardDeck(await fo())}catch(A){_e(ye("upgMap.selectionCardsFailed",{reason:mr(A,ye).slice(0,90)}),4e3)}finally{Ze.value=!1,nt.value=""}}}async function Ro(){if(!Ze.value){Ze.value=!0,nt.value="poster";try{const A=so();if(!A.length)throw qo().length||co().length?Qt("upgMap.selectionPosterNeedsZone","posters exist per territory on the legend — use Prayer list for a map selection"):Qt("upgMap.nothingSelected","nothing is selected");if(A.length>1){_e(ye("messages.posterOneTerritory",{count:A.length}),5e3);return}await Y.printPoster(A[0])}catch(A){_e(ye("messages.selectionPosterFailed",{reason:mr(A,ye).slice(0,90)}),4e3)}finally{Ze.value=!1,nt.value=""}}}function Zt(){const A=ke&&(ke.value??ke);return typeof A=="string"&&A||"en"}function fa(A){if(!E||!E.getLayer("tapestry-fill"))return!1;if(J.value)return A&&wo(A),!0;if(!A)return io=null,x.value=null,E.setFilter("tapestry-fill",null),E.setFilter("tapestry-line",null),E.setPaintProperty("upg-pins","circle-opacity",1),!0;io=A;const B=[...Lt(A)];x.value=B.length===1?B[0]:A.id??null;const W=["in",["get","zoneKey"],["literal",B]];E.setFilter("tapestry-fill",W),E.setFilter("tapestry-line",W),E.getLayer("upg-pins")&&E.setPaintProperty("upg-pins","circle-opacity",["case",["in",["get","zoneKey"],["literal",B]],.95,.05]);const he=xt(Re=>B.includes(Re.properties.zoneKey));return he&&E.fitBounds(he,{padding:40,duration:700,maxZoom:6}),!0}function Lr(){E&&(typeof Le=="function"&&Le(),ce&&(R(),V(),be(),h(),x.value&&E.getLayer("tapestry-fill")&&fa(io)))}function Ra(){E&&(g.value=!g.value,b.theme.value=g.value?"dark":"light",E.setStyle(g.value?xc("ink",l).style||"mapbox://styles/mapbox/dark-v11":xc("paper",l).style||"mapbox://styles/mapbox/light-v11"),E.once("style.load",Lr))}function Cr(){!E||!E.getLayer("upg-pins")||(E.on("click","upg-pins",A=>{const B=A&&A.features&&A.features[0];B&&y&&typeof y.selectPeopleGroup=="function"&&y.selectPeopleGroup(B)}),E.on("mouseenter","upg-pins",()=>{E&&(E.getCanvas().style.cursor="pointer")}),E.on("mouseleave","upg-pins",()=>{E&&(E.getCanvas().style.cursor="")}))}let Zo=null,Po,Fo=null;function Mn(A,B){var W,he,Re;try{const Ye=(Re=(he=(W=v.value)==null?void 0:W.getRootNode)==null?void 0:he.call(W))==null?void 0:Re.host;if(!Ye)return;Ye.setAttribute("data-doxa-select-zone-state",A),B&&Ye.setAttribute("data-doxa-select-zone-applied",String(B))}catch{}}function tn(A){if(!A)return fa(null),Po=void 0,Mn("cleared",""),!0;const B=Tr(_.value,A);return B?fa(B)?(Po=void 0,Mn("applied",A),!0):(Po=A,Mn("applied-but-no-selection",A),!1):(Po=A,Mn("unresolved",A),!1)}function Nn(A){var W;const B=((W=A==null?void 0:A.detail)==null?void 0:W.listId)??null;tn(B)}function Tr(A,B){for(const W of A||[]){if((W.zoneKey||W.id)===B)return W;const he=W.children&&Tr(W.children,B);if(he)return he}return null}function Oc(){const A=Me(),B=j(null);_.value=B,fe=_r(B);const W={};for(const he of A.lists||[])W[he.id]=he.selector;for(const he of A.asia_lists||[])W[he.id]=he.selector;for(const he of A.uncovered_lists||[])W[he.id]=he.selector;W.deaf=$r;for(const he of fe)he.selector=W[he.id];xe=ue(fe)}async function Rn(){if(Ne)try{const B=await fetch(`${Ne}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${Zt()}`,{cache:"no-store"});if(!B.ok)throw new Error(`list ${B.status}`);const W=Sc(await Ei(Ac(await B.json()),a));Z=sf(W),_.value=j(W)}catch{}}To(async()=>{var Re,Ye,ht,Ue,rt;Oc();try{await yP(l)}catch{}const A=Pc(l);A&&_P(A);const B=(o==null?void 0:o.value)||((Re=a==null?void 0:a.value)==null?void 0:Re.tk)||"";if(!A){console.warn(`[upg-100-list] ${l} engine global is missing — refusing to substitute another engine. A page that asked for the keyless engine must not silently receive the token-gated one.`),$.value=`⚠ ${ye("messages.engineNotLoaded")}`,f.value=ye("messages.engineNotLoadedDetail",{engine:c?"MapLibre":"Mapbox"}),Rn();return}if(!c){if(!B){$.value=`⚠ ${ye("messages.noMapboxToken")}`,f.value=ye("messages.noMapboxTokenDetail"),Rn();return}A.accessToken=B}try{const Ce=af(l);Ce&&await vP(v.value,Ce)}catch{}try{const Ce=!c&&v.value&&v.value.getRootNode();if(Ce instanceof ShadowRoot){const tt=af("mapbox");if(tt&&!Ce.querySelector(`link[href="${tt}"]`)){const Pt=document.createElement("link");Pt.rel="stylesheet",Pt.href=tt,Ce.prepend(Pt)}}}catch{}E=new A.Map({container:v.value,style:xc("paper",l).style||"mapbox://styles/mapbox/light-v11",center:[35,20],zoom:1.5,projection:"mercator"}),w.value=E,Se=mP(((Ye=v.value)==null?void 0:Ye.parentElement)||null,{enabled:d.value}),typeof window<"u"&&(window.__UPG_MAP__=E,r=E,(window.__UPG_MAPS__||(window.__UPG_MAPS__={}))[s()]=E),window.__UPG_SELECT__={get list(){return k.value.map(Ce=>({...Ce}))},get total(){return L.value},get count(){return S.value},get color(){return X.value},get batchMode(){return J.value},setColor:Ce=>ne(Ce),setBatchMode:Ce=>I(Ce),clipboardText:()=>AP(k.value,{color:X.value}),clear:()=>re(),toggleByProps:Ce=>{const tt=lf(Ce,{nameMap:Z});return tt?(le(tt),{...tt}):null},toggleLegendRow:Ce=>{const tt=uo=>{for(const pt of uo){if(pt.label===Ce||pt.id===Ce)return pt;if(pt.children&&pt.children.length){const Xe=tt(pt.children);if(Xe)return Xe}}return null},Pt=tt(_.value);return Pt?(wo(Pt),{label:Pt.label,zoneKeys:[...Lt(Pt)]}):null},markedLegendRows:()=>{if(typeof document>"u")return[];const Ce=document.querySelector("my-upg-100-list-map");return[...(Ce&&Ce.shadowRoot||document).querySelectorAll(".stl-row.upg-batch-row .stl-name")].map(Pt=>Pt.textContent.trim())},highlightFeatureCount:()=>{if(!E||!ce||!E.getLayer("upg-sel-fill"))return-1;const Ce=new Set,tt=new Set,Pt=new Set;for(const pt of k.value)pt.kind==="zone"?Ce.add(pt.key.slice(5)):pt.kind==="adm1"?tt.add(pt.name):pt.kind==="adm0"&&Pt.add(pt.key.slice(5));let uo=0;for(const pt of ce.features){const Xe=pt.properties||{};(Ce.has(Xe.zoneKey)||tt.has(Xe.shapeName)||Pt.has(Xe.iso3))&&uo++}return uo},zoneKeysForRow:Ce=>{const tt=uo=>{for(const pt of uo){if(pt.label===Ce||pt.id===Ce)return pt;if(pt.children&&pt.children.length){const Xe=tt(pt.children);if(Xe)return Xe}}return null},Pt=tt(_.value);return Pt?[...Lt(Pt)]:null}},i=window.__UPG_SELECT__,(window.__UPG_SELECTS__||(window.__UPG_SELECTS__={}))[s()]=window.__UPG_SELECT__;try{$.value=ye("messages.loadingBoundaries");const Ce=Qe=>`${ua(a.value)}/boundaries/${Qe}`,tt=Qe=>fetch(Ce(Qe)).then(Ut=>{if(!Ut.ok)throw new Error(`boundary fetch ${Ut.status} ${Qe}`);return Ut.json()});if(!Ne)throw new Error("No API base configured — set window.MAP_APP_API_URL or VITE_API_BASE_URL. Failing closed (no default host).");const uo=fetch(`${Ne}/api/people-groups/list?fields=slug,name,country_code,wagf_region,wagf_block,rop1,population,latitude,longitude&lang=${Zt()}`).then(Qe=>{if(!Qe.ok)throw new Error(`list ${Qe.status}`);return Qe.json()}),pt={adm0:tt("world-adm0-web.geojson"),adm1Chn:tt("gb-CHN-ADM1.geojson"),adm1Ind:tt("gb-IND-ADM1-web.geojson")};$.value=ye("messages.fetchingUupgs",{n:2106});const Xe=Sc(await Ei(Ac(await uo),a));Z=sf(Xe),_.value=j(Xe);const So=[],Jo={},{evaluate:Dc}=await ft(async()=>{const{evaluate:Qe}=await Promise.resolve().then(()=>Dg);return{evaluate:Qe}},void 0);for(const Qe of fe)if(Qe.selector&&Qe.selector.type==="pg_slugs")for(const Ut of Qe.selector.values||[])Ut in Jo||(Jo[Ut]=Qe.zoneKey);else try{for(const Ut of Dc(Qe.selector,Xe))Ut in Jo||(Jo[Ut]=Qe.zoneKey)}catch(Ut){console.warn("zone selector skipped",Qe.id,Ut&&Ut.message)}for(const Qe of Xe){const Ut=Number(Qe.latitude),Hc=Number(Qe.longitude);!isFinite(Ut)||!isFinite(Hc)||So.push({type:"Feature",geometry:{type:"Point",coordinates:[Hc,Ut]},properties:{slug:Qe.slug,zoneKey:Jo[Qe.slug]||"",name:Qe.name||Qe.slug||"",population:Qe.population??0,countryName:Qe.country_code_label||"",country:Qe.country_code||""}})}const zc=Oa({type:"FeatureCollection",features:So});Le=()=>{if(!(E.getSource("upg")&&E.getLayer("upg-pins"))){if(E.getSource("upg")||E.addSource("upg",{type:"geojson",data:zc}),E.getLayer("upg-pins")){Cr();return}E.addLayer({id:"upg-pins",type:"circle",source:"upg",paint:{"circle-radius":["interpolate",["linear"],["zoom"],1,5,4,6.5,8,9],"circle-color":xe,"circle-opacity":1,"circle-stroke-width":["interpolate",["linear"],["zoom"],1,1.8,8,2],"circle-stroke-color":"rgba(15,20,25,0.9)"}}),Cr()}};const Er=()=>{try{Lr()}catch(Qe){console.warn("early pin paint skipped",Qe&&Qe.message)}};E.isStyleLoaded()?Er():E.once("style.load",Er),$.value=ye("messages.loadingBoundaries");const[Gc,jc]=await Promise.all([pt.adm0,pt.adm1Chn]),fA=await pt.adm1Ind,{tapestry:mA,perZone:bA}=G1(fe,{records:Xe,adm0:Gc,adm1Ind:fA,adm1Chn:jc});ce=Oa(mA),K(Xe);let Bc=!0;const Fn=()=>{Bc&&(Bc=!1,E.off("style.load",Fn),E.off("idle",Fn),Lr())};if(E.isStyleLoaded())Fn();else{E.once("style.load",Fn),E.once("idle",Fn);const Qe=setInterval(()=>{if(!Bc||!E){clearInterval(Qe);return}let Ut=!1;try{Ut=E.isStyleLoaded()}catch{clearInterval(Qe);return}Ut&&(clearInterval(Qe),Fn())},120);setTimeout(()=>clearInterval(Qe),15e3)}const Df=[...bA.entries()].filter(([Qe])=>Qe!=="deaf"),$A=Df.filter(([,Qe])=>Qe>=1).length;$.value=ye("messages.mapStatusCounts",{polys:ce.features.length,zones:$A,total:Df.length,pins:So.length})}catch(Ce){console.warn("[upg-100-list] map data failed:",Ce),$.value="⚠ "+ye("upgMap.mapDataFailed")}let W=0;const he=()=>{const Ce=typeof document<"u"&&document.querySelector("my-upg-100-list-map"),tt=Ce&&Ce.shadowRoot||(typeof document<"u"?document:null);if(tt&&tt.querySelector(".stl-rows")){Ee(),H();return}W++<40&&setTimeout(he,250)};he();{const Ce=(rt=(Ue=(ht=v.value)==null?void 0:ht.getRootNode)==null?void 0:Ue.call(ht))==null?void 0:rt.host;if(Ce){Zo=Nn,Ce.addEventListener("doxa:select-zone",Zo);const tt=Ce.getAttribute("select-zone");tt&&tn(tt),Fo=new MutationObserver(()=>{tn(Ce.getAttribute("select-zone")||null)}),Fo.observe(Ce,{attributes:!0,attributeFilter:["select-zone"]})}}});const as=()=>{var A,B,W;try{return((W=(B=(A=v.value)==null?void 0:A.getRootNode)==null?void 0:B.call(A))==null?void 0:W.host)||null}catch{return null}};return st([_,w],()=>{po(()=>{var B;const A=((B=as())==null?void 0:B.getAttribute("select-zone"))||Po||null;A&&tn(A)})}),go(()=>{var A,B,W;if(Fo==null||Fo.disconnect(),Fo=null,Zo){const he=(W=(B=(A=v.value)==null?void 0:A.getRootNode)==null?void 0:B.call(A))==null?void 0:W.host;he==null||he.removeEventListener("doxa:select-zone",Zo),Zo=null}if(oe){try{oe.disconnect()}catch{}oe=null}if(Se){try{Se()}catch{}Se=null}if(E&&(E.remove(),E=null),ce=null,typeof window<"u"){const he=s();try{window.__UPG_SEARCHES__&&delete window.__UPG_SEARCHES__[he],window.__UPG_MAPS__&&delete window.__UPG_MAPS__[he],window.__UPG_SELECTS__&&delete window.__UPG_SELECTS__[he],window.__UPG_SEARCH__===n&&delete window.__UPG_SEARCH__,window.__UPG_MAP__===r&&delete window.__UPG_MAP__,window.__UPG_SELECT__===i&&delete window.__UPG_SELECT__}catch{}}}),(A,B)=>{var W;return q(),se("div",NP,[N("div",{ref_key:"mapEl",ref:v,class:"upg-map"},null,512),f.value?(q(),se("div",RP,[N("strong",null,pe(de(ye)("messages.mapUnavailable")),1),Rt(pe(f.value),1)])):Pe("",!0),d.value?(q(),se(Ke,{key:1},[B[0]||(B[0]=N("div",{class:"map-scroll-edge map-scroll-edge--left"},null,-1)),B[1]||(B[1]=N("div",{class:"map-scroll-edge map-scroll-edge--right"},null,-1))],64)):Pe("",!0),w.value&&u.value?(q(),mt(uP,{key:2,ref_key:"geocoderRef",ref:z,"map-instance":w.value,"access-token":de(o)||((W=de(a))==null?void 0:W.tk)||"","data-source-id":Lc,"is-dark":g.value,placeholder:ge.value,"active-context":qP,onPeopleGroupResult:we,onAggregateResult:Te,onClear:Je},null,8,["map-instance","access-token","is-dark","placeholder"])):Pe("",!0),w.value?(q(),mt(Ox,{key:3,"has-geocoder":u.value},{default:_o(()=>[dt(zx,{map:w.value,"is-dark":g.value},null,8,["map","is-dark"]),dt(Gx,{map:w.value,"is-dark":g.value},null,8,["map","is-dark"]),dt(jx,{map:w.value,"is-dark":g.value},null,8,["map","is-dark"]),dt(Ux,{"map-container":v.value,"is-dark":g.value},null,8,["map-container","is-dark"]),dt(Kx,{"is-dark":g.value,onToggle:Ra},null,8,["is-dark"]),dt(Ja,{"is-dark":g.value,active:J.value,class:je({"upg-batch-on":J.value}),"aria-pressed":J.value?"true":"false",title:ae.value,onClick:P},{default:_o(()=>[...B[2]||(B[2]=[N("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[N("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),N("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),N("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),N("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})],-1)])]),_:1},8,["is-dark","active","class","aria-pressed","title"])]),_:1},8,["has-geocoder"])):Pe("",!0),N("div",FP,[_.value.length?(q(),mt(Qg,{key:0,nodes:_.value,tabs:U.value,"default-tab":uf,columns:["count","pop"],title:F.value,"export-enabled":!0,"export-cards":!0,onSelect:fa,onExport:De},null,8,["nodes","tabs","title"])):Pe("",!0)]),N("div",IP,[_.value.length?(q(),mt(Ix,{key:0,"legend-type":"upg-100",nodes:_.value,tabs:U.value,"default-tab":uf,columns:["count","pop"],"column-label":"UPG 100",title:F.value,"is-dark":g.value,"popup-action":"pray"},null,8,["nodes","tabs","title","is-dark"])):Pe("",!0)]),N("div",OP,[de(y)&&de(y).selectedPeopleGroup?(q(),se("div",{key:0,class:je(["upg-detail-panel pg-detail-root",{dark:g.value}])},[dt(de(t),{peopleGroup:de(y).selectedPeopleGroup,dark:g.value,action:"pray"},null,8,["peopleGroup","dark"])],2)):Pe("",!0)]),J.value?(q(),se("div",DP,[N("div",zP,pe(de(ye)("messages.tapTerritoriesHint")),1),S.value?(q(),se("div",GP,[N("span",null,pe(de(ye)("messages.territoriesSelected",{count:S.value}))+" ·",1),N("span",jP,pe(L.value)+" UUPG",1),N("span",{class:je(["upg-hud-band",{ok:L.value>=50&&L.value<=100}])},pe(L.value>=50&&L.value<=100?de(ye)("messages.bandInRange"):de(ye)("messages.bandOutOfRange")),3)])):Pe("",!0),S.value?(q(),se("div",BP,pe(de(yl)(k.value.map(he=>he.name),{locale:Zt()})),1)):Pe("",!0),S.value?(q(),se("div",HP,[N("button",{class:je(["upg-hud-btn make",{"is-busy":nt.value==="packet"}]),disabled:Ze.value,onClick:Nt},pe(nt.value==="packet"?de(ye)("buttons.working"):de(ye)("buttons.prayerList")),11,UP),N("button",{class:je(["upg-hud-btn make",{"is-busy":nt.value==="poster"}]),disabled:Ze.value,onClick:Ro},pe(nt.value==="poster"?de(ye)("buttons.working"):de(ye)("buttons.posterMap")),11,WP),N("button",{class:je(["upg-hud-btn make",{"is-busy":nt.value==="cards"}]),disabled:Ze.value,onClick:Et},pe(nt.value==="cards"?de(ye)("buttons.working"):de(ye)("buttons.cardDeck")),11,KP),N("button",{class:"upg-hud-btn clear",onClick:re},pe(de(ye)("buttons.clearSelection")),1)])):Pe("",!0),S.value?(q(),se("div",VP,pe(C.value),1)):Pe("",!0)])):Pe("",!0),N("div",YP,pe($.value),1)])}}}},Symbol.toStringTag,{value:"Module"})),JP=` .pane-col{ position:absolute; inset:0; overflow-y:auto; overflow-x:hidden; scroll-snap-type:y mandatory; scroll-behavior:smooth; diff --git a/public/dx-maps/my-upg-100-list/poster-wall/index.html b/public/dx-maps/my-upg-100-list/poster-wall/index.html index 63479f208..2c8587d1e 100644 --- a/public/dx-maps/my-upg-100-list/poster-wall/index.html +++ b/public/dx-maps/my-upg-100-list/poster-wall/index.html @@ -61,7 +61,7 @@ - + - + - +