From d0939c049219a14fe0ec0546b6fea0d093f829fd Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 06:31:27 +0000 Subject: [PATCH] library: one embedScript for the app shells, replacing four private copies DEDUP-AUDIT.md (measured today: 253 files, 31 cross-plugin duplicate clusters, 622 duplicated lines) ranks this tenth by raw cost and first by suitability. It is the only cluster where the copies are identical in code, close over nothing, and sit in two plugins with one owner between them. loadScriptOnce (13 lines) and whenTagDefined (11) were byte-identical between doxa-maps-spa and plugin-studio. deriveTreeBase (9) differed by ONE COMMENT LINE and not one character of code -- drift in the documentation of a shared function, which is its own argument for having one copy. They are one concern, not three: load a bundle's script once, wait for its custom element to register, and work out the tree base to load it from. That is what a capability-5 app shell does to nest another plugin, and both plugins here ARE the capability-5 shells. Any future shell needs the same three. Verbatim move: no parameterisation, no behaviour change, callers import instead of declaring. The comments travel with the code because each records a measurement -- particularly the one explaining why onload is not a usable success signal for a dev-server ES module. ONE BEHAVIOUR CHANGE, AND IT IS AN IMPROVEMENT: the _loaded cache is now shared. Two shells on one page previously kept separate caches and each loaded the same bundle; the second now reuses the first's promise. deriveTreeBase reads document.currentScript, so it is only valid AT MODULE EVALUATION TIME. The call sites did not move -- both entries still call it at module top level -- and the library file documents the constraint, because a later call silently returns '' and every nested bundle URL would break. Verified: both bundles build; each built file contains all three functions exactly once and still derives currentScript; check:sri, check:series-isolation, check:studio-rail and check:capability-derived all PASS. library/utils/embedScript.js is the build owner's under rule 5B. The plugin-designs and public/ changes are in the same commit because they import it -- landing them apart breaks the build in between. --- library/utils/embedScript.js | 82 +++++++++++++++++++ .../doxa-maps-spa/doxa-maps-spa.vue | 48 +---------- plugin-designs/doxa-maps-spa/index.js | 10 +-- plugin-designs/plugin-studio/index.js | 9 +- .../plugin-studio/plugin-studio.vue | 41 +--------- public/dx-maps/doxa-maps-spa/doxa-maps-spa.js | 2 +- .../doxa-maps-spa/app/index.html | 2 +- .../doxa-maps-spa/doxa-maps-spa/index.html | 2 +- public/dx-maps/doxa-maps-spa/manifest.json | 10 +-- public/dx-maps/index.html | 2 +- public/dx-maps/manifest.json | 10 +-- public/dx-maps/plugin-studio/plugin-studio.js | 6 +- .../plugin-studio/plugin-studio/index.html | 2 +- .../plugin-studio/studio/index.html | 2 +- 14 files changed, 105 insertions(+), 123 deletions(-) create mode 100644 library/utils/embedScript.js diff --git a/library/utils/embedScript.js b/library/utils/embedScript.js new file mode 100644 index 000000000..06c05a8ea --- /dev/null +++ b/library/utils/embedScript.js @@ -0,0 +1,82 @@ +/** + * embedScript — load another bundle's script and wait for its element to register. + * + * ★ WHAT AN APP SHELL DOES. A capability-5 plugin nests other plugins, so it needs three things: + * work out the tree root it was served from, load a bundle's `.js` exactly once, and wait for the + * custom element to actually exist before mounting it. Both shells in this repo — the Research + * Gallery (`doxa-maps-spa`) and the Plugin Studio (`plugin-studio`) — had their own copy of all + * three, identical in code (DEDUP-AUDIT.md, 2026-09-28: 33 lines, the only cross-plugin cluster + * that is identical, closes over nothing, and spans one owner's plugins). + * + * Moved verbatim; the comments below are the originals, because each records a measurement. + * + * ★ ONE BEHAVIOUR CHANGE, AND IT IS AN IMPROVEMENT: `_loaded` is now shared. Two shells on one page + * previously kept separate caches and would each load the same bundle. Now the second one reuses + * the first's promise. Same result, one network request instead of two. + */ + +/** + * Load a bundle exactly once per URL; resolves after its script has executed. + * + * ★ A CLASSIC SCRIPT FIRES onload AND THEN FAILS, for a dev-server bundle. Measured 2026-09-22: + * pointing a plain - + - + \n\n" + "script": "\n\n" }, "instances": [ { @@ -956,7 +956,7 @@ "bundle": "plugin-studio", "scriptUrl": "./plugin-studio/plugin-studio.js", "output": "dx-maps/plugin-studio/plugin-studio.js", - "integrity": "sha384-NsG6VNbCUAcOh9jEf5+8DeaKFm7xRySJO8yIUiE0O0AQ3FhuILru4eBHgaXCPQUD", + "integrity": "sha384-hounA2cKrxqGX3ltwUElfV5XW1XSg3lOoSVUTSeOrWw1zTLzyyeR1ywb4fQ/zTsu", "elements": [ "plugin-studio" ], @@ -987,7 +987,7 @@ "scriptUrl": "./plugin-studio/plugin-studio.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" }, "instances": [ { diff --git a/public/dx-maps/index.html b/public/dx-maps/index.html index ef5b416f5..145d191b6 100644 --- a/public/dx-maps/index.html +++ b/public/dx-maps/index.html @@ -19,6 +19,6 @@ - + diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json index 7258a6514..cd024f9c3 100644 --- a/public/dx-maps/manifest.json +++ b/public/dx-maps/manifest.json @@ -213,7 +213,7 @@ "label": "Country Posters — Wall + Map", "file": "country-posters-mfe.vue", "description": "Country Posters as ONE two-tab element — the countries map and the printable", - "element": "country-posters-map", + "element": "country-posters-mfe", "type": "nested-elements-mfe", "isMap": true, "iframeUrl": "./country-posters/country-posters-mfe/index.html", @@ -321,7 +321,7 @@ "bundle": "doxa-maps-spa", "scriptUrl": "./doxa-maps-spa/doxa-maps-spa.js", "output": "dx-maps/doxa-maps-spa/doxa-maps-spa.js", - "integrity": "sha384-CKJT8BCWZubQKLenstpsz19Kd87akZiO1SGu5+Ma3byRUdyXz0gcjrtmmkQxzw7i", + "integrity": "sha384-v2Dwy2XYwI0BWeBSSU+eMjQwfQOoPazHYADsRmth6eQ3xjpSiHh0GEyQgvwLIGx7", "elements": [ "doxa-maps-spa" ], @@ -349,7 +349,7 @@ "scriptUrl": "./doxa-maps-spa/doxa-maps-spa.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" }, "instances": [ { @@ -956,7 +956,7 @@ "bundle": "plugin-studio", "scriptUrl": "./plugin-studio/plugin-studio.js", "output": "dx-maps/plugin-studio/plugin-studio.js", - "integrity": "sha384-NsG6VNbCUAcOh9jEf5+8DeaKFm7xRySJO8yIUiE0O0AQ3FhuILru4eBHgaXCPQUD", + "integrity": "sha384-hounA2cKrxqGX3ltwUElfV5XW1XSg3lOoSVUTSeOrWw1zTLzyyeR1ywb4fQ/zTsu", "elements": [ "plugin-studio" ], @@ -987,7 +987,7 @@ "scriptUrl": "./plugin-studio/plugin-studio.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" }, "instances": [ { diff --git a/public/dx-maps/plugin-studio/plugin-studio.js b/public/dx-maps/plugin-studio/plugin-studio.js index 9fe9da2b3..9b1269c26 100644 --- a/public/dx-maps/plugin-studio/plugin-studio.js +++ b/public/dx-maps/plugin-studio/plugin-studio.js @@ -143,7 +143,7 @@ .vtl.rail-collapsed:dir(rtl) .vtl-tab { padding-left:12px; padding-right:10px; } .vtl.rail-collapsed:dir(rtl) .vtl-tier { padding-left:8px; padding-right:8px; } } -`,ec=bo({name:"VerticalTabsLayout",props:{active:{type:String,default:""},title:{type:String,default:""},items:{type:Array,default:()=>[]},groups:{type:Array,default:()=>[]},navLabel:{type:String,default:"Sections"},labels:{type:Object,default:()=>({})},initialNavOpen:{type:Boolean,default:!0},header:{type:Boolean,default:!0},initialRailCollapsed:{type:Boolean,default:!1}},emits:["update:active"],setup(){return Tn(Qr,"vertical-tabs-layout"),{T:Jr}},data(){return{navOpen:this.initialNavOpen,railCollapsed:this.initialRailCollapsed,_tabEls:{},folderOverride:{},narrow:!1,_mql:null,_onMedia:null,activatedKeys:{},hostState:{},hostError:{},_hostSlots:{},_hostMounted:{}}},computed:{railShown(){return this.narrow?this.navOpen:!0},allRows(){if(this.groups&&this.groups.length){const e=[];for(const t of this.groups)for(const o of t.rows||[])e.push(o);return e}return this.items},orderedKeys(){return this.allRows.map(e=>e.key)},elementRows(){return this.allRows.filter(e=>e&&e.element)},mountedElementRows(){return this.elementRows.filter(e=>this.activatedKeys[e.key])}},watch:{active:{immediate:!0,handler(e){this.activateElement(e)}}},mounted(){try{window.matchMedia&&(this._mql=window.matchMedia("(max-width: 760px)"),this.narrow=this._mql.matches,this.reconcileForWidth(),this._onMedia=e=>{this.narrow=e.matches,this.reconcileForWidth()},this._mql.addEventListener?this._mql.addEventListener("change",this._onMedia):this._mql.addListener&&this._mql.addListener(this._onMedia))}catch{}this.$nextTick(()=>this.activateElement(this.active))},beforeUnmount(){try{this._mql&&this._onMedia&&(this._mql.removeEventListener?this._mql.removeEventListener("change",this._onMedia):this._mql.removeListener&&this._mql.removeListener(this._onMedia))}catch{}this._mql=null,this._onMedia=null},methods:{registerTab(e,t){t&&(this._tabEls[e]=t)},isNarrow(){return this.narrow},reconcileForWidth(){this.narrow?(this.navOpen=!1,this.railCollapsed=!1):this.navOpen=!0},label(e){const t={toggleList:"Toggle list",openViews:"Open the list of views",expandList:"Expand list",collapseList:"Collapse list",collapse:"Collapse"};return this.labels&&this.labels[e]||t[e]},expandRail(){!this.narrow&&this.railCollapsed&&(this.railCollapsed=!1)},toggleRail(){this.narrow?this.navOpen=!this.navOpen:this.railCollapsed=!this.railCollapsed},setHostSlot(e,t){t&&(this._hostSlots[e]=t,this.$nextTick(()=>this.mountHostElement(e)))},activateElement(e){!e||!this.elementRows.find(o=>o.key===e)||(this.activatedKeys[e]||(this.activatedKeys={...this.activatedKeys,[e]:!0},this.hostState={...this.hostState,[e]:"loading"}),this.$nextTick(()=>this.mountHostElement(e)))},mountHostElement(e){if(this._hostMounted[e])return;const t=this.elementRows.find(n=>n.key===e),o=this._hostSlots[e];!t||!o||(this._hostMounted[e]=!0,this.hostState={...this.hostState,[e]:"loading"},Xr(t.src).then(()=>Zr(t.element)).then(()=>{o.innerHTML="";const n=document.createElement(t.element),s=t.attrs||{};for(const i in s){const l=s[i],a=l!=null&&typeof l=="object"?JSON.stringify(l):String(l);try{n[i]=l}catch{}try{n.setAttribute(i,a)}catch{}}n.style.cssText="display:block;position:absolute;inset:0;width:100%;height:100%;",o.appendChild(n),this.hostState={...this.hostState,[e]:"ready"}}).catch(n=>{this._hostMounted[e]=!1,this.hostState={...this.hostState,[e]:"error"},this.hostError={...this.hostError,[e]:n&&n.message||String(n)}}))},iconSvg(e){return e?Di(e):""},initial(e){const t=(e||"").trim();return t?t.charAt(0).toUpperCase():"•"},isFolderClosed(e){const t=this.folderOverride[e.key];return t!=null?!t:e.open!==!0},toggleFolder(e){const t=this.folderOverride[e],o=(this.groups||[]).find(s=>s.key===e),n=t??(o&&o.open===!0);this.folderOverride={...this.folderOverride,[e]:!n}},pick(e){this.$emit("update:active",e),this.narrow&&(this.navOpen=!1)},onKey(e){const t=this.orderedKeys;if(!t.length)return;const o=t.indexOf(this.active);let n=-1;if(e.key==="ArrowDown"||e.key==="ArrowRight")n=(o+1)%t.length;else if(e.key==="ArrowUp"||e.key==="ArrowLeft")n=(o-1+t.length)%t.length;else if(e.key==="Home")n=0;else if(e.key==="End")n=t.length-1;else return;e.preventDefault();const s=t[n];this.pick(s),this.$nextTick(()=>{const i=this._tabEls[s];i&&i.focus&&i.focus()})}}}),tc={key:0,class:"vtl-top"},oc=["aria-expanded","aria-label"],nc={class:"vtl-brand"},sc={class:"vtl-title"},ic={class:"vtl-meta"},lc=["aria-expanded","aria-label"],ac={class:"vtl-body"},rc=["aria-label","aria-hidden","role","aria-orientation"],cc=["aria-expanded","aria-label"],pc=["innerHTML"],dc={class:"vtl-collapse-tx"},uc=["aria-expanded","onClick"],fc={key:0,class:"vtl-cap"},gc={class:"vtl-tl"},hc={key:1,class:"vtl-td"},$c=["innerHTML"],bc={key:1,class:"vtl-tier"},mc={key:0,class:"vtl-cap"},_c={class:"vtl-tl"},vc={key:1,class:"vtl-td"},xc={class:"vtl-rows"},kc=["aria-selected","tabindex","onClick"],yc=["innerHTML"],wc={key:1,class:"vtl-tab-emoji","aria-hidden":"true"},Sc={key:2,class:"vtl-tab-fallback","aria-hidden":"true"},Lc={class:"vtl-tab-text"},Nc={class:"vtl-tab-label"},Pc={key:0,class:"vtl-tab-badge"},Cc={key:0,class:"vtl-tab-sub"},Ec=["innerHTML"],Mc=["aria-selected","tabindex","onClick"],Tc=["innerHTML"],Ac={key:1,class:"vtl-tab-emoji","aria-hidden":"true"},Oc={key:2,class:"vtl-tab-fallback","aria-hidden":"true"},Fc={class:"vtl-tab-text"},Ic={class:"vtl-tab-label"},Hc={key:0,class:"vtl-tab-sub"},Dc={class:"vtl-main"},Uc={class:"vtl-content"},Rc=["hidden"],Wc={key:0,class:"vtl-host-hint"},jc={key:1,class:"vtl-host-hint err"};function zc(e,t,o,n,s,i){return L(),N("div",{class:ge(["vtl",{"nav-open":e.navOpen,"rail-collapsed":e.railCollapsed,"no-header":!e.header}])},[e.header?(L(),N("header",tc,[_("button",{class:"vtl-menu",type:"button","aria-expanded":String(e.navOpen),onClick:t[0]||(t[0]=l=>e.navOpen=!e.navOpen),"aria-label":e.label("toggleList")},"☰",8,oc),_("span",nc,[Tt(e.$slots,"brand")]),_("b",sc,P(e.title),1),_("span",ic,[Tt(e.$slots,"meta")])])):Y("",!0),e.narrow&&!e.header&&!e.navOpen?(L(),N("button",{key:1,class:"vtl-fab",type:"button","aria-expanded":String(e.navOpen),onClick:t[1]||(t[1]=l=>e.navOpen=!0),"aria-label":e.label("openViews")},"☰",8,lc)):Y("",!0),_("div",ac,[_("nav",{class:"vtl-nav","aria-label":e.navLabel,"aria-hidden":String(!e.railShown),role:e.$slots.rail?null:"tablist","aria-orientation":e.$slots.rail?null:"vertical"},[_("button",{type:"button",class:"vtl-collapse","aria-expanded":String(!e.railCollapsed),"aria-label":e.railCollapsed?e.label("expandList"):e.label("collapseList"),onClick:t[2]||(t[2]=(...l)=>e.toggleRail&&e.toggleRail(...l))},[_("span",{class:"vtl-collapse-ic","aria-hidden":"true",innerHTML:e.iconSvg("chevron")},null,8,pc),_("span",dc,P(e.label("collapse")),1)],8,cc),e.$slots.rail?Tt(e.$slots,"rail",{collapsed:e.railCollapsed&&!e.narrow,expand:e.expandRail,pick:e.pick},void 0,void 0,0):e.groups&&e.groups.length?(L(!0),N(G,{key:1},Pe(e.groups,l=>(L(),N("div",{class:"vtl-grp",key:l.key},[l.folder?(L(),N("button",{key:0,type:"button",class:"vtl-tier vtl-tier-btn","aria-expanded":String(!e.isFolderClosed(l)),onClick:a=>e.toggleFolder(l.key)},[l.badge?(L(),N("span",fc,P(l.badge),1)):Y("",!0),_("span",gc,P(l.label),1),l.count!=null?(L(),N("span",hc,P(l.count),1)):Y("",!0),_("span",{class:ge(["vtl-chev",{open:!e.isFolderClosed(l)}]),"aria-hidden":"true",innerHTML:e.iconSvg("chevron")},null,10,$c)],8,uc)):(L(),N("div",bc,[l.badge?(L(),N("span",mc,P(l.badge),1)):Y("",!0),_("span",_c,P(l.label),1),l.count!=null?(L(),N("span",vc,P(l.count),1)):Y("",!0)])),ft(_("div",xc,[(L(!0),N(G,null,Pe(l.rows,a=>(L(),N("button",{key:a.key,type:"button",role:"tab",class:ge(["vtl-tab",{active:a.key===e.active}]),"aria-selected":String(a.key===e.active),tabindex:a.key===e.active?0:-1,ref_for:!0,ref:r=>e.registerTab(a.key,r),onClick:r=>e.pick(a.key),onKeydown:t[3]||(t[3]=r=>e.onKey(r))},[a.icon?(L(),N("span",{key:0,class:"vtl-tab-ic","aria-hidden":"true",innerHTML:e.iconSvg(a.icon)},null,8,yc)):a.emoji?(L(),N("span",wc,P(a.emoji),1)):(L(),N("span",Sc,P(e.initial(a.label)),1)),_("span",Lc,[_("span",Nc,[Ke(P(a.label),1),a.badge?(L(),N("span",Pc,P(a.badge),1)):Y("",!0)]),a.sub?(L(),N("span",Cc,[_("span",{innerHTML:a.sub},null,8,Ec)])):Y("",!0)])],42,kc))),128))],512),[[Ln,!l.folder||!e.isFolderClosed(l)]])]))),128)):(L(!0),N(G,{key:2},Pe(e.items,l=>(L(),N("button",{key:l.key,type:"button",role:"tab",class:ge(["vtl-tab",{active:l.key===e.active}]),"aria-selected":String(l.key===e.active),tabindex:l.key===e.active?0:-1,ref_for:!0,ref:a=>e.registerTab(l.key,a),onClick:a=>e.pick(l.key),onKeydown:t[4]||(t[4]=a=>e.onKey(a))},[l.icon?(L(),N("span",{key:0,class:"vtl-tab-ic","aria-hidden":"true",innerHTML:e.iconSvg(l.icon)},null,8,Tc)):l.emoji?(L(),N("span",Ac,P(l.emoji),1)):(L(),N("span",Oc,P(e.initial(l.label)),1)),_("span",Fc,[_("span",Ic,P(l.label),1),l.sub?(L(),N("span",Hc,P(l.sub),1)):Y("",!0)])],42,Mc))),128))],8,rc),_("main",Dc,[e.header?Tt(e.$slots,"toolbar",{},void 0,void 0,0):Y("",!0),_("div",Uc,[(L(!0),N(G,null,Pe(e.mountedElementRows,l=>ft((L(),N("section",{key:l.key,class:"vtl-host",hidden:l.key!==e.active},[_("div",{class:"vtl-host-slot",ref_for:!0,ref:a=>e.setHostSlot(l.key,a)},null,512),e.hostState[l.key]==="loading"?(L(),N("div",Wc,P(e.T("messages.loadingNamed","Loading {name}…").replace("{name}",l.label)),1)):e.hostState[l.key]==="error"?(L(),N("div",jc,[Ke(P(e.T("messages.couldNotLoadNamed","Could not load {name}.").replace("{name}",l.label)),1),t[5]||(t[5]=_("br",null,null,-1)),_("small",null,P(e.hostError[l.key]),1)])):Y("",!0)],8,Rc)),[[Ln,l.key===e.active]])),128)),Tt(e.$slots,"default")])])])],2)}const Bc=An(ec,[["render",zc],["styles",[Yr]]]),Kc='.st{display:flex;flex-direction:column;margin:0 -12px}.st-bar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:6px;padding:8px 12px;background:#fff}.st-find{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:6px;height:30px;padding:0 8px;border:1px solid #d1d4cd;border-radius:8px;background:#f3f3f1;color:#6d766e}.st-find:focus-within{border-color:#92b195;background:#fff}.st-find-ic{display:inline-flex}.st-find-ic svg{width:14px;height:14px}.st-find-in{flex:1 1 auto;min-width:0;border:0;outline:0;background:none;font:inherit;font-size:13px;color:#3b463d}.st-tool{flex:0 0 auto;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:none;color:#6d766e;cursor:pointer}.st-tool:hover{background:#f3f3f1;color:#3b463d}.st-tool:focus-visible{outline:2px solid #92b195;outline-offset:-2px}.st-tool svg{width:16px;height:16px}.st-tree{display:flex;flex-direction:column;padding:0 0 8px;outline:0}.st-row{position:relative;display:flex;align-items:center;gap:6px;height:28px;box-sizing:border-box;padding-block:0;padding-inline:calc(8px + var(--st-depth) * 14px) 10px;font-size:13px;color:#3b463d;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;outline:0}.st-row:hover{background:#f3f3f1}.st-row:focus-visible{box-shadow:inset 0 0 0 1px #92b195}.st-row.active{background:#92b1953d}.st-row.active:after{content:"";position:absolute;inset-inline-start:0;top:4px;bottom:4px;width:3px;border-start-end-radius:3px;border-end-end-radius:3px;background:#92b195}.st-row.alias.active{background:#92b1951f}.st-sec{position:sticky;top:46px;z-index:2;height:30px;margin-top:6px;background:#fff;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#6d766e;border-top:1px solid #eceee9}.st-sec:first-child{margin-top:0;border-top:0}.st-sec:hover{background:#fff;color:#3b463d}.st-cap{flex:0 0 auto;font:700 10px/1 system-ui,sans-serif;letter-spacing:.3px;padding:3px 6px;border-radius:999px;background:#92b195;color:#1d2a1f}.st-sec-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.st-twisty,.st-twisty-sp{flex:0 0 16px;width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:#6d766e}.st-twisty svg{width:14px;height:14px;transition:transform .12s ease}.st-row[aria-expanded=true]>.st-twisty svg{transform:rotate(90deg)}.st:dir(rtl) .st-twisty svg{transform:scaleX(-1)}.st:dir(rtl) .st-row[aria-expanded=true]>.st-twisty svg{transform:rotate(90deg)}.st-ic{flex:0 0 16px;display:inline-flex;color:#6d766e}.st-ic svg{width:16px;height:16px}.st-row.active .st-ic{color:#5f8a63}.st-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.st-desc{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;font:11px/1 ui-monospace,Menlo,monospace;color:#8a928b}.st-part{flex:0 0 auto;font:600 9px/1 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.3px;padding:2px 4px;border:1px solid #92b195;border-radius:4px;color:#5f8a63}.st-count{flex:0 0 auto;margin-inline-start:auto;min-width:18px;text-align:right;font-size:11px;font-weight:500;letter-spacing:0;color:#6d766e}.st-guide{position:absolute;top:0;bottom:0;inset-inline-start:calc(15px + var(--st-g) * 14px);border-inline-start:1px solid #dfe2db;pointer-events:none}.st-row:hover>.st-guide{border-inline-start-color:#c4c8c0}.st-empty{margin:12px;font-size:13px;color:#6d766e}.st-activity{display:flex;flex-direction:column;gap:4px}.st-act{position:relative;display:flex;align-items:center;justify-content:center;width:48px;height:44px;margin-inline-start:172px;padding:0;border:0;border-radius:10px;background:none;color:#6d766e;cursor:pointer}.st-act:hover,.st-act.active{background:#f3f3f1;color:#3b463d}.st-act:focus-visible{outline:2px solid #92b195;outline-offset:-2px}.st-act-ic{display:inline-flex}.st-act-ic svg{width:20px;height:20px}.st-act-n{position:absolute;right:6px;bottom:5px;font:700 9px/1 system-ui,sans-serif;color:#5f8a63}',Vc='.st { display:flex; flex-direction:column; margin:0 -12px; }.st-bar { position:sticky; top:0; z-index:3; display:flex; align-items:center; gap:6px; padding:8px 12px 8px; background:#ffffff; }.st-find { flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:6px; height:30px; padding:0 8px; border:1px solid #d1d4cd; border-radius:8px; background:#f3f3f1; color:#6d766e; }.st-find:focus-within { border-color:#92b195; background:#ffffff; }.st-find-ic { display:inline-flex; } .st-find-ic svg { width:14px; height:14px; }.st-find-in { flex:1 1 auto; min-width:0; border:0; outline:0; background:none; font:inherit; font-size:13px; color:#3b463d; }.st-tool { flex:0 0 auto; width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center; padding:0; border:0; border-radius:8px; background:none; color:#6d766e; cursor:pointer; }.st-tool:hover { background:#f3f3f1; color:#3b463d; } .st-tool:focus-visible { outline:2px solid #92b195; outline-offset:-2px; }.st-tool svg { width:16px; height:16px; }.st-tree { display:flex; flex-direction:column; padding:0 0 8px; outline:0; }.st-row { position:relative; display:flex; align-items:center; gap:6px; height:28px; box-sizing:border-box; padding-block:0; padding-inline:calc(8px + var(--st-depth) * 14px) 10px; font-size:13px; color:#3b463d; cursor:pointer; white-space:nowrap; user-select:none; outline:0; }.st-row:hover { background:#f3f3f1; }.st-row:focus-visible { box-shadow:inset 0 0 0 1px #92b195; }.st-row.active { background:rgba(146,177,149,.24); }.st-row.active::after { content:""; position:absolute; inset-inline-start:0; top:4px; bottom:4px; width:3px; border-start-end-radius:3px; border-end-end-radius:3px; background:#92b195; }.st-row.alias.active { background:rgba(146,177,149,.12); }.st-sec { position:sticky; top:46px; z-index:2; height:30px; margin-top:6px; background:#ffffff; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:#6d766e; border-top:1px solid #eceee9; }.st-sec:first-child { margin-top:0; border-top:0; }.st-sec:hover { background:#ffffff; color:#3b463d; }.st-cap { flex:0 0 auto; font:700 10px/1 system-ui,sans-serif; letter-spacing:.3px; padding:3px 6px; border-radius:999px; background:#92b195; color:#1d2a1f; }.st-sec-label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }.st-twisty, .st-twisty-sp { flex:0 0 16px; width:16px; height:16px; display:inline-flex; align-items:center; justify-content:center; color:#6d766e; }.st-twisty svg { width:14px; height:14px; transition:transform .12s ease; }.st-row[aria-expanded="true"] > .st-twisty svg { transform:rotate(90deg); }.st:dir(rtl) .st-twisty svg { transform:scaleX(-1); } .st:dir(rtl) .st-row[aria-expanded="true"] > .st-twisty svg { transform:rotate(90deg); }.st-ic { flex:0 0 16px; display:inline-flex; color:#6d766e; } .st-ic svg { width:16px; height:16px; }.st-row.active .st-ic { color:#5f8a63; }.st-label { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }.st-desc { flex:1 1 0; min-width:0; overflow:hidden; text-overflow:ellipsis; font:11px/1 ui-monospace,Menlo,monospace; color:#8a928b; }.st-part { flex:0 0 auto; font:600 9px/1 system-ui,sans-serif; text-transform:uppercase; letter-spacing:.3px; padding:2px 4px; border:1px solid #92b195; border-radius:4px; color:#5f8a63; }.st-count { flex:0 0 auto; margin-inline-start:auto; min-width:18px; text-align:right; font-size:11px; font-weight:500; letter-spacing:0; color:#6d766e; }.st-guide { position:absolute; top:0; bottom:0; inset-inline-start:calc(15px + var(--st-g) * 14px); border-inline-start:1px solid #dfe2db; pointer-events:none; }.st-row:hover > .st-guide { border-inline-start-color:#c4c8c0; }.st-empty { margin:12px; font-size:13px; color:#6d766e; }.st-activity { display:flex; flex-direction:column; gap:4px; }.st-act { position:relative; display:flex; align-items:center; justify-content:center; width:48px; height:44px; margin-inline-start:172px; padding:0; border:0; border-radius:10px; background:none; color:#6d766e; cursor:pointer; }.st-act:hover, .st-act.active { background:#f3f3f1; color:#3b463d; }.st-act:focus-visible { outline:2px solid #92b195; outline-offset:-2px; }.st-act-ic { display:inline-flex; } .st-act-ic svg { width:20px; height:20px; }.st-act-n { position:absolute; right:6px; bottom:5px; font:700 9px/1 system-ui,sans-serif; color:#5f8a63; }',qc='',Gc={filterPlaceholder:"Filter plugins",collapseAll:"Collapse all",noMatch:"No plugin matches “{query}”.",treeLabel:"Plugins by capability",openSection:"Open {cap}, {label}",part:"part"},Yc='',On=e=>e.canonical!==void 0?!!e.canonical:e.depth===0,Jc=e=>e.canonical!==void 0?!e.canonical&&!e.folder:e.depth>0,Xc=bo({name:"StudioTree",props:{sections:{type:Array,default:()=>[]},active:{type:String,default:""},collapsed:{type:Boolean,default:!1},pick:{type:Function,default:null},expand:{type:Function,default:null},strings:{type:Object,default:()=>({})}},emits:["select"],setup(){Tn(Vc,"studio-tree")},data(){const e=this.readState();return{query:"",focusId:"",secClosed:e.sec||{},nodeOpen:e.node||{},chev:Yc,collapseAllSvg:qc}},computed:{byId(){const e=new Map;for(const t of this.sections)for(const o of t.nodes)e.set(o.id,o);return e},q(){return this.query.trim().toLowerCase()},kept(){if(!this.q)return null;const e=new Set;for(const t of this.sections)for(const o of t.nodes){if(!(o.label.toLowerCase().includes(this.q)||String(o.desc||"").toLowerCase().includes(this.q)))continue;e.add(o.id);let s=o.parent;for(;s;)e.add(s),s=this.byId.get(s)&&this.byId.get(s).parent}return e},visible(){const e=[];for(const t of this.sections){const o=this.kept?t.nodes.filter(n=>this.kept.has(n.id)):t.nodes;if(!(this.kept&&!o.length)&&(e.push({id:"sec:"+t.id,section:!0,sectionId:t.id,level:1,depth:0,expandable:!0,cap:t.cap,badge:t.badge||"CAP "+t.cap,label:t.label,title:t.title||"",count:t.nodes.filter(n=>n.depth===0).length}),!(!this.kept&&this.secClosed[t.id])))for(const n of o)!this.kept&&!this.ancestorsOpen(n)||e.push({...n,sectionId:t.id,level:n.depth+2,expandable:!!n.kids,alias:Jc(n)})}return e},activeSectionId(){for(const e of this.sections)if(e.nodes.some(t=>On(t)&&t.target===this.active))return e.id;return""}},watch:{active:{handler(){this.reveal()},immediate:!0},sections(){this.reveal()},query(e){e&&this.visible.length&&(this.focusId=this.visible[0].id)}},methods:{svg(e){return e?Di(e):""},str(e,t){let o=this.strings[e]||Gc[e]||e;if(t)for(const n in t)o=o.split("{"+n+"}").join(String(t[n]));return o},storageKey(){return"dx-studio-tree:"+(typeof location<"u"&&location.pathname||"")},readState(){try{return JSON.parse(window.localStorage.getItem(this.storageKey())||"{}")||{}}catch{return{}}},saveState(){try{window.localStorage.setItem(this.storageKey(),JSON.stringify({sec:this.secClosed,node:this.nodeOpen}))}catch{}},ancestorsOpen(e){let t=e.parent;for(;t;){if(!this.nodeOpen[t])return!1;t=this.byId.get(t)&&this.byId.get(t).parent}return!0},isOpen(e){return this.kept?!0:e.section?!this.secClosed[e.sectionId]:!!this.nodeOpen[e.id]},setOpen(e,t){e.section?this.secClosed={...this.secClosed,[e.sectionId]:!t}:this.nodeOpen={...this.nodeOpen,[e.id]:t},this.saveState()},toggle(e){e.expandable&&this.setOpen(e,!this.isOpen(e))},collapseAll(){this.nodeOpen={},this.saveState();const e=this.visible.find(t=>!t.section&&t.target===this.active&&On(t));e&&(this.focusId=e.id)},rowClass(e){return{"st-row":!0,"st-sec":!!e.section,active:!e.section&&e.target===this.active,alias:!!e.alias}},setRow(e,t){this._rows||(this._rows={}),t?this._rows[e]=t:delete this._rows[e]},activate(e){if(e.section){this.toggle(e);return}e.target&&(this.pick?this.pick(e.target):this.$emit("select",e.target))},onRowClick(e){this.focusId=e.id,this.activate(e)},focusRow(e){e&&(this.focusId=e,this.$nextTick(()=>{const t=this._rows&&this._rows[e];t&&(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"}))}))},onTreeKey(e){const t=this.visible;if(!t.length)return;const o=Math.max(0,t.findIndex(i=>i.id===this.focusId)),n=t[o],s=i=>i.section?"":i.parent||"sec:"+i.sectionId;switch(e.key){case"ArrowDown":this.focusRow((t[o+1]||n).id);break;case"ArrowUp":this.focusRow((t[o-1]||n).id);break;case"Home":this.focusRow(t[0].id);break;case"End":this.focusRow(t[t.length-1].id);break;case"ArrowRight":if(!n.expandable)break;this.isOpen(n)?t[o+1]&&t[o+1].level>n.level&&this.focusRow(t[o+1].id):this.setOpen(n,!0);break;case"ArrowLeft":n.expandable&&this.isOpen(n)&&!this.kept?this.setOpen(n,!1):this.focusRow(s(n));break;case"Enter":case" ":this.activate(n);break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){const i=e.key.toLowerCase(),a=t.slice(o+1).concat(t.slice(0,o+1)).find(r=>String(r.label).toLowerCase().startsWith(i));a&&this.focusRow(a.id);break}return}e.preventDefault()},onFindKey(e){e.key==="Escape"?(this.query="",e.preventDefault()):e.key==="ArrowDown"&&this.visible.length&&(this.focusRow(this.visible[0].id),e.preventDefault())},reveal(){if(!this.active||!this.sections.length)return;let e=null;for(const t of this.sections)if(e=t.nodes.find(o=>On(o)&&o.target===this.active),e){this.secClosed[t.id]&&(this.secClosed={...this.secClosed,[t.id]:!1},this.saveState());break}if(e)for(let t=e.parent;t;){const o=this.byId.get(t);if(!o)break;if(o.target===this.active&&!this.nodeOpen[t]){e=o;break}t=o.parent}if(e){let t=e.parent,o=!1;for(;t;)this.nodeOpen[t]||(this.nodeOpen={...this.nodeOpen,[t]:!0},o=!0),t=this.byId.get(t)&&this.byId.get(t).parent;o&&this.saveState()}e&&((!this.focusId||!this.byId.has(this.focusId)||this.byId.get(this.focusId).target!==this.active)&&(this.focusId=e.id),this.$nextTick(()=>{const t=this._rows&&this._rows[e.id];t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest"})}))},openSectionFromActivity(e){this.secClosed[e]&&(this.secClosed={...this.secClosed,[e]:!1},this.saveState()),this.expand&&this.expand(),this.$nextTick(()=>this.focusRow("sec:"+e))}}}),Zc={key:0,class:"st-activity"},Qc=["aria-label","onClick"],ep=["innerHTML"],tp={class:"st-act-n","aria-hidden":"true"},op={key:1,class:"st"},np={class:"st-bar"},sp={class:"st-find"},ip=["innerHTML"],lp=["placeholder","aria-label"],ap=["aria-label","title"],rp=["innerHTML"],cp=["aria-label"],pp=["aria-level","aria-expanded","aria-selected","tabindex","title","onClick","onFocus"],dp=["innerHTML"],up={class:"st-cap"},fp={class:"st-sec-label"},gp={class:"st-count"},hp=["innerHTML","onClick"],$p={key:1,class:"st-twisty-sp","aria-hidden":"true"},bp=["innerHTML"],mp={class:"st-label"},_p={key:2,class:"st-part"},vp={class:"st-desc"},xp={key:3,class:"st-count"},kp={key:0,class:"st-empty"};function yp(e,t,o,n,s,i){return e.collapsed?(L(),N("div",Zc,[(L(!0),N(G,null,Pe(e.sections,l=>(L(),N("button",{key:l.id,type:"button",class:ge(["st-act",{active:l.id===e.activeSectionId}]),"aria-label":e.str("openSection",{cap:l.badge||"CAP "+l.cap,label:l.label}),onClick:a=>e.openSectionFromActivity(l.id)},[_("span",{class:"st-act-ic","aria-hidden":"true",innerHTML:e.svg(l.icon)},null,8,ep),_("span",tp,P(l.short||l.cap),1)],10,Qc))),128))])):(L(),N("div",op,[_("div",np,[_("label",sp,[_("span",{class:"st-find-ic","aria-hidden":"true",innerHTML:e.svg("search")},null,8,ip),ft(_("input",{ref:"find",type:"search",class:"st-find-in","onUpdate:modelValue":t[0]||(t[0]=l=>e.query=l),placeholder:e.str("filterPlaceholder"),"aria-label":e.str("filterPlaceholder"),onKeydown:t[1]||(t[1]=(...l)=>e.onFindKey&&e.onFindKey(...l))},null,40,lp),[[Mn,e.query]])]),_("button",{type:"button",class:"st-tool","aria-label":e.str("collapseAll"),title:e.str("collapseAll"),onClick:t[2]||(t[2]=(...l)=>e.collapseAll&&e.collapseAll(...l))},[_("span",{"aria-hidden":"true",innerHTML:e.collapseAllSvg},null,8,rp)],8,ap)]),_("div",{class:"st-tree",role:"tree","aria-label":e.str("treeLabel"),onKeydown:t[3]||(t[3]=(...l)=>e.onTreeKey&&e.onTreeKey(...l))},[(L(!0),N(G,null,Pe(e.visible,l=>(L(),N("div",{key:l.id,ref_for:!0,ref:a=>e.setRow(l.id,a),role:"treeitem","aria-level":l.level,"aria-expanded":l.expandable?String(e.isOpen(l)):null,"aria-selected":l.section?null:String(l.target===e.active),tabindex:l.id===e.focusId?0:-1,class:ge(e.rowClass(l)),style:kt({"--st-depth":l.depth}),title:l.title||null,onClick:a=>e.onRowClick(l),onFocus:a=>e.focusId=l.id},[l.section?(L(),N(G,{key:0},[_("span",{class:"st-twisty","aria-hidden":"true",innerHTML:e.chev},null,8,dp),_("span",up,P(l.badge),1),_("span",fp,P(l.label),1),_("span",gp,P(l.count),1)],64)):(L(),N(G,{key:1},[(L(!0),N(G,null,Pe(l.depth,a=>(L(),N("span",{key:a,class:"st-guide",style:kt({"--st-g":a-1}),"aria-hidden":"true"},null,4))),128)),l.expandable?(L(),N("span",{key:0,class:"st-twisty","aria-hidden":"true",innerHTML:e.chev,onClick:Ti(a=>e.toggle(l),["stop"])},null,8,hp)):(L(),N("span",$p)),_("span",{class:"st-ic","aria-hidden":"true",innerHTML:e.svg(l.icon)},null,8,bp),_("span",mp,P(l.label),1),l.part?(L(),N("span",_p,P(e.str("part")),1)):Y("",!0),_("span",vp,P(l.desc),1),l.expandable?(L(),N("span",xp,P(l.kids),1)):Y("",!0)],64))],46,pp))),128)),e.query&&!e.visible.length?(L(),N("p",kp,P(e.str("noMatch",{query:e.query})),1)):Y("",!0)],40,cp)]))}const wp=An(Xc,[["render",yp],["styles",[Kc]]]),To=[{code:"en",name:"English",nativeName:"English",flag:"🇺🇸"},{code:"es",name:"Spanish",nativeName:"Español",flag:"🇪🇸"},{code:"fr",name:"French",nativeName:"Français",flag:"🇫🇷"},{code:"pt",name:"Portuguese",nativeName:"Português",flag:"🇵🇹"},{code:"ar",name:"Arabic",nativeName:"العربية",flag:"🇸🇦",dir:"rtl"},{code:"ru",name:"Russian",nativeName:"Русский",flag:"🇷🇺"},{code:"de",name:"German",nativeName:"Deutsch",flag:"🇩🇪",hideFromSwitcher:!0},{code:"hi",name:"Hindi",nativeName:"हिन्दी",flag:"🇮🇳",hideFromSwitcher:!0},{code:"it",name:"Italian",nativeName:"Italiano",flag:"🇮🇹",hideFromSwitcher:!0},{code:"ro",name:"Romanian",nativeName:"Română",flag:"🇷🇴",hideFromSwitcher:!0},{code:"zh",name:"Chinese",nativeName:"中文",flag:"🇨🇳",hideFromSwitcher:!0}];To.filter(e=>!e.hideFromSwitcher);function Sp(e){return To.find(t=>t.code===e)}function Fn(e){const t=String(e||"").split("-")[0].toLowerCase();return To.some(o=>o.code===t)?t:"en"}const Ui="doxa-maps:locale";function Lp(){try{const e=localStorage.getItem(Ui);if(e)return Fn(e)}catch{}return Fn(navigator==null?void 0:navigator.language)}function Np(e){try{localStorage.setItem(Ui,e)}catch{}}const Ao="__doxaMapToken",Ri="doxa:map-token",Wi="__doxaMapTokenBridge",Bt=()=>{if(typeof window>"u")return"";const e=window[Ao];return typeof e=="string"?e:""};function ji(e){if(typeof window>"u")return"";zi();const t=typeof e=="string"?e.trim():"";if(!t||t===Bt())return Bt();window[Ao]=t;try{window.dispatchEvent(new CustomEvent(Ri,{detail:t}))}catch{}return t}function Pp(){var t;if(typeof window>"u")return;const e=Bt()||typeof window.MAP_TOKEN=="string"&&window.MAP_TOKEN;if(zi(),window[Ao]="",!((t=Object.getOwnPropertyDescriptor(window,"MAP_TOKEN"))!=null&&t.get))try{window.MAP_TOKEN=""}catch{}if(e)try{window.dispatchEvent(new CustomEvent(Ri,{detail:""}))}catch{}}function zi(){var t;if(typeof window>"u"||window[Wi]&&((t=Object.getOwnPropertyDescriptor(window,"MAP_TOKEN"))!=null&&t.get))return;const e=typeof window.MAP_TOKEN=="string"?window.MAP_TOKEN:"";e&&!Bt()&&(window[Ao]=e);try{Object.defineProperty(window,"MAP_TOKEN",{configurable:!0,get(){return Bt()},set(o){ji(o)}}),window[Wi]=!0}catch{}}const Cp=":host{display:block;position:relative;height:var(--plugin-studio-height, 85vh);min-height:480px}:host([hidden]){display:none}.ps-logo{display:inline-flex;align-items:center}.ps-logo svg{display:block}.ps-count{color:#6d766e}.vtl-top{position:relative;z-index:3}.vtl-body{isolation:isolate}.ps-token{position:relative;display:inline-flex}.ps-show-header{position:fixed;top:8px;inset-inline-end:8px;z-index:2147483000;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid #d1d4cd;border-radius:999px;background:#fffffff0;color:#3b463d;font:600 12px system-ui,sans-serif;cursor:pointer;box-shadow:0 4px 14px #0000002e}.ps-show-header:hover,.ps-show-header:focus-visible{background:#fff;outline:2px solid #92b195}.ps-token-dot{width:8px;height:8px;border-radius:50%;background:#b8bdb4}.ps-token-dot.is-yours,.ps-token-dot.is-url{background:#92b195}.ps-token-dot.is-built{background:#c9b36a}.ps-token-dot.is-none{background:#d27a6a}.ps-token-panel{position:absolute;top:100%;inset-inline-end:0;margin-top:4px;z-index:30;width:min(340px,90vw);display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid #d1d4cd;border-radius:10px;background:#fff;box-shadow:0 12px 32px #00000040;color:#3b463d;font-size:12px}.ps-token-label{display:flex;flex-direction:column;gap:4px}.ps-token-input{font:inherit;font-size:12px;padding:6px 8px;border:1px solid #d1d4cd;border-radius:7px;background:#f8f8f6;color:#3b463d;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ps-token-row{display:flex;gap:8px}.ps-token-apply,.ps-token-clear{font:inherit;font-size:12px;padding:5px 12px;border-radius:7px;border:1px solid #d1d4cd;background:#d1d4cd;color:#3b463d;cursor:pointer}.ps-token-apply{background:#92b195;border-color:#92b195;color:#fff}.ps-token-apply:disabled{opacity:.6;cursor:progress}.ps-token-status{margin:0}.ps-token-head{margin:0;font-weight:600;font-size:12px}.ps-token-status.err{color:#b3412f}.ps-token-note{margin:0;color:#6d766e}.ps-locale{position:relative;display:inline-flex}.ps-locale-btn{display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:12px;padding:4px 9px;border:1px solid #d1d4cd;border-radius:8px;background:#d1d4cd;color:#3b463d;cursor:pointer}.ps-locale-btn:hover{background:#d1d4cd}.ps-flag{font-size:13px;line-height:1}.ps-locale-name{max-width:11ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ps-token-btn .ps-locale-name{max-width:none}.ps-dots{color:#6d766e}.ps-locale-menu{position:absolute;top:100%;right:0;margin-top:4px;z-index:30;min-width:180px;list-style:none;padding:6px;border:1px solid #d1d4cd;border-radius:10px;background:#fff;box-shadow:0 12px 32px #00000080;max-height:320px;overflow:auto}.ps-locale-opt{display:flex;align-items:center;gap:8px;width:100%;text-align:left;font:inherit;font-size:13px;padding:7px 9px;border:0;border-radius:7px;background:none;color:#3b463d;cursor:pointer}.ps-locale-opt:hover,.ps-locale-opt.active{background:#d1d4cd;color:#3b463d}.ps-locale-opt.active .ps-locale-name{color:#92b195}.ps-locale-en{margin-left:auto;font-size:11px;color:#6d766e}.ps-toolbar{display:flex;flex-direction:column;gap:8px;padding:10px 12px 0}.ps-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ps-bar-t{flex:1 1 auto;min-width:0}.ps-bar-t b{font-size:15px;color:#3b463d}.ps-bar-sub{display:block;font-size:12px;color:#6d766e}.ps-btn{font:inherit;font-size:12px;padding:5px 10px;border:1px solid #d1d4cd;border-radius:8px;background:#d1d4cd;color:#3b463d;cursor:pointer;white-space:nowrap}.ps-btn:hover{background:#d1d4cd}.ps-embed{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid #d1d4cd;border-radius:8px;background:#f3f3f1}.ps-embed label{font-size:12px;color:#6d766e;display:flex;justify-content:space-between;align-items:center}.ps-embed textarea{width:100%;height:58px;font:11px/1.35 ui-monospace,Menlo,monospace;border:1px solid #d1d4cd;border-radius:6px;background:#fff;color:#3b463d;padding:6px;resize:vertical}.ps-stage{position:absolute;top:10px;right:12px;bottom:12px;left:12px;border:1px solid #d1d4cd;border-radius:10px;overflow:hidden;background:#f3f3f1}.ps-pane{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;--profile-min-h: 0}.ps-slot{position:relative;min-height:100%}.ps-slot>*{min-height:0;max-height:none}.ps-hint{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;text-align:center;color:#6d766e;font-size:13px;padding:20px}.ps-hint.err{color:#f87171}.ps-hint small{color:#6d766e}",Oo="plugin-studio:mapbox-token",Fo="plugin-studio:mapbox-token-url",Bi="plugin-studio:header-hidden",Ki="plugin-studio:map-provider";function mt(e){try{return typeof window<"u"&&window.localStorage.getItem(e)||""}catch{return""}}function _t(e,t){try{t?window.localStorage.setItem(e,t):window.localStorage.removeItem(e)}catch{}}const Ep=` +`,ec=bo({name:"VerticalTabsLayout",props:{active:{type:String,default:""},title:{type:String,default:""},items:{type:Array,default:()=>[]},groups:{type:Array,default:()=>[]},navLabel:{type:String,default:"Sections"},labels:{type:Object,default:()=>({})},initialNavOpen:{type:Boolean,default:!0},header:{type:Boolean,default:!0},initialRailCollapsed:{type:Boolean,default:!1}},emits:["update:active"],setup(){return Tn(Qr,"vertical-tabs-layout"),{T:Jr}},data(){return{navOpen:this.initialNavOpen,railCollapsed:this.initialRailCollapsed,_tabEls:{},folderOverride:{},narrow:!1,_mql:null,_onMedia:null,activatedKeys:{},hostState:{},hostError:{},_hostSlots:{},_hostMounted:{}}},computed:{railShown(){return this.narrow?this.navOpen:!0},allRows(){if(this.groups&&this.groups.length){const e=[];for(const t of this.groups)for(const o of t.rows||[])e.push(o);return e}return this.items},orderedKeys(){return this.allRows.map(e=>e.key)},elementRows(){return this.allRows.filter(e=>e&&e.element)},mountedElementRows(){return this.elementRows.filter(e=>this.activatedKeys[e.key])}},watch:{active:{immediate:!0,handler(e){this.activateElement(e)}}},mounted(){try{window.matchMedia&&(this._mql=window.matchMedia("(max-width: 760px)"),this.narrow=this._mql.matches,this.reconcileForWidth(),this._onMedia=e=>{this.narrow=e.matches,this.reconcileForWidth()},this._mql.addEventListener?this._mql.addEventListener("change",this._onMedia):this._mql.addListener&&this._mql.addListener(this._onMedia))}catch{}this.$nextTick(()=>this.activateElement(this.active))},beforeUnmount(){try{this._mql&&this._onMedia&&(this._mql.removeEventListener?this._mql.removeEventListener("change",this._onMedia):this._mql.removeListener&&this._mql.removeListener(this._onMedia))}catch{}this._mql=null,this._onMedia=null},methods:{registerTab(e,t){t&&(this._tabEls[e]=t)},isNarrow(){return this.narrow},reconcileForWidth(){this.narrow?(this.navOpen=!1,this.railCollapsed=!1):this.navOpen=!0},label(e){const t={toggleList:"Toggle list",openViews:"Open the list of views",expandList:"Expand list",collapseList:"Collapse list",collapse:"Collapse"};return this.labels&&this.labels[e]||t[e]},expandRail(){!this.narrow&&this.railCollapsed&&(this.railCollapsed=!1)},toggleRail(){this.narrow?this.navOpen=!this.navOpen:this.railCollapsed=!this.railCollapsed},setHostSlot(e,t){t&&(this._hostSlots[e]=t,this.$nextTick(()=>this.mountHostElement(e)))},activateElement(e){!e||!this.elementRows.find(o=>o.key===e)||(this.activatedKeys[e]||(this.activatedKeys={...this.activatedKeys,[e]:!0},this.hostState={...this.hostState,[e]:"loading"}),this.$nextTick(()=>this.mountHostElement(e)))},mountHostElement(e){if(this._hostMounted[e])return;const t=this.elementRows.find(n=>n.key===e),o=this._hostSlots[e];!t||!o||(this._hostMounted[e]=!0,this.hostState={...this.hostState,[e]:"loading"},Xr(t.src).then(()=>Zr(t.element)).then(()=>{o.innerHTML="";const n=document.createElement(t.element),s=t.attrs||{};for(const i in s){const l=s[i],a=l!=null&&typeof l=="object"?JSON.stringify(l):String(l);try{n[i]=l}catch{}try{n.setAttribute(i,a)}catch{}}n.style.cssText="display:block;position:absolute;inset:0;width:100%;height:100%;",o.appendChild(n),this.hostState={...this.hostState,[e]:"ready"}}).catch(n=>{this._hostMounted[e]=!1,this.hostState={...this.hostState,[e]:"error"},this.hostError={...this.hostError,[e]:n&&n.message||String(n)}}))},iconSvg(e){return e?Di(e):""},initial(e){const t=(e||"").trim();return t?t.charAt(0).toUpperCase():"•"},isFolderClosed(e){const t=this.folderOverride[e.key];return t!=null?!t:e.open!==!0},toggleFolder(e){const t=this.folderOverride[e],o=(this.groups||[]).find(s=>s.key===e),n=t??(o&&o.open===!0);this.folderOverride={...this.folderOverride,[e]:!n}},pick(e){this.$emit("update:active",e),this.narrow&&(this.navOpen=!1)},onKey(e){const t=this.orderedKeys;if(!t.length)return;const o=t.indexOf(this.active);let n=-1;if(e.key==="ArrowDown"||e.key==="ArrowRight")n=(o+1)%t.length;else if(e.key==="ArrowUp"||e.key==="ArrowLeft")n=(o-1+t.length)%t.length;else if(e.key==="Home")n=0;else if(e.key==="End")n=t.length-1;else return;e.preventDefault();const s=t[n];this.pick(s),this.$nextTick(()=>{const i=this._tabEls[s];i&&i.focus&&i.focus()})}}}),tc={key:0,class:"vtl-top"},oc=["aria-expanded","aria-label"],nc={class:"vtl-brand"},sc={class:"vtl-title"},ic={class:"vtl-meta"},lc=["aria-expanded","aria-label"],ac={class:"vtl-body"},rc=["aria-label","aria-hidden","role","aria-orientation"],cc=["aria-expanded","aria-label"],pc=["innerHTML"],dc={class:"vtl-collapse-tx"},uc=["aria-expanded","onClick"],fc={key:0,class:"vtl-cap"},gc={class:"vtl-tl"},hc={key:1,class:"vtl-td"},$c=["innerHTML"],bc={key:1,class:"vtl-tier"},mc={key:0,class:"vtl-cap"},_c={class:"vtl-tl"},vc={key:1,class:"vtl-td"},xc={class:"vtl-rows"},kc=["aria-selected","tabindex","onClick"],yc=["innerHTML"],wc={key:1,class:"vtl-tab-emoji","aria-hidden":"true"},Sc={key:2,class:"vtl-tab-fallback","aria-hidden":"true"},Lc={class:"vtl-tab-text"},Nc={class:"vtl-tab-label"},Pc={key:0,class:"vtl-tab-badge"},Cc={key:0,class:"vtl-tab-sub"},Ec=["innerHTML"],Mc=["aria-selected","tabindex","onClick"],Tc=["innerHTML"],Ac={key:1,class:"vtl-tab-emoji","aria-hidden":"true"},Oc={key:2,class:"vtl-tab-fallback","aria-hidden":"true"},Fc={class:"vtl-tab-text"},Ic={class:"vtl-tab-label"},Hc={key:0,class:"vtl-tab-sub"},Dc={class:"vtl-main"},Uc={class:"vtl-content"},Rc=["hidden"],Wc={key:0,class:"vtl-host-hint"},jc={key:1,class:"vtl-host-hint err"};function zc(e,t,o,n,s,i){return L(),N("div",{class:ge(["vtl",{"nav-open":e.navOpen,"rail-collapsed":e.railCollapsed,"no-header":!e.header}])},[e.header?(L(),N("header",tc,[_("button",{class:"vtl-menu",type:"button","aria-expanded":String(e.navOpen),onClick:t[0]||(t[0]=l=>e.navOpen=!e.navOpen),"aria-label":e.label("toggleList")},"☰",8,oc),_("span",nc,[Tt(e.$slots,"brand")]),_("b",sc,P(e.title),1),_("span",ic,[Tt(e.$slots,"meta")])])):Y("",!0),e.narrow&&!e.header&&!e.navOpen?(L(),N("button",{key:1,class:"vtl-fab",type:"button","aria-expanded":String(e.navOpen),onClick:t[1]||(t[1]=l=>e.navOpen=!0),"aria-label":e.label("openViews")},"☰",8,lc)):Y("",!0),_("div",ac,[_("nav",{class:"vtl-nav","aria-label":e.navLabel,"aria-hidden":String(!e.railShown),role:e.$slots.rail?null:"tablist","aria-orientation":e.$slots.rail?null:"vertical"},[_("button",{type:"button",class:"vtl-collapse","aria-expanded":String(!e.railCollapsed),"aria-label":e.railCollapsed?e.label("expandList"):e.label("collapseList"),onClick:t[2]||(t[2]=(...l)=>e.toggleRail&&e.toggleRail(...l))},[_("span",{class:"vtl-collapse-ic","aria-hidden":"true",innerHTML:e.iconSvg("chevron")},null,8,pc),_("span",dc,P(e.label("collapse")),1)],8,cc),e.$slots.rail?Tt(e.$slots,"rail",{collapsed:e.railCollapsed&&!e.narrow,expand:e.expandRail,pick:e.pick},void 0,void 0,0):e.groups&&e.groups.length?(L(!0),N(G,{key:1},Pe(e.groups,l=>(L(),N("div",{class:"vtl-grp",key:l.key},[l.folder?(L(),N("button",{key:0,type:"button",class:"vtl-tier vtl-tier-btn","aria-expanded":String(!e.isFolderClosed(l)),onClick:a=>e.toggleFolder(l.key)},[l.badge?(L(),N("span",fc,P(l.badge),1)):Y("",!0),_("span",gc,P(l.label),1),l.count!=null?(L(),N("span",hc,P(l.count),1)):Y("",!0),_("span",{class:ge(["vtl-chev",{open:!e.isFolderClosed(l)}]),"aria-hidden":"true",innerHTML:e.iconSvg("chevron")},null,10,$c)],8,uc)):(L(),N("div",bc,[l.badge?(L(),N("span",mc,P(l.badge),1)):Y("",!0),_("span",_c,P(l.label),1),l.count!=null?(L(),N("span",vc,P(l.count),1)):Y("",!0)])),ft(_("div",xc,[(L(!0),N(G,null,Pe(l.rows,a=>(L(),N("button",{key:a.key,type:"button",role:"tab",class:ge(["vtl-tab",{active:a.key===e.active}]),"aria-selected":String(a.key===e.active),tabindex:a.key===e.active?0:-1,ref_for:!0,ref:r=>e.registerTab(a.key,r),onClick:r=>e.pick(a.key),onKeydown:t[3]||(t[3]=r=>e.onKey(r))},[a.icon?(L(),N("span",{key:0,class:"vtl-tab-ic","aria-hidden":"true",innerHTML:e.iconSvg(a.icon)},null,8,yc)):a.emoji?(L(),N("span",wc,P(a.emoji),1)):(L(),N("span",Sc,P(e.initial(a.label)),1)),_("span",Lc,[_("span",Nc,[Ke(P(a.label),1),a.badge?(L(),N("span",Pc,P(a.badge),1)):Y("",!0)]),a.sub?(L(),N("span",Cc,[_("span",{innerHTML:a.sub},null,8,Ec)])):Y("",!0)])],42,kc))),128))],512),[[Ln,!l.folder||!e.isFolderClosed(l)]])]))),128)):(L(!0),N(G,{key:2},Pe(e.items,l=>(L(),N("button",{key:l.key,type:"button",role:"tab",class:ge(["vtl-tab",{active:l.key===e.active}]),"aria-selected":String(l.key===e.active),tabindex:l.key===e.active?0:-1,ref_for:!0,ref:a=>e.registerTab(l.key,a),onClick:a=>e.pick(l.key),onKeydown:t[4]||(t[4]=a=>e.onKey(a))},[l.icon?(L(),N("span",{key:0,class:"vtl-tab-ic","aria-hidden":"true",innerHTML:e.iconSvg(l.icon)},null,8,Tc)):l.emoji?(L(),N("span",Ac,P(l.emoji),1)):(L(),N("span",Oc,P(e.initial(l.label)),1)),_("span",Fc,[_("span",Ic,P(l.label),1),l.sub?(L(),N("span",Hc,P(l.sub),1)):Y("",!0)])],42,Mc))),128))],8,rc),_("main",Dc,[e.header?Tt(e.$slots,"toolbar",{},void 0,void 0,0):Y("",!0),_("div",Uc,[(L(!0),N(G,null,Pe(e.mountedElementRows,l=>ft((L(),N("section",{key:l.key,class:"vtl-host",hidden:l.key!==e.active},[_("div",{class:"vtl-host-slot",ref_for:!0,ref:a=>e.setHostSlot(l.key,a)},null,512),e.hostState[l.key]==="loading"?(L(),N("div",Wc,P(e.T("messages.loadingNamed","Loading {name}…").replace("{name}",l.label)),1)):e.hostState[l.key]==="error"?(L(),N("div",jc,[Ke(P(e.T("messages.couldNotLoadNamed","Could not load {name}.").replace("{name}",l.label)),1),t[5]||(t[5]=_("br",null,null,-1)),_("small",null,P(e.hostError[l.key]),1)])):Y("",!0)],8,Rc)),[[Ln,l.key===e.active]])),128)),Tt(e.$slots,"default")])])])],2)}const Bc=An(ec,[["render",zc],["styles",[Yr]]]),Kc='.st{display:flex;flex-direction:column;margin:0 -12px}.st-bar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:6px;padding:8px 12px;background:#fff}.st-find{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:6px;height:30px;padding:0 8px;border:1px solid #d1d4cd;border-radius:8px;background:#f3f3f1;color:#6d766e}.st-find:focus-within{border-color:#92b195;background:#fff}.st-find-ic{display:inline-flex}.st-find-ic svg{width:14px;height:14px}.st-find-in{flex:1 1 auto;min-width:0;border:0;outline:0;background:none;font:inherit;font-size:13px;color:#3b463d}.st-tool{flex:0 0 auto;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:none;color:#6d766e;cursor:pointer}.st-tool:hover{background:#f3f3f1;color:#3b463d}.st-tool:focus-visible{outline:2px solid #92b195;outline-offset:-2px}.st-tool svg{width:16px;height:16px}.st-tree{display:flex;flex-direction:column;padding:0 0 8px;outline:0}.st-row{position:relative;display:flex;align-items:center;gap:6px;height:28px;box-sizing:border-box;padding-block:0;padding-inline:calc(8px + var(--st-depth) * 14px) 10px;font-size:13px;color:#3b463d;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;outline:0}.st-row:hover{background:#f3f3f1}.st-row:focus-visible{box-shadow:inset 0 0 0 1px #92b195}.st-row.active{background:#92b1953d}.st-row.active:after{content:"";position:absolute;inset-inline-start:0;top:4px;bottom:4px;width:3px;border-start-end-radius:3px;border-end-end-radius:3px;background:#92b195}.st-row.alias.active{background:#92b1951f}.st-sec{position:sticky;top:46px;z-index:2;height:30px;margin-top:6px;background:#fff;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#6d766e;border-top:1px solid #eceee9}.st-sec:first-child{margin-top:0;border-top:0}.st-sec:hover{background:#fff;color:#3b463d}.st-cap{flex:0 0 auto;font:700 10px/1 system-ui,sans-serif;letter-spacing:.3px;padding:3px 6px;border-radius:999px;background:#92b195;color:#1d2a1f}.st-sec-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.st-twisty,.st-twisty-sp{flex:0 0 16px;width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:#6d766e}.st-twisty svg{width:14px;height:14px;transition:transform .12s ease}.st-row[aria-expanded=true]>.st-twisty svg{transform:rotate(90deg)}.st:dir(rtl) .st-twisty svg{transform:scaleX(-1)}.st:dir(rtl) .st-row[aria-expanded=true]>.st-twisty svg{transform:rotate(90deg)}.st-ic{flex:0 0 16px;display:inline-flex;color:#6d766e}.st-ic svg{width:16px;height:16px}.st-row.active .st-ic{color:#5f8a63}.st-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.st-desc{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;font:11px/1 ui-monospace,Menlo,monospace;color:#8a928b}.st-part{flex:0 0 auto;font:600 9px/1 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.3px;padding:2px 4px;border:1px solid #92b195;border-radius:4px;color:#5f8a63}.st-count{flex:0 0 auto;margin-inline-start:auto;min-width:18px;text-align:right;font-size:11px;font-weight:500;letter-spacing:0;color:#6d766e}.st-guide{position:absolute;top:0;bottom:0;inset-inline-start:calc(15px + var(--st-g) * 14px);border-inline-start:1px solid #dfe2db;pointer-events:none}.st-row:hover>.st-guide{border-inline-start-color:#c4c8c0}.st-empty{margin:12px;font-size:13px;color:#6d766e}.st-activity{display:flex;flex-direction:column;gap:4px}.st-act{position:relative;display:flex;align-items:center;justify-content:center;width:48px;height:44px;margin-inline-start:172px;padding:0;border:0;border-radius:10px;background:none;color:#6d766e;cursor:pointer}.st-act:hover,.st-act.active{background:#f3f3f1;color:#3b463d}.st-act:focus-visible{outline:2px solid #92b195;outline-offset:-2px}.st-act-ic{display:inline-flex}.st-act-ic svg{width:20px;height:20px}.st-act-n{position:absolute;right:6px;bottom:5px;font:700 9px/1 system-ui,sans-serif;color:#5f8a63}',Vc='.st { display:flex; flex-direction:column; margin:0 -12px; }.st-bar { position:sticky; top:0; z-index:3; display:flex; align-items:center; gap:6px; padding:8px 12px 8px; background:#ffffff; }.st-find { flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:6px; height:30px; padding:0 8px; border:1px solid #d1d4cd; border-radius:8px; background:#f3f3f1; color:#6d766e; }.st-find:focus-within { border-color:#92b195; background:#ffffff; }.st-find-ic { display:inline-flex; } .st-find-ic svg { width:14px; height:14px; }.st-find-in { flex:1 1 auto; min-width:0; border:0; outline:0; background:none; font:inherit; font-size:13px; color:#3b463d; }.st-tool { flex:0 0 auto; width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center; padding:0; border:0; border-radius:8px; background:none; color:#6d766e; cursor:pointer; }.st-tool:hover { background:#f3f3f1; color:#3b463d; } .st-tool:focus-visible { outline:2px solid #92b195; outline-offset:-2px; }.st-tool svg { width:16px; height:16px; }.st-tree { display:flex; flex-direction:column; padding:0 0 8px; outline:0; }.st-row { position:relative; display:flex; align-items:center; gap:6px; height:28px; box-sizing:border-box; padding-block:0; padding-inline:calc(8px + var(--st-depth) * 14px) 10px; font-size:13px; color:#3b463d; cursor:pointer; white-space:nowrap; user-select:none; outline:0; }.st-row:hover { background:#f3f3f1; }.st-row:focus-visible { box-shadow:inset 0 0 0 1px #92b195; }.st-row.active { background:rgba(146,177,149,.24); }.st-row.active::after { content:""; position:absolute; inset-inline-start:0; top:4px; bottom:4px; width:3px; border-start-end-radius:3px; border-end-end-radius:3px; background:#92b195; }.st-row.alias.active { background:rgba(146,177,149,.12); }.st-sec { position:sticky; top:46px; z-index:2; height:30px; margin-top:6px; background:#ffffff; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:#6d766e; border-top:1px solid #eceee9; }.st-sec:first-child { margin-top:0; border-top:0; }.st-sec:hover { background:#ffffff; color:#3b463d; }.st-cap { flex:0 0 auto; font:700 10px/1 system-ui,sans-serif; letter-spacing:.3px; padding:3px 6px; border-radius:999px; background:#92b195; color:#1d2a1f; }.st-sec-label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }.st-twisty, .st-twisty-sp { flex:0 0 16px; width:16px; height:16px; display:inline-flex; align-items:center; justify-content:center; color:#6d766e; }.st-twisty svg { width:14px; height:14px; transition:transform .12s ease; }.st-row[aria-expanded="true"] > .st-twisty svg { transform:rotate(90deg); }.st:dir(rtl) .st-twisty svg { transform:scaleX(-1); } .st:dir(rtl) .st-row[aria-expanded="true"] > .st-twisty svg { transform:rotate(90deg); }.st-ic { flex:0 0 16px; display:inline-flex; color:#6d766e; } .st-ic svg { width:16px; height:16px; }.st-row.active .st-ic { color:#5f8a63; }.st-label { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }.st-desc { flex:1 1 0; min-width:0; overflow:hidden; text-overflow:ellipsis; font:11px/1 ui-monospace,Menlo,monospace; color:#8a928b; }.st-part { flex:0 0 auto; font:600 9px/1 system-ui,sans-serif; text-transform:uppercase; letter-spacing:.3px; padding:2px 4px; border:1px solid #92b195; border-radius:4px; color:#5f8a63; }.st-count { flex:0 0 auto; margin-inline-start:auto; min-width:18px; text-align:right; font-size:11px; font-weight:500; letter-spacing:0; color:#6d766e; }.st-guide { position:absolute; top:0; bottom:0; inset-inline-start:calc(15px + var(--st-g) * 14px); border-inline-start:1px solid #dfe2db; pointer-events:none; }.st-row:hover > .st-guide { border-inline-start-color:#c4c8c0; }.st-empty { margin:12px; font-size:13px; color:#6d766e; }.st-activity { display:flex; flex-direction:column; gap:4px; }.st-act { position:relative; display:flex; align-items:center; justify-content:center; width:48px; height:44px; margin-inline-start:172px; padding:0; border:0; border-radius:10px; background:none; color:#6d766e; cursor:pointer; }.st-act:hover, .st-act.active { background:#f3f3f1; color:#3b463d; }.st-act:focus-visible { outline:2px solid #92b195; outline-offset:-2px; }.st-act-ic { display:inline-flex; } .st-act-ic svg { width:20px; height:20px; }.st-act-n { position:absolute; right:6px; bottom:5px; font:700 9px/1 system-ui,sans-serif; color:#5f8a63; }',qc='',Gc={filterPlaceholder:"Filter plugins",collapseAll:"Collapse all",noMatch:"No plugin matches “{query}”.",treeLabel:"Plugins by capability",openSection:"Open {cap}, {label}",part:"part"},Yc='',On=e=>e.canonical!==void 0?!!e.canonical:e.depth===0,Jc=e=>e.canonical!==void 0?!e.canonical&&!e.folder:e.depth>0,Xc=bo({name:"StudioTree",props:{sections:{type:Array,default:()=>[]},active:{type:String,default:""},collapsed:{type:Boolean,default:!1},pick:{type:Function,default:null},expand:{type:Function,default:null},strings:{type:Object,default:()=>({})}},emits:["select"],setup(){Tn(Vc,"studio-tree")},data(){const e=this.readState();return{query:"",focusId:"",secClosed:e.sec||{},nodeOpen:e.node||{},chev:Yc,collapseAllSvg:qc}},computed:{byId(){const e=new Map;for(const t of this.sections)for(const o of t.nodes)e.set(o.id,o);return e},q(){return this.query.trim().toLowerCase()},kept(){if(!this.q)return null;const e=new Set;for(const t of this.sections)for(const o of t.nodes){if(!(o.label.toLowerCase().includes(this.q)||String(o.desc||"").toLowerCase().includes(this.q)))continue;e.add(o.id);let s=o.parent;for(;s;)e.add(s),s=this.byId.get(s)&&this.byId.get(s).parent}return e},visible(){const e=[];for(const t of this.sections){const o=this.kept?t.nodes.filter(n=>this.kept.has(n.id)):t.nodes;if(!(this.kept&&!o.length)&&(e.push({id:"sec:"+t.id,section:!0,sectionId:t.id,level:1,depth:0,expandable:!0,cap:t.cap,badge:t.badge||"CAP "+t.cap,label:t.label,title:t.title||"",count:t.nodes.filter(n=>n.depth===0).length}),!(!this.kept&&this.secClosed[t.id])))for(const n of o)!this.kept&&!this.ancestorsOpen(n)||e.push({...n,sectionId:t.id,level:n.depth+2,expandable:!!n.kids,alias:Jc(n)})}return e},activeSectionId(){for(const e of this.sections)if(e.nodes.some(t=>On(t)&&t.target===this.active))return e.id;return""}},watch:{active:{handler(){this.reveal()},immediate:!0},sections(){this.reveal()},query(e){e&&this.visible.length&&(this.focusId=this.visible[0].id)}},methods:{svg(e){return e?Di(e):""},str(e,t){let o=this.strings[e]||Gc[e]||e;if(t)for(const n in t)o=o.split("{"+n+"}").join(String(t[n]));return o},storageKey(){return"dx-studio-tree:"+(typeof location<"u"&&location.pathname||"")},readState(){try{return JSON.parse(window.localStorage.getItem(this.storageKey())||"{}")||{}}catch{return{}}},saveState(){try{window.localStorage.setItem(this.storageKey(),JSON.stringify({sec:this.secClosed,node:this.nodeOpen}))}catch{}},ancestorsOpen(e){let t=e.parent;for(;t;){if(!this.nodeOpen[t])return!1;t=this.byId.get(t)&&this.byId.get(t).parent}return!0},isOpen(e){return this.kept?!0:e.section?!this.secClosed[e.sectionId]:!!this.nodeOpen[e.id]},setOpen(e,t){e.section?this.secClosed={...this.secClosed,[e.sectionId]:!t}:this.nodeOpen={...this.nodeOpen,[e.id]:t},this.saveState()},toggle(e){e.expandable&&this.setOpen(e,!this.isOpen(e))},collapseAll(){this.nodeOpen={},this.saveState();const e=this.visible.find(t=>!t.section&&t.target===this.active&&On(t));e&&(this.focusId=e.id)},rowClass(e){return{"st-row":!0,"st-sec":!!e.section,active:!e.section&&e.target===this.active,alias:!!e.alias}},setRow(e,t){this._rows||(this._rows={}),t?this._rows[e]=t:delete this._rows[e]},activate(e){if(e.section){this.toggle(e);return}e.target&&(this.pick?this.pick(e.target):this.$emit("select",e.target))},onRowClick(e){this.focusId=e.id,this.activate(e)},focusRow(e){e&&(this.focusId=e,this.$nextTick(()=>{const t=this._rows&&this._rows[e];t&&(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"}))}))},onTreeKey(e){const t=this.visible;if(!t.length)return;const o=Math.max(0,t.findIndex(i=>i.id===this.focusId)),n=t[o],s=i=>i.section?"":i.parent||"sec:"+i.sectionId;switch(e.key){case"ArrowDown":this.focusRow((t[o+1]||n).id);break;case"ArrowUp":this.focusRow((t[o-1]||n).id);break;case"Home":this.focusRow(t[0].id);break;case"End":this.focusRow(t[t.length-1].id);break;case"ArrowRight":if(!n.expandable)break;this.isOpen(n)?t[o+1]&&t[o+1].level>n.level&&this.focusRow(t[o+1].id):this.setOpen(n,!0);break;case"ArrowLeft":n.expandable&&this.isOpen(n)&&!this.kept?this.setOpen(n,!1):this.focusRow(s(n));break;case"Enter":case" ":this.activate(n);break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){const i=e.key.toLowerCase(),a=t.slice(o+1).concat(t.slice(0,o+1)).find(r=>String(r.label).toLowerCase().startsWith(i));a&&this.focusRow(a.id);break}return}e.preventDefault()},onFindKey(e){e.key==="Escape"?(this.query="",e.preventDefault()):e.key==="ArrowDown"&&this.visible.length&&(this.focusRow(this.visible[0].id),e.preventDefault())},reveal(){if(!this.active||!this.sections.length)return;let e=null;for(const t of this.sections)if(e=t.nodes.find(o=>On(o)&&o.target===this.active),e){this.secClosed[t.id]&&(this.secClosed={...this.secClosed,[t.id]:!1},this.saveState());break}if(e)for(let t=e.parent;t;){const o=this.byId.get(t);if(!o)break;if(o.target===this.active&&!this.nodeOpen[t]){e=o;break}t=o.parent}if(e){let t=e.parent,o=!1;for(;t;)this.nodeOpen[t]||(this.nodeOpen={...this.nodeOpen,[t]:!0},o=!0),t=this.byId.get(t)&&this.byId.get(t).parent;o&&this.saveState()}e&&((!this.focusId||!this.byId.has(this.focusId)||this.byId.get(this.focusId).target!==this.active)&&(this.focusId=e.id),this.$nextTick(()=>{const t=this._rows&&this._rows[e.id];t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest"})}))},openSectionFromActivity(e){this.secClosed[e]&&(this.secClosed={...this.secClosed,[e]:!1},this.saveState()),this.expand&&this.expand(),this.$nextTick(()=>this.focusRow("sec:"+e))}}}),Zc={key:0,class:"st-activity"},Qc=["aria-label","onClick"],ep=["innerHTML"],tp={class:"st-act-n","aria-hidden":"true"},op={key:1,class:"st"},np={class:"st-bar"},sp={class:"st-find"},ip=["innerHTML"],lp=["placeholder","aria-label"],ap=["aria-label","title"],rp=["innerHTML"],cp=["aria-label"],pp=["aria-level","aria-expanded","aria-selected","tabindex","title","onClick","onFocus"],dp=["innerHTML"],up={class:"st-cap"},fp={class:"st-sec-label"},gp={class:"st-count"},hp=["innerHTML","onClick"],$p={key:1,class:"st-twisty-sp","aria-hidden":"true"},bp=["innerHTML"],mp={class:"st-label"},_p={key:2,class:"st-part"},vp={class:"st-desc"},xp={key:3,class:"st-count"},kp={key:0,class:"st-empty"};function yp(e,t,o,n,s,i){return e.collapsed?(L(),N("div",Zc,[(L(!0),N(G,null,Pe(e.sections,l=>(L(),N("button",{key:l.id,type:"button",class:ge(["st-act",{active:l.id===e.activeSectionId}]),"aria-label":e.str("openSection",{cap:l.badge||"CAP "+l.cap,label:l.label}),onClick:a=>e.openSectionFromActivity(l.id)},[_("span",{class:"st-act-ic","aria-hidden":"true",innerHTML:e.svg(l.icon)},null,8,ep),_("span",tp,P(l.short||l.cap),1)],10,Qc))),128))])):(L(),N("div",op,[_("div",np,[_("label",sp,[_("span",{class:"st-find-ic","aria-hidden":"true",innerHTML:e.svg("search")},null,8,ip),ft(_("input",{ref:"find",type:"search",class:"st-find-in","onUpdate:modelValue":t[0]||(t[0]=l=>e.query=l),placeholder:e.str("filterPlaceholder"),"aria-label":e.str("filterPlaceholder"),onKeydown:t[1]||(t[1]=(...l)=>e.onFindKey&&e.onFindKey(...l))},null,40,lp),[[Mn,e.query]])]),_("button",{type:"button",class:"st-tool","aria-label":e.str("collapseAll"),title:e.str("collapseAll"),onClick:t[2]||(t[2]=(...l)=>e.collapseAll&&e.collapseAll(...l))},[_("span",{"aria-hidden":"true",innerHTML:e.collapseAllSvg},null,8,rp)],8,ap)]),_("div",{class:"st-tree",role:"tree","aria-label":e.str("treeLabel"),onKeydown:t[3]||(t[3]=(...l)=>e.onTreeKey&&e.onTreeKey(...l))},[(L(!0),N(G,null,Pe(e.visible,l=>(L(),N("div",{key:l.id,ref_for:!0,ref:a=>e.setRow(l.id,a),role:"treeitem","aria-level":l.level,"aria-expanded":l.expandable?String(e.isOpen(l)):null,"aria-selected":l.section?null:String(l.target===e.active),tabindex:l.id===e.focusId?0:-1,class:ge(e.rowClass(l)),style:kt({"--st-depth":l.depth}),title:l.title||null,onClick:a=>e.onRowClick(l),onFocus:a=>e.focusId=l.id},[l.section?(L(),N(G,{key:0},[_("span",{class:"st-twisty","aria-hidden":"true",innerHTML:e.chev},null,8,dp),_("span",up,P(l.badge),1),_("span",fp,P(l.label),1),_("span",gp,P(l.count),1)],64)):(L(),N(G,{key:1},[(L(!0),N(G,null,Pe(l.depth,a=>(L(),N("span",{key:a,class:"st-guide",style:kt({"--st-g":a-1}),"aria-hidden":"true"},null,4))),128)),l.expandable?(L(),N("span",{key:0,class:"st-twisty","aria-hidden":"true",innerHTML:e.chev,onClick:Ti(a=>e.toggle(l),["stop"])},null,8,hp)):(L(),N("span",$p)),_("span",{class:"st-ic","aria-hidden":"true",innerHTML:e.svg(l.icon)},null,8,bp),_("span",mp,P(l.label),1),l.part?(L(),N("span",_p,P(e.str("part")),1)):Y("",!0),_("span",vp,P(l.desc),1),l.expandable?(L(),N("span",xp,P(l.kids),1)):Y("",!0)],64))],46,pp))),128)),e.query&&!e.visible.length?(L(),N("p",kp,P(e.str("noMatch",{query:e.query})),1)):Y("",!0)],40,cp)]))}const wp=An(Xc,[["render",yp],["styles",[Kc]]]),To=[{code:"en",name:"English",nativeName:"English",flag:"🇺🇸"},{code:"es",name:"Spanish",nativeName:"Español",flag:"🇪🇸"},{code:"fr",name:"French",nativeName:"Français",flag:"🇫🇷"},{code:"pt",name:"Portuguese",nativeName:"Português",flag:"🇵🇹"},{code:"ar",name:"Arabic",nativeName:"العربية",flag:"🇸🇦",dir:"rtl"},{code:"ru",name:"Russian",nativeName:"Русский",flag:"🇷🇺"},{code:"de",name:"German",nativeName:"Deutsch",flag:"🇩🇪",hideFromSwitcher:!0},{code:"hi",name:"Hindi",nativeName:"हिन्दी",flag:"🇮🇳",hideFromSwitcher:!0},{code:"it",name:"Italian",nativeName:"Italiano",flag:"🇮🇹",hideFromSwitcher:!0},{code:"ro",name:"Romanian",nativeName:"Română",flag:"🇷🇴",hideFromSwitcher:!0},{code:"zh",name:"Chinese",nativeName:"中文",flag:"🇨🇳",hideFromSwitcher:!0}];To.filter(e=>!e.hideFromSwitcher);function Sp(e){return To.find(t=>t.code===e)}function Fn(e){const t=String(e||"").split("-")[0].toLowerCase();return To.some(o=>o.code===t)?t:"en"}const Ui="doxa-maps:locale";function Lp(){try{const e=localStorage.getItem(Ui);if(e)return Fn(e)}catch{}return Fn(navigator==null?void 0:navigator.language)}function Np(e){try{localStorage.setItem(Ui,e)}catch{}}const Ao="__doxaMapToken",Ri="doxa:map-token",Wi="__doxaMapTokenBridge",Bt=()=>{if(typeof window>"u")return"";const e=window[Ao];return typeof e=="string"?e:""};function ji(e){if(typeof window>"u")return"";zi();const t=typeof e=="string"?e.trim():"";if(!t||t===Bt())return Bt();window[Ao]=t;try{window.dispatchEvent(new CustomEvent(Ri,{detail:t}))}catch{}return t}function Pp(){var t;if(typeof window>"u")return;const e=Bt()||typeof window.MAP_TOKEN=="string"&&window.MAP_TOKEN;if(zi(),window[Ao]="",!((t=Object.getOwnPropertyDescriptor(window,"MAP_TOKEN"))!=null&&t.get))try{window.MAP_TOKEN=""}catch{}if(e)try{window.dispatchEvent(new CustomEvent(Ri,{detail:""}))}catch{}}function zi(){var t;if(typeof window>"u"||window[Wi]&&((t=Object.getOwnPropertyDescriptor(window,"MAP_TOKEN"))!=null&&t.get))return;const e=typeof window.MAP_TOKEN=="string"?window.MAP_TOKEN:"";e&&!Bt()&&(window[Ao]=e);try{Object.defineProperty(window,"MAP_TOKEN",{configurable:!0,get(){return Bt()},set(o){ji(o)}}),window[Wi]=!0}catch{}}const Kt={};function Bi(e,t){return Kt[e]||(Kt[e]=new Promise((o,n)=>{const s=document.createElement("script");s.src=e,(/^\/plugin-designs\//.test(e)||/\/index\.js(\?|$)/.test(e))&&(s.type="module"),s.onload=()=>o(),s.onerror=()=>{delete Kt[e],n(new Error("failed to load "+e))},document.head.appendChild(s)})),Kt[e]}function Ki(e,t){return typeof customElements>"u"||customElements.get(e)?Promise.resolve():Promise.race([customElements.whenDefined(e),new Promise((o,n)=>setTimeout(()=>{customElements.get(e)||n(new Error("<"+e+"> never registered (bundle loaded but defined no element)"))},15e3))])}function Cp(){try{const e=typeof document<"u"&&document.currentScript&&document.currentScript.src||"";return e?e.replace(/[^/]+\/[^/]+$/,"").replace(/\/+$/,"")+"/":""}catch{return""}}const Ep=":host{display:block;position:relative;height:var(--plugin-studio-height, 85vh);min-height:480px}:host([hidden]){display:none}.ps-logo{display:inline-flex;align-items:center}.ps-logo svg{display:block}.ps-count{color:#6d766e}.vtl-top{position:relative;z-index:3}.vtl-body{isolation:isolate}.ps-token{position:relative;display:inline-flex}.ps-show-header{position:fixed;top:8px;inset-inline-end:8px;z-index:2147483000;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid #d1d4cd;border-radius:999px;background:#fffffff0;color:#3b463d;font:600 12px system-ui,sans-serif;cursor:pointer;box-shadow:0 4px 14px #0000002e}.ps-show-header:hover,.ps-show-header:focus-visible{background:#fff;outline:2px solid #92b195}.ps-token-dot{width:8px;height:8px;border-radius:50%;background:#b8bdb4}.ps-token-dot.is-yours,.ps-token-dot.is-url{background:#92b195}.ps-token-dot.is-built{background:#c9b36a}.ps-token-dot.is-none{background:#d27a6a}.ps-token-panel{position:absolute;top:100%;inset-inline-end:0;margin-top:4px;z-index:30;width:min(340px,90vw);display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid #d1d4cd;border-radius:10px;background:#fff;box-shadow:0 12px 32px #00000040;color:#3b463d;font-size:12px}.ps-token-label{display:flex;flex-direction:column;gap:4px}.ps-token-input{font:inherit;font-size:12px;padding:6px 8px;border:1px solid #d1d4cd;border-radius:7px;background:#f8f8f6;color:#3b463d;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ps-token-row{display:flex;gap:8px}.ps-token-apply,.ps-token-clear{font:inherit;font-size:12px;padding:5px 12px;border-radius:7px;border:1px solid #d1d4cd;background:#d1d4cd;color:#3b463d;cursor:pointer}.ps-token-apply{background:#92b195;border-color:#92b195;color:#fff}.ps-token-apply:disabled{opacity:.6;cursor:progress}.ps-token-status{margin:0}.ps-token-head{margin:0;font-weight:600;font-size:12px}.ps-token-status.err{color:#b3412f}.ps-token-note{margin:0;color:#6d766e}.ps-locale{position:relative;display:inline-flex}.ps-locale-btn{display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:12px;padding:4px 9px;border:1px solid #d1d4cd;border-radius:8px;background:#d1d4cd;color:#3b463d;cursor:pointer}.ps-locale-btn:hover{background:#d1d4cd}.ps-flag{font-size:13px;line-height:1}.ps-locale-name{max-width:11ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ps-token-btn .ps-locale-name{max-width:none}.ps-dots{color:#6d766e}.ps-locale-menu{position:absolute;top:100%;right:0;margin-top:4px;z-index:30;min-width:180px;list-style:none;padding:6px;border:1px solid #d1d4cd;border-radius:10px;background:#fff;box-shadow:0 12px 32px #00000080;max-height:320px;overflow:auto}.ps-locale-opt{display:flex;align-items:center;gap:8px;width:100%;text-align:left;font:inherit;font-size:13px;padding:7px 9px;border:0;border-radius:7px;background:none;color:#3b463d;cursor:pointer}.ps-locale-opt:hover,.ps-locale-opt.active{background:#d1d4cd;color:#3b463d}.ps-locale-opt.active .ps-locale-name{color:#92b195}.ps-locale-en{margin-left:auto;font-size:11px;color:#6d766e}.ps-toolbar{display:flex;flex-direction:column;gap:8px;padding:10px 12px 0}.ps-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ps-bar-t{flex:1 1 auto;min-width:0}.ps-bar-t b{font-size:15px;color:#3b463d}.ps-bar-sub{display:block;font-size:12px;color:#6d766e}.ps-btn{font:inherit;font-size:12px;padding:5px 10px;border:1px solid #d1d4cd;border-radius:8px;background:#d1d4cd;color:#3b463d;cursor:pointer;white-space:nowrap}.ps-btn:hover{background:#d1d4cd}.ps-embed{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid #d1d4cd;border-radius:8px;background:#f3f3f1}.ps-embed label{font-size:12px;color:#6d766e;display:flex;justify-content:space-between;align-items:center}.ps-embed textarea{width:100%;height:58px;font:11px/1.35 ui-monospace,Menlo,monospace;border:1px solid #d1d4cd;border-radius:6px;background:#fff;color:#3b463d;padding:6px;resize:vertical}.ps-stage{position:absolute;top:10px;right:12px;bottom:12px;left:12px;border:1px solid #d1d4cd;border-radius:10px;overflow:hidden;background:#f3f3f1}.ps-pane{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;--profile-min-h: 0}.ps-slot{position:relative;min-height:100%}.ps-slot>*{min-height:0;max-height:none}.ps-hint{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;text-align:center;color:#6d766e;font-size:13px;padding:20px}.ps-hint.err{color:#f87171}.ps-hint small{color:#6d766e}",Oo="plugin-studio:mapbox-token",Fo="plugin-studio:mapbox-token-url",Vi="plugin-studio:header-hidden",qi="plugin-studio:map-provider";function mt(e){try{return typeof window<"u"&&window.localStorage.getItem(e)||""}catch{return""}}function _t(e,t){try{t?window.localStorage.setItem(e,t):window.localStorage.removeItem(e)}catch{}}const Mp=` :host { display:block; position:relative; height:var(--plugin-studio-height, 85vh); min-height:480px; } :host([hidden]) { display:none; } .ps-logo { display:inline-flex; align-items:center; } @@ -199,7 +199,7 @@ .ps-hint { position:absolute; inset:0; display:grid; place-items:center; text-align:center; color:#6d766e; font-size:13px; padding:20px; } .ps-hint.err { color:#f87171; } .ps-hint small { color:#6d766e; } -`,Mp={5:"App shell · nested-mfe-spa",4:"Composite element",3:"Multi-view element",2:"Preset element",1:"Single element"},Vi={"nested-mfe-spa":0,"nested-elements-mfe":1,monolithic:2,parameterized:3,single:4},Tp=e=>Vi[e]!=null?5-Vi[e]:1,Ap={5:"nested-mfe-spa",4:"nested-elements-mfe",3:"monolithic",2:"parameterized",1:"single"},In={5:"monitor",4:"tree",3:"layers",2:"grid",1:"embed"},qi=new Set(["doxa-research-map","doxa-simple-map","cities-internet-map","gospel-resources-map","my-upg-100-list-map","doxa-map","doxa-maps-spa","dashboard-plus-grid","research-dashboard-map","demo-map","all-people-groups","country-posters-map","key-cities-map","research-map-plus-grid","gospel-internet-board"]),Gi=new Set(["big-picture"]),Io={};for(const[e,t]of Object.entries(Object.assign({"../../library/i18n/locales/ar/studio.json":Er,"../../library/i18n/locales/de/studio.json":Mr,"../../library/i18n/locales/en/studio.json":Tr,"../../library/i18n/locales/es/studio.json":Ar,"../../library/i18n/locales/fr/studio.json":Or,"../../library/i18n/locales/hi/studio.json":Fr,"../../library/i18n/locales/it/studio.json":Ir,"../../library/i18n/locales/pt/studio.json":Hr,"../../library/i18n/locales/ro/studio.json":Dr,"../../library/i18n/locales/ru/studio.json":Ur,"../../library/i18n/locales/zh/studio.json":Rr}))){const o=e.match(/locales\/([^/]+)\/studio\.json$/);o&&(Io[o[1]]=t)}const Yi={},Hn=e=>String(e).split(/[-_]+/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function Op(e,t){const o=e+"/"+t.profile;if(Yi[o])return Yi[o];const n=typeof t.label=="string"?t.label.replace(/\s*\([^()]*\)\s*$/,"").trim():"";return n||(t.profile===e?Hn(e):Hn(e)+" · "+Hn(t.profile))}const Kt={};function Ji(e,t){return Kt[e]||(Kt[e]=new Promise((o,n)=>{const s=document.createElement("script");s.src=e,(/^\/plugin-designs\//.test(e)||/\/index\.js(\?|$)/.test(e))&&(s.type="module"),s.onload=()=>o(),s.onerror=()=>{delete Kt[e],n(new Error("failed to load "+e))},document.head.appendChild(s)})),Kt[e]}function Xi(e,t){return typeof customElements>"u"||customElements.get(e)?Promise.resolve():Promise.race([customElements.whenDefined(e),new Promise((o,n)=>setTimeout(()=>{customElements.get(e)||n(new Error("<"+e+"> never registered (bundle loaded but defined no element)"))},15e3))])}const Fp=` +`,Tp={5:"App shell · nested-mfe-spa",4:"Composite element",3:"Multi-view element",2:"Preset element",1:"Single element"},Gi={"nested-mfe-spa":0,"nested-elements-mfe":1,monolithic:2,parameterized:3,single:4},Ap=e=>Gi[e]!=null?5-Gi[e]:1,Op={5:"nested-mfe-spa",4:"nested-elements-mfe",3:"monolithic",2:"parameterized",1:"single"},In={5:"monitor",4:"tree",3:"layers",2:"grid",1:"embed"},Yi=new Set(["doxa-research-map","doxa-simple-map","cities-internet-map","gospel-resources-map","my-upg-100-list-map","doxa-map","doxa-maps-spa","dashboard-plus-grid","research-dashboard-map","demo-map","all-people-groups","country-posters-map","key-cities-map","research-map-plus-grid","gospel-internet-board"]),Ji=new Set(["big-picture"]),Io={};for(const[e,t]of Object.entries(Object.assign({"../../library/i18n/locales/ar/studio.json":Er,"../../library/i18n/locales/de/studio.json":Mr,"../../library/i18n/locales/en/studio.json":Tr,"../../library/i18n/locales/es/studio.json":Ar,"../../library/i18n/locales/fr/studio.json":Or,"../../library/i18n/locales/hi/studio.json":Fr,"../../library/i18n/locales/it/studio.json":Ir,"../../library/i18n/locales/pt/studio.json":Hr,"../../library/i18n/locales/ro/studio.json":Dr,"../../library/i18n/locales/ru/studio.json":Ur,"../../library/i18n/locales/zh/studio.json":Rr}))){const o=e.match(/locales\/([^/]+)\/studio\.json$/);o&&(Io[o[1]]=t)}const Xi={},Hn=e=>String(e).split(/[-_]+/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function Fp(e,t){const o=e+"/"+t.profile;if(Xi[o])return Xi[o];const n=typeof t.label=="string"?t.label.replace(/\s*\([^()]*\)\s*$/,"").trim():"";return n||(t.profile===e?Hn(e):Hn(e)+" · "+Hn(t.profile))}const Ip=` [data-studio-widgets]{position:fixed;z-index:2147483647;display:flex;flex-direction:column;gap:10px;pointer-events:none} [data-studio-widgets] > *{pointer-events:auto} [data-studio-widgets="bottom-right"]{bottom:max(16px,env(safe-area-inset-bottom));right:max(16px,env(safe-area-inset-right));align-items:flex-end} @@ -233,4 +233,4 @@ [data-studio-widgets$="left"]{left:max(8px,env(safe-area-inset-left))} [data-widget-panel]{width:calc(100vw - 16px);max-width:none;height:60vh;height:60dvh} [data-widget-bubble]{max-width:calc(100vw - 16px)} -}`,Ip=''+''+""+''+"",Hp=bo({name:"PluginStudio",inheritAttrs:!1,components:{VerticalTabsLayout:Bc,StudioTree:wp},props:{treeBase:{type:String,default:""},profileConfig:{type:[String,Object],default:""},provider:{type:String,default:""},heading:{type:String,default:""},tokenUrl:{type:String,default:""},tk:{type:String,default:""}},setup(){return Tn(Ep,"plugin-studio"),{injectedBase:Et("psTreeBase","")}},data(){return{activeKey:"",embedOpen:!1,locale:this.initialLocale(),localeOpen:!1,settingsOpen:!1,headerHidden:mt(Bi)==="1",engineOpen:!1,userProvider:mt(Ki),tokenBusy:!1,tokenErr:"",tokenDraft:mt(Oo),urlDraft:mt(Fo),userTk:mt(Oo),userTokenUrl:mt(Fo),fetchedTk:"",bakedTk:"",hostProvider:"",switcherLangs:To,rows:[],manifestBundles:[]}},computed:{cfg(){let e=this.profileConfig;if(typeof e=="string")try{e=e?JSON.parse(e):{}}catch{e={}}return e&&typeof e=="object"?e:{}},base(){const e=(this.treeBase||this.cfg.treeBase||this.injectedBase||"").trim();return e?e.replace(/\/+$/,"")+"/":""},flatRows(){return this.rows},groups(){const e={};for(const t of this.rows)(e[t.cap]=e[t.cap]||[]).push(t);return[5,4,3,2,1].filter(t=>e[t]&&e[t].length).map(t=>({cap:t,label:Mp[t]||"capability "+t,rows:e[t]}))},treeSections(){const e=new Map(this.compositionTrees.map(s=>[s.nodes[0].selects,s])),t=new Map;for(const s of this.rows)t.has(s.bundle)||t.set(s.bundle,[]),t.get(s.bundle).push(s);const o=[...t.entries()].map(([s,i])=>({bundle:s,rows:i,cap:Math.max(...i.map(l=>l.cap))}));return[5,4,3,2,1].map(s=>({cap:s,group:o.filter(i=>i.cap===s).sort((i,l)=>i.bundle.localeCompare(l.bundle))})).map(({cap:s,group:i})=>{if(!i.length)return null;const l=[],a=(r,d,p)=>{const f=e.get(r.key);if(l.push({id:r.key,parent:p,depth:d,label:r.label,desc:(r.stage==="production"?"":this.tr("stageExperimental")+" · ")+"cap "+r.cap+" · "+r.tag,icon:r.icon,target:r.key,canonical:!0,kids:f?f.nodes[0].kids:0,title:r.label+" · <"+r.tag+"> · CAP "+r.cap+" "+this.tr("cap"+r.cap)}),!f)return;const v=x=>x===0?r.key:r.key+">"+x;for(const x of f.nodes.slice(1))l.push({id:v(x.id),parent:v(x.ancestors[x.ancestors.length-1]),depth:d+x.depth,label:x.label,part:!!x.part,target:x.selects||"",canonical:!1,icon:x.part?"dots":In[x.cap]||"embed",desc:x.part?this.tr("noStandalone"):"cap "+x.cap+" · "+x.tag,kids:x.kids||0,title:x.part?x.label+" · "+this.tr("partOf",{name:r.label}):x.label+" · <"+x.tag+"> · CAP "+x.cap+" "+this.tr("cap"+x.cap)})};for(const r of i){const d=[...r.rows].sort((f,v)=>v.cap-f.cap||f.label.localeCompare(v.label));if(d.length===1){a(d[0],0,"");continue}const p="bundle:"+r.bundle;l.push({id:p,parent:"",depth:0,label:r.bundle,desc:this.tr("elementsCount",{n:d.length}),icon:"folder",target:d[0].key,canonical:!1,folder:!0,kids:d.length,title:r.bundle+" · plugin-designs/"+r.bundle+"/ · "+d.length+" "+this.tr("elements")});for(const f of d)a(f,1,p)}return{id:"cap-"+s,cap:s,label:this.tr("cap"+s),title:this.tr("cap"+s)+" · "+(Ap[s]||""),icon:In[s]||"embed",nodes:l}}).filter(Boolean)},compositionTrees(){const e=[],t=(o,n,s,i,l)=>{const a=this.manifestBundles.find(v=>v.bundle===o.bundle),r=o.cap>=4&&a&&a.composes||[],d=[],p=[],f=new Set;for(const v of r){const x=this.resolveRef(v,o.bundle);if(!x){p.push(v);continue}x.key===o.key||f.has(x.key)||(f.add(x.key),d.push(x))}d.sort((v,x)=>x.cap-v.cap||v.label.localeCompare(x.label));for(const v of d){const x={id:i.length,label:v.label,tag:v.tag,cap:v.cap,selects:v.key,depth:n+1,ancestors:l,kids:0};i.push(x);const R=i.length;s.has(v.key)||t(v,n+1,new Set([...s,v.key]),i,[...l,x.id]),x.kids=i.filter((F,ee)=>ee>=R&&F.depth===n+2).length}for(const v of p)i.push({id:i.length,label:v,part:!0,selects:o.key,depth:n+1,ancestors:l,kids:0})};for(const o of this.manifestBundles){if(!o.composes||!o.composes.length||Gi.has(o.bundle))continue;const n=this.rows.find(i=>i.bundle===o.bundle);if(!n)continue;const s=[{id:0,label:n.label,tag:n.tag,cap:n.cap,selects:n.key,depth:0,ancestors:[]}];t(n,0,new Set([n.key]),s,[0]),s[0].kids=s.filter(i=>i.depth===1).length,s.length>1&&e.push({bundle:o.bundle,nodes:s})}return e},active(){return this.rows.find(e=>e.key===this.activeKey)||null},effectiveTk(){return this.userTk||this.fetchedTk||this.tk||this.cfg.tk||this.bakedTk||""},effectiveProvider(){const e=String(this.userProvider||this.provider||this.cfg.provider||"").toLowerCase().trim();return e==="maplibre"||e==="mapbox"?e:""},engines(){return[{id:"",label:this.tr("engineDefault"),note:""},{id:"mapbox",label:"Mapbox",note:this.tr("engineMapboxNote")},{id:"maplibre",label:"MapLibre",note:this.tr("engineMaplibreNote")}]},engineLabel(){return this.userProvider==="mapbox"?"Mapbox":this.userProvider==="maplibre"?"MapLibre":this.tr("engineDefault")},tokenSource(){return this.userTk?"yours":this.fetchedTk?"url":this.tk||this.cfg.tk||this.bakedTk?"built":"none"},tokenStatus(){return this.effectiveProvider==="maplibre"?this.tr("tokenNotNeeded"):this.tokenSource==="yours"?this.tr("tokenSourceYours"):this.tokenSource==="url"?this.tr("tokenSourceUrl",{url:this.userTokenUrl}):this.tokenSource==="built"?this.tr("tokenSourceBuilt"):this.tr("tokenSourceNone")},countLabel(){const e=new Set(this.rows.map(t=>t.bundle)).size;return this.tr("countLabel",{bundles:e,elements:this.rows.length})},activeLang(){return Sp(this.locale)||{code:this.locale,flag:"🌐",nativeName:this.locale}},uiDir(){return(this.activeLang&&this.activeLang.dir)==="rtl"?"rtl":"ltr"}},mounted(){this.bakedTk=typeof window<"u"&&window.MAP_TOKEN||"",this.hostProvider=typeof window<"u"&&typeof window.MAP_PROVIDER=="string"?window.MAP_PROVIDER:"",this.publishProvider(),this.userTk?this.publishToken():(this.userTokenUrl||this.tokenUrl||this.cfg.tokenUrl)&&this.fetchToken(this.userTokenUrl||this.tokenUrl||this.cfg.tokenUrl).then(e=>{e&&e!==this.fetchedTk&&(this.fetchedTk=e,this.publishToken(),this.remountPanes())}).catch(()=>{}),this.loadManifest()},methods:{async fetchToken(e){if(!/^https?:\/\//i.test(e))throw new Error("not an http(s) URL");let t;try{t=await fetch(e,{cache:"no-store",credentials:"same-origin"})}catch{throw new Error("the request was blocked or the server did not answer (cross-origin rules can do this)")}if(!t.ok)throw new Error("HTTP "+t.status);const o=(await t.text()).trim();let n=o;try{const s=JSON.parse(o);n=s&&(s.token||s.tk||s.accessToken)||(typeof s=="string"?s:"")}catch{}if(n=String(n||"").trim(),n.startsWith("sk."))throw new Error(this.tr("tokenSecret"));if(!n.startsWith("pk."))throw new Error(this.tr("tokenNotPk"));return n},async applyToken(){this.tokenErr="";const e=this.tokenDraft,t=this.urlDraft;if(e.startsWith("sk.")){this.tokenErr=this.tr("tokenSecret");return}if(e&&!e.startsWith("pk.")){this.tokenErr=this.tr("tokenNotPk");return}this.tokenBusy=!0;try{let o="";if(!e&&t)try{o=await this.fetchToken(t)}catch(n){this.tokenErr=this.tr("tokenUrlFailed",{why:n.message});return}this.userTk=e,this.userTokenUrl=e?"":t,this.fetchedTk=o,_t(Oo,this.userTk),_t(Fo,this.userTokenUrl),this.publishToken(),this.remountPanes(),this.settingsOpen=!1}finally{this.tokenBusy=!1}},setHeaderHidden(e){this.headerHidden=!!e,this.settingsOpen=!1,this.engineOpen=!1,this.localeOpen=!1,_t(Bi,e?"1":"")},setProvider(e){this.engineOpen=!1,e!==this.userProvider&&(this.userProvider=e,_t(Ki,e),this.publishProvider(),this.remountPanes())},publishProvider(){typeof window>"u"||(this.effectiveProvider?window.MAP_PROVIDER=this.effectiveProvider:this.hostProvider?window.MAP_PROVIDER=this.hostProvider:"MAP_PROVIDER"in window&&delete window.MAP_PROVIDER)},clearToken(){this.tokenDraft="",this.urlDraft="",this.tokenErr="",this.userTk="",this.userTokenUrl="",this.fetchedTk="",_t(Oo,""),_t(Fo,""),this.publishToken(),this.remountPanes()},publishToken(){typeof window>"u"||(this.effectiveTk?(ji(this.effectiveTk),window.MAP_TOKEN!==this.effectiveTk&&(window.MAP_TOKEN=this.effectiveTk)):Pp())},remountPanes(){for(const t of this.rows)t.mounted&&this.releaseRow(t);const e=this.active;e&&this.$nextTick(()=>{this.activeKey===e.key&&this.mountElement(e)})},tr(e,t){const o=(this.locale||"en").split("-")[0];let n=(Io[this.locale]||{})[e]||(Io[o]||{})[e]||(Io.en||{})[e]||e;if(t)for(const s in t)n=n.split("{"+s+"}").join(String(t[s]));return n},resolveRef(e,t){return t&&this.rows.find(o=>o.key===t+"/"+e)||this.rows.find(o=>o.key===e)||this.rows.find(o=>o.tag===e)||this.rows.find(o=>o.bundle===e)||null},setSlot(e,t){t&&(this._slots=Object.assign(this._slots||{},{[e]:t}))},initialLocale(){let e=this.profileConfig;if(typeof e=="string")try{e=e?JSON.parse(e):{}}catch{e={}}let t="";try{const n=new URLSearchParams(window.location.search);t=n.get("lang")||n.get("locale")||""}catch{}const o=e&&(e.locale||e.lang)||t;return o?Fn(o):Lp()},paneConfig(e,t){const o={profile:e.profile,instanceId:"ps-"+e.key.replace(/\//g,"-"),locale:t};this.effectiveTk&&(o.tk=this.effectiveTk);const n=this.userTokenUrl||this.tokenUrl||this.cfg.tokenUrl;return n&&(o.tokenUrl=n),this.effectiveProvider&&(o.provider=this.effectiveProvider),this.base&&(o.treeBase=this.base),o},setLocale(e){this.locale=e,this.localeOpen=!1,Np(e);try{for(const t of this.rows){if(!t.mounted)continue;const o=this._slots&&this._slots[t.key],n=o&&o.firstElementChild;n&&n.setAttribute&&n.setAttribute("profile-config",JSON.stringify(this.paneConfig(t,e)))}}catch{}},resolve(e){const t=String(e);if(/^(https?:)?\/\//.test(t)||t.startsWith("/"))return t;const o=t.replace(/^\.\//,"");return this.base?this.base.replace(/\/+$/,"")+"/"+o:"../"+o},loadManifest(){const e=o=>{this.manifestBundles=o&&o.bundles||[],this.rows=this.rowsFromManifest(o),this.setupWidgets(),this.route()},t=typeof window<"u"&&window.__psBaked||null;if(typeof fetch=="function"&&typeof location<"u"&&location.protocol!=="file:"){const o=this.base?this.resolve("manifest.json"):"../manifest.json";fetch(o,{cache:"no-cache"}).then(n=>n.ok?n.json():null).then(n=>e(n||t||{bundles:[]})).catch(()=>e(t||{bundles:[]}))}else e(t||{bundles:[]})},rowsFromManifest(e){const t=[];for(const o of e.bundles||[])if(!(o.bundle==="plugin-studio"||Gi.has(o.bundle)))for(const n of o.profiles||[]){const s=o.elements&&o.elements.length?o.elements:null,i=(n.element&&(!s||s.includes(n.element))?n.element:null)||s&&s[0]||n.element||o.bundle,l=Tp(n.type||"single"),a=qi.has(i)||qi.has(o.bundle)||n.heavy===!0;t.push({key:o.bundle+"/"+n.profile,bundle:o.bundle,stage:o.stage==="production"?"production":"experimental",label:Op(o.bundle,n),profile:n.profile,tag:i,cap:l,icon:In[l]||"embed",description:n.description||"",widget:n.widget&&["bottom-right","bottom-left","top-right","top-left"].includes(n.widget.corner)?n.widget.corner:"",heavy:a,bundleJs:o.scriptUrl||o.bundle+"/"+o.bundle+".js",embed:n.embed&&n.embed.script||"",mounted:!1,state:"idle",error:""})}return t.sort((o,n)=>n.cap-o.cap||o.bundle.localeCompare(n.bundle)||o.label.localeCompare(n.label)),t},route(){const e=(typeof location<"u"&&location.hash||"").replace(/^#\/?/,"");if(e&&this.rows.some(o=>o.key===e)){this.select(e);return}const t=this.readLastTab();if(t&&this.rows.some(o=>o.key===t)){this.select(t);return}this.rows.length&&this.select(this.rows[0].key)},storageKey(){return"dx-studio-tab:"+(typeof location<"u"&&location.pathname||"")},readLastTab(){try{return window.localStorage.getItem(this.storageKey())||""}catch{return""}},writeLastTab(e){try{window.localStorage.setItem(this.storageKey(),e)}catch{}},select(e){if(!this.rows.some(s=>s.key===e))return;const t=this.rows.find(s=>s.key===e);if(t&&t.widget){this.openWidget(t,!0);return}const o=this.activeKey;if(this.activeKey=e,this.embedOpen=!1,o&&o!==e){const s=this.rows.find(i=>i.key===o);s&&s.heavy&&s.mounted&&this.releaseRow(s)}const n=this.rows.find(s=>s.key===e);n&&(this.writeLastTab(e),n.mounted||this.$nextTick(()=>{this.activeKey===n.key&&this.mountElement(n)}))},releaseRow(e){try{const t=this._slots&&this._slots[e.key];t&&(t.innerHTML="")}catch{}this._slots&&delete this._slots[e.key],e.mounted=!1,e.state="idle",e.error=""},widgetStore(){return window.__doxaStudioWidgets||(window.__doxaStudioWidgets={hosts:{},els:{}}),window.__doxaStudioWidgets},widgetHost(e){const t=this.widgetStore();if(!document.getElementById("studio-widget-css")){const n=document.createElement("style");n.id="studio-widget-css",n.textContent=Fp,document.head.appendChild(n)}if(t.hosts[e]&&t.hosts[e].isConnected)return t.hosts[e];const o=document.createElement("div");return o.setAttribute("data-studio-widgets",e),document.body.appendChild(o),t.hosts[e]=o,o},setupWidgets(){for(const e of this.rows.filter(t=>t.widget)){const t=this.widgetStore(),o=this.widgetHost(e.widget);let n=o.querySelector(`[data-widget="${e.key}"]`);if(!n){n=document.createElement("div"),n.setAttribute("data-widget",e.key);const i=document.createElement("div");i.setAttribute("data-widget-panel","");const l=document.createElement("button");l.type="button",l.setAttribute("data-widget-bubble","");const a="widget:"+e.key,r=this.tr(a);l.setAttribute("aria-label",r!==a?r:e.label),l.title=l.getAttribute("aria-label"),l.setAttribute("aria-expanded","false"),l.innerHTML=Ip,l.querySelector("[data-wb-text]").textContent=l.getAttribute("aria-label"),l.addEventListener("click",()=>this.openWidget(e,!i.hasAttribute("data-open"))),n.appendChild(i),n.appendChild(l),o.appendChild(n)}t.els[e.key]&&!n.querySelector(e.tag)&&n.querySelector("[data-widget-panel]").appendChild(t.els[e.key]);let s=!1;try{s=localStorage.getItem("plugin-studio:widget-open:"+e.key)==="1"}catch{}s&&this.openWidget(e,!0)}},openWidget(e,t){const n=this.widgetHost(e.widget).querySelector(`[data-widget="${e.key}"]`);if(!n){this.setupWidgets();return}const s=n.querySelector("[data-widget-panel]"),i=n.querySelector("[data-widget-bubble]");t?s.setAttribute("data-open",""):s.removeAttribute("data-open"),i.setAttribute("aria-expanded",t?"true":"false");try{localStorage.setItem("plugin-studio:widget-open:"+e.key,t?"1":"0")}catch{}const l=this.widgetStore();!t||l.els[e.key]||Ji(this.resolve(e.bundleJs)).then(()=>Xi(e.tag)).then(()=>{if(l.els[e.key])return;const a=document.createElement(e.tag);a.setAttribute("profile-config",JSON.stringify(this.paneConfig(e,this.locale))),a.setAttribute("variant","widget"),this.base&&a.setAttribute("tree-base",this.base.replace(/\/+$/,"")),a.style.cssText="display:block;position:absolute;inset:0;width:100%;height:100%;overflow-y:auto;overscroll-behavior:contain;";const r=n.querySelector("[data-widget-bubble]"),d=r.querySelector("[data-wb-text]");a.addEventListener("recording",p=>{const f=!!(Array.isArray(p.detail)?p.detail[0]:p.detail);r.setAttribute("data-listening",f?"true":"false"),f?d.textContent="":(r.setAttribute("data-speaking","false"),d.textContent=r.getAttribute("aria-label"))}),a.addEventListener("activity",p=>{const f=(Array.isArray(p.detail)?p.detail[0]:p.detail)||{};if(r.getAttribute("data-listening")!=="true")return;r.setAttribute("data-speaking",f.speaking?"true":"false");const v=f.words||"";d.textContent=v.length>34?"…"+v.slice(-33):v}),l.els[e.key]=a,s.appendChild(a)}).catch(a=>{s.textContent=a&&a.message||String(a)})},mountElement(e){e.mounted=!0,e.state="loading";const t=this.resolve(e.bundleJs);Ji(t).then(()=>Xi(e.tag)).then(()=>{try{if(e.heavy&&this.activeKey!==e.key){e.mounted=!1,e.state="idle";return}const o=this._slots&&this._slots[e.key];if(!o){e.state="error",e.error="no slot";return}o.innerHTML="";const n=document.createElement(e.tag);n.setAttribute("profile-config",JSON.stringify(this.paneConfig(e,this.locale))),this.base&&n.setAttribute("tree-base",this.base.replace(/\/+$/,"")),n.style.cssText="display:block;position:absolute;inset:0;width:100%;height:100%;",o.appendChild(n),e.state="ready"}catch(o){e.state="error",e.error="mount failed: "+(o&&o.message||String(o))}}).catch(o=>{e.state="error",e.error=o&&o.message||String(o)})},copyText(e,t){const o=()=>{const n=t.textContent;t.textContent=this.tr("copied"),setTimeout(()=>{t.textContent=n},1200)};if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(e).then(o,()=>{});else try{const n=document.createElement("textarea");n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),o()}catch{}}}}),Dp={class:"ps-count"},Up={class:"ps-locale"},Rp=["aria-expanded","aria-label"],Wp={class:"ps-flag"},jp={class:"ps-locale-name"},zp={key:0,class:"ps-locale-menu",role:"listbox"},Bp=["aria-selected"],Kp=["onClick"],Vp={class:"ps-flag"},qp={class:"ps-locale-name"},Gp={class:"ps-locale-en"},Yp={class:"ps-locale ps-engine"},Jp=["aria-expanded","aria-label","title"],Xp={class:"ps-locale-name"},Zp=["aria-label"],Qp=["aria-selected"],ed=["onClick"],td={class:"ps-locale-name"},od={class:"ps-locale-en"},nd={class:"ps-token"},sd=["aria-expanded","title"],id={class:"ps-locale-name"},ld={class:"ps-token-head"},ad={class:"ps-token-label"},rd={class:"ps-token-label"},cd={class:"ps-token-row"},pd=["disabled"],dd={class:"ps-token-note"},ud=["title","aria-label"],fd={class:"ps-locale-name"},gd={key:0,class:"ps-toolbar"},hd={class:"ps-bar"},$d={class:"ps-bar-t"},bd={class:"ps-bar-sub"},md={key:0},_d=["aria-expanded"],vd={key:0,class:"ps-embed"},xd=["value"],kd=["title","aria-label"],yd={class:"ps-stage"},wd=["hidden"],Sd={key:0,class:"ps-hint"},Ld={key:1,class:"ps-hint err"},Nd={key:0,class:"ps-hint"};function Pd(e,t,o,n,s,i){const l=Fs("StudioTree"),a=Fs("VerticalTabsLayout");return L(),yo(a,{title:e.heading||e.tr("title"),dir:e.uiDir,"nav-label":e.tr("navLabel"),labels:{toggleList:e.tr("toggleList"),openViews:e.tr("openViews"),expandList:e.tr("expandList"),collapseList:e.tr("collapseList"),collapse:e.tr("collapse")},header:!e.headerHidden,active:e.activeKey,"onUpdate:active":e.select},{rail:ut(({collapsed:r,expand:d,pick:p})=>[me(l,{sections:e.treeSections,active:e.activeKey,collapsed:r,expand:d,pick:p,strings:{filterPlaceholder:e.tr("filterPlaceholder"),collapseAll:e.tr("collapseAll"),noMatch:e.tr("noMatch"),treeLabel:e.tr("navLabel"),openSection:e.tr("openSection"),part:e.tr("part")}},null,8,["sections","active","collapsed","expand","pick","strings"])]),brand:ut(()=>[...t[11]||(t[11]=[_("span",{class:"ps-logo","aria-hidden":"true"},[_("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#92b195","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M10 3v3M14 3v3M7 6h10v5a5 5 0 0 1-10 0V6Z"}),_("path",{d:"M12 16v5"})])],-1)])]),meta:ut(()=>[_("span",Dp,P(e.countLabel),1),_("span",Up,[_("button",{type:"button",class:"ps-locale-btn","aria-expanded":String(e.localeOpen),"aria-label":e.tr("changeLanguage"),onClick:t[0]||(t[0]=r=>{e.localeOpen=!e.localeOpen,e.engineOpen=!1,e.settingsOpen=!1})},[_("span",Wp,P(e.activeLang.flag),1),_("span",jp,P(e.activeLang.nativeName),1),t[12]||(t[12]=_("span",{class:"ps-dots","aria-hidden":"true"},"⋮",-1))],8,Rp),e.localeOpen?(L(),N("ul",zp,[(L(!0),N(G,null,Pe(e.switcherLangs,r=>(L(),N("li",{key:r.code,role:"option","aria-selected":String(r.code===e.locale)},[_("button",{type:"button",class:ge(["ps-locale-opt",{active:r.code===e.locale}]),onClick:d=>e.setLocale(r.code)},[_("span",Vp,P(r.flag),1),_("span",qp,P(r.nativeName),1),_("span",Gp,P(r.name),1)],10,Kp)],8,Bp))),128))])):Y("",!0)]),_("span",Yp,[_("button",{type:"button",class:"ps-locale-btn","aria-expanded":String(e.engineOpen),"aria-label":e.tr("mapEngine"),title:e.tr("mapEngine"),onClick:t[1]||(t[1]=r=>{e.engineOpen=!e.engineOpen,e.localeOpen=!1,e.settingsOpen=!1})},[t[13]||(t[13]=_("span",{"aria-hidden":"true"},"🗺",-1)),_("span",Xp,P(e.engineLabel),1),t[14]||(t[14]=_("span",{class:"ps-dots","aria-hidden":"true"},"⋮",-1))],8,Jp),e.engineOpen?(L(),N("ul",{key:0,class:"ps-locale-menu",role:"listbox","aria-label":e.tr("mapEngine")},[(L(!0),N(G,null,Pe(e.engines,r=>(L(),N("li",{key:r.id||"default",role:"option","aria-selected":String(r.id===e.userProvider)},[_("button",{type:"button",class:ge(["ps-locale-opt",{active:r.id===e.userProvider}]),onClick:d=>e.setProvider(r.id)},[_("span",td,P(r.label),1),_("span",od,P(r.note),1)],10,ed)],8,Qp))),128))],8,Zp)):Y("",!0)]),_("span",nd,[_("button",{type:"button",class:"ps-locale-btn ps-token-btn","aria-expanded":String(e.settingsOpen),title:e.tokenStatus,onClick:t[2]||(t[2]=r=>{e.settingsOpen=!e.settingsOpen,e.localeOpen=!1,e.engineOpen=!1})},[_("span",id,P(e.tr("mapboxToken")),1),_("span",{class:ge(["ps-token-dot","is-"+e.tokenSource]),"aria-hidden":"true"},null,2)],8,sd),e.settingsOpen?(L(),N("form",{key:0,class:"ps-token-panel",onSubmit:t[6]||(t[6]=Ti((...r)=>e.applyToken&&e.applyToken(...r),["prevent"]))},[_("p",ld,P(e.tr("mapToken")),1),_("label",ad,[Ke(P(e.tr("tokenPaste"))+" ",1),ft(_("input",{class:"ps-token-input","onUpdate:modelValue":t[3]||(t[3]=r=>e.tokenDraft=r),placeholder:"pk.eyJ…",autocomplete:"off",spellcheck:"false"},null,512),[[Mn,e.tokenDraft,void 0,{trim:!0}]])]),_("label",rd,[Ke(P(e.tr("tokenUrlLabel"))+" ",1),ft(_("input",{class:"ps-token-input","onUpdate:modelValue":t[4]||(t[4]=r=>e.urlDraft=r),type:"url",placeholder:"https://doxa.life/api/maps/token",autocomplete:"off",spellcheck:"false"},null,512),[[Mn,e.urlDraft,void 0,{trim:!0}]])]),_("div",cd,[_("button",{type:"submit",class:"ps-token-apply",disabled:e.tokenBusy},P(e.tr("tokenApply")),9,pd),_("button",{type:"button",class:"ps-token-clear",onClick:t[5]||(t[5]=(...r)=>e.clearToken&&e.clearToken(...r))},P(e.tr("tokenClear")),1)]),_("p",{class:ge(["ps-token-status",{err:!!e.tokenErr}]),role:"status"},P(e.tokenErr||e.tokenStatus),3),_("p",dd,P(e.tr("tokenStoredHere")),1)],32)):Y("",!0)]),_("button",{type:"button",class:"ps-locale-btn ps-hide-header",title:e.tr("hideHeader"),"aria-label":e.tr("hideHeader"),onClick:t[7]||(t[7]=r=>e.setHeaderHidden(!0))},[t[15]||(t[15]=_("span",{"aria-hidden":"true"},"⌃",-1)),_("span",fd,P(e.tr("hideHeader")),1)],8,ud)]),toolbar:ut(()=>[e.active?(L(),N("div",gd,[_("div",hd,[_("div",$d,[_("b",null,P(e.active.label),1),_("span",bd,[Ke(P(e.active.bundle)+" · <"+P(e.active.tag)+">",1),e.active.description?(L(),N("span",md," · "+P(e.active.description),1)):Y("",!0)])]),e.active.embed?(L(),N("button",{key:0,type:"button",class:"ps-btn","aria-expanded":String(e.embedOpen),onClick:t[8]||(t[8]=r=>e.embedOpen=!e.embedOpen)},P(e.tr("copyEmbed")),9,_d)):Y("",!0)]),e.embedOpen&&e.active.embed?(L(),N("div",vd,[_("label",null,[Ke(P(e.tr("scriptEmbed"))+" ",1),_("button",{type:"button",class:"ps-btn",onClick:t[9]||(t[9]=r=>e.copyText(e.active.embed,r.target))},P(e.tr("copy")),1)]),_("textarea",{readonly:"",value:e.active.embed},null,8,xd)])):Y("",!0)])):Y("",!0)]),default:ut(()=>[e.headerHidden?(L(),N("button",{key:0,type:"button",class:"ps-show-header",title:e.tr("showHeader"),"aria-label":e.tr("showHeader"),onClick:t[10]||(t[10]=r=>e.setHeaderHidden(!1))},[t[16]||(t[16]=_("span",{"aria-hidden":"true"},"⌄",-1)),Ke(" "+P(e.tr("showHeader")),1)],8,kd)):Y("",!0),_("div",yd,[(L(!0),N(G,null,Pe(e.flatRows,r=>ft((L(),N("section",{key:r.key,class:"ps-pane",hidden:r.key!==e.activeKey},[!r.heavy||r.key===e.activeKey?(L(),N(G,{key:0},[_("div",{class:"ps-slot",ref_for:!0,ref:d=>e.setSlot(r.key,d)},null,512),r.state==="loading"?(L(),N("div",Sd,P(e.tr("loading",{name:r.label})),1)):r.state==="error"?(L(),N("div",Ld,[Ke(P(e.tr("couldNotLoad",{name:r.label})),1),t[17]||(t[17]=_("br",null,null,-1)),_("small",null,P(r.error),1)])):Y("",!0)],64)):Y("",!0)],8,wd)),[[Ln,r.key===e.activeKey]])),128)),e.activeKey?Y("",!0):(L(),N("div",Nd,P(e.tr("chooseElement")),1))])]),_:1},8,["title","dir","nav-label","labels","header","active","onUpdate:active"])}const Cd=An(Hp,[["render",Pd],["styles",[Cp]]]);function Ed(){try{const e=typeof document<"u"&&document.currentScript&&document.currentScript.src||"";return e?e.replace(/[^/]+\/[^/]+$/,"").replace(/\/+$/,"")+"/":""}catch{return""}}const Md=Ed(),Td=xr(Cd,{configureApp(e){e.provide("psTreeBase",Md)}});typeof customElements<"u"&&!customElements.get("plugin-studio")&&customElements.define("plugin-studio",Td)})(); +}`,Hp=''+''+""+''+"",Dp=bo({name:"PluginStudio",inheritAttrs:!1,components:{VerticalTabsLayout:Bc,StudioTree:wp},props:{treeBase:{type:String,default:""},profileConfig:{type:[String,Object],default:""},provider:{type:String,default:""},heading:{type:String,default:""},tokenUrl:{type:String,default:""},tk:{type:String,default:""}},setup(){return Tn(Mp,"plugin-studio"),{injectedBase:Et("psTreeBase","")}},data(){return{activeKey:"",embedOpen:!1,locale:this.initialLocale(),localeOpen:!1,settingsOpen:!1,headerHidden:mt(Vi)==="1",engineOpen:!1,userProvider:mt(qi),tokenBusy:!1,tokenErr:"",tokenDraft:mt(Oo),urlDraft:mt(Fo),userTk:mt(Oo),userTokenUrl:mt(Fo),fetchedTk:"",bakedTk:"",hostProvider:"",switcherLangs:To,rows:[],manifestBundles:[]}},computed:{cfg(){let e=this.profileConfig;if(typeof e=="string")try{e=e?JSON.parse(e):{}}catch{e={}}return e&&typeof e=="object"?e:{}},base(){const e=(this.treeBase||this.cfg.treeBase||this.injectedBase||"").trim();return e?e.replace(/\/+$/,"")+"/":""},flatRows(){return this.rows},groups(){const e={};for(const t of this.rows)(e[t.cap]=e[t.cap]||[]).push(t);return[5,4,3,2,1].filter(t=>e[t]&&e[t].length).map(t=>({cap:t,label:Tp[t]||"capability "+t,rows:e[t]}))},treeSections(){const e=new Map(this.compositionTrees.map(s=>[s.nodes[0].selects,s])),t=new Map;for(const s of this.rows)t.has(s.bundle)||t.set(s.bundle,[]),t.get(s.bundle).push(s);const o=[...t.entries()].map(([s,i])=>({bundle:s,rows:i,cap:Math.max(...i.map(l=>l.cap))}));return[5,4,3,2,1].map(s=>({cap:s,group:o.filter(i=>i.cap===s).sort((i,l)=>i.bundle.localeCompare(l.bundle))})).map(({cap:s,group:i})=>{if(!i.length)return null;const l=[],a=(r,d,p)=>{const f=e.get(r.key);if(l.push({id:r.key,parent:p,depth:d,label:r.label,desc:(r.stage==="production"?"":this.tr("stageExperimental")+" · ")+"cap "+r.cap+" · "+r.tag,icon:r.icon,target:r.key,canonical:!0,kids:f?f.nodes[0].kids:0,title:r.label+" · <"+r.tag+"> · CAP "+r.cap+" "+this.tr("cap"+r.cap)}),!f)return;const v=x=>x===0?r.key:r.key+">"+x;for(const x of f.nodes.slice(1))l.push({id:v(x.id),parent:v(x.ancestors[x.ancestors.length-1]),depth:d+x.depth,label:x.label,part:!!x.part,target:x.selects||"",canonical:!1,icon:x.part?"dots":In[x.cap]||"embed",desc:x.part?this.tr("noStandalone"):"cap "+x.cap+" · "+x.tag,kids:x.kids||0,title:x.part?x.label+" · "+this.tr("partOf",{name:r.label}):x.label+" · <"+x.tag+"> · CAP "+x.cap+" "+this.tr("cap"+x.cap)})};for(const r of i){const d=[...r.rows].sort((f,v)=>v.cap-f.cap||f.label.localeCompare(v.label));if(d.length===1){a(d[0],0,"");continue}const p="bundle:"+r.bundle;l.push({id:p,parent:"",depth:0,label:r.bundle,desc:this.tr("elementsCount",{n:d.length}),icon:"folder",target:d[0].key,canonical:!1,folder:!0,kids:d.length,title:r.bundle+" · plugin-designs/"+r.bundle+"/ · "+d.length+" "+this.tr("elements")});for(const f of d)a(f,1,p)}return{id:"cap-"+s,cap:s,label:this.tr("cap"+s),title:this.tr("cap"+s)+" · "+(Op[s]||""),icon:In[s]||"embed",nodes:l}}).filter(Boolean)},compositionTrees(){const e=[],t=(o,n,s,i,l)=>{const a=this.manifestBundles.find(v=>v.bundle===o.bundle),r=o.cap>=4&&a&&a.composes||[],d=[],p=[],f=new Set;for(const v of r){const x=this.resolveRef(v,o.bundle);if(!x){p.push(v);continue}x.key===o.key||f.has(x.key)||(f.add(x.key),d.push(x))}d.sort((v,x)=>x.cap-v.cap||v.label.localeCompare(x.label));for(const v of d){const x={id:i.length,label:v.label,tag:v.tag,cap:v.cap,selects:v.key,depth:n+1,ancestors:l,kids:0};i.push(x);const R=i.length;s.has(v.key)||t(v,n+1,new Set([...s,v.key]),i,[...l,x.id]),x.kids=i.filter((F,ee)=>ee>=R&&F.depth===n+2).length}for(const v of p)i.push({id:i.length,label:v,part:!0,selects:o.key,depth:n+1,ancestors:l,kids:0})};for(const o of this.manifestBundles){if(!o.composes||!o.composes.length||Ji.has(o.bundle))continue;const n=this.rows.find(i=>i.bundle===o.bundle);if(!n)continue;const s=[{id:0,label:n.label,tag:n.tag,cap:n.cap,selects:n.key,depth:0,ancestors:[]}];t(n,0,new Set([n.key]),s,[0]),s[0].kids=s.filter(i=>i.depth===1).length,s.length>1&&e.push({bundle:o.bundle,nodes:s})}return e},active(){return this.rows.find(e=>e.key===this.activeKey)||null},effectiveTk(){return this.userTk||this.fetchedTk||this.tk||this.cfg.tk||this.bakedTk||""},effectiveProvider(){const e=String(this.userProvider||this.provider||this.cfg.provider||"").toLowerCase().trim();return e==="maplibre"||e==="mapbox"?e:""},engines(){return[{id:"",label:this.tr("engineDefault"),note:""},{id:"mapbox",label:"Mapbox",note:this.tr("engineMapboxNote")},{id:"maplibre",label:"MapLibre",note:this.tr("engineMaplibreNote")}]},engineLabel(){return this.userProvider==="mapbox"?"Mapbox":this.userProvider==="maplibre"?"MapLibre":this.tr("engineDefault")},tokenSource(){return this.userTk?"yours":this.fetchedTk?"url":this.tk||this.cfg.tk||this.bakedTk?"built":"none"},tokenStatus(){return this.effectiveProvider==="maplibre"?this.tr("tokenNotNeeded"):this.tokenSource==="yours"?this.tr("tokenSourceYours"):this.tokenSource==="url"?this.tr("tokenSourceUrl",{url:this.userTokenUrl}):this.tokenSource==="built"?this.tr("tokenSourceBuilt"):this.tr("tokenSourceNone")},countLabel(){const e=new Set(this.rows.map(t=>t.bundle)).size;return this.tr("countLabel",{bundles:e,elements:this.rows.length})},activeLang(){return Sp(this.locale)||{code:this.locale,flag:"🌐",nativeName:this.locale}},uiDir(){return(this.activeLang&&this.activeLang.dir)==="rtl"?"rtl":"ltr"}},mounted(){this.bakedTk=typeof window<"u"&&window.MAP_TOKEN||"",this.hostProvider=typeof window<"u"&&typeof window.MAP_PROVIDER=="string"?window.MAP_PROVIDER:"",this.publishProvider(),this.userTk?this.publishToken():(this.userTokenUrl||this.tokenUrl||this.cfg.tokenUrl)&&this.fetchToken(this.userTokenUrl||this.tokenUrl||this.cfg.tokenUrl).then(e=>{e&&e!==this.fetchedTk&&(this.fetchedTk=e,this.publishToken(),this.remountPanes())}).catch(()=>{}),this.loadManifest()},methods:{async fetchToken(e){if(!/^https?:\/\//i.test(e))throw new Error("not an http(s) URL");let t;try{t=await fetch(e,{cache:"no-store",credentials:"same-origin"})}catch{throw new Error("the request was blocked or the server did not answer (cross-origin rules can do this)")}if(!t.ok)throw new Error("HTTP "+t.status);const o=(await t.text()).trim();let n=o;try{const s=JSON.parse(o);n=s&&(s.token||s.tk||s.accessToken)||(typeof s=="string"?s:"")}catch{}if(n=String(n||"").trim(),n.startsWith("sk."))throw new Error(this.tr("tokenSecret"));if(!n.startsWith("pk."))throw new Error(this.tr("tokenNotPk"));return n},async applyToken(){this.tokenErr="";const e=this.tokenDraft,t=this.urlDraft;if(e.startsWith("sk.")){this.tokenErr=this.tr("tokenSecret");return}if(e&&!e.startsWith("pk.")){this.tokenErr=this.tr("tokenNotPk");return}this.tokenBusy=!0;try{let o="";if(!e&&t)try{o=await this.fetchToken(t)}catch(n){this.tokenErr=this.tr("tokenUrlFailed",{why:n.message});return}this.userTk=e,this.userTokenUrl=e?"":t,this.fetchedTk=o,_t(Oo,this.userTk),_t(Fo,this.userTokenUrl),this.publishToken(),this.remountPanes(),this.settingsOpen=!1}finally{this.tokenBusy=!1}},setHeaderHidden(e){this.headerHidden=!!e,this.settingsOpen=!1,this.engineOpen=!1,this.localeOpen=!1,_t(Vi,e?"1":"")},setProvider(e){this.engineOpen=!1,e!==this.userProvider&&(this.userProvider=e,_t(qi,e),this.publishProvider(),this.remountPanes())},publishProvider(){typeof window>"u"||(this.effectiveProvider?window.MAP_PROVIDER=this.effectiveProvider:this.hostProvider?window.MAP_PROVIDER=this.hostProvider:"MAP_PROVIDER"in window&&delete window.MAP_PROVIDER)},clearToken(){this.tokenDraft="",this.urlDraft="",this.tokenErr="",this.userTk="",this.userTokenUrl="",this.fetchedTk="",_t(Oo,""),_t(Fo,""),this.publishToken(),this.remountPanes()},publishToken(){typeof window>"u"||(this.effectiveTk?(ji(this.effectiveTk),window.MAP_TOKEN!==this.effectiveTk&&(window.MAP_TOKEN=this.effectiveTk)):Pp())},remountPanes(){for(const t of this.rows)t.mounted&&this.releaseRow(t);const e=this.active;e&&this.$nextTick(()=>{this.activeKey===e.key&&this.mountElement(e)})},tr(e,t){const o=(this.locale||"en").split("-")[0];let n=(Io[this.locale]||{})[e]||(Io[o]||{})[e]||(Io.en||{})[e]||e;if(t)for(const s in t)n=n.split("{"+s+"}").join(String(t[s]));return n},resolveRef(e,t){return t&&this.rows.find(o=>o.key===t+"/"+e)||this.rows.find(o=>o.key===e)||this.rows.find(o=>o.tag===e)||this.rows.find(o=>o.bundle===e)||null},setSlot(e,t){t&&(this._slots=Object.assign(this._slots||{},{[e]:t}))},initialLocale(){let e=this.profileConfig;if(typeof e=="string")try{e=e?JSON.parse(e):{}}catch{e={}}let t="";try{const n=new URLSearchParams(window.location.search);t=n.get("lang")||n.get("locale")||""}catch{}const o=e&&(e.locale||e.lang)||t;return o?Fn(o):Lp()},paneConfig(e,t){const o={profile:e.profile,instanceId:"ps-"+e.key.replace(/\//g,"-"),locale:t};this.effectiveTk&&(o.tk=this.effectiveTk);const n=this.userTokenUrl||this.tokenUrl||this.cfg.tokenUrl;return n&&(o.tokenUrl=n),this.effectiveProvider&&(o.provider=this.effectiveProvider),this.base&&(o.treeBase=this.base),o},setLocale(e){this.locale=e,this.localeOpen=!1,Np(e);try{for(const t of this.rows){if(!t.mounted)continue;const o=this._slots&&this._slots[t.key],n=o&&o.firstElementChild;n&&n.setAttribute&&n.setAttribute("profile-config",JSON.stringify(this.paneConfig(t,e)))}}catch{}},resolve(e){const t=String(e);if(/^(https?:)?\/\//.test(t)||t.startsWith("/"))return t;const o=t.replace(/^\.\//,"");return this.base?this.base.replace(/\/+$/,"")+"/"+o:"../"+o},loadManifest(){const e=o=>{this.manifestBundles=o&&o.bundles||[],this.rows=this.rowsFromManifest(o),this.setupWidgets(),this.route()},t=typeof window<"u"&&window.__psBaked||null;if(typeof fetch=="function"&&typeof location<"u"&&location.protocol!=="file:"){const o=this.base?this.resolve("manifest.json"):"../manifest.json";fetch(o,{cache:"no-cache"}).then(n=>n.ok?n.json():null).then(n=>e(n||t||{bundles:[]})).catch(()=>e(t||{bundles:[]}))}else e(t||{bundles:[]})},rowsFromManifest(e){const t=[];for(const o of e.bundles||[])if(!(o.bundle==="plugin-studio"||Ji.has(o.bundle)))for(const n of o.profiles||[]){const s=o.elements&&o.elements.length?o.elements:null,i=(n.element&&(!s||s.includes(n.element))?n.element:null)||s&&s[0]||n.element||o.bundle,l=Ap(n.type||"single"),a=Yi.has(i)||Yi.has(o.bundle)||n.heavy===!0;t.push({key:o.bundle+"/"+n.profile,bundle:o.bundle,stage:o.stage==="production"?"production":"experimental",label:Fp(o.bundle,n),profile:n.profile,tag:i,cap:l,icon:In[l]||"embed",description:n.description||"",widget:n.widget&&["bottom-right","bottom-left","top-right","top-left"].includes(n.widget.corner)?n.widget.corner:"",heavy:a,bundleJs:o.scriptUrl||o.bundle+"/"+o.bundle+".js",embed:n.embed&&n.embed.script||"",mounted:!1,state:"idle",error:""})}return t.sort((o,n)=>n.cap-o.cap||o.bundle.localeCompare(n.bundle)||o.label.localeCompare(n.label)),t},route(){const e=(typeof location<"u"&&location.hash||"").replace(/^#\/?/,"");if(e&&this.rows.some(o=>o.key===e)){this.select(e);return}const t=this.readLastTab();if(t&&this.rows.some(o=>o.key===t)){this.select(t);return}this.rows.length&&this.select(this.rows[0].key)},storageKey(){return"dx-studio-tab:"+(typeof location<"u"&&location.pathname||"")},readLastTab(){try{return window.localStorage.getItem(this.storageKey())||""}catch{return""}},writeLastTab(e){try{window.localStorage.setItem(this.storageKey(),e)}catch{}},select(e){if(!this.rows.some(s=>s.key===e))return;const t=this.rows.find(s=>s.key===e);if(t&&t.widget){this.openWidget(t,!0);return}const o=this.activeKey;if(this.activeKey=e,this.embedOpen=!1,o&&o!==e){const s=this.rows.find(i=>i.key===o);s&&s.heavy&&s.mounted&&this.releaseRow(s)}const n=this.rows.find(s=>s.key===e);n&&(this.writeLastTab(e),n.mounted||this.$nextTick(()=>{this.activeKey===n.key&&this.mountElement(n)}))},releaseRow(e){try{const t=this._slots&&this._slots[e.key];t&&(t.innerHTML="")}catch{}this._slots&&delete this._slots[e.key],e.mounted=!1,e.state="idle",e.error=""},widgetStore(){return window.__doxaStudioWidgets||(window.__doxaStudioWidgets={hosts:{},els:{}}),window.__doxaStudioWidgets},widgetHost(e){const t=this.widgetStore();if(!document.getElementById("studio-widget-css")){const n=document.createElement("style");n.id="studio-widget-css",n.textContent=Ip,document.head.appendChild(n)}if(t.hosts[e]&&t.hosts[e].isConnected)return t.hosts[e];const o=document.createElement("div");return o.setAttribute("data-studio-widgets",e),document.body.appendChild(o),t.hosts[e]=o,o},setupWidgets(){for(const e of this.rows.filter(t=>t.widget)){const t=this.widgetStore(),o=this.widgetHost(e.widget);let n=o.querySelector(`[data-widget="${e.key}"]`);if(!n){n=document.createElement("div"),n.setAttribute("data-widget",e.key);const i=document.createElement("div");i.setAttribute("data-widget-panel","");const l=document.createElement("button");l.type="button",l.setAttribute("data-widget-bubble","");const a="widget:"+e.key,r=this.tr(a);l.setAttribute("aria-label",r!==a?r:e.label),l.title=l.getAttribute("aria-label"),l.setAttribute("aria-expanded","false"),l.innerHTML=Hp,l.querySelector("[data-wb-text]").textContent=l.getAttribute("aria-label"),l.addEventListener("click",()=>this.openWidget(e,!i.hasAttribute("data-open"))),n.appendChild(i),n.appendChild(l),o.appendChild(n)}t.els[e.key]&&!n.querySelector(e.tag)&&n.querySelector("[data-widget-panel]").appendChild(t.els[e.key]);let s=!1;try{s=localStorage.getItem("plugin-studio:widget-open:"+e.key)==="1"}catch{}s&&this.openWidget(e,!0)}},openWidget(e,t){const n=this.widgetHost(e.widget).querySelector(`[data-widget="${e.key}"]`);if(!n){this.setupWidgets();return}const s=n.querySelector("[data-widget-panel]"),i=n.querySelector("[data-widget-bubble]");t?s.setAttribute("data-open",""):s.removeAttribute("data-open"),i.setAttribute("aria-expanded",t?"true":"false");try{localStorage.setItem("plugin-studio:widget-open:"+e.key,t?"1":"0")}catch{}const l=this.widgetStore();!t||l.els[e.key]||Bi(this.resolve(e.bundleJs)).then(()=>Ki(e.tag)).then(()=>{if(l.els[e.key])return;const a=document.createElement(e.tag);a.setAttribute("profile-config",JSON.stringify(this.paneConfig(e,this.locale))),a.setAttribute("variant","widget"),this.base&&a.setAttribute("tree-base",this.base.replace(/\/+$/,"")),a.style.cssText="display:block;position:absolute;inset:0;width:100%;height:100%;overflow-y:auto;overscroll-behavior:contain;";const r=n.querySelector("[data-widget-bubble]"),d=r.querySelector("[data-wb-text]");a.addEventListener("recording",p=>{const f=!!(Array.isArray(p.detail)?p.detail[0]:p.detail);r.setAttribute("data-listening",f?"true":"false"),f?d.textContent="":(r.setAttribute("data-speaking","false"),d.textContent=r.getAttribute("aria-label"))}),a.addEventListener("activity",p=>{const f=(Array.isArray(p.detail)?p.detail[0]:p.detail)||{};if(r.getAttribute("data-listening")!=="true")return;r.setAttribute("data-speaking",f.speaking?"true":"false");const v=f.words||"";d.textContent=v.length>34?"…"+v.slice(-33):v}),l.els[e.key]=a,s.appendChild(a)}).catch(a=>{s.textContent=a&&a.message||String(a)})},mountElement(e){e.mounted=!0,e.state="loading";const t=this.resolve(e.bundleJs);Bi(t).then(()=>Ki(e.tag)).then(()=>{try{if(e.heavy&&this.activeKey!==e.key){e.mounted=!1,e.state="idle";return}const o=this._slots&&this._slots[e.key];if(!o){e.state="error",e.error="no slot";return}o.innerHTML="";const n=document.createElement(e.tag);n.setAttribute("profile-config",JSON.stringify(this.paneConfig(e,this.locale))),this.base&&n.setAttribute("tree-base",this.base.replace(/\/+$/,"")),n.style.cssText="display:block;position:absolute;inset:0;width:100%;height:100%;",o.appendChild(n),e.state="ready"}catch(o){e.state="error",e.error="mount failed: "+(o&&o.message||String(o))}}).catch(o=>{e.state="error",e.error=o&&o.message||String(o)})},copyText(e,t){const o=()=>{const n=t.textContent;t.textContent=this.tr("copied"),setTimeout(()=>{t.textContent=n},1200)};if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(e).then(o,()=>{});else try{const n=document.createElement("textarea");n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),o()}catch{}}}}),Up={class:"ps-count"},Rp={class:"ps-locale"},Wp=["aria-expanded","aria-label"],jp={class:"ps-flag"},zp={class:"ps-locale-name"},Bp={key:0,class:"ps-locale-menu",role:"listbox"},Kp=["aria-selected"],Vp=["onClick"],qp={class:"ps-flag"},Gp={class:"ps-locale-name"},Yp={class:"ps-locale-en"},Jp={class:"ps-locale ps-engine"},Xp=["aria-expanded","aria-label","title"],Zp={class:"ps-locale-name"},Qp=["aria-label"],ed=["aria-selected"],td=["onClick"],od={class:"ps-locale-name"},nd={class:"ps-locale-en"},sd={class:"ps-token"},id=["aria-expanded","title"],ld={class:"ps-locale-name"},ad={class:"ps-token-head"},rd={class:"ps-token-label"},cd={class:"ps-token-label"},pd={class:"ps-token-row"},dd=["disabled"],ud={class:"ps-token-note"},fd=["title","aria-label"],gd={class:"ps-locale-name"},hd={key:0,class:"ps-toolbar"},$d={class:"ps-bar"},bd={class:"ps-bar-t"},md={class:"ps-bar-sub"},_d={key:0},vd=["aria-expanded"],xd={key:0,class:"ps-embed"},kd=["value"],yd=["title","aria-label"],wd={class:"ps-stage"},Sd=["hidden"],Ld={key:0,class:"ps-hint"},Nd={key:1,class:"ps-hint err"},Pd={key:0,class:"ps-hint"};function Cd(e,t,o,n,s,i){const l=Fs("StudioTree"),a=Fs("VerticalTabsLayout");return L(),yo(a,{title:e.heading||e.tr("title"),dir:e.uiDir,"nav-label":e.tr("navLabel"),labels:{toggleList:e.tr("toggleList"),openViews:e.tr("openViews"),expandList:e.tr("expandList"),collapseList:e.tr("collapseList"),collapse:e.tr("collapse")},header:!e.headerHidden,active:e.activeKey,"onUpdate:active":e.select},{rail:ut(({collapsed:r,expand:d,pick:p})=>[me(l,{sections:e.treeSections,active:e.activeKey,collapsed:r,expand:d,pick:p,strings:{filterPlaceholder:e.tr("filterPlaceholder"),collapseAll:e.tr("collapseAll"),noMatch:e.tr("noMatch"),treeLabel:e.tr("navLabel"),openSection:e.tr("openSection"),part:e.tr("part")}},null,8,["sections","active","collapsed","expand","pick","strings"])]),brand:ut(()=>[...t[11]||(t[11]=[_("span",{class:"ps-logo","aria-hidden":"true"},[_("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#92b195","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M10 3v3M14 3v3M7 6h10v5a5 5 0 0 1-10 0V6Z"}),_("path",{d:"M12 16v5"})])],-1)])]),meta:ut(()=>[_("span",Up,P(e.countLabel),1),_("span",Rp,[_("button",{type:"button",class:"ps-locale-btn","aria-expanded":String(e.localeOpen),"aria-label":e.tr("changeLanguage"),onClick:t[0]||(t[0]=r=>{e.localeOpen=!e.localeOpen,e.engineOpen=!1,e.settingsOpen=!1})},[_("span",jp,P(e.activeLang.flag),1),_("span",zp,P(e.activeLang.nativeName),1),t[12]||(t[12]=_("span",{class:"ps-dots","aria-hidden":"true"},"⋮",-1))],8,Wp),e.localeOpen?(L(),N("ul",Bp,[(L(!0),N(G,null,Pe(e.switcherLangs,r=>(L(),N("li",{key:r.code,role:"option","aria-selected":String(r.code===e.locale)},[_("button",{type:"button",class:ge(["ps-locale-opt",{active:r.code===e.locale}]),onClick:d=>e.setLocale(r.code)},[_("span",qp,P(r.flag),1),_("span",Gp,P(r.nativeName),1),_("span",Yp,P(r.name),1)],10,Vp)],8,Kp))),128))])):Y("",!0)]),_("span",Jp,[_("button",{type:"button",class:"ps-locale-btn","aria-expanded":String(e.engineOpen),"aria-label":e.tr("mapEngine"),title:e.tr("mapEngine"),onClick:t[1]||(t[1]=r=>{e.engineOpen=!e.engineOpen,e.localeOpen=!1,e.settingsOpen=!1})},[t[13]||(t[13]=_("span",{"aria-hidden":"true"},"🗺",-1)),_("span",Zp,P(e.engineLabel),1),t[14]||(t[14]=_("span",{class:"ps-dots","aria-hidden":"true"},"⋮",-1))],8,Xp),e.engineOpen?(L(),N("ul",{key:0,class:"ps-locale-menu",role:"listbox","aria-label":e.tr("mapEngine")},[(L(!0),N(G,null,Pe(e.engines,r=>(L(),N("li",{key:r.id||"default",role:"option","aria-selected":String(r.id===e.userProvider)},[_("button",{type:"button",class:ge(["ps-locale-opt",{active:r.id===e.userProvider}]),onClick:d=>e.setProvider(r.id)},[_("span",od,P(r.label),1),_("span",nd,P(r.note),1)],10,td)],8,ed))),128))],8,Qp)):Y("",!0)]),_("span",sd,[_("button",{type:"button",class:"ps-locale-btn ps-token-btn","aria-expanded":String(e.settingsOpen),title:e.tokenStatus,onClick:t[2]||(t[2]=r=>{e.settingsOpen=!e.settingsOpen,e.localeOpen=!1,e.engineOpen=!1})},[_("span",ld,P(e.tr("mapboxToken")),1),_("span",{class:ge(["ps-token-dot","is-"+e.tokenSource]),"aria-hidden":"true"},null,2)],8,id),e.settingsOpen?(L(),N("form",{key:0,class:"ps-token-panel",onSubmit:t[6]||(t[6]=Ti((...r)=>e.applyToken&&e.applyToken(...r),["prevent"]))},[_("p",ad,P(e.tr("mapToken")),1),_("label",rd,[Ke(P(e.tr("tokenPaste"))+" ",1),ft(_("input",{class:"ps-token-input","onUpdate:modelValue":t[3]||(t[3]=r=>e.tokenDraft=r),placeholder:"pk.eyJ…",autocomplete:"off",spellcheck:"false"},null,512),[[Mn,e.tokenDraft,void 0,{trim:!0}]])]),_("label",cd,[Ke(P(e.tr("tokenUrlLabel"))+" ",1),ft(_("input",{class:"ps-token-input","onUpdate:modelValue":t[4]||(t[4]=r=>e.urlDraft=r),type:"url",placeholder:"https://doxa.life/api/maps/token",autocomplete:"off",spellcheck:"false"},null,512),[[Mn,e.urlDraft,void 0,{trim:!0}]])]),_("div",pd,[_("button",{type:"submit",class:"ps-token-apply",disabled:e.tokenBusy},P(e.tr("tokenApply")),9,dd),_("button",{type:"button",class:"ps-token-clear",onClick:t[5]||(t[5]=(...r)=>e.clearToken&&e.clearToken(...r))},P(e.tr("tokenClear")),1)]),_("p",{class:ge(["ps-token-status",{err:!!e.tokenErr}]),role:"status"},P(e.tokenErr||e.tokenStatus),3),_("p",ud,P(e.tr("tokenStoredHere")),1)],32)):Y("",!0)]),_("button",{type:"button",class:"ps-locale-btn ps-hide-header",title:e.tr("hideHeader"),"aria-label":e.tr("hideHeader"),onClick:t[7]||(t[7]=r=>e.setHeaderHidden(!0))},[t[15]||(t[15]=_("span",{"aria-hidden":"true"},"⌃",-1)),_("span",gd,P(e.tr("hideHeader")),1)],8,fd)]),toolbar:ut(()=>[e.active?(L(),N("div",hd,[_("div",$d,[_("div",bd,[_("b",null,P(e.active.label),1),_("span",md,[Ke(P(e.active.bundle)+" · <"+P(e.active.tag)+">",1),e.active.description?(L(),N("span",_d," · "+P(e.active.description),1)):Y("",!0)])]),e.active.embed?(L(),N("button",{key:0,type:"button",class:"ps-btn","aria-expanded":String(e.embedOpen),onClick:t[8]||(t[8]=r=>e.embedOpen=!e.embedOpen)},P(e.tr("copyEmbed")),9,vd)):Y("",!0)]),e.embedOpen&&e.active.embed?(L(),N("div",xd,[_("label",null,[Ke(P(e.tr("scriptEmbed"))+" ",1),_("button",{type:"button",class:"ps-btn",onClick:t[9]||(t[9]=r=>e.copyText(e.active.embed,r.target))},P(e.tr("copy")),1)]),_("textarea",{readonly:"",value:e.active.embed},null,8,kd)])):Y("",!0)])):Y("",!0)]),default:ut(()=>[e.headerHidden?(L(),N("button",{key:0,type:"button",class:"ps-show-header",title:e.tr("showHeader"),"aria-label":e.tr("showHeader"),onClick:t[10]||(t[10]=r=>e.setHeaderHidden(!1))},[t[16]||(t[16]=_("span",{"aria-hidden":"true"},"⌄",-1)),Ke(" "+P(e.tr("showHeader")),1)],8,yd)):Y("",!0),_("div",wd,[(L(!0),N(G,null,Pe(e.flatRows,r=>ft((L(),N("section",{key:r.key,class:"ps-pane",hidden:r.key!==e.activeKey},[!r.heavy||r.key===e.activeKey?(L(),N(G,{key:0},[_("div",{class:"ps-slot",ref_for:!0,ref:d=>e.setSlot(r.key,d)},null,512),r.state==="loading"?(L(),N("div",Ld,P(e.tr("loading",{name:r.label})),1)):r.state==="error"?(L(),N("div",Nd,[Ke(P(e.tr("couldNotLoad",{name:r.label})),1),t[17]||(t[17]=_("br",null,null,-1)),_("small",null,P(r.error),1)])):Y("",!0)],64)):Y("",!0)],8,Sd)),[[Ln,r.key===e.activeKey]])),128)),e.activeKey?Y("",!0):(L(),N("div",Pd,P(e.tr("chooseElement")),1))])]),_:1},8,["title","dir","nav-label","labels","header","active","onUpdate:active"])}const Ed=An(Dp,[["render",Cd],["styles",[Ep]]]),Md=Cp(),Td=xr(Ed,{configureApp(e){e.provide("psTreeBase",Md)}});typeof customElements<"u"&&!customElements.get("plugin-studio")&&customElements.define("plugin-studio",Td)})(); diff --git a/public/dx-maps/plugin-studio/plugin-studio/index.html b/public/dx-maps/plugin-studio/plugin-studio/index.html index ddece84b2..b8d071c63 100644 --- a/public/dx-maps/plugin-studio/plugin-studio/index.html +++ b/public/dx-maps/plugin-studio/plugin-studio/index.html @@ -32,7 +32,7 @@ - + - +