@pie-players/pie-section-player 0.3.74 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +862 -866
- package/custom-elements.json +3922 -0
- package/dist/browser/assets/{evaluation-worker-DkU_wGh3.js → evaluation-worker-0xRDVTJx.js} +98934 -88735
- package/dist/browser/chunks/PUA-tLuTiQ7--f2b27953.js +1 -1
- package/dist/browser/chunks/ToolCoordinator-0a6c4088.js +1 -0
- package/dist/browser/chunks/accents-BTUYmhn9-cafeb96e.js +1 -1
- package/dist/browser/chunks/accents-b-i-CngHZsLL-e0eb98fd.js +1 -1
- package/dist/browser/chunks/arabic-BzEHMVZD-30ac1ade.js +1 -1
- package/dist/browser/chunks/arrows-VjxlU-jv-2e17c192.js +1 -1
- package/dist/browser/chunks/attribute-coercion-b93b482c.js +1 -0
- package/dist/browser/chunks/braille-BeWC_Ruq-a3bb8ef9.js +1 -1
- package/dist/browser/chunks/braille-d-Dk6J96GO-d832bfbf.js +1 -1
- package/dist/browser/chunks/browser-a3c32178.js +17 -16
- package/dist/browser/chunks/calculator-element-271c142f.js +11 -8
- package/dist/browser/chunks/calligraphic-Cew9cU3x-04cf0735.js +1 -1
- package/dist/browser/chunks/catalog-context-46d3e50e.js +1 -0
- package/dist/browser/chunks/catalog-owner-d602f784.js +1 -0
- package/dist/browser/chunks/cherokee-Cny3FYho-4da7d2f3.js +1 -1
- package/dist/browser/chunks/classPrivateFieldGet2-338e0179.js +1 -1
- package/dist/browser/chunks/classPrivateMethodInitSpec-563cd0a5.js +1 -0
- package/dist/browser/chunks/cyrillic-CfCDulXU-5550df0b.js +1 -1
- package/dist/browser/chunks/cyrillic-ss-lU7bNGG9-12eb0188.js +1 -1
- package/dist/browser/chunks/devanagari-CDIz2h-r-18c38725.js +1 -1
- package/dist/browser/chunks/dist-41b39e7f.js +1 -1
- package/dist/browser/chunks/dist-59132a53.js +1 -1
- package/dist/browser/chunks/dist-60d7afef.js +1 -1
- package/dist/browser/chunks/dist-ca9b9622.js +1 -1
- package/dist/browser/chunks/double-struck-BpJEQk8y-500ce8dd.js +1 -1
- package/dist/browser/chunks/focus-trap-44913bf3.js +1 -1
- package/dist/browser/chunks/fraktur-rLEq9DEH-44cc14d8.js +1 -1
- package/dist/browser/chunks/greek-BlraJTyL-90ce8924.js +1 -1
- package/dist/browser/chunks/greek-ss-D-EN2PK0-91610739.js +1 -1
- package/dist/browser/chunks/hebrew-GiQZeybp-b583f555.js +1 -1
- package/dist/browser/chunks/latin-b-BhEnC7R2-d13e06ff.js +1 -1
- package/dist/browser/chunks/latin-bi-DqiIKv3U-1dec8705.js +1 -1
- package/dist/browser/chunks/latin-i-B1xtwaE1-21637466.js +1 -1
- package/dist/browser/chunks/latin-xfWFlLkD-5bcea5cf.js +1 -1
- package/dist/browser/chunks/logger-8b07fb72.js +1 -1
- package/dist/browser/chunks/marrows-DD1NgMQi-15b63755.js +1 -1
- package/dist/browser/chunks/math-DpWn1mbG-38eeb914.js +1 -1
- package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
- package/dist/browser/chunks/{mathjax-D2JHb_R_-64780dc5.js → mathjax-BKrHE4xs-3ca05bf6.js} +41 -41
- package/dist/browser/chunks/monospace-D116QD2a-98d484fd.js +1 -1
- package/dist/browser/chunks/monospace-ex-DcXpouKS-456b403c.js +1 -1
- package/dist/browser/chunks/monospace-l-Ct5wkMDs-f34a4a9e.js +1 -1
- package/dist/browser/chunks/mshapes-DCp86WSX-c0055952.js +1 -1
- package/dist/browser/chunks/nl-NL-364d61b9.js +1 -1
- package/dist/browser/chunks/nl-NL-8b7e6d4b.js +1 -1
- package/dist/browser/chunks/phonetics-BwOCw2Y9-d2e3af59.js +1 -1
- package/dist/browser/chunks/phonetics-ss-CRtMn02f-579b6135.js +1 -1
- package/dist/browser/chunks/pie-api-client-687c319a.js +1 -1
- package/dist/browser/chunks/provider-4c704118.js +1 -1
- package/dist/browser/chunks/runtime-YFqnU6ic-d5c0cb49.js +8605 -0
- package/dist/browser/chunks/sans-serif-BYPZKlE9-2efdbcd9.js +1 -1
- package/dist/browser/chunks/sans-serif-b-B0kRKiC--b5530dce.js +1 -1
- package/dist/browser/chunks/sans-serif-bi-DXWul6mu-5370dba4.js +1 -1
- package/dist/browser/chunks/sans-serif-ex-Boux1kMP-aa178f31.js +1 -1
- package/dist/browser/chunks/sans-serif-i-676RFaSO-2db54474.js +1 -1
- package/dist/browser/chunks/sans-serif-r-DrN9xdZt-0fc72eea.js +1 -1
- package/dist/browser/chunks/script-0ohehnXc-526904f4.js +1 -1
- package/dist/browser/chunks/shapes-BG47NodJ-d59b0eca.js +1 -1
- package/dist/browser/chunks/{src-BcptuNS5-ed25d7fd.js → src-D_1goyPT-8cca0246.js} +81 -82
- package/dist/browser/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-0162a7a9.js} +18 -18
- package/dist/browser/chunks/sre-engine-ace23548.js +1 -0
- package/dist/browser/chunks/sre-engine-bj997w4b-891a4cbe.js +1 -0
- package/dist/browser/chunks/sre-locales-112320af.js +1 -0
- package/dist/browser/chunks/symbols-BqnUxf_t-83087e87.js +1 -1
- package/dist/browser/chunks/symbols-b-i-eg9k5hmF-9c461ac2.js +1 -1
- package/dist/browser/chunks/term-lookup-632cf6b1.js +1 -0
- package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +7 -6
- package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +6 -6
- package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
- package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
- package/dist/browser/chunks/tool-graph-cb0338e8.js +6 -6
- package/dist/browser/chunks/tool-host-contract-fae1c415.js +1 -0
- package/dist/browser/chunks/tool-instance-id-76ac45e2.js +1 -0
- package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
- package/dist/browser/chunks/tool-periodic-table-43b133b8.js +13 -16
- package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
- package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
- package/dist/browser/chunks/tool-ruler-1d9a03a6.js +12 -9
- package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +27 -33
- package/dist/browser/chunks/toolbar-registration-helpers-a7ab1ad4.js +194 -0
- package/dist/browser/chunks/variants-2LRNhOUP-966fc49d.js +1 -1
- package/dist/browser/pie-section-player.js +210 -100
- package/dist/chunks/nl-NL-364d61b9.js +35 -30
- package/dist/chunks/{sre-engine-wf9s43gg-f09289c5.js → sre-engine-bj997w4b-891a4cbe.js} +1 -1
- package/dist/component-definitions.d.ts +0 -2
- package/dist/components/shared/card-media-region.d.ts +3 -4
- package/dist/components/shared/composition.d.ts +3 -1
- package/dist/components/shared/framework-error-latch.d.ts +34 -0
- package/dist/components/shared/host-element.d.ts +10 -0
- package/dist/components/shared/kernel-host-default-body.d.ts +14 -0
- package/dist/components/shared/layout-host-methods.d.ts +12 -27
- package/dist/components/shared/missing-tool-providers.d.ts +6 -12
- package/dist/components/shared/player-preload.d.ts +4 -9
- package/dist/components/shared/section-player-backend-delivery.d.ts +1 -1
- package/dist/components/shared/section-player-card-context.d.ts +5 -4
- package/dist/components/shared/section-player-host-runtime.d.ts +32 -21
- package/dist/components/shared/section-player-layout-context.d.ts +77 -0
- package/dist/components/shared/section-player-own-event.d.ts +10 -0
- package/dist/components/shared/section-player-runtime-callbacks.d.ts +1 -1
- package/dist/components/shared/section-player-shell-layout.svelte.d.ts +3 -11
- package/dist/components/shared/section-player-view-state.d.ts +6 -2
- package/dist/components/shared/toolkit-ready-wait.d.ts +16 -0
- package/dist/contracts/host-hooks.d.ts +0 -7
- package/dist/contracts/runtime-host-contract.d.ts +0 -5
- package/dist/controllers/SectionController.d.ts +21 -6
- package/dist/controllers/types.d.ts +8 -1
- package/dist/item-section/index.d.ts +22 -0
- package/dist/item-section/index.js +37 -0
- package/dist/pie-section-player.d.ts +4 -6
- package/dist/pie-section-player.js +24965 -25463
- package/dist/policies/index.d.ts +1 -19
- package/dist/policies/index.js +6 -14
- package/dist/policies/types.d.ts +0 -4
- package/package.json +17 -55
- package/dist/browser/chunks/ToolCoordinator-cc2dc319.js +0 -1
- package/dist/browser/chunks/nds-icon-button-d602f784.js +0 -194
- package/dist/browser/chunks/pie-tool-calculator-cortex-0626bc24.js +0 -9
- package/dist/browser/chunks/pie-tool-calculator-geogebra-561236cb.js +0 -9
- package/dist/browser/chunks/runtime-C7H1jS4E-64772f5e.js +0 -8413
- package/dist/browser/chunks/tool-host-contract-b93b482c.js +0 -1
- package/dist/components/item-shell-element.d.ts +0 -1
- package/dist/components/shared/shell-registration.d.ts +0 -55
- package/dist/contracts/layout-contract.d.ts +0 -17
- package/dist/contracts/layout-contract.js +0 -0
- package/dist/contracts/layout-parity-metadata.d.ts +0 -4
- package/dist/contracts/layout-parity-metadata.js +0 -87
- package/dist/contracts/public-events.d.ts +0 -92
- package/dist/contracts/public-events.js +0 -12
- package/dist/policies/guards.d.ts +0 -2
- /package/dist/browser/chunks/{ItemToolBar-wr2myaah-2ce4b643.js → ItemToolBar-66hcwmfw-3bcb82a3.js} +0 -0
- /package/dist/chunks/{ItemToolBar-wr2myaah-1287ba31.js → ItemToolBar-66hcwmfw-1287ba31.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r as N,t as a}from"./classPrivateFieldGet2-338e0179.js";import{g as ml,n as wl,r as bl,t as yl}from"./tool-host-contract-b93b482c.js";import{r as _l,u as kl}from"./nds-icon-button-d602f784.js";import{i as xl}from"./provider-4c704118.js";var Ei="pie-tts-control-handoff",Ai,Ii,Kn,xt,gn,mn,an,mt,st,qt,Ie,Sr,$t,Ue,tt,Ln,cn,V,zr,ke,Un,Ne,Vt,se,xe,ce,$e,nt,wt,at,un,Vn,Jn,it,Tr,J,He,Xe,be,Lt,Pn,Dn,Mr,ot,Ae;typeof window<"u"&&((Ai=(Ii=window).__svelte??(Ii.__svelte={})).v??(Ai.v=new Set)).add("5");var Gt={},Y=Symbol("uninitialized"),$l="http://www.w3.org/1999/xhtml",Gi=Array.isArray,Sl=Array.prototype.indexOf,Lr=Array.prototype.includes,ar=Array.from,Xn=Object.keys,_n=Object.defineProperty,St=Object.getOwnPropertyDescriptor,Yi=Object.getOwnPropertyDescriptors,Tl=Object.prototype,Ml=Array.prototype,Yr=Object.getPrototypeOf,Ni=Object.isExtensible,El=()=>{};function Al(e){for(var t=0;t<e.length;t++)e[t]()}function Qi(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Te=1024,ze=2048,At=4096,Qr=8192,Il=16384,Xi=32768,Oi=1<<25,Xr=65536,Zt=1<<19,Nl=1<<20,wn=1<<25,Ci=1<<21,Ol=1<<22,Zn=1<<23,Tt=Symbol("$state"),Zi=Symbol("component"),eo=Symbol("legacy props"),Cl=Symbol(""),Pr=Symbol("attributes"),Dr=Symbol("class"),jr=Symbol("style"),Gn=Symbol("text"),Sn=new class extends Error{constructor(...e){super(...e),H(this,"name","StaleReactionError"),H(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Rl=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Wl(){console.warn("https://svelte.dev/e/derived_inert")}function cr(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function zl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var R=!1;function Oe(e){R=e}var L;function ue(e){if(e===null)throw cr(),Gt;return L=e}function ur(){return ue(Ge(L))}function Ht(e){if(R){if(Ge(L)!==null)throw cr(),Gt;L=e}}function Ll(e=1){if(R){for(var t=e,n=L;t--;)n=Ge(n);L=n}}function er(e=!0){for(var t=0,n=L;;){if(n.nodeType===8){var r=n.data;if(r==="]"){if(t===0)return n;--t}else(r==="["||r==="[!"||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Ge(n);e&&n.remove(),n=i}}function to(e){if(!e||e.nodeType!==8)throw cr(),Gt;return e.data}function no(e){return e===this.v}function ro(e,t){return e==e?e!==t||typeof e=="object"&&!!e||typeof e=="function":t==t}function io(e){return!ro(e,this.v)}function Pl(){throw Error("https://svelte.dev/e/async_derived_orphan")}function Dl(e,t,n){throw Error("https://svelte.dev/e/each_key_duplicate")}function jl(e){throw Error("https://svelte.dev/e/effect_in_teardown")}function Fl(){throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function ql(e){throw Error("https://svelte.dev/e/effect_orphan")}function Hl(){throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Bl(){throw Error("https://svelte.dev/e/hydration_failed")}function Kl(e){throw Error("https://svelte.dev/e/props_invalid_value")}function Ul(){throw Error("https://svelte.dev/e/state_descriptors_fixed")}function Vl(){throw Error("https://svelte.dev/e/state_prototype_fixed")}function Jl(){throw Error("https://svelte.dev/e/state_unsafe_mutation")}function Gl(){throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var re=null;function Yt(e){re=e}function oo(e,t=!1,n){re={p:re,i:!1,c:null,e:null,s:e,x:null,r:A,l:null}}function lo(e){var t=re,n=t.e;if(n!==null){t.e=null;for(var r of n)To(r)}return e!==void 0&&(t.x=e),t.i=!0,re=t.p,Zr(e)}function Zr(e={}){return _n(e,Zi,{value:!0}),e}function Tn(){return!0}var _t=[];function so(){var e=_t;_t=[],Al(e)}function ct(e){if(_t.length===0&&!bn){var t=_t;queueMicrotask(()=>{t===_t&&so()})}_t.push(e)}function Yl(){for(;_t.length>0;)so()}var Ql=~(ze|At|Te);function G(e,t){e.f=e.f&Ql|t}function ei(e){e.f&512||e.deps===null?G(e,Te):G(e,At)}function ao(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),G(e,Te)}function fr(e){var t=O,n=A;fe(null),Ee(null);try{return e()}finally{fe(t),Ee(n)}}function Xl(e,t,n,r){let i=Tn()?kn:ti;var o=e.filter(g=>!g.settled),s=t.map(i);if(n.length===0&&o.length===0){r(s);return}var u=A,f=Zl(),d=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(g=>g.promise)):null;function p(g){if(!(u.f&16384)){f();try{r([...s,...g])}catch(k){Je(k,u)}tr()}}var v=co();if(n.length===0){d.then(()=>p([])).finally(v);return}function m(){Promise.all(n.map(g=>es(g))).then(p).catch(g=>Je(g,u)).finally(v)}d?d.then(()=>{f(),m(),tr()}):m()}function Zl(){var e=A,t=O,n=re,r=E;return function(i=!0){Ee(e),fe(t),Yt(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function tr(e=!0){Ee(null),fe(null),Yt(null),e&&E?.deactivate()}function co(){var e=A,t=e.b,n=E,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function kn(e){var t=2|ze;return A!==null&&(A.f|=Zt),{ctx:re,deps:null,effects:null,equals:no,f:t,fn:e,reactions:null,rv:0,v:Y,wv:0,parent:A,ac:null}}var hn=Symbol("obsolete");function es(e,t,n){let r=A;r===null&&Pl();var i=void 0,o=Et(Y),s=!O,u=new Set;return gs(()=>{var f=A,d=Qi();i=d.promise;try{Promise.resolve(e()).then(d.resolve,g=>{g!==Sn&&d.reject(g)}).finally(tr)}catch(g){d.reject(g),tr()}var p=E;if(s){if(f.f&32768)var v=co();if(r.b?.is_rendered())p.async_deriveds.get(f)?.reject(hn);else for(let g of u.values())g.reject(hn);u.add(d),p.async_deriveds.set(f,d)}let m=(g,k=void 0)=>{v?.(),u.delete(d),k!==hn&&(p.activate(),k?(o.f|=Zn,Qt(o,k)):(o.f&8388608&&(o.f^=Zn),Qt(o,g)),p.deactivate())};d.promise.then(m,g=>m(null,g||"unknown"))}),hs(()=>{for(let f of u)f.reject(hn)}),new Promise(f=>{function d(p){function v(){p===i?f(o):d(i)}p.then(v,v)}d(i)})}function ne(e){let t=kn(e);return No(t),t}function ti(e){let t=kn(e);return t.equals=io,t}function ts(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ie(t[n])}}function ni(e){var t,n=A,r=e.parent;if(!rt&&r!==null&&e.v!==Y&&r.f&24576)return Wl(),e.v;Ee(r);try{ts(e),t=Wo(e)}finally{Ee(n)}return t}function uo(e){var t=ni(e);if(!e.equals(t)&&(e.wv=Co(),(!E?.is_fork||e.deps===null)&&(E===null?e.v=t:(E.capture(e,t,!0),Fr?.capture(e,t,!0)),e.deps===null))){G(e,Te);return}rt||(Ce===null?ei(e):(oi()||E?.is_fork)&&Ce.set(e,t))}function ns(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&fr(()=>{t.ac.abort(Sn),t.ac=null}),t.fn!==null&&(t.teardown=El),$n(t,0),ai(t))}function fo(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Xt(t)}var Bt=null,E=null,Fr=null,Ce=null,qr=null,bn=!1,Er=!1,xn=null,nr=null,ho=0,rs=1,en=(Kn=new WeakMap,xt=new WeakMap,gn=new WeakMap,mn=new WeakMap,an=new WeakMap,mt=new WeakMap,st=new WeakMap,qt=new WeakMap,Ie=new WeakMap,Sr=new WeakMap,$t=new WeakMap,Ue=new WeakMap,tt=new WeakMap,Ln=new WeakMap,cn=new WeakMap,V=new WeakSet,zr=class po{constructor(){Ji(this,V),H(this,"id",rs++),T(this,Kn,!1),H(this,"linked",!0),T(this,xt,null),T(this,gn,null),H(this,"async_deriveds",new Map),H(this,"current",new Map),H(this,"previous",new Map),T(this,mn,new Set),T(this,an,new Set),T(this,mt,0),T(this,st,new Map),T(this,qt,null),T(this,Ie,[]),T(this,Sr,[]),T(this,$t,new Set),T(this,Ue,new Set),T(this,tt,new Map),T(this,Ln,new Set),H(this,"is_fork",!1),T(this,cn,!1),Bt===null?Bt=this:($(gn,Bt,this),$(xt,this,Bt)),Bt=this}skip_effect(t){a(tt,this).has(t)||a(tt,this).set(t,{d:[],m:[]}),a(Ln,this).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=a(tt,this).get(t);if(r){a(tt,this).delete(t);for(var i of r.d)G(i,ze),n(i);for(i of r.m)G(i,At),n(i)}a(Ln,this).add(t)}capture(t,n,r=!1){t.v!==Y&&!this.previous.has(t)&&this.previous.set(t,t.v),t.f&8388608||(this.current.set(t,[n,r]),Ce?.set(t,n)),this.is_fork||(t.v=n)}activate(){E=this}deactivate(){E=null,Ce=null}flush(){try{Er=!0,E=this,N(V,this,rr).call(this)}finally{ho=0,qr=null,xn=null,nr=null,Er=!1,E=null,Ce=null,Ve.clear()}}discard(){for(let t of a(an,this))t(this);a(an,this).clear();for(let t of this.async_deriveds.values())t.reject(hn);N(V,this,ir).call(this),a(qt,this)?.resolve()}register_created_effect(t){a(Sr,this).push(t)}increment(t,n){if($(mt,this,a(mt,this)+1),t){let r=a(st,this).get(n)??0;a(st,this).set(n,r+1)}}decrement(t,n){var r;if($(mt,this,(r=a(mt,this),--r)),t){let i=a(st,this).get(n)??0;i===1?a(st,this).delete(n):a(st,this).set(n,i-1)}a(cn,this)||($(cn,this,!0),ct(()=>{$(cn,this,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(let r of t)a($t,this).add(r);for(let r of n)a(Ue,this).add(r);t.clear(),n.clear()}oncommit(t){a(mn,this).add(t)}ondiscard(t){a(an,this).add(t)}settled(){return(a(qt,this)??$(qt,this,Qi())).promise}static ensure(){if(E===null){let t=E=new po;!Er&&!bn&&ct(()=>{a(Kn,t)||t.flush()})}return E}apply(){Ce=null}schedule(t){if(qr=t,t.b?.is_pending&&t.f&16777228&&!(t.f&32768)){t.b.defer_effect(t);return}a(Ie,this).push(t)}},zr);function Ri(){if(this.is_fork)return!0;for(let n of a(st,this).keys()){for(var e=n,t=!1;e.parent!==null;){if(a(tt,this).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}function is(){var e=[];for(let i of a(Ie,this))if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=Te}}n||e.push(t)}return $(Ie,this,[]),e}function rr(){$(Kn,this,!0);for(let s of a($t,this))a(Ue,this).delete(s),G(s,ze),this.schedule(s);for(let s of a(Ue,this))G(s,At),this.schedule(s);this.apply();for(var e=xn=[],t=[],n=nr=[];a(Ie,this).length>0;){ho++>1e3&&(N(V,this,ir).call(this),as());for(let s of N(V,this,is).call(this))try{N(V,this,os).call(this,s,e,t)}catch(u){throw mo(s),N(V,this,Ri).call(this)||this.discard(),u}}if(E=null,n.length>0){var r=zr.ensure();for(let s of n)r.schedule(s)}if(xn=null,nr=null,N(V,this,Ri).call(this)){N(V,this,jn).call(this,t),N(V,this,jn).call(this,e);for(let[s,u]of a(tt,this))go(s,u);n.length>0&&N(V,E,rr).call(E);return}let i=N(V,this,ls).call(this);if(i){N(V,this,jn).call(this,t),N(V,this,jn).call(this,e),N(V,i,ss).call(i,this);return}a($t,this).clear(),a(Ue,this).clear();for(let s of a(mn,this))s(this);a(mn,this).clear(),Fr=this,Wi(t),Wi(e),Fr=null,a(qt,this)?.resolve();var o=E;if(a(mt,this)===0&&(a(Ie,this).length===0||o!==null)&&N(V,this,ir).call(this),a(Ie,this).length>0)if(o!==null){for(let s of a(Ie,this))a(Ie,o).push(s);$(Ie,this,[])}else o=this;o!==null&&(Ve.clear(),N(V,o,rr).call(o))}function os(e,t,n){e.f^=Te;for(var r=e.first;r!==null;){var i=r.f,o=!!(i&96);if(!(o&&i&1024||i&8192||a(tt,this).has(r))&&r.fn!==null){o?r.f^=Te:i&4?t.push(r):Mn(r)&&(i&16&&a(Ue,this).add(r),Xt(r));var s=r.first;if(s!==null){r=s;continue}}for(;r!==null;){var u=r.next;if(u!==null){r=u;break}r=r.parent}}}function ls(){for(var e=a(xt,this);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=a(xt,e)}return null}function ss(e){for(let[n,r]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,r);for(let[n,r]of e.async_deriveds){let i=this.async_deriveds.get(n);i&&r.promise.then(i.resolve).catch(i.reject)}e.async_deriveds.clear(),this.transfer_effects(a($t,e),a(Ue,e));let t=n=>{var r=n.reactions;if(r!==null&&!(n.f&2&&!(n.f&6144)))for(let s of r){var i=s.f;if(i&2)t(s);else{var o=s;i&4194320&&!this.async_deriveds.has(o)&&(a(Ue,this).delete(o),G(o,ze),this.schedule(o))}}};for(let n of this.current.keys())t(n);this.oncommit(()=>e.discard()),N(V,e,ir).call(e),E=this,N(V,this,rr).call(this)}function jn(e){for(var t=0;t<e.length;t+=1)ao(e[t],a($t,this),a(Ue,this))}function ir(){if(this.linked){var e=a(xt,this),t=a(gn,this);e===null||$(gn,e,t),t===null?Bt=e:$(xt,t,e),this.linked=!1}}function bt(e){var t=bn;bn=!0;try{var n;for(e&&(E!==null&&!E.is_fork&&E.flush(),n=e());;){if(Yl(),E===null)return n;E.flush()}}finally{bn=t}}function as(){try{Hl()}catch(e){Je(e,qr)}}var et=null;function Wi(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Mn(r)&&(et=new Set,Xt(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Eo(r),et?.size>0)){Ve.clear();for(let i of et){if(i.f&24576)continue;let o=[i],s=i.parent;for(;s!==null;)et.has(s)&&(et.delete(s),o.push(s)),s=s.parent;for(let u=o.length-1;u>=0;u--){let f=o[u];f.f&24576||Xt(f)}}et.clear()}}et=null}}function vo(e){E.schedule(e)}function go(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),G(e,Te);for(var n=e.first;n!==null;)go(n,t),n=n.next}}function mo(e){G(e,Te);for(var t=e.first;t!==null;)mo(t),t=t.next}var or=new Set,Ve=new Map,wo=!1;function Et(e,t){return{f:0,v:e,reactions:null,equals:no,rv:0,wv:0}}function F(e,t){let n=Et(e,t);return No(n),n}function bo(e,t=!1,n=!0){let r=Et(e);return t||(r.equals=io),r}function y(e,t,n=!1){return O!==null&&(!Re||O.f&131072)&&Tn()&&O.f&4325394&&(We===null||!We.has(e))&&Jl(),Qt(e,n?Kt(t):t,nr)}var yt=null,Hr=0;function Qt(e,t,n=null){if(!e.equals(t)){rt?Ve.set(e,t):Ve.has(e)||Ve.set(e,e.v);var r=en.ensure();if(r.capture(e,t),e.f&2){let i=e;e.f&2048&&ni(i),Ce===null&&ei(i)}e.wv=Co(),yt=null,Hr=0,yo(e,ze,n),yt=null,Tn()&&A!==null&&A.f&1024&&!(A.f&96)&&(_e===null?ys([e]):_e.push(e)),!r.is_fork&&or.size>0&&!wo&&cs()}return t}function cs(){wo=!1;for(let e of or){e.f&1024&&G(e,At);let t;try{t=Mn(e)}catch{t=!0}t&&Xt(e)}or.clear()}function yn(e){y(e,e.v+1)}function yo(e,t,n){var r=e.reactions;if(r!==null){var i=Tn(),o=r.length;if(Hr+=o,Hr>1e5&&yt===null&&(yt=new Set),yt!==null){if(yt.has(e))return;yt.add(e)}for(var s=0;s<o;s++){var u=r[s],f=u.f;if(i||u!==A){var d=(f&ze)===0;if(d&&G(u,t),f&131072)or.add(u);else if(f&2){var p=u;Ce?.delete(p),yo(p,At,n)}else if(d){var v=u;f&16&&et!==null&&et.add(v),n===null?vo(v):n.push(v)}}}}}function Kt(e){if(typeof e!="object"||!e||Tt in e||Zi in e)return e;let t=Yr(e);if(t!==Tl&&t!==Ml)return e;var n=new Map,r=Gi(e),i=F(0),o=null,s=Mt,u=f=>{if(Mt===s)return f();var d=O,p=Mt;fe(null),Pi(s);var v=f();return fe(d),Pi(p),v};return r&&n.set("length",F(e.length,o)),new Proxy(e,{defineProperty(f,d,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&Ul();var v=n.get(d);return v===void 0?u(()=>{var m=F(p.value,o);return n.set(d,m),m}):y(v,p.value,!0),!0},deleteProperty(f,d){var p=n.get(d);if(p===void 0){if(d in f){let v=u(()=>F(Y,o));n.set(d,v),yn(i)}}else y(p,Y),yn(i);return!0},get(f,d,p){if(d===Tt)return e;var v=n.get(d),m=d in f;if(v===void 0&&(!m||St(f,d)?.writable)&&(v=u(()=>F(Kt(m?f[d]:Y),o)),n.set(d,v)),v!==void 0){var g=l(v);return g===Y?void 0:g}return Reflect.get(f,d,p)},getOwnPropertyDescriptor(f,d){this.has?.(f,d);var p=Reflect.getOwnPropertyDescriptor(f,d),v=n.get(d);if(v!==void 0){var m=l(v);if(m===Y)return;if(p&&"value"in p)p.value=m;else return{enumerable:!0,configurable:!0,value:m,writable:!0}}return p},has(f,d){if(d===Tt)return!0;var p=n.get(d),v=p!==void 0&&p.v!==Y||Reflect.has(f,d);return(p!==void 0||A!==null&&(!v||St(f,d)?.writable))&&(p===void 0&&(p=u(()=>F(v?Kt(f[d]):Y,o)),n.set(d,p)),l(p)===Y)?!1:v},set(f,d,p,v){var m=n.get(d),g=d in f;if(r&&d==="length")for(var k=p;k<m.v;k+=1){var M=n.get(k+"");M===void 0?k in f&&(M=u(()=>F(Y,o)),n.set(k+"",M)):y(M,Y)}if(m===void 0)(!g||St(f,d)?.writable)&&(m=u(()=>F(void 0,o)),y(m,Kt(p)),n.set(d,m));else{g=m.v!==Y;var b=u(()=>Kt(p));y(m,b)}var _=Reflect.getOwnPropertyDescriptor(f,d);if(_?.set&&_.set.call(v,p),!g){if(r&&typeof d=="string"){var U=n.get("length"),K=Number(d);Number.isInteger(K)&&K>=U.v&&y(U,K+1)}yn(i)}return!0},ownKeys(f){l(i);var d=Reflect.ownKeys(f).filter(m=>{var g=n.get(m);return g===void 0||g.v!==Y});for(var[p,v]of n)v.v!==Y&&!(p in f)&&d.push(p);return d},setPrototypeOf(){Vl()}})}var zi,_o,ko,xo;function Br(){if(zi===void 0){zi=window,_o=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ko=St(t,"firstChild").get,xo=St(t,"nextSibling").get,Ni(e)&&(e[Dr]=void 0,e[Pr]=null,e[jr]=void 0,e.__e=void 0),Ni(n)&&(n[Gn]=void 0)}}function Se(e=""){return document.createTextNode(e)}function ut(e){return ko.call(e)}function Ge(e){return xo.call(e)}function pn(e,t){if(!R)return ut(e);var n=ut(L);if(n===null)n=L.appendChild(Se());else if(t&&n.nodeType!==3){var r=Se();return n?.before(r),ue(r),r}return t&&ii(n),ue(n),n}function Fn(e,t=!1){if(!R){var n=ut(e);return n instanceof Comment&&n.data===""?Ge(n):n}if(t){if(L?.nodeType!==3){var r=Se();return L?.before(r),ue(r),r}ii(L)}return L}function Ar(e,t=!1){if(!R)return ut(e);var n=pn(e,t);return Ht(e),n}function Pt(e,t=1,n=!1){let r=R?L:e;for(var i;t--;)i=r,r=Ge(r);if(!R)return r;if(n){if(r?.nodeType!==3){var o=Se();return r===null?i?.after(o):r.before(o),ue(o),o}ii(r)}return ue(r),r}function $o(e){e.textContent=""}function So(){return!1}function ri(e,t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ii(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function us(e){var t=A;if(t===null)return O.f|=Zn,e;if(!(t.f&32768)&&!(t.f&4))throw e;Je(e,t)}function Je(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}function fs(e){A===null&&(O===null&&ql(e),Fl()),rt&&jl(e)}function ds(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Ye(e,t){var n=A;n!==null&&n.f&8192&&(e|=Qr);var r={ctx:re,deps:null,nodes:null,f:e|ze|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};E?.register_created_effect(r);var i=r;if(e&4)xn===null?en.ensure().schedule(r):xn.push(r);else if(t!==null){try{Xt(r)}catch(s){throw ie(r),s}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=Xr))}if(i!==null&&(i.parent=n,n!==null&&ds(i,n),O!==null&&O.f&2&&!(e&64))){var o=O;(o.effects??(o.effects=[])).push(i)}return r}function oi(){return O!==null&&!Re}function hs(e){let t=Ye(8,null);return G(t,Te),t.teardown=e,t}function Ze(e){fs("$effect");var t=A.f;if(!O&&t&32&&re!==null&&!re.i){var n=re;(n.e??(n.e=[])).push(e)}else return To(e)}function To(e){return Ye(4|Nl,e)}function ps(e){en.ensure();let t=Ye(64|Zt,e);return()=>{ie(t)}}function vs(e){en.ensure();let t=Ye(64|Zt,e);return(n={})=>new Promise(r=>{n.outro?It(t,()=>{ie(t),r(void 0)}):(ie(t),r(void 0))})}function li(e){return Ye(4,e)}function gs(e){return Ye(Ol|Zt,e)}function dr(e,t=0){return Ye(8|t,e)}function Be(e,t=[],n=[],r=[]){Xl(r,t,n,i=>{Ye(8,()=>{e(...i.map(l))})})}function si(e,t=0){return Ye(16|t,e)}function Me(e){return Ye(32|Zt,e)}function Mo(e){var t=e.teardown;if(t!==null){let n=rt,r=O;Li(!0),fe(null);try{t.call(null)}catch(i){Je(i,e.parent)}finally{Li(n),fe(r)}}}function ai(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let i=n.ac;i!==null&&fr(()=>{i.abort(Sn)});var r=n.next;n.f&64?n.parent=null:ie(n,t),n=r}}function ms(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ie(t),t=n}}function ie(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(ws(e.nodes.start,e.nodes.end),n=!0),e.f|=Oi,ai(e,t&&!n),$n(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let o of r)o.stop();Mo(e),e.f^=Oi,e.f|=Il;var i=e.parent;i!==null&&i.first!==null&&Eo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ws(e,t){for(;e!==null;){var n=e===t?null:Ge(e);e.remove(),e=n}}function Eo(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function It(e,t,n=!0){var r=[];e.f|=256,Ao(e,r,!0);var i=()=>{n&&ie(e),t&&t()},o=r.length;if(o>0){var s=()=>--o||i();for(var u of r)u.out(s)}else i()}function Ao(e,t,n){if(!(e.f&8192)){e.f^=Qr;var r=e.nodes&&e.nodes.t;if(r!==null)for(let u of r)(u.is_global||n)&&t.push(u);for(var i=e.first;i!==null;){var o=i.next;if(!(i.f&64)){var s=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Ao(i,t,s?n:!1)}i=o}}}function lr(e){e.f&=-257,Io(e,!0)}function Io(e,t){if(!(e.f&256)&&e.f&8192){e.f^=Qr,e.f&1024||(G(e,ze),en.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Io(n,i?t:!1),n=r}var o=e.nodes&&e.nodes.t;if(o!==null)for(let s of o)(s.is_global||t)&&s.in()}}function ci(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Ge(n);t.append(n),n=i}}var bs=null,Yn=!1,rt=!1;function Li(e){rt=e}var O=null,Re=!1;function fe(e){O=e}var A=null;function Ee(e){A=e}var We=null;function No(e){O!==null&&(O.f&2097152||O.f&2)&&(We??(We=new Set)).add(e)}var ae=null,ve=0,_e=null;function ys(e){_e=e}var Oo=1,kt=0,Mt=kt;function Pi(e){Mt=e}function Co(){return++Oo}function Mn(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(Mn(o)&&uo(o),o.wv>e.wv)return!0}t&512&&Ce===null&&G(e,Te)}return!1}function Ro(e,t,n=!0){var r=e.reactions;if(r!==null&&!(We!==null&&We.has(e)))for(var i=0;i<r.length;i++){var o=r[i];o.f&2?Ro(o,t,!1):t===o&&(n?G(o,ze):o.f&1024&&G(o,At),vo(o))}}function Wo(e){var t=ae,n=ve,r=_e,i=O,o=We,s=re,u=Re,f=Mt,d=e.f;ae=null,ve=0,_e=null,O=d&96?null:e,We=null,Yt(e.ctx),Re=!1,Mt=++kt,e.ac!==null&&(fr(()=>{e.ac.abort(Sn)}),e.ac=null);try{e.f|=Ci;var p=e.fn,v=p();e.f|=Xi;var m=Di(e);if(Tn()&&_e!==null&&!Re&&m!==null&&!(e.f&6146))for(var g=0;g<_e.length;g++)Ro(_e[g],e);if(i!==null&&i!==e){if(kt++,i.deps!==null)for(let k=0;k<n;k+=1)i.deps[k].rv=kt;if(t!==null)for(let k of t)k.rv=kt;_e!==null&&(r===null?r=_e:r.push(..._e))}return e.f&8388608&&(e.f^=Zn),v}catch(k){return Di(e),us(k)}finally{e.f^=Ci,ae=t,ve=n,_e=r,O=i,We=o,Yt(s),Re=u,Mt=f}}function Di(e){var t=e.deps,n=E?.is_fork;if(ae!==null){var r,i;if(n||$n(e,ve),t!==null&&ve>0)for(t.length=ve+ae.length,i=0;i<ae.length;i++)t[ve+i]=ae[i];else e.deps=t=ae;if(oi()&&e.f&512)for(i=ve;i<t.length;i++)((r=t[i]).reactions??(r.reactions=[])).push(e)}else!n&&t!==null&&ve<t.length&&($n(e,ve),t.length=ve);return t}function _s(e,t){let n=t.reactions;if(n!==null){var r=Sl.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(ae===null||!Lr.call(ae,t))){var o=t;o.f&512&&(o.f^=512),o.v!==Y&&ei(o),o.ac!==null&&fr(()=>{o.ac.abort(Sn),o.ac=null,G(o,ze)}),ns(o),$n(o,0)}}function $n(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)_s(e,n[r])}function Xt(e){var t=e.f;if(!(t&16384)){G(e,Te);var n=A,r=Yn;A=e,Yn=!(t&96);try{t&16777232?ms(e):ai(e),Mo(e);var i=Wo(e);e.teardown=typeof i=="function"?i:null,e.wv=Oo}finally{Yn=r,A=n}}}function l(e){var t=!!(e.f&2);if(bs?.add(e),O!==null&&!Re&&!(A!==null&&A.f&16384)&&(We===null||!We.has(e))){var n=O.deps;if(O.f&2097152)e.rv<kt&&(e.rv=kt,ae===null&&n!==null&&n[ve]===e?ve++:ae===null?ae=[e]:ae.push(e));else{var r;(r=O).deps??(r.deps=[]),Lr.call(O.deps,e)||O.deps.push(e);var i=e.reactions;i===null?e.reactions=[O]:Lr.call(i,O)||i.push(O)}}if(rt&&Ve.has(e))return Ve.get(e);if(t){var o=e;if(rt){var s=o.v;return(!(o.f&1024)&&o.reactions!==null||Lo(o))&&(s=ni(o)),Ve.set(o,s),s}var u=!(o.f&512)&&!Re&&O!==null&&(Yn||!!(O.f&512)),f=(o.f&Xi)===0;Mn(o)&&(u&&(o.f|=512),uo(o)),u&&!f&&(fo(o),zo(o))}if(Ce?.has(e))return Ce.get(e);if(e.f&8388608)throw e.v;return e.v}function zo(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??(t.reactions=[])).push(e),t.f&2&&!(t.f&512)&&(fo(t),zo(t))}function Lo(e){if(e.v===Y)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ve.has(t)||t.f&2&&Lo(t))return!0;return!1}function hr(e){var t=Re;try{return Re=!0,e()}finally{Re=t}}function ks(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Tt in e)Kr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n=="object"&&n&&Tt in n&&Kr(n)}}}function Kr(e,t=new Set){if(typeof e=="object"&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{Kr(e[r],t)}catch{}let n=Yr(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let r=Yi(n);for(let i in r){let o=r[i].get;if(o)try{o.call(e)}catch{}}}}}var Ut=Symbol("events"),Po=new Set,Ur=new Set;function Ke(e,t,n){(t[Ut]??(t[Ut]={}))[e]=n}function xs(e){for(var t=0;t<e.length;t++)Po.add(e[t]);for(var n of Ur)n(e)}var Ir=null,Nr=!1;function ji(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;Ir=e,Nr||(Nr=!0,setTimeout(()=>{Nr=!1,Ir=null}));var s=0,u=Ir===e&&e[Ut];if(u){var f=i.indexOf(u);if(f!==-1&&(t===document||t===window)){e[Ut]=t;return}var d=i.indexOf(t);if(d===-1)return;f<=d&&(s=f)}if(o=i[s]||e.target,o!==t){_n(e,"currentTarget",{configurable:!0,get(){return o||n}});var p=O,v=A;fe(null),Ee(null);try{for(var m,g=[];o!==null&&o!==t;){try{var k=o[Ut]?.[r];k!=null&&(!o.disabled||e.target===o)&&k.call(o,e)}catch(M){m?g.push(M):m=M}if(e.cancelBubble)break;s++,o=s<i.length?i[s]:null}if(m){for(let M of g)queueMicrotask(()=>{throw M});throw m}}finally{e[Ut]=t,delete e.currentTarget,fe(p),Ee(v)}}}var $s=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Ss(e){return $s?.createHTML(e)??e}function Ts(e){var t=ri("template");return t.innerHTML=Ss(e.replaceAll("<!>","<!---->")),t.content}function Jt(e,t){var n=A;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function ft(e,t){var n=!!(t&1),r=!!(t&2),i,o=!e.startsWith("<!>");return()=>{if(R)return Jt(L,null),L;i===void 0&&(i=Ts(o?e:"<!>"+e),n||(i=ut(i)));var s=r||_o?document.importNode(i,!0):i.cloneNode(!0);if(n){var u=ut(s),f=s.lastChild;Jt(u,f)}else Jt(s,s);return s}}function Fi(){if(R)return Jt(L,null),L;var e=document.createDocumentFragment(),t=document.createComment(""),n=Se();return e.append(t,n),Jt(t,n),e}function ye(e,t){if(R){var n=A;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=L),ur();return}e!==null&&e.before(t)}[..."allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback".split(".")];var Ms=["touchstart","touchmove"];function Es(e){return Ms.includes(e)}function As(e){let t=0,n=Et(0),r;return()=>{oi()&&(l(n),dr(()=>(t===0&&(r=hr(()=>e(()=>yn(n)))),t+=1,()=>{ct(()=>{--t,t===0&&(r?.(),r=void 0,yn(n))})})))}}var Is=Xr|Zt;function Ns(e,t,n,r){new Os(e,t,n,r)}var Os=(ke=new WeakMap,Un=new WeakMap,Ne=new WeakMap,Vt=new WeakMap,se=new WeakMap,xe=new WeakMap,ce=new WeakMap,$e=new WeakMap,nt=new WeakMap,wt=new WeakMap,at=new WeakMap,un=new WeakMap,Vn=new WeakMap,Jn=new WeakMap,it=new WeakMap,Tr=new WeakMap,J=new WeakSet,class{constructor(e,t,n,r){Ji(this,J),H(this,"parent",void 0),H(this,"is_pending",!1),H(this,"transform_error",void 0),T(this,ke,void 0),T(this,Un,R?L:null),T(this,Ne,void 0),T(this,Vt,void 0),T(this,se,void 0),T(this,xe,null),T(this,ce,null),T(this,$e,null),T(this,nt,null),T(this,wt,0),T(this,at,0),T(this,un,!1),T(this,Vn,new Set),T(this,Jn,new Set),T(this,it,null),T(this,Tr,As(()=>($(it,this,Et(a(wt,this))),()=>{$(it,this,null)}))),$(ke,this,e),$(Ne,this,t),$(Vt,this,i=>{var o=A;o.b=this,o.f|=128,n(i)}),this.parent=A.b,this.transform_error=r??this.parent?.transform_error??(i=>i),$(se,this,si(()=>{if(R){let i=a(Un,this);ur();let o=i.data==="[!";if(i.data.startsWith("[?")){let s=JSON.parse(i.data.slice(2));N(J,this,Rs).call(this,s)}else o?N(J,this,Ws).call(this):N(J,this,Cs).call(this)}else N(J,this,jo).call(this)},Is)),R&&$(ke,this,L)}defer_effect(e){ao(e,a(Vn,this),a(Jn,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!a(Ne,this).pending}update_pending_count(e,t){N(J,this,Fo).call(this,e,t),$(wt,this,a(wt,this)+e),a(it,this)&&!a(un,this)&&($(un,this,!0),ct(()=>{$(un,this,!1),a(it,this)&&Qt(a(it,this),a(wt,this))}))}get_effect_pending(){return a(Tr,this).call(this),l(a(it,this))}error(e){if(!a(Ne,this).onerror&&!a(Ne,this).failed)throw e;E?.is_fork?(a(xe,this)&&E.skip_effect(a(xe,this)),a(ce,this)&&E.skip_effect(a(ce,this)),a($e,this)&&E.skip_effect(a($e,this)),E.oncommit(()=>{N(J,this,qi).call(this,e)})):N(J,this,qi).call(this,e)}});function Cs(){try{$(xe,this,Me(()=>a(Vt,this).call(this,a(ke,this))))}catch(e){this.error(e)}}function Rs(e){let t=a(Ne,this).failed,{reset:n,invoke_onerror:r}=N(J,this,Do).call(this,e);ct(r),t&&$($e,this,Me(()=>{t(a(ke,this),()=>e,()=>n)}))}function Do(e){var t=!1,n=!1;let r=()=>{if(t){zl();return}t=!0,n&&Gl(),a($e,this)!==null&&It(a($e,this),()=>{$($e,this,null)}),N(J,this,ui).call(this,()=>{N(J,this,jo).call(this)})};return{reset:r,invoke_onerror:()=>{try{n=!0,a(Ne,this).onerror?.(e,r),n=!1}catch(i){Je(i,a(se,this)&&a(se,this).parent)}}}}function Ws(){let e=a(Ne,this).pending;e&&(this.is_pending=!0,$(ce,this,Me(()=>e(a(ke,this)))),ct(()=>{var t=$(nt,this,document.createDocumentFragment()),n=Se(),r=!1;if(t.append(n),$(xe,this,N(J,this,ui).call(this,()=>{try{return Me(()=>a(Vt,this).call(this,n))}catch(i){try{this.error(i),r=!0}catch(o){Je(o,a(se,this).parent)}return null}})),a(xe,this)===null){$(nt,this,null),r&&N(J,this,sr).call(this,E);return}a(at,this)===0&&(a(ke,this).before(t),$(nt,this,null),It(a(ce,this),()=>{$(ce,this,null)}),N(J,this,sr).call(this,E))}))}function jo(){try{if(this.is_pending=this.has_pending_snippet(),$(at,this,0),$(wt,this,0),$(xe,this,Me(()=>{a(Vt,this).call(this,a(ke,this))})),a(at,this)>0){var e=$(nt,this,document.createDocumentFragment());ci(a(xe,this),e);let t=a(Ne,this).pending;$(ce,this,Me(()=>t(a(ke,this))))}else N(J,this,sr).call(this,E)}catch(t){this.error(t)}}function sr(e){this.is_pending=!1,e.transfer_effects(a(Vn,this),a(Jn,this))}function ui(e){var t=A,n=O,r=re;Ee(a(se,this)),fe(a(se,this)),Yt(a(se,this).ctx);try{return en.ensure(),e()}finally{Ee(t),fe(n),Yt(r)}}function Fo(e,t){if(!this.has_pending_snippet()){var n;this.parent&&N(J,n=this.parent,Fo).call(n,e,t);return}$(at,this,a(at,this)+e),a(at,this)===0&&(N(J,this,sr).call(this,t),a(ce,this)&&It(a(ce,this),()=>{$(ce,this,null)}),a(nt,this)&&$(nt,this,(a(ke,this).before(a(nt,this)),null)))}function qi(e){a(xe,this)&&$(xe,this,(ie(a(xe,this)),null)),a(ce,this)&&$(ce,this,(ie(a(ce,this)),null)),a($e,this)&&$($e,this,(ie(a($e,this)),null)),R&&(ue(a(Un,this)),Ll(),ue(er()));let t=a(Ne,this).failed,n=r=>{let{reset:i,invoke_onerror:o}=N(J,this,Do).call(this,r);o(),t&&$($e,this,N(J,this,ui).call(this,()=>{try{return Me(()=>{var s=A;s.b=this,s.f|=128,t(a(ke,this),()=>r,()=>i)})}catch(s){return Je(s,a(se,this).parent),null}}))};ct(()=>{var r;try{r=this.transform_error(e)}catch(i){Je(i,a(se,this)&&a(se,this).parent);return}typeof r=="object"&&r&&typeof r.then=="function"?r.then(n,i=>Je(i,a(se,this)&&a(se,this).parent)):n(r)})}function Hi(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[Gn]??(e[Gn]=e.nodeValue))&&(e[Gn]=n,e.nodeValue=`${n}`)}function qo(e,t){return Ho(e,t)}function zs(e,t){Br(),t.intro=t.intro??!1;let n=t.target,r=R,i=L;try{for(var o=ut(n);o&&(o.nodeType!==8||o.data!=="[");)o=Ge(o);if(!o)throw Gt;Oe(!0),ue(o);let s=Ho(e,{...t,anchor:o});return Oe(!1),s}catch(s){if(s instanceof Error&&s.message.split(`
|
|
2
|
-
`).some(
|
|
3
|
-
\r\f \v\uFEFF`];function
|
|
1
|
+
import{t as K}from"./defineProperty-a20a667d.js";import{i as M,n as x,r as W,t as a}from"./classPrivateFieldGet2-338e0179.js";import{t as Ii}from"./classPrivateMethodInitSpec-563cd0a5.js";import{t as cl}from"./attribute-coercion-b93b482c.js";import{r as ul,t as fl}from"./logger-8b07fb72.js";import{i as hl,n as dl,r as pl}from"./tool-host-contract-fae1c415.js";import{i as vl}from"./provider-4c704118.js";import{o as gl}from"./toolbar-registration-helpers-a7ab1ad4.js";import{i as _i,o as ml,r as bl,t as wl}from"./catalog-context-46d3e50e.js";var ki,xi,Kn,yt,pn,vn,on,vt,it,Lt,Ae,kr,_t,Be,Qe,Dn,ln,V,Cr,we,Vn,Ee,qt,le,ye,ae,_e,Xe,gt,ot,sn,Un,Jn,tt,xr,U,Ie,Ge,ge,Wt,Pn,jn,$r,nt,Te;typeof window<"u"&&((ki=(xi=window).__svelte??(xi.__svelte={})).v??(ki.v=new Set)).add("5");var Bt={},G=Symbol("uninitialized"),yl="http://www.w3.org/1999/xhtml",qi=Array.isArray,_l=Array.prototype.indexOf,Rr=Array.prototype.includes,ar=Array.from,Xn=Object.keys,wn=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,Hi=Object.getOwnPropertyDescriptors,kl=Object.prototype,xl=Array.prototype,Ur=Object.getPrototypeOf,$i=Object.isExtensible,$l=()=>{};function Sl(e){for(var t=0;t<e.length;t++)e[t]()}function Bi(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var xe=1024,Re=2048,Mt=4096,Jr=8192,Ml=16384,Ki=32768,Si=1<<25,Gr=65536,Jt=1<<19,Tl=1<<20,gn=1<<25,Mi=1<<21,Al=1<<22,Zn=1<<23,xt=Symbol("$state"),Vi=Symbol("component"),Ui=Symbol("legacy props"),El=Symbol(""),zr=Symbol("attributes"),Lr=Symbol("class"),Dr=Symbol("style"),Gn=Symbol("text"),xn=new class extends Error{constructor(...e){super(...e),K(this,"name","StaleReactionError"),K(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Ol=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Nl(){console.warn("https://svelte.dev/e/derived_inert")}function cr(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Wl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var z=!1;function Oe(e){z=e}var P;function ce(e){if(e===null)throw cr(),Bt;return P=e}function ur(){return ce(Ue(P))}function Dt(e){if(z){if(Ue(P)!==null)throw cr(),Bt;P=e}}function Cl(e=1){if(z){for(var t=e,n=P;t--;)n=Ue(n);P=n}}function er(e=!0){for(var t=0,n=P;;){if(n.nodeType===8){var r=n.data;if(r==="]"){if(t===0)return n;--t}else(r==="["||r==="[!"||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Ue(n);e&&n.remove(),n=i}}function Ji(e){if(!e||e.nodeType!==8)throw cr(),Bt;return e.data}function Gi(e){return e===this.v}function Yi(e,t){return e==e?e!==t||typeof e=="object"&&!!e||typeof e=="function":t==t}function Qi(e){return!Yi(e,this.v)}function Rl(){throw Error("https://svelte.dev/e/async_derived_orphan")}function zl(e,t,n){throw Error("https://svelte.dev/e/each_key_duplicate")}function Ll(e){throw Error("https://svelte.dev/e/effect_in_teardown")}function Dl(){throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function Pl(e){throw Error("https://svelte.dev/e/effect_orphan")}function jl(){throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Fl(){throw Error("https://svelte.dev/e/hydration_failed")}function Il(e){throw Error("https://svelte.dev/e/props_invalid_value")}function ql(){throw Error("https://svelte.dev/e/state_descriptors_fixed")}function Hl(){throw Error("https://svelte.dev/e/state_prototype_fixed")}function Bl(){throw Error("https://svelte.dev/e/state_unsafe_mutation")}function Kl(){throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var re=null;function Kt(e){re=e}function Xi(e,t=!1,n){re={p:re,i:!1,c:null,e:null,s:e,x:null,r:A,l:null}}function Zi(e){var t=re,n=t.e;if(n!==null){t.e=null;for(var r of n)wo(r)}return e!==void 0&&(t.x=e),t.i=!0,re=t.p,Yr(e)}function Yr(e={}){return wn(e,Vi,{value:!0}),e}function $n(){return!0}var bt=[];function eo(){var e=bt;bt=[],Sl(e)}function lt(e){if(bt.length===0&&!mn){var t=bt;queueMicrotask(()=>{t===bt&&eo()})}bt.push(e)}function Vl(){for(;bt.length>0;)eo()}var Ul=~(Re|Mt|xe);function J(e,t){e.f=e.f&Ul|t}function Qr(e){e.f&512||e.deps===null?J(e,xe):J(e,Mt)}function to(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),J(e,xe)}function fr(e){var t=C,n=A;ue(null),Se(null);try{return e()}finally{ue(t),Se(n)}}function Jl(e,t,n,r){let i=$n()?yn:Xr;var o=e.filter(g=>!g.settled),s=t.map(i);if(n.length===0&&o.length===0){r(s);return}var c=A,f=Gl(),h=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(g=>g.promise)):null;function p(g){if(!(c.f&16384)){f();try{r([...s,...g])}catch(k){Ve(k,c)}tr()}}var v=no();if(n.length===0){h.then(()=>p([])).finally(v);return}function m(){Promise.all(n.map(g=>Yl(g))).then(p).catch(g=>Ve(g,c)).finally(v)}h?h.then(()=>{f(),m(),tr()}):m()}function Gl(){var e=A,t=C,n=re,r=T;return function(i=!0){Se(e),ue(t),Kt(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function tr(e=!0){Se(null),ue(null),Kt(null),e&&T?.deactivate()}function no(){var e=A,t=e.b,n=T,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function yn(e){var t=2|Re;return A!==null&&(A.f|=Jt),{ctx:re,deps:null,effects:null,equals:Gi,f:t,fn:e,reactions:null,rv:0,v:G,wv:0,parent:A,ac:null}}var fn=Symbol("obsolete");function Yl(e,t,n){let r=A;r===null&&Rl();var i=void 0,o=St(G),s=!C,c=new Set;return hs(()=>{var f=A,h=Bi();i=h.promise;try{Promise.resolve(e()).then(h.resolve,g=>{g!==xn&&h.reject(g)}).finally(tr)}catch(g){h.reject(g),tr()}var p=T;if(s){if(f.f&32768)var v=no();if(r.b?.is_rendered())p.async_deriveds.get(f)?.reject(fn);else for(let g of c.values())g.reject(fn);c.add(h),p.async_deriveds.set(f,h)}let m=(g,k=void 0)=>{v?.(),c.delete(h),k!==fn&&(p.activate(),k?(o.f|=Zn,Vt(o,k)):(o.f&8388608&&(o.f^=Zn),Vt(o,g)),p.deactivate())};h.promise.then(m,g=>m(null,g||"unknown"))}),cs(()=>{for(let f of c)f.reject(fn)}),new Promise(f=>{function h(p){function v(){p===i?f(o):h(i)}p.then(v,v)}h(i)})}function ne(e){let t=yn(e);return $o(t),t}function Xr(e){let t=yn(e);return t.equals=Qi,t}function Ql(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ie(t[n])}}function Zr(e){var t,n=A,r=e.parent;if(!Ze&&r!==null&&e.v!==G&&r.f&24576)return Nl(),e.v;Se(r);try{Ql(e),t=Ao(e)}finally{Se(n)}return t}function ro(e){var t=Zr(e);if(!e.equals(t)&&(e.wv=Mo(),(!T?.is_fork||e.deps===null)&&(T===null?e.v=t:(T.capture(e,t,!0),Pr?.capture(e,t,!0)),e.deps===null))){J(e,xe);return}Ze||(Ne===null?Qr(e):(ni()||T?.is_fork)&&Ne.set(e,t))}function Xl(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&fr(()=>{t.ac.abort(xn),t.ac=null}),t.fn!==null&&(t.teardown=$l),kn(t,0),oi(t))}function io(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Ut(t)}var Pt=null,T=null,Pr=null,Ne=null,jr=null,mn=!1,Sr=!1,_n=null,nr=null,oo=0,Zl=1,Gt=(Kn=new WeakMap,yt=new WeakMap,pn=new WeakMap,vn=new WeakMap,on=new WeakMap,vt=new WeakMap,it=new WeakMap,Lt=new WeakMap,Ae=new WeakMap,kr=new WeakMap,_t=new WeakMap,Be=new WeakMap,Qe=new WeakMap,Dn=new WeakMap,ln=new WeakMap,V=new WeakSet,Cr=class lo{constructor(){Ii(this,V),K(this,"id",Zl++),M(this,Kn,!1),K(this,"linked",!0),M(this,yt,null),M(this,pn,null),K(this,"async_deriveds",new Map),K(this,"current",new Map),K(this,"previous",new Map),M(this,vn,new Set),M(this,on,new Set),M(this,vt,0),M(this,it,new Map),M(this,Lt,null),M(this,Ae,[]),M(this,kr,[]),M(this,_t,new Set),M(this,Be,new Set),M(this,Qe,new Map),M(this,Dn,new Set),K(this,"is_fork",!1),M(this,ln,!1),Pt===null?Pt=this:(x(pn,Pt,this),x(yt,this,Pt)),Pt=this}skip_effect(t){a(Qe,this).has(t)||a(Qe,this).set(t,{d:[],m:[]}),a(Dn,this).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=a(Qe,this).get(t);if(r){a(Qe,this).delete(t);for(var i of r.d)J(i,Re),n(i);for(i of r.m)J(i,Mt),n(i)}a(Dn,this).add(t)}capture(t,n,r=!1){t.v!==G&&!this.previous.has(t)&&this.previous.set(t,t.v),t.f&8388608||(this.current.set(t,[n,r]),Ne?.set(t,n)),this.is_fork||(t.v=n)}activate(){T=this}deactivate(){T=null,Ne=null}flush(){try{Sr=!0,T=this,W(V,this,rr).call(this)}finally{oo=0,jr=null,_n=null,nr=null,Sr=!1,T=null,Ne=null,Ke.clear()}}discard(){for(let t of a(on,this))t(this);a(on,this).clear();for(let t of this.async_deriveds.values())t.reject(fn);W(V,this,ir).call(this),a(Lt,this)?.resolve()}register_created_effect(t){a(kr,this).push(t)}increment(t,n){if(x(vt,this,a(vt,this)+1),t){let r=a(it,this).get(n)??0;a(it,this).set(n,r+1)}}decrement(t,n){var r;if(x(vt,this,(r=a(vt,this),--r)),t){let i=a(it,this).get(n)??0;i===1?a(it,this).delete(n):a(it,this).set(n,i-1)}a(ln,this)||(x(ln,this,!0),lt(()=>{x(ln,this,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(let r of t)a(_t,this).add(r);for(let r of n)a(Be,this).add(r);t.clear(),n.clear()}oncommit(t){a(vn,this).add(t)}ondiscard(t){a(on,this).add(t)}settled(){return(a(Lt,this)??x(Lt,this,Bi())).promise}static ensure(){if(T===null){let t=T=new lo;!Sr&&!mn&<(()=>{a(Kn,t)||t.flush()})}return T}apply(){Ne=null}schedule(t){if(jr=t,t.b?.is_pending&&t.f&16777228&&!(t.f&32768)){t.b.defer_effect(t);return}a(Ae,this).push(t)}},Cr);function Ti(){if(this.is_fork)return!0;for(let n of a(it,this).keys()){for(var e=n,t=!1;e.parent!==null;){if(a(Qe,this).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}function es(){var e=[];for(let i of a(Ae,this))if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=xe}}n||e.push(t)}return x(Ae,this,[]),e}function rr(){x(Kn,this,!0);for(let s of a(_t,this))a(Be,this).delete(s),J(s,Re),this.schedule(s);for(let s of a(Be,this))J(s,Mt),this.schedule(s);this.apply();for(var e=_n=[],t=[],n=nr=[];a(Ae,this).length>0;){oo++>1e3&&(W(V,this,ir).call(this),is());for(let s of W(V,this,es).call(this))try{W(V,this,ts).call(this,s,e,t)}catch(c){throw co(s),W(V,this,Ti).call(this)||this.discard(),c}}if(T=null,n.length>0){var r=Cr.ensure();for(let s of n)r.schedule(s)}if(_n=null,nr=null,W(V,this,Ti).call(this)){W(V,this,Fn).call(this,t),W(V,this,Fn).call(this,e);for(let[s,c]of a(Qe,this))ao(s,c);n.length>0&&W(V,T,rr).call(T);return}let i=W(V,this,ns).call(this);if(i){W(V,this,Fn).call(this,t),W(V,this,Fn).call(this,e),W(V,i,rs).call(i,this);return}a(_t,this).clear(),a(Be,this).clear();for(let s of a(vn,this))s(this);a(vn,this).clear(),Pr=this,Ai(t),Ai(e),Pr=null,a(Lt,this)?.resolve();var o=T;if(a(vt,this)===0&&(a(Ae,this).length===0||o!==null)&&W(V,this,ir).call(this),a(Ae,this).length>0)if(o!==null){for(let s of a(Ae,this))a(Ae,o).push(s);x(Ae,this,[])}else o=this;o!==null&&(Ke.clear(),W(V,o,rr).call(o))}function ts(e,t,n){e.f^=xe;for(var r=e.first;r!==null;){var i=r.f,o=!!(i&96);if(!(o&&i&1024||i&8192||a(Qe,this).has(r))&&r.fn!==null){o?r.f^=xe:i&4?t.push(r):Sn(r)&&(i&16&&a(Be,this).add(r),Ut(r));var s=r.first;if(s!==null){r=s;continue}}for(;r!==null;){var c=r.next;if(c!==null){r=c;break}r=r.parent}}}function ns(){for(var e=a(yt,this);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=a(yt,e)}return null}function rs(e){for(let[n,r]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,r);for(let[n,r]of e.async_deriveds){let i=this.async_deriveds.get(n);i&&r.promise.then(i.resolve).catch(i.reject)}e.async_deriveds.clear(),this.transfer_effects(a(_t,e),a(Be,e));let t=n=>{var r=n.reactions;if(r!==null&&!(n.f&2&&!(n.f&6144)))for(let s of r){var i=s.f;if(i&2)t(s);else{var o=s;i&4194320&&!this.async_deriveds.has(o)&&(a(Be,this).delete(o),J(o,Re),this.schedule(o))}}};for(let n of this.current.keys())t(n);this.oncommit(()=>e.discard()),W(V,e,ir).call(e),T=this,W(V,this,rr).call(this)}function Fn(e){for(var t=0;t<e.length;t+=1)to(e[t],a(_t,this),a(Be,this))}function ir(){if(this.linked){var e=a(yt,this),t=a(pn,this);e===null||x(pn,e,t),t===null?Pt=e:x(yt,t,e),this.linked=!1}}function jt(e){var t=mn;mn=!0;try{var n;for(e&&(T!==null&&!T.is_fork&&T.flush(),n=e());;){if(Vl(),T===null)return n;T.flush()}}finally{mn=t}}function is(){try{jl()}catch(e){Ve(e,jr)}}var Ye=null;function Ai(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Sn(r)&&(Ye=new Set,Ut(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&_o(r),Ye?.size>0)){Ke.clear();for(let i of Ye){if(i.f&24576)continue;let o=[i],s=i.parent;for(;s!==null;)Ye.has(s)&&(Ye.delete(s),o.push(s)),s=s.parent;for(let c=o.length-1;c>=0;c--){let f=o[c];f.f&24576||Ut(f)}}Ye.clear()}}Ye=null}}function so(e){T.schedule(e)}function ao(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),J(e,xe);for(var n=e.first;n!==null;)ao(n,t),n=n.next}}function co(e){J(e,xe);for(var t=e.first;t!==null;)co(t),t=t.next}var or=new Set,Ke=new Map,uo=!1;function St(e,t){return{f:0,v:e,reactions:null,equals:Gi,rv:0,wv:0}}function H(e,t){let n=St(e,t);return $o(n),n}function fo(e,t=!1,n=!0){let r=St(e);return t||(r.equals=Qi),r}function _(e,t,n=!1){return C!==null&&(!We||C.f&131072)&&$n()&&C.f&4325394&&(Ce===null||!Ce.has(e))&&Bl(),Vt(e,n?Ft(t):t,nr)}var mt=null,Fr=0;function Vt(e,t,n=null){if(!e.equals(t)){Ze?Ke.set(e,t):Ke.has(e)||Ke.set(e,e.v);var r=Gt.ensure();if(r.capture(e,t),e.f&2){let i=e;e.f&2048&&Zr(i),Ne===null&&Qr(i)}e.wv=Mo(),mt=null,Fr=0,ho(e,Re,n),mt=null,$n()&&A!==null&&A.f&1024&&!(A.f&96)&&(be===null?gs([e]):be.push(e)),!r.is_fork&&or.size>0&&!uo&&os()}return t}function os(){uo=!1;for(let e of or){e.f&1024&&J(e,Mt);let t;try{t=Sn(e)}catch{t=!0}t&&Ut(e)}or.clear()}function bn(e){_(e,e.v+1)}function ho(e,t,n){var r=e.reactions;if(r!==null){var i=$n(),o=r.length;if(Fr+=o,Fr>1e5&&mt===null&&(mt=new Set),mt!==null){if(mt.has(e))return;mt.add(e)}for(var s=0;s<o;s++){var c=r[s],f=c.f;if(i||c!==A){var h=(f&Re)===0;if(h&&J(c,t),f&131072)or.add(c);else if(f&2){var p=c;Ne?.delete(p),ho(p,Mt,n)}else if(h){var v=c;f&16&&Ye!==null&&Ye.add(v),n===null?so(v):n.push(v)}}}}}function Ft(e){if(typeof e!="object"||!e||xt in e||Vi in e)return e;let t=Ur(e);if(t!==kl&&t!==xl)return e;var n=new Map,r=qi(e),i=H(0),o=null,s=$t,c=f=>{if($t===s)return f();var h=C,p=$t;ue(null),Ni(s);var v=f();return ue(h),Ni(p),v};return r&&n.set("length",H(e.length,o)),new Proxy(e,{defineProperty(f,h,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&ql();var v=n.get(h);return v===void 0?c(()=>{var m=H(p.value,o);return n.set(h,m),m}):_(v,p.value,!0),!0},deleteProperty(f,h){var p=n.get(h);if(p===void 0){if(h in f){let v=c(()=>H(G,o));n.set(h,v),bn(i)}}else _(p,G),bn(i);return!0},get(f,h,p){if(h===xt)return e;var v=n.get(h),m=h in f;if(v===void 0&&(!m||kt(f,h)?.writable)&&(v=c(()=>H(Ft(m?f[h]:G),o)),n.set(h,v)),v!==void 0){var g=l(v);return g===G?void 0:g}return Reflect.get(f,h,p)},getOwnPropertyDescriptor(f,h){this.has?.(f,h);var p=Reflect.getOwnPropertyDescriptor(f,h),v=n.get(h);if(v!==void 0){var m=l(v);if(m===G)return;if(p&&"value"in p)p.value=m;else return{enumerable:!0,configurable:!0,value:m,writable:!0}}return p},has(f,h){if(h===xt)return!0;var p=n.get(h),v=p!==void 0&&p.v!==G||Reflect.has(f,h);return(p!==void 0||A!==null&&(!v||kt(f,h)?.writable))&&(p===void 0&&(p=c(()=>H(v?Ft(f[h]):G,o)),n.set(h,p)),l(p)===G)?!1:v},set(f,h,p,v){var m=n.get(h),g=h in f;if(r&&h==="length")for(var k=p;k<m.v;k+=1){var E=n.get(k+"");E===void 0?k in f&&(E=c(()=>H(G,o)),n.set(k+"",E)):_(E,G)}if(m===void 0)(!g||kt(f,h)?.writable)&&(m=c(()=>H(void 0,o)),_(m,Ft(p)),n.set(h,m));else{g=m.v!==G;var b=c(()=>Ft(p));_(m,b)}var w=Reflect.getOwnPropertyDescriptor(f,h);if(w?.set&&w.set.call(v,p),!g){if(r&&typeof h=="string"){var O=n.get("length"),j=Number(h);Number.isInteger(j)&&j>=O.v&&_(O,j+1)}bn(i)}return!0},ownKeys(f){l(i);var h=Reflect.ownKeys(f).filter(m=>{var g=n.get(m);return g===void 0||g.v!==G});for(var[p,v]of n)v.v!==G&&!(p in f)&&h.push(p);return h},setPrototypeOf(){Hl()}})}var Ei,po,vo,go;function Ir(){if(Ei===void 0){Ei=window,po=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;vo=kt(t,"firstChild").get,go=kt(t,"nextSibling").get,$i(e)&&(e[Lr]=void 0,e[zr]=null,e[Dr]=void 0,e.__e=void 0),$i(n)&&(n[Gn]=void 0)}}function ke(e=""){return document.createTextNode(e)}function st(e){return vo.call(e)}function Ue(e){return go.call(e)}function hn(e,t){if(!z)return st(e);var n=st(P);if(n===null)n=P.appendChild(ke());else if(t&&n.nodeType!==3){var r=ke();return n?.before(r),ce(r),r}return t&&ti(n),ce(n),n}function In(e,t=!1){if(!z){var n=st(e);return n instanceof Comment&&n.data===""?Ue(n):n}if(t){if(P?.nodeType!==3){var r=ke();return P?.before(r),ce(r),r}ti(P)}return P}function Mr(e,t=!1){if(!z)return st(e);var n=hn(e,t);return Dt(e),n}function Ct(e,t=1,n=!1){let r=z?P:e;for(var i;t--;)i=r,r=Ue(r);if(!z)return r;if(n){if(r?.nodeType!==3){var o=ke();return r===null?i?.after(o):r.before(o),ce(o),o}ti(r)}return ce(r),r}function mo(e){e.textContent=""}function bo(){return!1}function ei(e,t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ti(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function ls(e){var t=A;if(t===null)return C.f|=Zn,e;if(!(t.f&32768)&&!(t.f&4))throw e;Ve(e,t)}function Ve(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}function ss(e){A===null&&(C===null&&Pl(e),Dl()),Ze&&Ll(e)}function as(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Je(e,t){var n=A;n!==null&&n.f&8192&&(e|=Jr);var r={ctx:re,deps:null,nodes:null,f:e|Re|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};T?.register_created_effect(r);var i=r;if(e&4)_n===null?Gt.ensure().schedule(r):_n.push(r);else if(t!==null){try{Ut(r)}catch(s){throw ie(r),s}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=Gr))}if(i!==null&&(i.parent=n,n!==null&&as(i,n),C!==null&&C.f&2&&!(e&64))){var o=C;(o.effects??(o.effects=[])).push(i)}return r}function ni(){return C!==null&&!We}function cs(e){let t=Je(8,null);return J(t,xe),t.teardown=e,t}function pt(e){ss("$effect");var t=A.f;if(!C&&t&32&&re!==null&&!re.i){var n=re;(n.e??(n.e=[])).push(e)}else return wo(e)}function wo(e){return Je(4|Tl,e)}function us(e){Gt.ensure();let t=Je(64|Jt,e);return()=>{ie(t)}}function fs(e){Gt.ensure();let t=Je(64|Jt,e);return(n={})=>new Promise(r=>{n.outro?Tt(t,()=>{ie(t),r(void 0)}):(ie(t),r(void 0))})}function ri(e){return Je(4,e)}function hs(e){return Je(Al|Jt,e)}function hr(e,t=0){return Je(8|t,e)}function qe(e,t=[],n=[],r=[]){Jl(r,t,n,i=>{Je(8,()=>{e(...i.map(l))})})}function ii(e,t=0){return Je(16|t,e)}function $e(e){return Je(32|Jt,e)}function yo(e){var t=e.teardown;if(t!==null){let n=Ze,r=C;Oi(!0),ue(null);try{t.call(null)}catch(i){Ve(i,e.parent)}finally{Oi(n),ue(r)}}}function oi(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let i=n.ac;i!==null&&fr(()=>{i.abort(xn)});var r=n.next;n.f&64?n.parent=null:ie(n,t),n=r}}function ds(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ie(t),t=n}}function ie(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(ps(e.nodes.start,e.nodes.end),n=!0),e.f|=Si,oi(e,t&&!n),kn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let o of r)o.stop();yo(e),e.f^=Si,e.f|=Ml;var i=e.parent;i!==null&&i.first!==null&&_o(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ps(e,t){for(;e!==null;){var n=e===t?null:Ue(e);e.remove(),e=n}}function _o(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Tt(e,t,n=!0){var r=[];e.f|=256,ko(e,r,!0);var i=()=>{n&&ie(e),t&&t()},o=r.length;if(o>0){var s=()=>--o||i();for(var c of r)c.out(s)}else i()}function ko(e,t,n){if(!(e.f&8192)){e.f^=Jr;var r=e.nodes&&e.nodes.t;if(r!==null)for(let c of r)(c.is_global||n)&&t.push(c);for(var i=e.first;i!==null;){var o=i.next;if(!(i.f&64)){var s=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);ko(i,t,s?n:!1)}i=o}}}function lr(e){e.f&=-257,xo(e,!0)}function xo(e,t){if(!(e.f&256)&&e.f&8192){e.f^=Jr,e.f&1024||(J(e,Re),Gt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);xo(n,i?t:!1),n=r}var o=e.nodes&&e.nodes.t;if(o!==null)for(let s of o)(s.is_global||t)&&s.in()}}function li(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Ue(n);t.append(n),n=i}}var vs=null,Yn=!1,Ze=!1;function Oi(e){Ze=e}var C=null,We=!1;function ue(e){C=e}var A=null;function Se(e){A=e}var Ce=null;function $o(e){C!==null&&(C.f&2097152||C.f&2)&&(Ce??(Ce=new Set)).add(e)}var se=null,pe=0,be=null;function gs(e){be=e}var So=1,wt=0,$t=wt;function Ni(e){$t=e}function Mo(){return++So}function Sn(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(Sn(o)&&ro(o),o.wv>e.wv)return!0}t&512&&Ne===null&&J(e,xe)}return!1}function To(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ce!==null&&Ce.has(e)))for(var i=0;i<r.length;i++){var o=r[i];o.f&2?To(o,t,!1):t===o&&(n?J(o,Re):o.f&1024&&J(o,Mt),so(o))}}function Ao(e){var t=se,n=pe,r=be,i=C,o=Ce,s=re,c=We,f=$t,h=e.f;se=null,pe=0,be=null,C=h&96?null:e,Ce=null,Kt(e.ctx),We=!1,$t=++wt,e.ac!==null&&(fr(()=>{e.ac.abort(xn)}),e.ac=null);try{e.f|=Mi;var p=e.fn,v=p();e.f|=Ki;var m=Wi(e);if($n()&&be!==null&&!We&&m!==null&&!(e.f&6146))for(var g=0;g<be.length;g++)To(be[g],e);if(i!==null&&i!==e){if(wt++,i.deps!==null)for(let k=0;k<n;k+=1)i.deps[k].rv=wt;if(t!==null)for(let k of t)k.rv=wt;be!==null&&(r===null?r=be:r.push(...be))}return e.f&8388608&&(e.f^=Zn),v}catch(k){return Wi(e),ls(k)}finally{e.f^=Mi,se=t,pe=n,be=r,C=i,Ce=o,Kt(s),We=c,$t=f}}function Wi(e){var t=e.deps,n=T?.is_fork;if(se!==null){var r,i;if(n||kn(e,pe),t!==null&&pe>0)for(t.length=pe+se.length,i=0;i<se.length;i++)t[pe+i]=se[i];else e.deps=t=se;if(ni()&&e.f&512)for(i=pe;i<t.length;i++)((r=t[i]).reactions??(r.reactions=[])).push(e)}else!n&&t!==null&&pe<t.length&&(kn(e,pe),t.length=pe);return t}function ms(e,t){let n=t.reactions;if(n!==null){var r=_l.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(se===null||!Rr.call(se,t))){var o=t;o.f&512&&(o.f^=512),o.v!==G&&Qr(o),o.ac!==null&&fr(()=>{o.ac.abort(xn),o.ac=null,J(o,Re)}),Xl(o),kn(o,0)}}function kn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ms(e,n[r])}function Ut(e){var t=e.f;if(!(t&16384)){J(e,xe);var n=A,r=Yn;A=e,Yn=!(t&96);try{t&16777232?ds(e):oi(e),yo(e);var i=Ao(e);e.teardown=typeof i=="function"?i:null,e.wv=So}finally{Yn=r,A=n}}}function l(e){var t=!!(e.f&2);if(vs?.add(e),C!==null&&!We&&!(A!==null&&A.f&16384)&&(Ce===null||!Ce.has(e))){var n=C.deps;if(C.f&2097152)e.rv<wt&&(e.rv=wt,se===null&&n!==null&&n[pe]===e?pe++:se===null?se=[e]:se.push(e));else{var r;(r=C).deps??(r.deps=[]),Rr.call(C.deps,e)||C.deps.push(e);var i=e.reactions;i===null?e.reactions=[C]:Rr.call(i,C)||i.push(C)}}if(Ze&&Ke.has(e))return Ke.get(e);if(t){var o=e;if(Ze){var s=o.v;return(!(o.f&1024)&&o.reactions!==null||Oo(o))&&(s=Zr(o)),Ke.set(o,s),s}var c=!(o.f&512)&&!We&&C!==null&&(Yn||!!(C.f&512)),f=(o.f&Ki)===0;Sn(o)&&(c&&(o.f|=512),ro(o)),c&&!f&&(io(o),Eo(o))}if(Ne?.has(e))return Ne.get(e);if(e.f&8388608)throw e.v;return e.v}function Eo(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??(t.reactions=[])).push(e),t.f&2&&!(t.f&512)&&(io(t),Eo(t))}function Oo(e){if(e.v===G)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ke.has(t)||t.f&2&&Oo(t))return!0;return!1}function dr(e){var t=We;try{return We=!0,e()}finally{We=t}}function bs(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(xt in e)qr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n=="object"&&n&&xt in n&&qr(n)}}}function qr(e,t=new Set){if(typeof e=="object"&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{qr(e[r],t)}catch{}let n=Ur(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let r=Hi(n);for(let i in r){let o=r[i].get;if(o)try{o.call(e)}catch{}}}}}var It=Symbol("events"),No=new Set,Hr=new Set;function He(e,t,n){(t[It]??(t[It]={}))[e]=n}function ws(e){for(var t=0;t<e.length;t++)No.add(e[t]);for(var n of Hr)n(e)}var Tr=null,Ar=!1;function Ci(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;Tr=e,Ar||(Ar=!0,setTimeout(()=>{Ar=!1,Tr=null}));var s=0,c=Tr===e&&e[It];if(c){var f=i.indexOf(c);if(f!==-1&&(t===document||t===window)){e[It]=t;return}var h=i.indexOf(t);if(h===-1)return;f<=h&&(s=f)}if(o=i[s]||e.target,o!==t){wn(e,"currentTarget",{configurable:!0,get(){return o||n}});var p=C,v=A;ue(null),Se(null);try{for(var m,g=[];o!==null&&o!==t;){try{var k=o[It]?.[r];k!=null&&(!o.disabled||e.target===o)&&k.call(o,e)}catch(E){m?g.push(E):m=E}if(e.cancelBubble)break;s++,o=s<i.length?i[s]:null}if(m){for(let E of g)queueMicrotask(()=>{throw E});throw m}}finally{e[It]=t,delete e.currentTarget,ue(p),Se(v)}}}var ys=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function _s(e){return ys?.createHTML(e)??e}function ks(e){var t=ei("template");return t.innerHTML=_s(e.replaceAll("<!>","<!---->")),t.content}function Ht(e,t){var n=A;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function at(e,t){var n=!!(t&1),r=!!(t&2),i,o=!e.startsWith("<!>");return()=>{if(z)return Ht(P,null),P;i===void 0&&(i=ks(o?e:"<!>"+e),n||(i=st(i)));var s=r||po?document.importNode(i,!0):i.cloneNode(!0);if(n){var c=st(s),f=s.lastChild;Ht(c,f)}else Ht(s,s);return s}}function Ri(){if(z)return Ht(P,null),P;var e=document.createDocumentFragment(),t=document.createComment(""),n=ke();return e.append(t,n),Ht(t,n),e}function me(e,t){if(z){var n=A;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=P),ur();return}e!==null&&e.before(t)}[..."allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback".split(".")];var xs=["touchstart","touchmove"];function $s(e){return xs.includes(e)}function Ss(e){let t=0,n=St(0),r;return()=>{ni()&&(l(n),hr(()=>(t===0&&(r=dr(()=>e(()=>bn(n)))),t+=1,()=>{lt(()=>{--t,t===0&&(r?.(),r=void 0,bn(n))})})))}}var Ms=Gr|Jt;function Ts(e,t,n,r){new As(e,t,n,r)}var As=(we=new WeakMap,Vn=new WeakMap,Ee=new WeakMap,qt=new WeakMap,le=new WeakMap,ye=new WeakMap,ae=new WeakMap,_e=new WeakMap,Xe=new WeakMap,gt=new WeakMap,ot=new WeakMap,sn=new WeakMap,Un=new WeakMap,Jn=new WeakMap,tt=new WeakMap,xr=new WeakMap,U=new WeakSet,class{constructor(e,t,n,r){Ii(this,U),K(this,"parent",void 0),K(this,"is_pending",!1),K(this,"transform_error",void 0),M(this,we,void 0),M(this,Vn,z?P:null),M(this,Ee,void 0),M(this,qt,void 0),M(this,le,void 0),M(this,ye,null),M(this,ae,null),M(this,_e,null),M(this,Xe,null),M(this,gt,0),M(this,ot,0),M(this,sn,!1),M(this,Un,new Set),M(this,Jn,new Set),M(this,tt,null),M(this,xr,Ss(()=>(x(tt,this,St(a(gt,this))),()=>{x(tt,this,null)}))),x(we,this,e),x(Ee,this,t),x(qt,this,i=>{var o=A;o.b=this,o.f|=128,n(i)}),this.parent=A.b,this.transform_error=r??this.parent?.transform_error??(i=>i),x(le,this,ii(()=>{if(z){let i=a(Vn,this);ur();let o=i.data==="[!";if(i.data.startsWith("[?")){let s=JSON.parse(i.data.slice(2));W(U,this,Os).call(this,s)}else o?W(U,this,Ns).call(this):W(U,this,Es).call(this)}else W(U,this,Co).call(this)},Ms)),z&&x(we,this,P)}defer_effect(e){to(e,a(Un,this),a(Jn,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!a(Ee,this).pending}update_pending_count(e,t){W(U,this,Ro).call(this,e,t),x(gt,this,a(gt,this)+e),a(tt,this)&&!a(sn,this)&&(x(sn,this,!0),lt(()=>{x(sn,this,!1),a(tt,this)&&Vt(a(tt,this),a(gt,this))}))}get_effect_pending(){return a(xr,this).call(this),l(a(tt,this))}error(e){if(!a(Ee,this).onerror&&!a(Ee,this).failed)throw e;T?.is_fork?(a(ye,this)&&T.skip_effect(a(ye,this)),a(ae,this)&&T.skip_effect(a(ae,this)),a(_e,this)&&T.skip_effect(a(_e,this)),T.oncommit(()=>{W(U,this,zi).call(this,e)})):W(U,this,zi).call(this,e)}});function Es(){try{x(ye,this,$e(()=>a(qt,this).call(this,a(we,this))))}catch(e){this.error(e)}}function Os(e){let t=a(Ee,this).failed,{reset:n,invoke_onerror:r}=W(U,this,Wo).call(this,e);lt(r),t&&x(_e,this,$e(()=>{t(a(we,this),()=>e,()=>n)}))}function Wo(e){var t=!1,n=!1;let r=()=>{if(t){Wl();return}t=!0,n&&Kl(),a(_e,this)!==null&&Tt(a(_e,this),()=>{x(_e,this,null)}),W(U,this,si).call(this,()=>{W(U,this,Co).call(this)})};return{reset:r,invoke_onerror:()=>{try{n=!0,a(Ee,this).onerror?.(e,r),n=!1}catch(i){Ve(i,a(le,this)&&a(le,this).parent)}}}}function Ns(){let e=a(Ee,this).pending;e&&(this.is_pending=!0,x(ae,this,$e(()=>e(a(we,this)))),lt(()=>{var t=x(Xe,this,document.createDocumentFragment()),n=ke(),r=!1;if(t.append(n),x(ye,this,W(U,this,si).call(this,()=>{try{return $e(()=>a(qt,this).call(this,n))}catch(i){try{this.error(i),r=!0}catch(o){Ve(o,a(le,this).parent)}return null}})),a(ye,this)===null){x(Xe,this,null),r&&W(U,this,sr).call(this,T);return}a(ot,this)===0&&(a(we,this).before(t),x(Xe,this,null),Tt(a(ae,this),()=>{x(ae,this,null)}),W(U,this,sr).call(this,T))}))}function Co(){try{if(this.is_pending=this.has_pending_snippet(),x(ot,this,0),x(gt,this,0),x(ye,this,$e(()=>{a(qt,this).call(this,a(we,this))})),a(ot,this)>0){var e=x(Xe,this,document.createDocumentFragment());li(a(ye,this),e);let t=a(Ee,this).pending;x(ae,this,$e(()=>t(a(we,this))))}else W(U,this,sr).call(this,T)}catch(t){this.error(t)}}function sr(e){this.is_pending=!1,e.transfer_effects(a(Un,this),a(Jn,this))}function si(e){var t=A,n=C,r=re;Se(a(le,this)),ue(a(le,this)),Kt(a(le,this).ctx);try{return Gt.ensure(),e()}finally{Se(t),ue(n),Kt(r)}}function Ro(e,t){if(!this.has_pending_snippet()){var n;this.parent&&W(U,n=this.parent,Ro).call(n,e,t);return}x(ot,this,a(ot,this)+e),a(ot,this)===0&&(W(U,this,sr).call(this,t),a(ae,this)&&Tt(a(ae,this),()=>{x(ae,this,null)}),a(Xe,this)&&x(Xe,this,(a(we,this).before(a(Xe,this)),null)))}function zi(e){a(ye,this)&&x(ye,this,(ie(a(ye,this)),null)),a(ae,this)&&x(ae,this,(ie(a(ae,this)),null)),a(_e,this)&&x(_e,this,(ie(a(_e,this)),null)),z&&(ce(a(Vn,this)),Cl(),ce(er()));let t=a(Ee,this).failed,n=r=>{let{reset:i,invoke_onerror:o}=W(U,this,Wo).call(this,r);o(),t&&x(_e,this,W(U,this,si).call(this,()=>{try{return $e(()=>{var s=A;s.b=this,s.f|=128,t(a(we,this),()=>r,()=>i)})}catch(s){return Ve(s,a(le,this).parent),null}}))};lt(()=>{var r;try{r=this.transform_error(e)}catch(i){Ve(i,a(le,this)&&a(le,this).parent);return}typeof r=="object"&&r&&typeof r.then=="function"?r.then(n,i=>Ve(i,a(le,this)&&a(le,this).parent)):n(r)})}function Li(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[Gn]??(e[Gn]=e.nodeValue))&&(e[Gn]=n,e.nodeValue=`${n}`)}function zo(e,t){return Lo(e,t)}function Ws(e,t){Ir(),t.intro=t.intro??!1;let n=t.target,r=z,i=P;try{for(var o=st(n);o&&(o.nodeType!==8||o.data!=="[");)o=Ue(o);if(!o)throw Bt;Oe(!0),ce(o);let s=Lo(e,{...t,anchor:o});return Oe(!1),s}catch(s){if(s instanceof Error&&s.message.split(`
|
|
2
|
+
`).some(c=>c.startsWith("https://svelte.dev/e/")))throw s;return s!==Bt&&console.warn("Failed to hydrate: ",s),t.recover===!1&&Fl(),Ir(),mo(n),Oe(!1),zo(e,t)}finally{Oe(r),ce(i)}}var qn=new Map;function Lo(e,{target:t,anchor:n,props:r={},events:i,context:o,intro:s=!0,transformError:c}){Ir();var f=void 0,h=fs(()=>{var p=n??t.appendChild(ke());Ts(p,{pending:()=>{}},g=>{Xi({});var k=re;if(o&&(k.c=o),i&&(r.$$events=i),z&&Ht(g,null),f=e(g,r)||Yr(),z&&(A.nodes.end=P,P===null||P.nodeType!==8||P.data!=="]"))throw cr(),Bt;Zi()},c);var v=new Set,m=g=>{for(var k=0;k<g.length;k++){var E=g[k];if(!v.has(E)){v.add(E);var b=$s(E);for(let j of[t,document]){var w=qn.get(j);w===void 0&&(w=new Map,qn.set(j,w));var O=w.get(E);O===void 0?(j.addEventListener(E,Ci,{passive:b}),w.set(E,1)):w.set(E,O+1)}}}};return m(ar(No)),Hr.add(m),()=>{for(var g of v)for(let b of[t,document]){var k=qn.get(b),E=k.get(g);--E==0?(b.removeEventListener(g,Ci),k.delete(g),k.size===0&&qn.delete(b)):k.set(g,E)}Hr.delete(m),p!==n&&p.parentNode?.removeChild(p)}});return Br.set(f,h),f}var Br=new WeakMap;function Cs(e,t){let n=Br.get(e);return n?(Br.delete(e),n(t)):Promise.resolve()}var Rs=(Ie=new WeakMap,Ge=new WeakMap,ge=new WeakMap,Wt=new WeakMap,Pn=new WeakMap,jn=new WeakMap,$r=new WeakMap,class{constructor(e,t=!0){K(this,"anchor",void 0),M(this,Ie,new Map),M(this,Ge,new Map),M(this,ge,new Map),M(this,Wt,new Set),M(this,Pn,!0),M(this,jn,n=>{if(a(Ie,this).has(n)){var r=a(Ie,this).get(n),i=a(Ge,this).get(r);if(i)lr(i),a(Wt,this).delete(r);else{var o=a(ge,this).get(r);o&&(lr(o.effect),a(Ge,this).set(r,o.effect),a(ge,this).delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),i=o.effect)}for(let[s,c]of a(Ie,this)){if(a(Ie,this).delete(s),s===n)break;let f=a(ge,this).get(c);f&&(ie(f.effect),a(ge,this).delete(c))}for(let[s,c]of a(Ge,this)){if(s===r||a(Wt,this).has(s))continue;let f=()=>{if(Array.from(a(Ie,this).values()).includes(s)){var h=document.createDocumentFragment();li(c,h),h.append(ke()),a(ge,this).set(s,{effect:c,fragment:h})}else ie(c);a(Wt,this).delete(s),a(Ge,this).delete(s)};a(Pn,this)||!i?(a(Wt,this).add(s),Tt(c,f,!1)):f()}}}),M(this,$r,n=>{a(Ie,this).delete(n);let r=Array.from(a(Ie,this).values());for(let[i,o]of a(ge,this))r.includes(i)||(ie(o.effect),a(ge,this).delete(i))}),this.anchor=e,x(Pn,this,t)}ensure(e,t){var n=T,r=bo();if(t&&!a(Ge,this).has(e)&&!a(ge,this).has(e))if(r){var i=document.createDocumentFragment(),o=ke();i.append(o),a(ge,this).set(e,{effect:$e(()=>t(o)),fragment:i})}else a(Ge,this).set(e,$e(()=>t(this.anchor)));if(a(Ie,this).set(n,e),r){for(let[s,c]of a(Ge,this))s===e?n.unskip_effect(c):n.skip_effect(c);for(let[s,c]of a(ge,this))s===e?n.unskip_effect(c.effect):n.skip_effect(c.effect);n.oncommit(a(jn,this)),n.ondiscard(a($r,this))}else z&&(this.anchor=P),a(jn,this).call(this,n)}});function an(e,t,n=!1){var r;z&&(r=P,ur());var i=new Rs(e),o=n?Gr:0;function s(c,f){if(z){var h=Ji(r);if(c!==parseInt(h.substring(1))){var p=er();ce(p),i.anchor=p,Oe(!1),i.ensure(c,f),Oe(!0);return}}i.ensure(c,f)}ii(()=>{var c=!1;t((f,h=0)=>{c=!0,s(h,f)}),c||s(-1,null)},o)}function zs(e,t,n){for(var r=[],i=t.length,o,s=t.length,c=0;c<i;c++){let v=t[c];Tt(v,()=>{if(o){if(o.pending.delete(v),o.done.add(v),o.pending.size===0){var m=e.outrogroups;Kr(e,ar(o.done)),m.delete(o),m.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var f=r.length===0&&n!==null&&e.pending.size===0;if(f){var h=n,p=h.parentNode;mo(p),p.append(h),e.items.clear()}Kr(e,t,!f)}else o={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(o)}function Kr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let s of e.pending.values())for(let c of s)r.add(e.items.get(c).e)}for(var i=0;i<t.length;i++){var o=t[i];r?.has(o)?(o.f|=gn,li(o,document.createDocumentFragment())):ie(t[i],n)}}var Hn;function Ls(e,t,n,r,i,o=null){var s=e,c=new Map;if(t&4){var f=e;s=z?ce(st(f)):f.appendChild(ke())}z&&ur();var h=null,p=Xr(()=>{var w=n();return qi(w)?w:w==null?[]:ar(w)}),v,m=new Map,g=!0;function k(w){b.effect.f&16384||(b.pending.delete(w),b.fallback=h,Ds(b,v,s,t,r),h!==null&&(v.length===0?h.f&33554432?(h.f^=gn,dn(h,null,s)):lr(h):Tt(h,()=>{h=null})))}function E(w){b.pending.delete(w)}var b={effect:ii(()=>{v=l(p);var w=v.length;let O=!1;z&&Ji(s)==="[!"!=(w===0)&&(s=er(),ce(s),Oe(!1),O=!0);for(var j=new Set,L=T,R=bo(),B=0;B<w;B+=1){z&&P.nodeType===8&&P.data==="]"&&(s=P,O=!0,Oe(!1));var ee=v[B],I=r(ee,B),Z=g?null:c.get(I);Z?(Z.v&&Vt(Z.v,ee),Z.i&&Vt(Z.i,B),R&&L.unskip_effect(Z.e)):(Z=Ps(c,g?s:Hn??(Hn=ke()),ee,I,B,i,t,n),g||(Z.e.f|=gn),c.set(I,Z)),j.add(I)}if(w===0&&o&&!h&&(g?h=$e(()=>o(s)):(h=$e(()=>o(Hn??(Hn=ke()))),h.f|=gn)),w>j.size&&zl("","",""),z&&w>0&&ce(er()),!g)if(m.set(L,j),R){for(let[Me,te]of c)j.has(Me)||L.skip_effect(te.e);L.oncommit(k),L.ondiscard(E)}else k(L);O&&Oe(!0),l(p)}),flags:t,items:c,pending:m,outrogroups:null,fallback:h};g=!1,z&&(s=P)}function cn(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Ds(e,t,n,r,i){var o=!!(r&8),s=t.length,c=e.items,f=cn(e.effect.first),h,p=null,v,m=[],g=[],k,E,b,w;if(o)for(w=0;w<s;w+=1)k=t[w],E=i(k,w),b=c.get(E).e,b.f&33554432||(b.nodes?.a?.measure(),(v??(v=new Set)).add(b));for(w=0;w<s;w+=1){if(k=t[w],E=i(k,w),b=c.get(E).e,e.outrogroups!==null)for(let Me of e.outrogroups)Me.pending.delete(b),Me.done.delete(b);if(b.f&8192&&(lr(b),o&&(b.nodes?.a?.unfix(),(v??(v=new Set)).delete(b))),b.f&33554432)if(b.f^=gn,b===f)dn(b,null,n);else{var O=p?p.next:f;b===e.effect.last&&(e.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),rt(e,p,b),rt(e,b,O),dn(b,O,n),p=b,m=[],g=[],f=cn(p.next);continue}if(b!==f){if(h!==void 0&&h.has(b)){if(m.length<g.length){var j=g[0],L;p=j.prev;var R=m[0],B=m[m.length-1];for(L=0;L<m.length;L+=1)dn(m[L],j,n);for(L=0;L<g.length;L+=1)h.delete(g[L]);rt(e,R.prev,B.next),rt(e,p,R),rt(e,B,j),f=j,p=B,--w,m=[],g=[]}else h.delete(b),dn(b,f,n),rt(e,b.prev,b.next),rt(e,b,p===null?e.effect.first:p.next),rt(e,p,b),p=b;continue}for(m=[],g=[];f!==null&&f!==b;)(h??(h=new Set)).add(f),g.push(f),f=cn(f.next);if(f===null)continue}b.f&33554432||m.push(b),p=b,f=cn(b.next)}if(e.outrogroups!==null){for(let Me of e.outrogroups)Me.pending.size===0&&(Kr(e,ar(Me.done)),e.outrogroups?.delete(Me));e.outrogroups.size===0&&(e.outrogroups=null)}if(f!==null||h!==void 0){var ee=[];if(h!==void 0)for(b of h)b.f&8192||ee.push(b);for(;f!==null;)!(f.f&8192)&&f!==e.fallback&&ee.push(f),f=cn(f.next);var I=ee.length;if(I>0){var Z=r&4&&s===0?n:null;if(o){for(w=0;w<I;w+=1)ee[w].nodes?.a?.measure();for(w=0;w<I;w+=1)ee[w].nodes?.a?.fix()}zs(e,ee,Z)}}o&<(()=>{if(v!==void 0)for(b of v)b.nodes?.a?.apply()})}function Ps(e,t,n,r,i,o,s,c){var f=s&1?s&16?St(n):fo(n,!1,!1):null,h=s&2?St(i):null;return{v:f,i:h,e:$e(()=>(o(t,f??n,h??i,c),()=>{e.delete(r)}))}}function dn(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,o=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var s=Ue(r);if(o.before(r),r===i)return;r=s}}function rt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function js(e,t){ri(()=>{e=A?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){let i=ei("style");i.id=t.hash,i.textContent=t.code,r.appendChild(i)}})}function Er(e,t,n){ri(()=>{var r=dr(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,o={};hr(()=>{var s=n();bs(s),i&&Yi(o,s)&&(o=s,r.update(s))}),i=!0}if(r?.destroy)return()=>r.destroy()})}var Di=[...`
|
|
3
|
+
\r\f \v\uFEFF`];function Fs(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,s=0;(s=r.indexOf(i,s))>=0;){var c=s+o;(s===0||Di.includes(r[s-1]))&&(c===r.length||Di.includes(r[c]))?r=(s===0?"":r.substring(0,s))+r.substring(c+1):s=c}}return r===""?null:r}function Pi(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var o=e[i];o!=null&&o!==""&&(r+=" "+i+": "+o+n)}return r}function Or(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Is(e,t){if(t){var n="",r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,"").trim();var o=!1,s=0,c=!1,f=[];r&&f.push(...Object.keys(r).map(Or)),i&&f.push(...Object.keys(i).map(Or));var h=0,p=-1;let E=e.length;for(var v=0;v<E;v++){var m=e[v];if(c?m==="/"&&e[v-1]==="*"&&(c=!1):o?o===m&&(o=!1):m==="/"&&e[v+1]==="*"?c=!0:m==='"'||m==="'"?o=m:m==="("?s++:m===")"&&s--,!c&&o===!1&&s===0){if(m===":"&&p===-1)p=v;else if(m===";"||v===E-1){if(p!==-1){var g=Or(e.substring(h,p).trim());if(!f.includes(g)){m!==";"&&v++;var k=e.substring(h,v).trim();n+=" "+k+";"}}h=v+1,p=-1}}}}return r&&(n+=Pi(r)),i&&(n+=Pi(i,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function Rt(e,t,n,r,i,o){var s=e[Lr];if(z||s!==n||s===void 0){var c=Fs(n,r,o);(!z||c!==e.getAttribute("class"))&&(c==null?e.removeAttribute("class"):t?e.className=c:e.setAttribute("class",c)),e[Lr]=n}else if(o&&i!==o)for(var f in o){var h=!!o[f];(i==null||h!==!!i[f])&&e.classList.toggle(f,h)}return o}function Nr(e,t={},n,r){for(var i in n){var o=n[i];t[i]!==o&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,o,r))}}function qs(e,t,n,r){var i=e[Dr];if(z||i!==t){var o=Is(t,r);(!z||o!==e.getAttribute("style"))&&(o==null?e.removeAttribute("style"):e.style.cssText=o),e[Dr]=t}else r&&(Array.isArray(r)?(Nr(e,n?.[0],r[0]),Nr(e,n?.[1],r[1],"important")):Nr(e,n,r));return r}var Hs=Symbol("is custom element"),Bs=Symbol("is html"),Ks=Ol?"link":"LINK";function X(e,t,n,r){var i=Vs(e);z&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===Ks)||i[t]!==(i[t]=n)&&(t==="loading"&&(e[El]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Do(e).has(t)?e[t]=n:e.setAttribute(t,n))}function zt(e,t,n){var r=C,i=A;let o=z;z&&Oe(!1),ue(null),Se(null);try{t!=="style"&&(Vr.has(e.getAttribute("is")||e.nodeName)||!customElements||customElements.get(e.getAttribute("is")||e.nodeName.toLowerCase())?Do(e).has(t):n&&typeof n=="object")?e[t]=n:X(e,t,n==null?n:String(n))}finally{ue(r),Se(i),o&&Oe(!0)}}function Vs(e){return e[zr]??(e[zr]={[Hs]:e.nodeName.includes("-"),[Bs]:e.namespaceURI===yl})}var Vr=new Map;function Do(e){var t=e.getAttribute("is")||e.nodeName,n=Vr.get(t);if(n)return n;Vr.set(t,n=new Set);for(var r,i=e,o=Element.prototype;o!==i;){for(var s in r=Hi(i),r)r[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&n.add(s);i=Ur(i)}return n}function Wr(e,t){return e===t||e?.[xt]===t}function ji(e=Yr(),t,n,r){var i=re.r,o=A;return ri(()=>{var s,c;return hr(()=>{s=c,c=r?.()||[],dr(()=>{Wr(n(...c),e)||(t(e,...c),s&&Wr(n(...s),e)&&t(null,...s))})}),()=>{let f=o;for(;f!==i&&f.parent!==null&&f.parent.f&33554432;)f=f.parent;let h=()=>{c&&Wr(n(...c),e)&&t(null,...c)},p=f.teardown;f.teardown=()=>{h(),p?.()}}}),e}var Bn=!1;function Us(e){var t=Bn;try{return Bn=!1,[e(),Bn]}finally{Bn=t}}function un(e,t,n,r){var i=!0,o=!!(n&8),s=!!(n&16),c=r,f=!0,h=void 0,p=()=>s&&i?(h??(h=yn(r)),l(h)):(f&&(f=!1,c=s?dr(r):r),c);let v;if(o){var m=xt in e||Ui in e;v=kt(e,t)?.set??(m&&t in e?L=>e[t]=L:void 0)}var g,k=!1;o?[g,k]=Us(()=>e[t]):g=e[t],g===void 0&&r!==void 0&&(g=p(),v&&(i&&Il(t),v(g)));var E=i?()=>{var L=e[t];return L===void 0?p():(f=!0,L)}:()=>{var L=e[t];return L!==void 0&&(c=void 0),L===void 0?c:L};if(i&&!(n&4))return E;if(v){var b=e.$$legacy;return(function(L,R){return arguments.length>0?((!i||!R||b||k)&&v(R?E():L),L):E()})}var w=!1,O=(n&1?yn:Xr)(()=>(w=!1,E()));o&&l(O);var j=A;return(function(L,R){if(arguments.length>0){let B=R?l(O):i&&o?Ft(L):L;return _(O,B),w=!0,c!==void 0&&(c=B),L}return Ze&&w||j.f&16384?O.v:l(O)})}function Js(e){return new Gs(e)}var Gs=(nt=new WeakMap,Te=new WeakMap,class{constructor(e){M(this,nt,void 0),M(this,Te,void 0);var t=new Map,n=(i,o)=>{var s=fo(o,!1,!1);return t.set(i,s),s};let r=new Proxy({...e.props||{},$$events:{}},{get(i,o){return l(t.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===Ui||(l(t.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,s){return _(t.get(o)??n(o,s),s),Reflect.set(i,o,s)}});x(Te,this,(e.hydrate?Ws:zo)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError})),(!e?.props?.$$host||e.sync===!1)&&jt(),x(nt,this,r.$$events);for(let i of Object.keys(a(Te,this)))i!=="$set"&&i!=="$destroy"&&i!=="$on"&&wn(this,i,{get(){return a(Te,this)[i]},set(o){a(Te,this)[i]=o},enumerable:!0});a(Te,this).$set=i=>{Object.assign(r,i)},a(Te,this).$destroy=()=>{Cs(a(Te,this))}}$set(e){a(Te,this).$set(e)}$on(e,t){a(nt,this)[e]=a(nt,this)[e]||[];let n=(...r)=>t.call(this,...r);return a(nt,this)[e].push(n),()=>{a(nt,this)[e]=a(nt,this)[e].filter(r=>r!==n)}}$destroy(){a(Te,this).$destroy()}}),Po;typeof HTMLElement=="function"&&(Po=class extends HTMLElement{constructor(e,t,n){var r=(...i)=>(super(...i),K(this,"$$ctor",void 0),K(this,"$$s",void 0),K(this,"$$c",void 0),K(this,"$$cn",!1),K(this,"$$d",{}),K(this,"$$r",!1),K(this,"$$p_d",{}),K(this,"$$l",{}),K(this,"$$l_u",new Map),K(this,"$$me",void 0),K(this,"$$shadowRoot",null),this);r(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return i=>{let o=ei("slot");r!=="default"&&(o.name=r),me(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=Ys(this);for(let r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let r of this.attributes){let i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=Qn(i,r.value,this.$$p_d,"toProp"))}for(let r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Js({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=us(()=>{hr(()=>{this.$$r=!0;for(let r of Xn(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];let i=Qn(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(let r in this.$$l)for(let i of this.$$l[r]){let o=this.$$c.$on(r,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Qn(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Xn(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Qn(e,t,n,r){let i=n[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t==null?t:+t;default:return t}}function Ys(e){let t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function Qs(e,t,n,r,i,o){let s=class extends Po{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return Xn(t).map(c=>(t[c].attribute||c).toLowerCase())}};return Xn(t).forEach(c=>{wn(s.prototype,c,{get(){return this.$$c&&c in this.$$c?this.$$c[c]:this.$$d[c]},set(f){f=Qn(c,f,t),this.$$d[c]=f;var h=this.$$c;h&&(kt(h,c)?.get?h[c]=f:h.$set({[c]:f}))}})}),r.forEach(c=>{wn(s.prototype,c,{get(){return this.$$c?.[c]}})}),o&&(s=o(s)),e.element=s,s}var Xs=at("<nds-icon-button></nds-icon-button>",2),Zs=at('<button type="button"><i aria-hidden="true"></i></button>'),ea=at('<span class="pie-tool-tts-inline__trigger-zoom svelte-9msc39"><!></span>'),ta=at('<button type="button" role="radio" data-pie-tts-control="" class="pie-tool-tts-inline__control pie-tool-tts-inline__control--speed svelte-9msc39"><span class="pie-tool-tts-inline__speed-label svelte-9msc39"> </span></button>'),na=at('<div role="radiogroup"></div>'),ra=at('<div role="toolbar" tabindex="-1"><!> <button type="button" data-pie-tts-control="" data-pie-tts-media="" data-pie-tts-seek="" class="pie-tool-tts-inline__control pie-tool-tts-inline__control--secondary svelte-9msc39"><i class="fa-solid fa-backward pie-tool-tts-inline__icon svelte-9msc39" aria-hidden="true"></i></button> <button type="button" data-pie-tts-control="" data-pie-tts-media="" data-pie-tts-seek="" class="pie-tool-tts-inline__control pie-tool-tts-inline__control--secondary svelte-9msc39"><i class="fa-solid fa-forward pie-tool-tts-inline__icon svelte-9msc39" aria-hidden="true"></i></button> <button type="button" data-pie-tts-control="" data-pie-tts-media="" data-pie-tts-stop="" class="pie-tool-tts-inline__control pie-tool-tts-inline__control--secondary svelte-9msc39"><i class="fa-solid fa-stop pie-tool-tts-inline__icon svelte-9msc39" aria-hidden="true"></i></button></div>'),Fi=at("<!> <!>",1),ia=at('<div><!> <div class="pie-sr-only svelte-9msc39" role="status" aria-live="polite" aria-atomic="true"> </div></div>'),oa={hash:"svelte-9msc39",code:`
|
|
4
4
|
/* Lay the component out as a flex box, not the default inline custom element.
|
|
5
5
|
As \`display: inline\` the host is blockified into a block flex item that
|
|
6
6
|
wraps its content in a line box, so the inline-flex root sits on the text
|
|
@@ -8,12 +8,11 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
8
8
|
LOW versus the calculator button (whose flex-item wrapper has no line box).
|
|
9
9
|
inline-flex + center removes the line box and keeps the trigger centered. */:host {display:inline-flex;align-items:center;}.pie-tool-tts-inline.svelte-9msc39 {position:relative;display:inline-flex;align-items:center;gap:0.5rem;}.pie-tool-tts-inline--controls-row.svelte-9msc39 {width:100%;justify-content:flex-end;}
|
|
10
10
|
|
|
11
|
-
/* The play/pause trigger
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
button matches the toolbar's md/sm/lg dimensions. */.pie-tool-tts-inline__trigger-zoom.svelte-9msc39 {display:inline-flex;}.pie-tool-tts-inline__trigger.svelte-9msc39 {display:inline-flex;
|
|
11
|
+
/* The play/pause trigger is an <nds-icon-button> host; the NDS component
|
|
12
|
+
owns its shape, colours and hover/active/focus states. This class only
|
|
13
|
+
drives the host's size via NDS's own size custom properties (see the size
|
|
14
|
+
variants below), so the light-DOM inner button matches the toolbar's
|
|
15
|
+
md/sm/lg dimensions. */.pie-tool-tts-inline__trigger-zoom.svelte-9msc39 {display:inline-flex;}.pie-tool-tts-inline__trigger.svelte-9msc39 {display:inline-flex;
|
|
17
16
|
/* Outer button size follows the toolbar size variants (below); the glyph
|
|
18
17
|
keeps the NDS-native icon size (size="small") so it isn't oversized. */--height-32: 2rem;
|
|
19
18
|
/* Host-settable accent: the NDS tertiary glyph colour derives from
|
|
@@ -32,20 +31,18 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
32
31
|
the plain \`__control\` box; only override to keep the round trigger
|
|
33
32
|
shape and the themeable accent colour on its glyph. */.pie-tool-tts-inline__trigger--plain.svelte-9msc39 {border-radius:50%;color:var(--pie-tts-button-color, var(--pie-button-color, var(--pie-text, #222)));}
|
|
34
33
|
|
|
35
|
-
/* Active/open trigger hooks
|
|
34
|
+
/* Active/open trigger hooks.
|
|
36
35
|
---------------------------------------------------------------------------
|
|
37
36
|
README documents --pie-tool-trigger-active-background / -color /
|
|
38
37
|
-border-color as the supported way to style this trigger while its panel is
|
|
39
|
-
open, instead of overriding broad tokens like --pie-primary.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
the same three hooks.
|
|
38
|
+
open, instead of overriding broad tokens like --pie-primary. These rules
|
|
39
|
+
honour all three, matching how tool-calculator-inline-desmos wires the same
|
|
40
|
+
hooks.
|
|
43
41
|
---------------------------------------------------------------------------
|
|
44
|
-
Every fallback is the value this element
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
host. Hosts opt in by setting a hook; nobody is opted in by us.
|
|
42
|
+
Every fallback is the value this element resolves to when the hook is
|
|
43
|
+
unset, so the rules are inert by default: unlike the calculator, this
|
|
44
|
+
trigger has no filled active look, and adding one would restyle the
|
|
45
|
+
control for every host. Hosts opt in by setting a hook.
|
|
49
46
|
|
|
50
47
|
Keyed off [aria-expanded='true'], which the markup already maintains, so
|
|
51
48
|
there is no new state to keep in sync. */.pie-tool-tts-inline__trigger--plain[aria-expanded="true"].svelte-9msc39 {
|
|
@@ -61,7 +58,7 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
61
58
|
var(--pie-button-color, var(--pie-text, #222))
|
|
62
59
|
);border-color:var(
|
|
63
60
|
--pie-tool-trigger-active-border-color,
|
|
64
|
-
var(--pie-button-border
|
|
61
|
+
var(--pie-button-border, var(--pie-border, #c6c6c6))
|
|
65
62
|
);}
|
|
66
63
|
|
|
67
64
|
/* NDS variant: its glyph colour derives from --color-interactive-blue, so the
|
|
@@ -71,7 +68,7 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
71
68
|
box the tertiary button does not currently have. */.pie-tool-tts-inline__trigger:not(.pie-tool-tts-inline__trigger--plain)[aria-expanded="true"].svelte-9msc39 {--color-interactive-blue: var(
|
|
72
69
|
--pie-tool-trigger-active-color,
|
|
73
70
|
var(--pie-tts-button-color, var(--pie-button-color, var(--pie-text, #222)))
|
|
74
|
-
);}.pie-tool-tts-inline__control.svelte-9msc39:hover:not(:disabled) {background-color:var(--pie-button-hover-
|
|
71
|
+
);}.pie-tool-tts-inline__control.svelte-9msc39:hover:not(:disabled) {background-color:var(--pie-button-hover-bg, var(--pie-secondary-background, #f2f4f8));transform:translateY(-1px);box-shadow:0 2px 6px color-mix(in srgb, var(--pie-shadow, #000) 14%, transparent);}.pie-tool-tts-inline__control.svelte-9msc39:active:not(:disabled) {transform:translateY(0);box-shadow:none;}.pie-tool-tts-inline__control.svelte-9msc39:focus-visible {outline:2px solid var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-primary, #0066cc)));outline-offset:2px;box-shadow:0 0 0 4px color-mix(in srgb, var(--pie-primary, #0066cc) 22%, transparent);}
|
|
75
72
|
|
|
76
73
|
/* Activating play/pause deliberately KEEPS focus on the trigger while the
|
|
77
74
|
controls panel opens beside it, so where focus sits has to stay visible —
|
|
@@ -86,7 +83,7 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
86
83
|
class and must be reached with :global(). */.pie-tool-tts-inline__trigger.svelte-9msc39:focus:not(:focus-visible),
|
|
87
84
|
.pie-tool-tts-inline__trigger.svelte-9msc39 button:focus:not(:focus-visible) {outline:2px solid var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-primary, #0066cc)));outline-offset:2px;}.pie-tool-tts-inline__panel.svelte-9msc39 {display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:0.25rem;box-sizing:border-box;min-height:var(--pie-tts-controls-row-height, 2.875rem);padding:0.25rem 0.5rem;background:var(--pie-surface, var(--pie-background, #fff));border:1px solid var(--pie-border, #d0d0d0);border-radius:0.5rem;}.pie-tool-tts-inline__panel--floating.svelte-9msc39 {position:absolute;z-index:2;top:50%;right:0;left:auto;}.pie-tool-tts-inline__panel--left-aligned-inline.svelte-9msc39 {
|
|
88
85
|
/* Fixed so it escapes overflow-clipping ancestors; top / right /
|
|
89
|
-
max-width are set inline by measureLeftAlignedOverlay(). */position:fixed;}.pie-tool-tts-inline__panel--row.svelte-9msc39 {position:absolute;z-index:2;top:100%;right:0;left:auto;}.pie-tool-tts-inline__control.svelte-9msc39 {display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:1px solid var(--pie-button-border
|
|
86
|
+
max-width are set inline by measureLeftAlignedOverlay(). */position:fixed;}.pie-tool-tts-inline__panel--row.svelte-9msc39 {position:absolute;z-index:2;top:100%;right:0;left:auto;}.pie-tool-tts-inline__control.svelte-9msc39 {display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:1px solid var(--pie-button-border, var(--pie-border, #c6c6c6));border-radius:0.25rem;background:var(--pie-button-background-color, var(--pie-button-bg, var(--pie-background, #fff)));color:var(--pie-button-color, var(--pie-text, #222));cursor:pointer;transition:background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;}
|
|
90
87
|
|
|
91
88
|
/* Icon-only panel controls (rewind / fast-forward / stop) are round to match
|
|
92
89
|
the circular NDS trigger; the pill-shaped speed radios keep square corners. */.pie-tool-tts-inline__control--secondary.svelte-9msc39 {border-radius:50%;}.pie-tool-tts-inline__speed-group.svelte-9msc39 {display:inline-flex;flex-wrap:wrap;align-items:center;gap:0.25rem;}.pie-tool-tts-inline__control--speed.svelte-9msc39 {width:auto;height:2rem;padding:0;font-size:1rem;font-weight:500;letter-spacing:0;white-space:nowrap;}.pie-tool-tts-inline__control--speed[aria-checked='true'].svelte-9msc39 {border-color:var(--pie-primary, #1565c0);background:color-mix(in srgb, var(--pie-primary, #1565c0) 14%, var(--pie-background, #fff));color:var(--pie-primary, #1565c0);font-weight:600;}.pie-tool-tts-inline__speed-label.svelte-9msc39 {line-height:1.2;
|
|
@@ -101,16 +98,13 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
101
98
|
sets the column width. The inline (roomy) row keeps its natural sizing. */.pie-tool-tts-inline__speed-group--stacked.svelte-9msc39 .pie-tool-tts-inline__speed-label:where(.svelte-9msc39) {display:inline-grid;justify-items:center;}.pie-tool-tts-inline__speed-group--stacked.svelte-9msc39 .pie-tool-tts-inline__speed-label:where(.svelte-9msc39)::before {content:attr(data-label);height:0;overflow:hidden;font-weight:700;visibility:hidden;}.pie-tool-tts-inline__control.svelte-9msc39:disabled {cursor:not-allowed;opacity:0.6;}
|
|
102
99
|
|
|
103
100
|
/* ── Overlay layouts (floating-overlay + left-aligned) ──────────────────────
|
|
104
|
-
The
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
The design keeps the controls on the surrounding Question/Passage header: a
|
|
102
|
+
low-chrome card, icon-only media glyphs, and speed radios as plain text with
|
|
103
|
+
the selected one lifted into a chip.
|
|
107
104
|
|
|
108
|
-
Shape comes from that design; colour comes from the theme.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
\`valentine\` page rendered a pink player with a blue TTS panel. Each surface
|
|
112
|
-
now defaults through a canonical token and keeps its literal only as the
|
|
113
|
-
no-theme last resort.
|
|
105
|
+
Shape comes from that design; colour comes from the theme. Each surface
|
|
106
|
+
defaults through a canonical token, and its literal is only the no-theme
|
|
107
|
+
last resort.
|
|
114
108
|
|
|
115
109
|
Foregrounds resolve through --pie-button-color (DaisyUI base-content), the
|
|
116
110
|
one family whose contrast against the card is guaranteed in every shipped
|
|
@@ -119,7 +113,7 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
119
113
|
from either drops to 1.37:1 on \`pastel\` and 11 of 35 themes fall under 3:1.
|
|
120
114
|
Selection is signalled by the chip and the bolder weight rather than by hue.
|
|
121
115
|
|
|
122
|
-
Host knobs
|
|
116
|
+
Host knobs: --pie-tts-button-color (accent),
|
|
123
117
|
--pie-tts-inline-muted-color, --pie-tts-selected-bg,
|
|
124
118
|
--pie-selected-button-background/-border, --pie-tts-menu-shadow. */.pie-tool-tts-inline__panel--floating.svelte-9msc39,
|
|
125
119
|
.pie-tool-tts-inline__panel--left-aligned-inline.svelte-9msc39 {min-height:0;height:3rem; /* Figma: 48px */justify-content:center;gap:0.375rem;
|
|
@@ -176,4 +170,4 @@ import{t as H}from"./defineProperty-a20a667d.js";import{a as Ji,i as T,n as $,r
|
|
|
176
170
|
}.pie-sr-only.svelte-9msc39 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}
|
|
177
171
|
|
|
178
172
|
@media (prefers-reduced-motion: reduce) {.pie-tool-tts-inline__control.svelte-9msc39 {transition:none !important;}
|
|
179
|
-
}`};function ua(e,t){oo(t,!0),Hs(e,ca);let n=Ft(t,"catalogId",7,""),r=Ft(t,"language",7,"en-US"),i=Ft(t,"size",7,"md"),o=Ft(t,"speedOptions",7,void 0),s=Ft(t,"showSingleSpeedOption",7,!1),u=Ft(t,"layoutMode",7,"expanding-row"),f=typeof window<"u",d="__pie_tts_inline_active_owner__",p="pie-tts-inline-owner-change",v=["/_fa-pro/fontawesome.min.css","/_fa-pro/light.min.css"],m=/font.?awesome|fa-?pro/i,g=c=>{if(document.querySelector(`link[href="${c}"]`))return;let h=document.createElement("link");h.rel="stylesheet",h.href=c,h.addEventListener("error",()=>{h.dataset.pieLoadFailed=""},{once:!0}),document.head.appendChild(h)},k=c=>{if(f&&(c&&!document.querySelector('link[href*="Roboto"]')&&g("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"),!Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some(h=>m.test(h.href))&&(g("https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css"),c)))for(let h of v)g(h)},M="__pieFaTtsShadowInstalled",b=c=>{let h=c.getRootNode();if(!(h instanceof ShadowRoot))return;let w=h;if(w[M])return;w[M]=!0;let S=new Set,W=z=>{if(!z||S.has(z))return;S.add(z);let Z=document.createElement("link");Z.rel="stylesheet",Z.href=z,h.appendChild(Z)},D=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter(z=>m.test(z.href));for(let z of D){if("pieLoadFailed"in z.dataset)continue;if(z.sheet){W(z.href);continue}let Z=zt=>{z.removeEventListener("load",Z),z.removeEventListener("error",Z),zt.type==="load"&&W(z.href)};z.addEventListener("load",Z),z.addEventListener("error",Z)}},_=c=>{k(!0),b(c);let h=()=>{for(let S of c.querySelectorAll("i.fa-light"))S.classList.remove("fa-light"),S.classList.add("fa-solid")};h();let w=new MutationObserver(h);return w.observe(c,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),{destroy(){w.disconnect()}}},U=(c,h)=>{let w=h,S=()=>{let D=c.querySelector("button");if(D)for(let[z,Z]of Object.entries(w))Z==null?D.removeAttribute(z):D.setAttribute(z,Z)};S();let W=new MutationObserver(S);return W.observe(c,{childList:!0,subtree:!0}),{update(D){w=D,S()},destroy(){W.disconnect()}}},K=c=>(k(!1),b(c),{}),x=F(void 0),P=F(void 0),B=F(null),ge=ne(()=>l(B)?.ndsIcons===!0),C=ne(()=>xl(l(B))),q=F(null),de=F(null),I=ne(()=>l(B)?.ttsService),Nt=ne(()=>l(B)?.highlightCoordinator),fi=ne(()=>l(de)?.scopeElement||l(q)?.scopeElement||null),he=F(!1),dt=F(!1),oe=F(!1),me=F(!1),te=F(""),Ot=F(null),En=F(null),An=F(!1),Ct=F(!1),pr=F(!1),tn=null,vr=ne(()=>l(An)||l(Ct)),Le=null,nn=ne(()=>_l(o())),rn=ne(()=>Vo(l(nn))),gr=ne(()=>l(nn).length>1||s()?l(nn):[]),on=ne(()=>l(Ot)!==null&&l(En)===l(rn)&&l(nn).some(c=>c.rate===l(Ot))?l(Ot):Jo(l(nn))),Qe=`pie-tts-inline-instance-${Math.random().toString(36).slice(2)}`,di=`pie-tts-inline-${Math.random().toString(36).slice(2)}`,mr=`${Qe}-controls`;function wr(){if(!f)return null;let c=window[d];return typeof c=="string"?c:null}function Pe(){return wr()===Qe}function hi(c,h){f&&window.dispatchEvent(new CustomEvent(p,{detail:{ownerId:c,previousOwnerId:h}}))}function Uo(){if(!f)return;let c=wr();c!==Qe&&(window[d]=Qe,hi(Qe,c))}function In(){f&&wr()===Qe&&(delete window[d],hi(null,Qe))}function br(c="",h=!1){y(Ct,!1),y(oe,!1),y(me,!1),y(he,h,!0),y(te,c,!0)}function Vo(c){return c.map(h=>`${h.rate}:${h.label}:${h.ariaLabel}:${h.isDefault?"1":"0"}`).join("|")}function Jo(c){return c.find(h=>h.isDefault)?.rate??c.find(h=>h.rate===1)?.rate??c[0]?.rate??1}async function yr(c,h){if(typeof c.setPlaybackRate=="function"){await c.setPlaybackRate(h);return}await c.updateSettings({rate:h})}function _r(){if(!l(x)||!l(P))return!1;let c=l(x).getRootNode();if(!(c instanceof ShadowRoot))return!1;let h=c.activeElement;return!!(h&&l(P).contains(h))}function Go(){if(!l(P))return!1;let c=l(P).getRootNode();if(!(c instanceof ShadowRoot))return!1;let h=c.activeElement;return!h||!l(P).contains(h)?!1:h.matches(Xo)}function Yo(){let c=l(P)?.querySelector(Zo);if(c&&!c.disabled){c.focus();return}Nn(!0)}function Nn(c){if(!l(x)||!c)return;let h=l(x).getRootNode();if(!(h instanceof ShadowRoot))return;let w=h.querySelector(".pie-tool-tts-inline__trigger");(w?.querySelector("button")??w)?.focus()}function pi(c=l(C).t("tools.textToSpeech.inline.switchedSection"),h=!1){if(!l(pr)&&(l(he)||Pe())){y(pr,!0);try{let w=_r();Pe()&&In(),br(c),Rt(),h&&queueMicrotask(()=>{Nn(w)})}finally{y(pr,!1)}}}Ze(()=>{if(l(x))return wl(l(x),c=>{y(B,c,!0)})}),Ze(()=>{if(!l(x))return;let c=bl(l(x),w=>{y(q,w,!0)}),h=yl(l(x),w=>{y(de,w,!0)});return()=>{h(),c()}}),Ze(()=>{if(!l(I))return;let c=w=>{if(!l(he)||!Pe()){y(oe,!1),y(me,!1);return}y(oe,w==="playing"||w==="paused",!0),y(me,w==="paused")},h=w=>{let S=String(w),W=Go();c(S),S==="playing"&&(l(Ct)&&y(te,l(C).t("tools.textToSpeech.inline.started"),!0),y(Ct,!1)),(S==="error"||S==="idle")&&y(Ct,!1),W&&!l(oe)&&queueMicrotask(Yo)};return l(I).onStateChange(di,h),c(l(I).getState()),()=>{l(I).offStateChange(di,h)}}),Ze(()=>{if(!f)return;let c=h=>{let{ownerId:w=null,previousOwnerId:S=null}=h.detail||{};S===Qe&&w!==Qe&&pi(l(C).t("tools.textToSpeech.inline.switchedSection"))};return window.addEventListener(p,c),()=>{window.removeEventListener(p,c)}}),Ze(()=>{if(!f)return;let c=()=>{pi(l(C).t("tools.textToSpeech.inline.switchedSection"),!0)};return window.addEventListener(Ei,c),()=>{window.removeEventListener(Ei,c)}}),Ze(()=>()=>{In(),Rt()});async function Qo(){if(!l(I))return!1;try{return await l(B)?.toolkitCoordinator?.ensureTTSReady?.(),!0}catch(c){return console.error("[TTS Inline] Failed to initialize TTS:",c),!1}}let vi="[data-pie-tts-speed-rate]",kr="[data-pie-tts-media]",Xo="[data-pie-tts-seek]",Zo="[data-pie-tts-stop]";function gi(c){return l(P)?Array.from(l(P).querySelectorAll(c)).filter(h=>!h.disabled&&window.getComputedStyle(h).display!=="none"):[]}function xr(c,h){let w=gi(c);if(!w.length)return;let S=w[(h+w.length)%w.length];if(S.focus(),c!==vi)return;let W=Number(S.dataset.pieTtsSpeedRate),D=l(gr).find(z=>z.rate===W);D&&yi(D)}function mi(c,h){let w=gi(c);if(!w.length)return;let S=l(P)?.getRootNode(),W=S instanceof ShadowRoot?S.activeElement:null,D=W?w.indexOf(W):-1;xr(c,D===-1?0:D+h)}function On(c,h){switch(h.key){case"ArrowDown":case"ArrowRight":h.preventDefault(),mi(c,1);break;case"ArrowUp":case"ArrowLeft":h.preventDefault(),mi(c,-1);break;case"Home":h.preventDefault(),xr(c,0);break;case"End":h.preventDefault(),xr(c,-1)}}function el(){if(!l(fi))return null;let c=l(fi);if(c.getAttribute?.("data-region")==="content")return c;let h=c.querySelector?.("[data-region='content']");return h instanceof Element?h:c}function tl(){if(l(q))return kl({kind:l(q).kind,assessmentId:l(B)?.assessmentId,sectionId:l(B)?.sectionId,itemId:l(q).itemId,canonicalItemId:l(q).canonicalItemId||l(q).itemId})}function nl(c){return Rt(),tn=l(I)?.setHighlightTargetResolverProvider?.(()=>({context:{scopeElement:l(de)?.scopeElement||c||null,kind:l(q)?.kind,itemId:l(q)?.itemId,canonicalItemId:l(q)?.canonicalItemId,contentKind:l(q)?.contentKind,regionPolicy:l(q)?.regionPolicy},resolver:l(de)?.ttsHighlightTargetResolver||null}))||null,tn}function Rt(c=tn){c?.(),c===tn&&(tn=null)}function rl(){if(!Pe())return!1;let c=String(l(I)?.getState?.()||"");return c==="playing"||c==="paused"||c==="loading"}function wi(c){let h=_r();br(l(C).t("tools.textToSpeech.inline.startFailed")),Pe()&&In(),l(Nt)&&l(Nt).clearTTS(),Rt(c),h&&queueMicrotask(()=>{Nn(!0)})}async function il(){if(!l(I))return;let c=null,h=el();if(!h){console.warn("[TTS Inline] No target container found from shell scope context");return}try{y(he,!0);let w=h.textContent||"";if(!w){console.warn("[TTS Inline] No text content found");return}l(Nt)&&l(I).setHighlightCoordinator&&l(I).setHighlightCoordinator(l(Nt)),await yr(l(I),l(on)),Le={service:l(I),choicesKey:l(rn)},c=nl(h),l(I).setRootElement?.(h),y(Ct,!0),y(te,l(C).t("tools.textToSpeech.inline.starting"),!0),l(I).speak(w,{catalogId:n()||void 0,catalogContext:tl(),language:r(),contentElement:h}).catch(S=>{console.error("[TTS Inline] Error:",S),wi(c)}).finally(()=>{rl()||Rt(c)})}catch(w){console.error("[TTS Inline] Error:",w),wi(c)}}async function bi(){if(l(I)&&!(l(vr)||Pe()&&String(l(I).getState?.()||"")==="loading")){if(Pe()&&l(me)){l(I).resume(),y(te,l(C).t("tools.textToSpeech.inline.resumed"),!0);return}if(Pe()&&l(oe)&&!l(me)){l(I).pause(),y(te,l(C).t("tools.textToSpeech.inline.pausedAnnouncement"),!0);return}if(!l(An)){y(An,!0);try{if(y(te,l(C).t("tools.textToSpeech.inline.initializing"),!0),!await Qo()){y(te,l(C).t("tools.textToSpeech.inline.initFailed"),!0);return}let c=String(l(I).getState?.()||"");(c==="playing"||c==="paused"||c==="loading")&&!Pe()&&l(I).stop(),Uo(),await il()}finally{y(An,!1)}}}}function ol(){if(!l(I))return;let c=_r();l(I).stop(),In(),br(l(C).t("tools.textToSpeech.inline.stopped")),l(Nt)&&l(Nt).clearTTS(),Rt(),c&&queueMicrotask(()=>{Nn(!0)})}async function ll(){if(l(I)&&l(oe))try{await l(I).seekForward?.(1),y(te,l(C).t("tools.textToSpeech.inline.skippedForward"),!0)}catch(c){console.error("[TTS Inline] Seek forward failed:",c),y(te,l(C).t("tools.textToSpeech.inline.skipForwardFailed"),!0)}}async function sl(){if(l(I)&&l(oe))try{await l(I).seekBackward?.(1),y(te,l(C).t("tools.textToSpeech.inline.skippedBackward"),!0)}catch(c){console.error("[TTS Inline] Seek backward failed:",c),y(te,l(C).t("tools.textToSpeech.inline.skipBackwardFailed"),!0)}}async function yi(c){let h=l(I);if(!h)return;if(l(on)===c.rate){y(te,l(C).t("tools.textToSpeech.inline.speedAnnounce",{label:c.label}),!0);return}let w=l(Ot),S=l(En);y(Ot,c.rate,!0),y(En,l(rn),!0),y(te,l(C).t("tools.textToSpeech.inline.speedAnnounce",{label:c.label}),!0);let W={service:h,choicesKey:l(rn)};Le=W;try{await yr(h,c.rate)}catch(D){Le===W&&(Le=null),console.error("[TTS Inline] Playback speed change failed:",D),y(Ot,w,!0),y(En,S,!0),y(te,l(C).t("tools.textToSpeech.inline.speedChangeFailed"),!0)}}let _i=ne(()=>i()==="sm"?"pie-tool-tts-inline__trigger--sm":i()==="lg"?"pie-tool-tts-inline__trigger--lg":"pie-tool-tts-inline__trigger--md"),ki=ne(()=>u()==="reserved-row"||u()==="expanding-row"),$r=ne(()=>u()==="floating-overlay"),Wt=ne(()=>u()==="left-aligned"),al=ne(()=>l($r)||l(Wt)),xi="[data-pie-tool-overlay-boundary]",Cn=F(""),Rn=F(0);Ze(()=>{let c=l(I),h=l(rn),w=l(oe)||l(me);if(!c||!w||!Pe()||Le?.service===c&&Le.choicesKey===h)return;let S={service:c,choicesKey:h};Le=S;let W=!1;return queueMicrotask(()=>{if(W||Le!==S)return;let D=l(on);yr(c,D).catch(z=>{Le===S&&(Le=null),console.error("[TTS Inline] External playback speed sync failed:",z)})}),()=>{W=!0}});function $i(c,h){let w=c;for(;w;){if(w.matches?.(h))return w;w=w.parentElement??(w.getRootNode()instanceof ShadowRoot?w.getRootNode().host:null)}return null}function Si(){let c=l(x)?.getRootNode();return c instanceof ShadowRoot?c.querySelector(".pie-tool-tts-inline__trigger"):null}function cl(c){let h=window.getComputedStyle(c),w=parseFloat(h.columnGap||h.gap)||0,S=(parseFloat(h.paddingLeft)||0)+(parseFloat(h.paddingRight)||0)+(parseFloat(h.borderLeftWidth)||0)+(parseFloat(h.borderRightWidth)||0),W=Array.from(c.children).filter(D=>window.getComputedStyle(D).display!=="none");return W.length?W.reduce((D,z)=>D+z.offsetWidth,0)+(W.length-1)*w+S:0}function ul(){let c=Si();if(!c||!l(P))return;let h=c.getBoundingClientRect(),w=$i(c,xi),S=w?.getBoundingClientRect().left??0,W=Math.max(0,h.left-S-16);if(!l(dt)){let Q=cl(l(P));Q>0&&y(Rn,Q,!0)}y(dt,l(Rn)>0&&W<l(Rn),!0);let D=parseFloat(window.getComputedStyle(l(P)).minWidth)||0;if(l(dt)&&W<D){let Q=w?.getBoundingClientRect(),we=Math.max(0,Q?.left??0)+8,De=Math.min(window.innerWidth,Q?.right??window.innerWidth)-8,je=Math.max(0,De-we),X=Math.min(l(P).offsetWidth,je),j=Math.max(we,Math.min(h.right-X,De-X));y(Cn,`top: ${h.bottom+8}px; left: ${j}px; right: auto; min-width: min(7.5rem, ${je}px); max-width: min(${je}px, var(--pie-tts-left-aligned-panel-width, ${je}px));`);return}let z=l(P).offsetHeight||h.height,Z=l(dt)?h.top:h.top+h.height/2-z/2,zt=h.bottom>0&&h.top<window.innerHeight?Math.max(8,Math.min(Z,window.innerHeight-z-8)):Z,le=window.innerWidth-h.left+8;y(Cn,`top: ${zt}px; right: ${le}px; left: auto; max-width: min(${W}px, var(--pie-tts-left-aligned-panel-width, ${W}px));`)}Ze(()=>{if(!(l(Wt)&&l(he))){let z=!1;return queueMicrotask(()=>{z||(y(Cn,""),y(dt,!1),y(Rn,0))}),()=>{z=!0}}if(typeof window>"u")return;let c=0,h=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,ul()}))};h(),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0);let w=Si(),S=new ResizeObserver(h);w&&S.observe(w),l(P)&&S.observe(l(P));let W=w?$i(w,xi):null;W&&S.observe(W);let D=W?.querySelector("[data-pie-tool-overlay-protect]");return D&&S.observe(D),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0),S.disconnect()}});function fl(){if(!l(x))return null;let c=l(x).getRootNode();return c instanceof ShadowRoot?c.host:null}Ze(()=>{let c=fl();if(!c)return;let h=l(he)===!0;if(c.getAttribute("data-active")==="true"===h)return;let w=!1;return queueMicrotask(()=>{w||(c.setAttribute("data-active",h?"true":"false"),c.dispatchEvent(new CustomEvent("pie-tool-active-change",{detail:{active:h},bubbles:!0,composed:!0})))}),()=>{w=!0}});var dl={get catalogId(){return n()},set catalogId(c=""){n(c),bt()},get language(){return r()},set language(c="en-US"){r(c),bt()},get size(){return i()},set size(c="md"){i(c),bt()},get speedOptions(){return o()},set speedOptions(c=void 0){o(c),bt()},get showSingleSpeedOption(){return s()},set showSingleSpeedOption(c=!1){s(c),bt()},get layoutMode(){return u()},set layoutMode(c="expanding-row"){u(c),bt()}},Ti=Fi(),hl=Fn(Ti),pl=c=>{var h=aa();let w;{let Z=le=>{var Q=ia(),we=pn(Q),De=X=>{var j=na();jt(j,"type","circle"),jt(j,"size","small"),jt(j,"variant","tertiary"),Be(()=>jt(j,"icon-name",l(oe)&&!l(me)?"pause":"play")),Be(Fe=>jt(j,"button-aria-label",Fe),[()=>l(C).t(l(oe)&&!l(me)?"tools.textToSpeech.inline.pauseA11y":l(me)?"tools.textToSpeech.inline.resumeA11y":"tools.textToSpeech.inline.playA11y")]),Be(()=>jt(j,"disabled",!l(I))),Or(j,Fe=>_?.(Fe)),Or(j,(Fe,ht)=>U?.(Fe,ht),()=>({"aria-expanded":l(he)?"true":"false","aria-controls":l(he)?mr:null,"aria-pressed":l(he)?"true":"false","aria-busy":l(vr)?"true":null})),Be(()=>Dt(j,1,`pie-tool-tts-inline__trigger ${l(_i)??""}`,"svelte-9msc39")),Ke("click",j,bi),ye(X,j)},je=X=>{var j=ra(),Fe=Ar(j);Or(j,ht=>K?.(ht)),Be(ht=>{Dt(j,1,`pie-tool-tts-inline__control pie-tool-tts-inline__trigger pie-tool-tts-inline__trigger--plain ${l(_i)??""}`,"svelte-9msc39"),ee(j,"aria-expanded",l(he)?"true":"false"),ee(j,"aria-controls",l(he)?mr:void 0),ee(j,"aria-pressed",l(he)?"true":"false"),ee(j,"aria-label",ht),ee(j,"aria-busy",l(vr)?"true":void 0),j.disabled=!l(I),Dt(Fe,1,`fa-solid ${l(oe)&&!l(me)?"fa-pause":"fa-play"} pie-tool-tts-inline__icon`,"svelte-9msc39")},[()=>l(C).t(l(oe)&&!l(me)?"tools.textToSpeech.inline.pauseA11y":l(me)?"tools.textToSpeech.inline.resumeA11y":"tools.textToSpeech.inline.playA11y")]),Ke("click",j,bi),ye(X,j)};fn(we,X=>{l(ge)?X(De):X(je,-1)}),Ht(Q),ye(le,Q)},zt=le=>{var Q=Fi(),we=Fn(Q),De=je=>{var X=sa();let j;var Fe=pn(X),ht=pe=>{var pt=la();let zn;js(pt,21,()=>l(gr),vt=>vt.rate,(vt,gt)=>{var qe=oa(),Mi=pn(qe),vl=Ar(Mi,!0);Ht(qe),Be(()=>{ee(qe,"data-pie-tts-speed-rate",l(gt).rate),ee(qe,"tabindex",l(on)===l(gt).rate?0:-1),ee(qe,"aria-label",l(gt).ariaLabel),ee(qe,"aria-checked",l(on)===l(gt).rate),qe.disabled=!l(I),ee(Mi,"data-label",l(gt).label),Hi(vl,l(gt).label)}),Ke("click",qe,()=>yi(l(gt))),Ke("keydown",qe,gl=>On(vi,gl)),ye(vt,qe)}),Ht(pt),Be(vt=>{zn=Dt(pt,1,"pie-tool-tts-inline__speed-group svelte-9msc39",null,zn,{"pie-tool-tts-inline__speed-group--stacked":l(dt)}),ee(pt,"aria-label",vt)},[()=>l(C).t("tools.textToSpeech.inline.playbackSpeedA11y")]),ye(pe,pt)};fn(Fe,pe=>{l(gr).length>0&&pe(ht)});var ln=Pt(Fe,2),sn=Pt(ln,2),Wn=Pt(sn,2);Ht(X),Ui(X,pe=>y(P,pe),()=>l(P)),Be((pe,pt,zn,vt)=>{ee(X,"id",mr),j=Dt(X,1,"pie-tool-tts-inline__panel svelte-9msc39",null,j,{"pie-tool-tts-inline__panel--floating":l($r),"pie-tool-tts-inline__panel--row":l(ki),"pie-tool-tts-inline__panel--left-aligned-inline":l(Wt),"pie-tool-tts-inline__panel--compact":l(Wt)&&l(dt)}),Us(X,l(Wt)?l(Cn):""),ee(X,"aria-label",pe),ee(ln,"aria-label",pt),ln.disabled=!l(I)||!l(oe),ee(sn,"aria-label",zn),sn.disabled=!l(I)||!l(oe),ee(Wn,"aria-label",vt),Wn.disabled=!l(I)},[()=>l(C).t("tools.textToSpeech.inline.controlsA11y"),()=>l(C).t("tools.textToSpeech.inline.rewindA11y"),()=>l(C).t("tools.textToSpeech.inline.fastForwardA11y"),()=>l(C).t("tools.textToSpeech.inline.stopA11y")]),Ke("click",ln,sl),Ke("keydown",ln,pe=>On(kr,pe)),Ke("click",sn,ll),Ke("keydown",sn,pe=>On(kr,pe)),Ke("click",Wn,ol),Ke("keydown",Wn,pe=>On(kr,pe)),ye(je,X)};fn(we,je=>{l(he)&&je(De)}),ye(le,Q)};var S=pn(h),W=le=>{var Q=Vi(),we=Fn(Q);zt(we);var De=Pt(we,2);Z(De),ye(le,Q)},D=le=>{var Q=Vi(),we=Fn(Q);Z(we);var De=Pt(we,2);zt(De),ye(le,Q)};fn(S,le=>{l(al)?le(W):le(D,-1)});var z=Ar(Pt(S,2),!0);Ht(h),Ui(h,le=>y(x,le),()=>l(x)),Be(()=>Hi(z,l(te)))}Be(()=>w=Dt(h,1,"pie-tool-tts-inline svelte-9msc39",null,w,{"pie-tool-tts-inline--controls-row":l(ki),"pie-tool-tts-inline--floating":l($r),"pie-tool-tts-inline--left-aligned":l(Wt)})),ye(c,h)};return fn(hl,c=>{f&&c(pl)}),ye(e,Ti),lo(dl)}xs(["click","keydown"]),fa("pie-tool-tts-inline",ta(ua,{catalogId:{attribute:"catalog-id",type:"String"},language:{attribute:"language",type:"String"},size:{attribute:"size",type:"String"},speedOptions:{attribute:"speed-options",type:"Array"},showSingleSpeedOption:{attribute:"show-single-speed-option",type:"Boolean"},layoutMode:{attribute:"layout-mode",type:"String"}},[],[],{mode:"open"},ml));function fa(e,t){customElements.get(e)||customElements.define(e,t)}export{ua as default};
|
|
173
|
+
}`};function la(e,t){Xi(t,!0),js(e,oa);let n=fl("tts-inline",ul),r=un(t,"catalogId",7,""),i=un(t,"size",7,"md"),o=un(t,"speedOptions",7,void 0),s=un(t,"showSingleSpeedOption",7,!1),c=un(t,"layoutMode",7,"left-aligned"),f=typeof window<"u",h=/font.?awesome|fa-?pro/i,p=u=>{if(document.querySelector(`link[href="${u}"]`))return;let d=document.createElement("link");d.rel="stylesheet",d.href=u,d.addEventListener("error",()=>{d.dataset.pieLoadFailed=""},{once:!0}),document.head.appendChild(d)},v=()=>{f&&(Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some(u=>h.test(u.href))||p("https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css"))},m="__pieFaTtsShadowInstalled",g=u=>{let d=u.getRootNode();if(!(d instanceof ShadowRoot))return;let y=d;if(y[m])return;y[m]=!0;let $=new Set,S=N=>{if(!N||$.has(N))return;$.add(N);let q=document.createElement("link");q.rel="stylesheet",q.href=N,d.appendChild(q)},D=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter(N=>h.test(N.href));for(let N of D){if("pieLoadFailed"in N.dataset)continue;if(N.sheet){S(N.href);continue}let q=Nt=>{N.removeEventListener("load",q),N.removeEventListener("error",q),Nt.type==="load"&&S(N.href)};N.addEventListener("load",q),N.addEventListener("error",q)}},k=u=>{v(),g(u);let d=()=>{for(let $ of u.querySelectorAll("i.fa-light"))$.classList.remove("fa-light"),$.classList.add("fa-solid")};d();let y=new MutationObserver(d);return y.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),{destroy(){y.disconnect()}}},E=(u,d)=>{let y=d,$=()=>{let D=u.querySelector("button");if(D)for(let[N,q]of Object.entries(y))q==null?D.removeAttribute(N):D.setAttribute(N,q)};$();let S=new MutationObserver($);return S.observe(u,{childList:!0,subtree:!0}),{update(D){y=D,$()},destroy(){S.disconnect()}}},b=u=>(v(),g(u),{}),w=H(void 0),O=H(void 0),j=H(null),L=ne(()=>l(j)?.ndsIcons===!0),R=ne(()=>vl(l(j))),B=H(null),ee=H(null),I=ne(()=>l(j)?.ttsService),Z=ne(()=>l(j)?.highlightCoordinator),Me=ne(()=>l(ee)?.scopeElement||l(B)?.scopeElement||null),te=H(!1),ct=H(!1),fe=H(!1),ze=H(!1),he=H(""),At=H(null),Mn=H(null),et=H(!1),pr=H(!1),Tn=!1,Yt=0,An=null,Le=null,Qt=ne(()=>gl(o())),Xt=ne(()=>jo(l(Qt))),vr=ne(()=>l(Qt).length>1||s()?l(Qt):[]),Zt=ne(()=>l(At)!==null&&l(Mn)===l(Xt)&&l(Qt).some(u=>u.rate===l(At))?l(At):Fo(l(Qt))),En=`pie-tts-inline-instance-${Math.random().toString(36).slice(2)}`,gr=`${En}-controls`;function en(){return l(I)?.getRunOwner()===En}function On(u="",d=!1){_(et,!1),_(fe,!1),_(ze,!1),_(te,d,!0),_(he,u,!0)}function jo(u){return u.map(d=>`${d.rate}:${d.label}:${d.ariaLabel}:${d.isDefault?"1":"0"}`).join("|")}function Fo(u){return u.find(d=>d.isDefault)?.rate??u.find(d=>d.rate===1)?.rate??u[0]?.rate??1}function mr(){if(!l(w)||!l(O))return!1;let u=l(w).getRootNode();if(!(u instanceof ShadowRoot))return!1;let d=u.activeElement;return!!(d&&l(O).contains(d))}function Io(){if(!l(O))return!1;let u=l(O).getRootNode();if(!(u instanceof ShadowRoot))return!1;let d=u.activeElement;return!d||!l(O).contains(d)?!1:d.matches(Ho)}function qo(){let u=l(O)?.querySelector(Bo);if(u&&!u.disabled){u.focus();return}Nn(!0)}function Nn(u){if(!u)return;let d=_r();(d?.querySelector("button")??d)?.focus()}function ai(u=l(R).t("tools.textToSpeech.inline.switchedSection"),d=!1){if(!l(pr)&&l(te)){_(pr,!0);try{let y=mr();Yt+=1,On(u),Et(),d&&queueMicrotask(()=>{Nn(y)})}finally{_(pr,!1)}}}pt(()=>{if(l(w))return pl(l(w),u=>{_(j,u,!0)})}),pt(()=>{if(!l(w))return;let u=hl(l(w),y=>{_(B,y,!0)}),d=dl(l(w),y=>{_(ee,y,!0)});return()=>{d(),u()}}),pt(()=>{let u=l(I);if(!u)return;let d=$=>{if(!l(te)||!en()){_(fe,!1),_(ze,!1);return}_(fe,$==="playing"||$==="paused",!0),_(ze,$==="paused")},y=u.onStateChange($=>{let S=String($),D=Io();(S==="loading"||S==="playing"||S==="paused")&&!Tn&&!en()&&ai(),S==="idle"&&!Tn&&u.getRunOwner()===null&&ai(l(R).t("tools.textToSpeech.inline.stopped"),!0),d(S),S==="playing"&&(l(et)&&en()&&_(he,l(R).t("tools.textToSpeech.inline.started"),!0),_(et,!1)),(S==="error"||S==="idle")&&_(et,!1),D&&!l(fe)&&queueMicrotask(qo)});return d(u.getState()),y}),pt(()=>()=>{Et()});let ci="[data-pie-tts-speed-rate]",br="[data-pie-tts-media]",Ho="[data-pie-tts-seek]",Bo="[data-pie-tts-stop]";function ui(u){return l(O)?Array.from(l(O).querySelectorAll(u)).filter(d=>!d.disabled&&window.getComputedStyle(d).display!=="none"):[]}function wr(u,d){let y=ui(u);if(!y.length)return;let $=y[(d+y.length)%y.length];if($.focus(),u!==ci)return;let S=Number($.dataset.pieTtsSpeedRate),D=l(vr).find(N=>N.rate===S);D&&di(D)}function fi(u,d){let y=ui(u);if(!y.length)return;let $=l(O)?.getRootNode(),S=$ instanceof ShadowRoot?$.activeElement:null,D=S?y.indexOf(S):-1;wr(u,D===-1?0:D+d)}function Wn(u,d){switch(d.key){case"ArrowDown":case"ArrowRight":d.preventDefault(),fi(u,1);break;case"ArrowUp":case"ArrowLeft":d.preventDefault(),fi(u,-1);break;case"Home":d.preventDefault(),wr(u,0);break;case"End":d.preventDefault(),wr(u,-1)}}function Ko(){return l(Me)?ml(l(Me)):null}function Vo(){return l(B)?wl(l(B),l(j)):void 0}function Uo(u,d){Et();let y=u.setHighlightTargetResolverProvider(()=>({context:{scopeElement:l(ee)?.scopeElement||d||null,kind:l(B)?.kind,itemId:l(B)?.itemId,canonicalItemId:l(B)?.canonicalItemId,contentKind:l(B)?.contentKind,regionPolicy:l(B)?.regionPolicy},resolver:l(ee)?.ttsHighlightTargetResolver||null}));return An=y,y}function Et(u=An){u?.(),u===An&&(An=null)}function Jo(u){if(u.getRunOwner()!==En)return!1;let d=String(u.getState());return d==="playing"||d==="paused"||d==="loading"}function Go(u,d){let y=mr();On(l(R).t(_i(u)?"tools.textToSpeech.initFailed":"tools.textToSpeech.inline.startFailed")),l(Z)&&l(Z).clearTTS(),Et(d),y&&queueMicrotask(()=>{Nn(!0)})}function tn(u){_i(u)||bl(l(j)?.toolkitCoordinator,"textToSpeech","tool-playback",u)}function Yo(){let u=l(I);if(!u)return;let d=Ko();if(!d){n.debug("No target container found from shell scope context");return}let y=++Yt,$=!1,S=u.onStateChange(q=>{String(q)==="playing"&&($=!0)});_(te,!0),_(et,!0),_(he,l(R).t("tools.textToSpeech.inline.starting"),!0);let D=Uo(u,d),N;try{N=u.speak(d,{ownerId:En,rate:l(Zt),catalogId:r()||void 0,catalogContext:Vo(),language:l(j)?.contentLanguage||void 0})}catch(q){N=Promise.reject(q)}Le={service:u,choicesKey:l(Xt)},N.then(()=>{y!==Yt||$||String(u.getState())==="idle"&&On(l(R).t("tools.textToSpeech.inline.nothingToRead"))}).catch(q=>{y===Yt&&(tn(q),Go(q,D))}).finally(()=>{S(),Jo(u)||Et(D)})}function hi(){let u=l(I);if(!u)return;let d=en();if(!(l(et)||d&&String(u.getState())==="loading")){if(d&&l(ze)){u.resume(),_(he,l(R).t("tools.textToSpeech.inline.resumed"),!0);return}if(d&&l(fe)&&!l(ze)){u.pause(),_(he,l(R).t("tools.textToSpeech.inline.pausedAnnouncement"),!0);return}Tn=!0;try{Yo()}finally{Tn=!1}}}function Qo(){if(!l(I))return;let u=mr();Yt+=1,l(I).stop(),On(l(R).t("tools.textToSpeech.inline.stopped")),l(Z)&&l(Z).clearTTS(),Et(),u&&queueMicrotask(()=>{Nn(!0)})}async function Xo(){if(l(I)&&l(fe))try{await l(I).seekForward(1),_(he,l(R).t("tools.textToSpeech.inline.skippedForward"),!0)}catch(u){tn(u),_(he,l(R).t("tools.textToSpeech.inline.skipForwardFailed"),!0)}}async function Zo(){if(l(I)&&l(fe))try{await l(I).seekBackward(1),_(he,l(R).t("tools.textToSpeech.inline.skippedBackward"),!0)}catch(u){tn(u),_(he,l(R).t("tools.textToSpeech.inline.skipBackwardFailed"),!0)}}async function di(u){let d=l(I);if(!d)return;if(l(Zt)===u.rate){_(he,l(R).t("tools.textToSpeech.inline.speedAnnounce",{label:u.label}),!0);return}let y=l(At),$=l(Mn);_(At,u.rate,!0),_(Mn,l(Xt),!0),_(he,l(R).t("tools.textToSpeech.inline.speedAnnounce",{label:u.label}),!0);let S={service:d,choicesKey:l(Xt)};Le=S;try{await d.setPlaybackRate(u.rate)}catch(D){Le===S&&(Le=null),tn(D),_(At,y,!0),_(Mn,$,!0),_(he,l(R).t("tools.textToSpeech.inline.speedChangeFailed"),!0)}}let pi=ne(()=>i()==="sm"?"pie-tool-tts-inline__trigger--sm":i()==="lg"?"pie-tool-tts-inline__trigger--lg":"pie-tool-tts-inline__trigger--md"),vi=ne(()=>l(fe)&&!l(ze)?"tools.textToSpeech.inline.pauseA11y":l(ze)?"tools.textToSpeech.inline.resumeA11y":"tools.textToSpeech.inline.playA11y"),gi=ne(()=>c()==="reserved-row"||c()==="expanding-row"),yr=ne(()=>c()==="floating-overlay"),Ot=ne(()=>c()==="left-aligned"),el=ne(()=>l(yr)||l(Ot)),mi="[data-pie-tool-overlay-boundary]",Cn=H(""),Rn=H(0);pt(()=>{let u=l(I),d=l(Xt),y=l(fe)||l(ze);if(!u||!y||!en()||Le?.service===u&&Le.choicesKey===d)return;let $={service:u,choicesKey:d};Le=$;let S=!1;return queueMicrotask(()=>{if(S||Le!==$)return;let D=l(Zt);u.setPlaybackRate(D).catch(N=>{Le===$&&(Le=null),tn(N)})}),()=>{S=!0}});function bi(u,d){let y=u;for(;y;){if(y.matches?.(d))return y;y=y.parentElement??(y.getRootNode()instanceof ShadowRoot?y.getRootNode().host:null)}return null}function _r(){let u=l(w)?.getRootNode();return u instanceof ShadowRoot?u.querySelector(".pie-tool-tts-inline__trigger"):null}function tl(u){let d=window.getComputedStyle(u),y=parseFloat(d.columnGap||d.gap)||0,$=(parseFloat(d.paddingLeft)||0)+(parseFloat(d.paddingRight)||0)+(parseFloat(d.borderLeftWidth)||0)+(parseFloat(d.borderRightWidth)||0),S=Array.from(u.children).filter(D=>window.getComputedStyle(D).display!=="none");return S.length?S.reduce((D,N)=>D+N.offsetWidth,0)+(S.length-1)*y+$:0}function nl(){let u=_r();if(!u||!l(O))return;let d=u.getBoundingClientRect(),y=bi(u,mi),$=y?.getBoundingClientRect().left??0,S=Math.max(0,d.left-$-16);if(!l(ct)){let Y=tl(l(O));Y>0&&_(Rn,Y,!0)}_(ct,l(Rn)>0&&S<l(Rn),!0);let D=parseFloat(window.getComputedStyle(l(O)).minWidth)||0;if(l(ct)&&S<D){let Y=y?.getBoundingClientRect(),ve=Math.max(0,Y?.left??0)+8,De=Math.min(window.innerWidth,Y?.right??window.innerWidth)-8,Pe=Math.max(0,De-ve),Q=Math.min(l(O).offsetWidth,Pe),F=Math.max(ve,Math.min(d.right-Q,De-Q));_(Cn,`top: ${d.bottom+8}px; left: ${F}px; right: auto; min-width: min(7.5rem, ${Pe}px); max-width: min(${Pe}px, var(--pie-tts-left-aligned-panel-width, ${Pe}px));`);return}let N=l(O).offsetHeight||d.height,q=l(ct)?d.top:d.top+d.height/2-N/2,Nt=d.bottom>0&&d.top<window.innerHeight?Math.max(8,Math.min(q,window.innerHeight-N-8)):q,oe=window.innerWidth-d.left+8;_(Cn,`top: ${Nt}px; right: ${oe}px; left: auto; max-width: min(${S}px, var(--pie-tts-left-aligned-panel-width, ${S}px));`)}pt(()=>{if(!(l(Ot)&&l(te))){let N=!1;return queueMicrotask(()=>{N||(_(Cn,""),_(ct,!1),_(Rn,0))}),()=>{N=!0}}if(typeof window>"u")return;let u=0,d=()=>{u||(u=window.requestAnimationFrame(()=>{u=0,nl()}))};d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0);let y=_r(),$=new ResizeObserver(d);y&&$.observe(y),l(O)&&$.observe(l(O));let S=y?bi(y,mi):null;S&&$.observe(S);let D=S?.querySelector("[data-pie-tool-overlay-protect]");return D&&$.observe(D),()=>{u&&window.cancelAnimationFrame(u),window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),$.disconnect()}});function rl(){if(!l(w))return null;let u=l(w).getRootNode();return u instanceof ShadowRoot?u.host:null}pt(()=>{let u=rl();if(!u)return;let d=l(te)===!0;if(u.getAttribute("data-active")==="true"===d)return;let y=!1;return queueMicrotask(()=>{y||(u.setAttribute("data-active",d?"true":"false"),u.dispatchEvent(new CustomEvent("pie-tool-active-change",{detail:{active:d},bubbles:!0,composed:!0})))}),()=>{y=!0}});var il={get catalogId(){return r()},set catalogId(u=""){r(u),jt()},get size(){return i()},set size(u="md"){i(u),jt()},get speedOptions(){return o()},set speedOptions(u=void 0){o(u),jt()},get showSingleSpeedOption(){return s()},set showSingleSpeedOption(u=!1){s(u),jt()},get layoutMode(){return c()},set layoutMode(u="left-aligned"){c(u),jt()}},wi=Ri(),ol=In(wi),ll=u=>{var d=ia();let y;{let q=oe=>{var Y=ea(),ve=hn(Y),De=Q=>{var F=Xs();zt(F,"type","circle"),zt(F,"size","small"),zt(F,"variant","tertiary"),qe(()=>zt(F,"icon-name",l(fe)&&!l(ze)?"pause":"play")),qe(je=>zt(F,"button-aria-label",je),[()=>l(R).t(l(vi))]),qe(()=>zt(F,"disabled",!l(I))),Er(F,je=>k?.(je)),Er(F,(je,ut)=>E?.(je,ut),()=>({"aria-expanded":l(te)?"true":"false","aria-controls":l(te)?gr:null,"aria-pressed":l(te)?"true":"false","aria-busy":l(et)?"true":null})),qe(()=>Rt(F,1,`pie-tool-tts-inline__trigger ${l(pi)??""}`,"svelte-9msc39")),He("click",F,hi),me(Q,F)},Pe=Q=>{var F=Zs(),je=Mr(F);Er(F,ut=>b?.(ut)),qe(ut=>{Rt(F,1,`pie-tool-tts-inline__control pie-tool-tts-inline__trigger pie-tool-tts-inline__trigger--plain ${l(pi)??""}`,"svelte-9msc39"),X(F,"aria-expanded",l(te)?"true":"false"),X(F,"aria-controls",l(te)?gr:void 0),X(F,"aria-pressed",l(te)?"true":"false"),X(F,"aria-label",ut),X(F,"aria-busy",l(et)?"true":void 0),F.disabled=!l(I),Rt(je,1,`fa-solid ${l(fe)&&!l(ze)?"fa-pause":"fa-play"} pie-tool-tts-inline__icon`,"svelte-9msc39")},[()=>l(R).t(l(vi))]),He("click",F,hi),me(Q,F)};an(ve,Q=>{l(L)?Q(De):Q(Pe,-1)}),Dt(Y),me(oe,Y)},Nt=oe=>{var Y=Ri(),ve=In(Y),De=Pe=>{var Q=ra();let F;var je=hn(Q),ut=de=>{var ft=na();let Ln;Ls(ft,21,()=>l(vr),ht=>ht.rate,(ht,dt)=>{var Fe=ta(),yi=hn(Fe),sl=Mr(yi,!0);Dt(Fe),qe(()=>{X(Fe,"data-pie-tts-speed-rate",l(dt).rate),X(Fe,"tabindex",l(Zt)===l(dt).rate?0:-1),X(Fe,"aria-label",l(dt).ariaLabel),X(Fe,"aria-checked",l(Zt)===l(dt).rate),Fe.disabled=!l(I),X(yi,"data-label",l(dt).label),Li(sl,l(dt).label)}),He("click",Fe,()=>di(l(dt))),He("keydown",Fe,al=>Wn(ci,al)),me(ht,Fe)}),Dt(ft),qe(ht=>{Ln=Rt(ft,1,"pie-tool-tts-inline__speed-group svelte-9msc39",null,Ln,{"pie-tool-tts-inline__speed-group--stacked":l(ct)}),X(ft,"aria-label",ht)},[()=>l(R).t("tools.textToSpeech.inline.playbackSpeedA11y")]),me(de,ft)};an(je,de=>{l(vr).length>0&&de(ut)});var nn=Ct(je,2),rn=Ct(nn,2),zn=Ct(rn,2);Dt(Q),ji(Q,de=>_(O,de),()=>l(O)),qe((de,ft,Ln,ht)=>{X(Q,"id",gr),F=Rt(Q,1,"pie-tool-tts-inline__panel svelte-9msc39",null,F,{"pie-tool-tts-inline__panel--floating":l(yr),"pie-tool-tts-inline__panel--row":l(gi),"pie-tool-tts-inline__panel--left-aligned-inline":l(Ot),"pie-tool-tts-inline__panel--compact":l(Ot)&&l(ct)}),qs(Q,l(Ot)?l(Cn):""),X(Q,"aria-label",de),X(nn,"aria-label",ft),nn.disabled=!l(I)||!l(fe),X(rn,"aria-label",Ln),rn.disabled=!l(I)||!l(fe),X(zn,"aria-label",ht),zn.disabled=!l(I)},[()=>l(R).t("tools.textToSpeech.inline.controlsA11y"),()=>l(R).t("tools.textToSpeech.inline.rewindA11y"),()=>l(R).t("tools.textToSpeech.inline.fastForwardA11y"),()=>l(R).t("tools.textToSpeech.inline.stopA11y")]),He("click",nn,Zo),He("keydown",nn,de=>Wn(br,de)),He("click",rn,Xo),He("keydown",rn,de=>Wn(br,de)),He("click",zn,Qo),He("keydown",zn,de=>Wn(br,de)),me(Pe,Q)};an(ve,Pe=>{l(te)&&Pe(De)}),me(oe,Y)};var $=hn(d),S=oe=>{var Y=Fi(),ve=In(Y);Nt(ve);var De=Ct(ve,2);q(De),me(oe,Y)},D=oe=>{var Y=Fi(),ve=In(Y);q(ve);var De=Ct(ve,2);Nt(De),me(oe,Y)};an($,oe=>{l(el)?oe(S):oe(D,-1)});var N=Mr(Ct($,2),!0);Dt(d),ji(d,oe=>_(w,oe),()=>l(w)),qe(()=>Li(N,l(he)))}qe(()=>y=Rt(d,1,"pie-tool-tts-inline svelte-9msc39",null,y,{"pie-tool-tts-inline--controls-row":l(gi),"pie-tool-tts-inline--floating":l(yr),"pie-tool-tts-inline--left-aligned":l(Ot)})),me(u,d)};return an(ol,u=>{f&&u(ll)}),me(e,wi),Zi(il)}ws(["click","keydown"]),sa("pie-tool-tts-inline",Qs(la,{catalogId:{attribute:"catalog-id",type:"String"},size:{attribute:"size",type:"String"},speedOptions:{attribute:"speed-options",type:"Array"},showSingleSpeedOption:{attribute:"show-single-speed-option",type:"Boolean"},layoutMode:{attribute:"layout-mode",type:"String"}},[],[],{mode:"open"},cl));function sa(e,t){customElements.get(e)||customElements.define(e,t)}export{la as default};
|