@pie-players/pie-section-player 1.0.0-beta.1 → 1.0.0-beta.2

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.
@@ -1,6 +1,6 @@
1
- import{t as T}from"./defineProperty-a20a667d.js";import{i as _,n as g,r as b,t as l}from"./classPrivateFieldGet2-338e0179.js";import{t as wn}from"./classPrivateMethodInitSpec-563cd0a5.js";import{t as Mi}from"./attribute-coercion-b93b482c.js";import{t as xi}from"./custom-element-define-2a92deb0.js";import{r as Si}from"./tool-host-contract-fae1c415.js";import{i as Ti}from"./provider-4c704118.js";import{n as Wi}from"./tool-instance-id-76ac45e2.js";var Yr,Zr,He,jt,zt,pe,fe,qt,Pt,Zt,st,gr,Jt,dt,kt,Ne,he,P,xr,Z,Je,lt,ie,H,tt,K,et,Mt,Ft,Nt,ve,Ke,Ve,Et,wr,j,ft,bt,X,Xt,Oe,Ie,mr,At,it;typeof window<"u"&&((Yr=(Zr=window).__svelte??(Zr.__svelte={})).v??(Yr.v=new Set)).add("5");var se={},I=Symbol("uninitialized"),Ci="http://www.w3.org/1999/xhtml",Ei=Array.isArray,Ai=Array.prototype.indexOf,Sr=Array.prototype.includes,Pi=Array.from,er=Object.keys,_e=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,ji=Object.getOwnPropertyDescriptors,Ni=Object.prototype,Oi=Array.prototype,mn=Object.getPrototypeOf,tn=Object.isExtensible,Ii=()=>{};function Ri(t){for(var e=0;e<t.length;e++)t[e]()}function _n(){var t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}var rt=1024,ct=2048,Qt=4096,Or=8192,Li=16384,Ir=32768,en=1<<25,Rr=65536,ue=1<<19,qi=1<<20,rn=1<<21,Fi=1<<22,rr=1<<23,ge=Symbol("$state"),yn=Symbol("component"),$n=Symbol("legacy props"),zi=Symbol(""),Tr=Symbol("attributes"),Wr=Symbol("class"),Di=Symbol("style"),Ue=Symbol("text"),ke=new class extends Error{constructor(...t){super(...t),T(this,"name","StaleReactionError"),T(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Bi=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Hi(){console.warn("https://svelte.dev/e/derived_inert")}function cr(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ji(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var E=!1;function re(t){E=t}var C;function wt(t){if(t===null)throw cr(),se;return C=t}function Lr(){return wt(Ot(C))}function Ge(t){if(E){if(Ot(C)!==null)throw cr(),se;C=t}}function Ki(t=1){if(E){for(var e=t,r=C;e--;)r=Ot(r);C=r}}function bn(t=!0){for(var e=0,r=C;;){if(r.nodeType===8){var n=r.data;if(n==="]"){if(e===0)return r;e-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=Ot(r);t&&r.remove(),r=i}}function Vi(t){if(!t||t.nodeType!==8)throw cr(),se;return t.data}function kn(t){return t===this.v}function Ui(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Mn(t){return!Ui(t,this.v)}function Gi(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Qi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Xi(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Yi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Zi(t){throw new Error("https://svelte.dev/e/effect_orphan")}function ts(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function es(){throw new Error("https://svelte.dev/e/hydration_failed")}function rs(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ns(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function is(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ss(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ls(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var fr=!1,hr=!1,N=null;function le(t){N=t}function qr(t,e=!1,r){N={p:N,i:!1,c:null,e:null,s:t,x:null,r:y,l:hr&&!e?{s:null,u:null,$:[]}:null}}function Fr(t){var e=N,r=e.e;if(r!==null){e.e=null;for(var n of r)Dn(n)}return t!==void 0&&(e.x=t),e.i=!0,N=e.p,zr(t)}function zr(t={}){return _e(t,yn,{value:!0}),t}function Me(){return!hr||N!==null&&N.l===null}var Bt=[];function xn(){var t=Bt;Bt=[],Ri(t)}function Ut(t){if(Bt.length===0&&!we){var e=Bt;queueMicrotask(()=>{e===Bt&&xn()})}Bt.push(t)}function as(){for(;Bt.length>0;)xn()}var os=~(ct|Qt|rt);function O(t,e){t.f=t.f&os|e}function Dr(t){(t.f&512)!==0||t.deps===null?O(t,rt):O(t,Qt)}function Sn(t,e,r){(t.f&2048)!==0?e.add(t):t.f&4096&&r.add(t),O(t,rt)}function vr(t){var e=k,r=y;nt(null),mt(null);try{return t()}finally{nt(e),mt(r)}}function us(t,e,r,n){const i=Me()?ye:Wn;var s=t.filter(v=>!v.settled),a=e.map(i);if(r.length===0&&s.length===0){n(a);return}var o=y,u=cs(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(v=>v.promise)):null;function f(v){if((o.f&16384)===0){u();try{n([...a,...v])}catch(m){gt(m,o)}nr()}}var d=Tn();if(r.length===0){c.then(()=>f([])).finally(d);return}function w(){Promise.all(r.map(v=>fs(v))).then(f).catch(v=>gt(v,o)).finally(d)}c?c.then(()=>{u(),w(),nr()}):w()}function cs(){var t=y,e=k,r=N,n=$;return function(i=!0){mt(t),nt(e),le(r),i&&!(t.f&16384)&&(n?.activate(),n?.apply())}}function nr(t=!0){mt(null),nt(null),le(null),t&&$?.deactivate()}function Tn(){var t=y,e=t.b,r=$,n=!!e?.is_rendered();return e?.update_pending_count(1,r),r.increment(n,t),()=>{e?.update_pending_count(-1,r),r.decrement(n,t)}}function ye(t){var e=2|ct;return y!==null&&(y.f|=ue),{ctx:N,deps:null,effects:null,equals:kn,f:e,fn:t,reactions:null,rv:0,v:I,wv:0,parent:y,ac:null}}var de=Symbol("obsolete");function fs(t,e,r){let n=y;n===null&&Qi();var i=void 0,s=xe(I),a=!k,o=new Set;return Es(()=>{var u=y,c=_n();i=c.promise;try{Promise.resolve(t()).then(c.resolve,v=>{v!==ke&&c.reject(v)}).finally(nr)}catch(v){c.reject(v),nr()}var f=$;if(a){if((u.f&32768)!==0)var d=Tn();if(n.b?.is_rendered())f.async_deriveds.get(u)?.reject(de);else for(const v of o.values())v.reject(de);o.add(c),f.async_deriveds.set(u,c)}const w=(v,m=void 0)=>{d?.(),o.delete(c),m!==de&&(f.activate(),m?(s.f|=rr,or(s,m)):(s.f&8388608&&(s.f^=rr),or(s,v)),f.deactivate())};c.promise.then(w,v=>w(null,v||"unknown"))}),Ts(()=>{for(const u of o)u.reject(de)}),new Promise(u=>{function c(f){function d(){f===i?u(s):c(i)}f.then(d,d)}c(i)})}function Lt(t){const e=ye(t);return Qn(e),e}function Wn(t){const e=ye(t);return e.equals=Mn,e}function hs(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)V(e[r])}}function Br(t){var e,r=y,n=t.parent;if(!St&&n!==null&&t.v!==I&&(n.f&24576)!==0)return Hi(),t.v;mt(n);try{hs(t),e=ti(t)}finally{mt(r)}return e}function Cn(t){var e=Br(t);if(!t.equals(e)&&(t.wv=Yn(),(!$?.is_fork||t.deps===null)&&($!==null?($.capture(t,e,!0),Er?.capture(t,e,!0)):t.v=e,t.deps===null))){O(t,rt);return}St||(z!==null?(Jr()||$?.is_fork)&&z.set(t,e):Dr(t))}function vs(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&vr(()=>{e.ac.abort(ke),e.ac=null}),e.fn!==null&&(e.teardown=Ii),be(e,0),Vr(e))}function En(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&oe(e)}var Cr=null,te=null,$=null,Er=null,z=null,Ar=null,we=!1,_r=!1,$e=null,ir=null,An=0,ds=1,ce=(He=new WeakMap,jt=new WeakMap,zt=new WeakMap,pe=new WeakMap,fe=new WeakMap,qt=new WeakMap,Pt=new WeakMap,Zt=new WeakMap,st=new WeakMap,gr=new WeakMap,Jt=new WeakMap,dt=new WeakMap,kt=new WeakMap,Ne=new WeakMap,he=new WeakMap,P=new WeakSet,xr=class Pn{constructor(){wn(this,P),T(this,"id",ds++),_(this,He,!1),T(this,"linked",!0),_(this,jt,null),_(this,zt,null),T(this,"async_deriveds",new Map),T(this,"current",new Map),T(this,"previous",new Map),_(this,pe,new Set),_(this,fe,new Set),_(this,qt,0),_(this,Pt,new Map),_(this,Zt,null),_(this,st,[]),_(this,gr,[]),_(this,Jt,new Set),_(this,dt,new Set),_(this,kt,new Map),_(this,Ne,new Set),T(this,"is_fork",!1),_(this,he,!1),te===null?Cr=te=this:(g(zt,te,this),g(jt,this,te)),te=this}skip_effect(e){l(kt,this).has(e)||l(kt,this).set(e,{d:[],m:[]}),l(Ne,this).delete(e)}unskip_effect(e,r=n=>this.schedule(n)){var n=l(kt,this).get(e);if(n){l(kt,this).delete(e);for(var i of n.d)O(i,ct),r(i);for(i of n.m)O(i,Qt),r(i)}l(Ne,this).add(e)}capture(e,r,n=!1){e.v!==I&&!this.previous.has(e)&&this.previous.set(e,e.v),!(e.f&8388608)&&(this.current.set(e,[r,n]),z?.set(e,r)),this.is_fork||(e.v=r)}activate(){$=this}deactivate(){$=null,z=null}flush(){try{_r=!0,$=this,b(P,this,sr).call(this)}finally{An=0,Ar=null,$e=null,ir=null,_r=!1,$=null,z=null,pt.clear()}}discard(){for(const e of l(fe,this))e(this);l(fe,this).clear();for(const e of this.async_deriveds.values())e.reject(de);b(P,this,lr).call(this),l(Zt,this)?.resolve()}register_created_effect(e){l(gr,this).push(e)}increment(e,r){if(g(qt,this,l(qt,this)+1),e){let n=l(Pt,this).get(r)??0;l(Pt,this).set(r,n+1)}}decrement(e,r){if(g(qt,this,l(qt,this)-1),e){let n=l(Pt,this).get(r)??0;n===1?l(Pt,this).delete(r):l(Pt,this).set(r,n-1)}l(he,this)||(g(he,this,!0),Ut(()=>{g(he,this,!1),this.linked&&this.flush()}))}transfer_effects(e,r){for(const n of e)l(Jt,this).add(n);for(const n of r)l(dt,this).add(n);e.clear(),r.clear()}oncommit(e){l(pe,this).add(e)}ondiscard(e){l(fe,this).add(e)}settled(){return(l(Zt,this)??g(Zt,this,_n())).promise}static ensure(){if($===null){const e=$=new Pn;!_r&&!we&&Ut(()=>{l(He,e)||e.flush()})}return $}apply(){if(!fr||!this.is_fork&&l(jt,this)===null&&l(zt,this)===null){z=null;return}z=new Map;for(const[r,[n]]of this.current)z.set(r,n);for(let r=Cr;r!==null;r=l(zt,r))if(!(r===this||r.is_fork)){var e=!1;if(r.id<this.id){for(const[n,[,i]]of r.current)if(!i&&this.current.has(n)){e=!0;break}}if(!e)for(const[n,i]of r.previous)z.has(n)||z.set(n,i)}}schedule(e){if(Ar=e,e.b?.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}l(st,this).push(e)}},xr);function nn(){if(this.is_fork)return!0;for(const r of l(Pt,this).keys()){for(var t=r,e=!1;t.parent!==null;){if(l(kt,this).has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}function ps(){var t=[];for(const i of l(st,this))if(!((i.f&16384)!==0||(i.f&6144)===0)){for(var e=i,r=!1;e.parent!==null;){e=e.parent;var n=e.f;if((n&96)!==0){if((n&1024)===0){r=!0;break}e.f^=rt}}r||t.push(e)}return g(st,this,[]),t}function sr(){g(He,this,!0);for(const a of l(Jt,this))l(dt,this).delete(a),O(a,ct),this.schedule(a);for(const a of l(dt,this))O(a,Qt),this.schedule(a);this.apply();for(var t=$e=[],e=[],r=ir=[];l(st,this).length>0;){An++>1e3&&(b(P,this,lr).call(this),_s());for(const a of b(P,this,ps).call(this))try{b(P,this,gs).call(this,a,t,e)}catch(o){throw On(a),b(P,this,nn).call(this)||this.discard(),o}}if($=null,r.length>0){var n=xr.ensure();for(const a of r)n.schedule(a)}if($e=null,ir=null,b(P,this,nn).call(this)){b(P,this,Re).call(this,e),b(P,this,Re).call(this,t);for(const[a,o]of l(kt,this))Nn(a,o);r.length>0&&b(P,$,sr).call($);return}const i=b(P,this,ws).call(this);if(i){b(P,this,Re).call(this,e),b(P,this,Re).call(this,t),b(P,i,ms).call(i,this);return}l(Jt,this).clear(),l(dt,this).clear();for(const a of l(pe,this))a(this);l(pe,this).clear(),Er=this,sn(e),sn(t),Er=null,l(Zt,this)?.resolve();var s=$;if(l(qt,this)===0&&(l(st,this).length===0||s!==null)&&b(P,this,lr).call(this),l(st,this).length>0)if(s!==null){for(const a of l(st,this))l(st,s).push(a);g(st,this,[])}else s=this;s!==null&&(pt.clear(),b(P,s,sr).call(s))}function gs(t,e,r){t.f^=rt;for(var n=t.first;n!==null;){var i=n.f,s=(i&96)!==0;if(!(s&&(i&1024)!==0||(i&8192)!==0||l(kt,this).has(n))&&n.fn!==null){s?n.f^=rt:(i&4)!==0?e.push(n):fr&&(i&16777224)!==0?r.push(n):Te(n)&&(i&16&&l(dt,this).add(n),oe(n));var a=n.first;if(a!==null){n=a;continue}}for(;n!==null;){var o=n.next;if(o!==null){n=o;break}n=n.parent}}}function ws(){for(var t=l(jt,this);t!==null;){if(!t.is_fork){for(const[e,[,r]]of this.current)if(t.current.has(e)&&!r)return t}t=l(jt,t)}return null}function ms(t){for(const[r,n]of t.current)!this.previous.has(r)&&t.previous.has(r)&&this.previous.set(r,t.previous.get(r)),this.current.set(r,n);for(const[r,n]of t.async_deriveds){const i=this.async_deriveds.get(r);i&&n.promise.then(i.resolve).catch(i.reject)}t.async_deriveds.clear(),this.transfer_effects(l(Jt,t),l(dt,t));const e=r=>{var n=r.reactions;if(n!==null&&!((r.f&2)!==0&&(r.f&6144)===0))for(const a of n){var i=a.f;if((i&2)!==0)e(a);else{var s=a;i&4194320&&!this.async_deriveds.has(s)&&(l(dt,this).delete(s),O(s,ct),this.schedule(s))}}};for(const r of this.current.keys())e(r);this.oncommit(()=>t.discard()),b(P,t,lr).call(t),$=this,b(P,this,sr).call(this)}function Re(t){for(var e=0;e<t.length;e+=1)Sn(t[e],l(Jt,this),l(dt,this))}function lr(){if(this.linked){var t=l(jt,this),e=l(zt,this);t===null?Cr=e:g(zt,t,e),e===null?te=t:g(jt,e,t),this.linked=!1}}function at(t){var e=we;we=!0;try{var r;for(t&&($!==null&&!$.is_fork&&$.flush(),r=t());;){if(as(),$===null)return r;$.flush()}}finally{we=e}}function _s(){try{ts()}catch(t){gt(t,Ar)}}var ht=null;function sn(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&24576)===0&&Te(n)&&(ht=new Set,oe(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&Kn(n),ht?.size>0)){pt.clear();for(const i of ht){if((i.f&24576)!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)ht.has(a)&&(ht.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const u=s[o];!(u.f&24576)&&oe(u)}}ht.clear()}}ht=null}}function jn(t){$.schedule(t)}function Nn(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):t.f&4096&&e.m.push(t),O(t,rt);for(var r=t.first;r!==null;)Nn(r,e),r=r.next}}function On(t){O(t,rt);for(var e=t.first;e!==null;)On(e),e=e.next}var ar=new Set,pt=new Map,In=!1;function xe(t,e){return{f:0,v:t,reactions:null,equals:kn,rv:0,wv:0}}function D(t,e){const r=xe(t,e);return Qn(r),r}function ys(t,e=!1,r=!0){const n=xe(t);return e||(n.equals=Mn),n}function x(t,e,r=!1){return k!==null&&(!ot||k.f&131072)&&Me()&&k.f&4325394&&(ut===null||!ut.has(t))&&ss(),or(t,r?ne(e):e,ir)}var Dt=null,Pr=0;function or(t,e,r=null){if(!t.equals(e)){St?pt.set(t,e):pt.has(t)||pt.set(t,t.v);var n=ce.ensure();if(n.capture(t,e),(t.f&2)!==0){const i=t;t.f&2048&&Br(i),z===null&&Dr(i)}t.wv=Yn(),Dt=null,Pr=0,Rn(t,ct,r),Dt=null,Me()&&y!==null&&y.f&1024&&!(y.f&96)&&(Y===null?Ns([t]):Y.push(t)),!n.is_fork&&ar.size>0&&!In&&$s()}return e}function $s(){In=!1;for(const t of ar){t.f&1024&&O(t,Qt);let e;try{e=Te(t)}catch{e=!0}e&&oe(t)}ar.clear()}function me(t){x(t,t.v+1)}function Rn(t,e,r){var n=t.reactions;if(n!==null){var i=Me(),s=n.length;if(Pr+=s,Pr>1e5&&Dt===null&&(Dt=new Set),Dt!==null){if(Dt.has(t))return;Dt.add(t)}for(var a=0;a<s;a++){var o=n[a],u=o.f;if(!(!i&&o===y)){var c=(u&ct)===0;if(c&&O(o,e),(u&131072)!==0)ar.add(o);else if((u&2)!==0){var f=o;z?.delete(f),Rn(f,Qt,r)}else if(c){var d=o;u&16&&ht!==null&&ht.add(d),r!==null?r.push(d):jn(d)}}}}}function ne(t){if(typeof t!="object"||t===null||ge in t||yn in t)return t;const e=mn(t);if(e!==Ni&&e!==Oi)return t;var r=new Map,n=Ei(t),i=D(0),s=null,a=Vt,o=u=>{if(Vt===a)return u();var c=k,f=Vt;nt(null),un(a);var d=u();return nt(c),un(f),d};return n&&r.set("length",D(t.length,s)),new Proxy(t,{defineProperty(u,c,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&ns();var d=r.get(c);return d===void 0?o(()=>{var w=D(f.value,s);return r.set(c,w),w}):x(d,f.value,!0),!0},deleteProperty(u,c){var f=r.get(c);if(f===void 0){if(c in u){const d=o(()=>D(I,s));r.set(c,d),me(i)}}else x(f,I),me(i);return!0},get(u,c,f){if(c===ge)return t;var d=r.get(c),w=c in u;if(d===void 0&&(!w||Kt(u,c)?.writable)&&(d=o(()=>D(ne(w?u[c]:I),s)),r.set(c,d)),d!==void 0){var v=h(d);return v===I?void 0:v}return Reflect.get(u,c,f)},getOwnPropertyDescriptor(u,c){this.has?.(u,c);var f=Reflect.getOwnPropertyDescriptor(u,c),d=r.get(c);if(d!==void 0){var w=h(d);if(w===I)return;if(f&&"value"in f)f.value=w;else return{enumerable:!0,configurable:!0,value:w,writable:!0}}return f},has(u,c){if(c===ge)return!0;var f=r.get(c),d=f!==void 0&&f.v!==I||Reflect.has(u,c);return(f!==void 0||y!==null&&(!d||Kt(u,c)?.writable))&&(f===void 0&&(f=o(()=>D(d?ne(u[c]):I,s)),r.set(c,f)),h(f)===I)?!1:d},set(u,c,f,d){var w=r.get(c),v=c in u;if(n&&c==="length")for(var m=f;m<w.v;m+=1){var M=r.get(m+"");M!==void 0?x(M,I):m in u&&(M=o(()=>D(I,s)),r.set(m+"",M))}if(w===void 0)(!v||Kt(u,c)?.writable)&&(w=o(()=>D(void 0,s)),x(w,ne(f)),r.set(c,w));else{v=w.v!==I;var B=o(()=>ne(f));x(w,B)}var R=Reflect.getOwnPropertyDescriptor(u,c);if(R?.set&&R.set.call(d,f),!v){if(n&&typeof c=="string"){var L=r.get("length"),G=Number(c);Number.isInteger(G)&&G>=L.v&&x(L,G+1)}me(i)}return!0},ownKeys(u){h(i);var c=Reflect.ownKeys(u).filter(w=>{var v=r.get(w);return v===void 0||v.v!==I});for(var[f,d]of r)d.v!==I&&!(f in u)&&c.push(f);return c},setPrototypeOf(){is()}})}var ln,Ln,qn,Fn;function jr(){if(ln===void 0){ln=window,Ln=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;qn=Kt(e,"firstChild").get,Fn=Kt(e,"nextSibling").get,tn(t)&&(t[Wr]=void 0,t[Tr]=null,t[Di]=void 0,t.__e=void 0),tn(r)&&(r[Ue]=void 0)}}function Gt(t=""){return document.createTextNode(t)}function ae(t){return qn.call(t)}function Ot(t){return Fn.call(t)}function Qe(t,e){if(!E)return ae(t);var r=ae(C);if(r===null)r=C.appendChild(Gt());else if(e&&r.nodeType!==3){var n=Gt();return r?.before(n),wt(n),n}return e&&zn(r),wt(r),r}function yr(t,e=!1){if(!E)return ae(t);var r=Qe(t,e);return Ge(t),r}function Le(t,e=1,r=!1){let n=E?C:t;for(var i;e--;)i=n,n=Ot(n);if(!E)return n;if(r){if(n?.nodeType!==3){var s=Gt();return n===null?i?.after(s):n.before(s),wt(s),s}zn(n)}return wt(n),n}function bs(t){t.textContent=""}function ks(){return!fr||ht!==null?!1:(y.f&Ir)!==0}function Hr(t,e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?r?document.createElement(t,{is:r}):document.createElement(t):r?document.createElementNS(e,t,{is:r}):document.createElementNS(e,t)}function zn(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===3;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Ms(t){var e=y;if(e===null)return k.f|=rr,t;if((e.f&32768)===0&&(e.f&4)===0)throw t;gt(t,e)}function gt(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0&&(e.f&33570816)===0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw t}}function xs(t){y===null&&(k===null&&Zi(t),Yi()),St&&Xi(t)}function Ss(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function _t(t,e){var r=y;r!==null&&r.f&8192&&(t|=Or);var n={ctx:N,deps:null,nodes:null,f:t|ct|512,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};$?.register_created_effect(n);var i=n;if((t&4)!==0)$e!==null?$e.push(n):ce.ensure().schedule(n);else if(e!==null){try{oe(n)}catch(a){throw V(n),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,t&16&&t&65536&&i!==null&&(i.f|=Rr))}if(i!==null&&(i.parent=r,r!==null&&Ss(i,r),k!==null&&(k.f&2)!==0&&(t&64)===0)){var s=k;(s.effects??(s.effects=[])).push(i)}return n}function Jr(){return k!==null&&!ot}function Ts(t){const e=_t(8,null);return O(e,rt),e.teardown=t,e}function Xe(t){xs("$effect");var e=y.f;if(!k&&(e&32)!==0&&N!==null&&!N.i){var r=N;(r.e??(r.e=[])).push(t)}else return Dn(t)}function Dn(t){return _t(4|qi,t)}function Ws(t){ce.ensure();const e=_t(64|ue,t);return()=>{V(e)}}function Cs(t){ce.ensure();const e=_t(64|ue,t);return(r={})=>new Promise(n=>{r.outro?Se(e,()=>{V(e),n(void 0)}):(V(e),n(void 0))})}function Bn(t){return _t(4,t)}function Es(t){return _t(Fi|ue,t)}function Kr(t,e=0){return _t(8|e,t)}function qe(t,e=[],r=[],n=[]){us(n,e,r,i=>{_t(8,()=>{t(...i.map(h))})})}function Hn(t,e=0){return _t(16|e,t)}function xt(t){return _t(32|ue,t)}function Jn(t){var e=t.teardown;if(e!==null){const r=St,n=k;on(!0),nt(null);try{e.call(null)}catch(i){gt(i,t.parent)}finally{on(r),nt(n)}}}function Vr(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&vr(()=>{i.abort(ke)});var n=r.next;(r.f&64)!==0?r.parent=null:V(r,e),r=n}}function As(t){for(var e=t.first;e!==null;){var r=e.next;!(e.f&32)&&V(e),e=r}}function V(t,e=!0){var r=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(Ps(t.nodes.start,t.nodes.end),r=!0),t.f|=en,Vr(t,e&&!r),be(t,0);var n=t.nodes&&t.nodes.t;if(n!==null)for(const s of n)s.stop();Jn(t),t.f^=en,t.f|=Li;var i=t.parent;i!==null&&i.first!==null&&Kn(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Ps(t,e){for(;t!==null;){var r=t===e?null:Ot(t);t.remove(),t=r}}function Kn(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Se(t,e,r=!0){var n=[];t.f|=256,Vn(t,n,!0);var i=()=>{r&&V(t),e&&e()},s=n.length;if(s>0){var a=()=>--s||i();for(var o of n)o.out(a)}else i()}function Vn(t,e,r){if((t.f&8192)===0){t.f^=Or;var n=t.nodes&&t.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&e.push(o);for(var i=t.first;i!==null;){var s=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(t.f&16)!==0;Vn(i,e,a?r:!1)}i=s}}}function an(t){t.f&=-257,Un(t,!0)}function Un(t,e){if((t.f&256)===0&&(t.f&8192)!==0){t.f^=Or,!(t.f&1024)&&(O(t,ct),ce.ensure().schedule(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;Un(r,i?e:!1),r=n}var s=t.nodes&&t.nodes.t;if(s!==null)for(const a of s)(a.is_global||e)&&a.in()}}function Gn(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var i=r===n?null:Ot(r);e.append(r),r=i}}var js=null,Ye=!1,St=!1;function on(t){St=t}var k=null,ot=!1;function nt(t){k=t}var y=null;function mt(t){y=t}var ut=null;function Qn(t){k!==null&&(k.f&2097152||k.f&2)&&(ut??(ut=new Set)).add(t)}var J=null,U=0,Y=null;function Ns(t){Y=t}var Xn=1,Ht=0,Vt=Ht;function un(t){Vt=t}function Yn(){return++Xn}function Te(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var r=t.deps,n=r.length,i=0;i<n;i++){var s=r[i];if(Te(s)&&Cn(s),s.wv>t.wv)return!0}e&512&&z===null&&O(t,rt)}return!1}function Zn(t,e,r=!0){var n=t.reactions;if(n!==null&&!(!fr&&ut!==null&&ut.has(t)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&2)!==0?Zn(s,e,!1):e===s&&(r?O(s,ct):s.f&1024&&O(s,Qt),jn(s))}}function ti(t){var e=J,r=U,n=Y,i=k,s=ut,a=N,o=ot,u=Vt,c=t.f;J=null,U=0,Y=null,k=(c&96)===0?t:null,ut=null,le(t.ctx),ot=!1,Vt=++Ht,t.ac!==null&&(vr(()=>{t.ac.abort(ke)}),t.ac=null);try{t.f|=rn;var f=t.fn,d=f();t.f|=Ir;var w=cn(t);if(Me()&&Y!==null&&!ot&&w!==null&&(t.f&6146)===0)for(var v=0;v<Y.length;v++)Zn(Y[v],t);if(i!==null&&i!==t){if(Ht++,i.deps!==null)for(let m=0;m<r;m+=1)i.deps[m].rv=Ht;if(e!==null)for(const m of e)m.rv=Ht;Y!==null&&(n===null?n=Y:n.push(...Y))}return t.f&8388608&&(t.f^=rr),d}catch(m){return cn(t),Ms(m)}finally{t.f^=rn,J=e,U=r,Y=n,k=i,ut=s,le(a),ot=o,Vt=u}}function cn(t){var e=t.deps,r=$?.is_fork;if(J!==null){var n,i;if(r||be(t,U),e!==null&&U>0)for(e.length=U+J.length,i=0;i<J.length;i++)e[U+i]=J[i];else t.deps=e=J;if(Jr()&&(t.f&512)!==0)for(i=U;i<e.length;i++)((n=e[i]).reactions??(n.reactions=[])).push(t)}else!r&&e!==null&&U<e.length&&(be(t,U),e.length=U);return e}function Os(t,e){let r=e.reactions;if(r!==null){var n=Ai.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(e.f&2)!==0&&(J===null||!Sr.call(J,e))){var s=e;s.f&512&&(s.f^=512),s.v!==I&&Dr(s),s.ac!==null&&vr(()=>{s.ac.abort(ke),s.ac=null,O(s,ct)}),vs(s),be(s,0)}}function be(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Os(t,r[n])}function oe(t){var e=t.f;if((e&16384)===0){O(t,rt);var r=y,n=Ye;y=t,Ye=(e&96)===0;try{(e&16777232)!==0?As(t):Vr(t),Jn(t);var i=ti(t);t.teardown=typeof i=="function"?i:null,t.wv=Xn}finally{Ye=n,y=r}}}function h(t){var e=(t.f&2)!==0;if(js?.add(t),k!==null&&!ot&&!(y!==null&&(y.f&16384)!==0)&&(ut===null||!ut.has(t))){var r=k.deps;if((k.f&2097152)!==0)t.rv<Ht&&(t.rv=Ht,J===null&&r!==null&&r[U]===t?U++:J===null?J=[t]:J.push(t));else{var n;(n=k).deps??(n.deps=[]),Sr.call(k.deps,t)||k.deps.push(t);var i=t.reactions;i===null?t.reactions=[k]:Sr.call(i,k)||i.push(k)}}if(St&&pt.has(t))return pt.get(t);if(e){var s=t;if(St){var a=s.v;return(!(s.f&1024)&&s.reactions!==null||ri(s))&&(a=Br(s)),pt.set(s,a),a}var o=(s.f&512)===0&&!ot&&k!==null&&(Ye||(k.f&512)!==0),u=(s.f&Ir)===0;Te(s)&&(o&&(s.f|=512),Cn(s)),o&&!u&&(En(s),ei(s))}if(z?.has(t))return z.get(t);if((t.f&8388608)!==0)throw t.v;return t.v}function ei(t){if(t.f|=512,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&2&&!(e.f&512)&&(En(e),ei(e))}function ri(t){if(t.v===I)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(pt.has(e)||(e.f&2)!==0&&ri(e))return!0;return!1}function We(t){var e=ot;try{return ot=!0,t()}finally{ot=e}}var Fe=Symbol("events"),Is=new Set,fn=new Set,$r=null,br=!1;function hn(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;$r=t,br||(br=!0,setTimeout(()=>{br=!1,$r=null}));var a=0,o=$r===t&&t[Fe];if(o){var u=i.indexOf(o);if(u!==-1&&(e===document||e===window)){t[Fe]=e;return}var c=i.indexOf(e);if(c===-1)return;u<=c&&(a=u)}if(s=i[a]||t.target,s!==e){_e(t,"currentTarget",{configurable:!0,get(){return s||r}});var f=k,d=y;nt(null),mt(null);try{for(var w,v=[];s!==null&&s!==e;){try{var m=s[Fe]?.[n];m!=null&&(!s.disabled||t.target===s)&&m.call(s,t)}catch(M){w?v.push(M):w=M}if(t.cancelBubble)break;a++,s=a<i.length?i[a]:null}if(w){for(let M of v)queueMicrotask(()=>{throw M});throw w}}finally{t[Fe]=e,delete t.currentTarget,nt(f),mt(d)}}}var Rs=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ls(t){return Rs?.createHTML(t)??t}function qs(t){var e=Hr("template");return e.innerHTML=Ls(t.replaceAll("<!>","<!---->")),e.content}function Ze(t,e){var r=y;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function Ce(t,e){var r=(e&1)!==0,n=(e&2)!==0,i,s=!t.startsWith("<!>");return()=>{if(E)return Ze(C,null),C;i===void 0&&(i=qs(s?t:"<!>"+t),r||(i=ae(i)));var a=n||Ln?document.importNode(i,!0):i.cloneNode(!0);if(r){var o=ae(a),u=a.lastChild;Ze(o,u)}else Ze(a,a);return a}}function ee(t,e){if(E){var r=y;(!(r.f&32768)||r.nodes.end===null)&&(r.nodes.end=C),Lr();return}t!==null&&t.before(e)}var Fs=["touchstart","touchmove"];function zs(t){return Fs.includes(t)}function Ds(t){let e=0,r=xe(0),n;return()=>{Jr()&&(h(r),Kr(()=>(e===0&&(n=We(()=>t(()=>me(r)))),e+=1,()=>{Ut(()=>{e-=1,e===0&&(n?.(),n=void 0,me(r))})})))}}var Bs=Rr|ue;function Hs(t,e,r,n){new Js(t,e,r,n)}var Js=(Z=new WeakMap,Je=new WeakMap,lt=new WeakMap,ie=new WeakMap,H=new WeakMap,tt=new WeakMap,K=new WeakMap,et=new WeakMap,Mt=new WeakMap,Ft=new WeakMap,Nt=new WeakMap,ve=new WeakMap,Ke=new WeakMap,Ve=new WeakMap,Et=new WeakMap,wr=new WeakMap,j=new WeakSet,class{constructor(t,e,r,n){wn(this,j),T(this,"parent",void 0),T(this,"is_pending",!1),T(this,"transform_error",void 0),_(this,Z,void 0),_(this,Je,E?C:null),_(this,lt,void 0),_(this,ie,void 0),_(this,H,void 0),_(this,tt,null),_(this,K,null),_(this,et,null),_(this,Mt,null),_(this,Ft,0),_(this,Nt,0),_(this,ve,!1),_(this,Ke,new Set),_(this,Ve,new Set),_(this,Et,null),_(this,wr,Ds(()=>(g(Et,this,xe(l(Ft,this))),()=>{g(Et,this,null)}))),g(Z,this,t),g(lt,this,e),g(ie,this,i=>{var s=y;s.b=this,s.f|=128,r(i)}),this.parent=y.b,this.transform_error=n??this.parent?.transform_error??(i=>i),g(H,this,Hn(()=>{if(E){const i=l(Je,this);Lr();const s=i.data==="[!";if(i.data.startsWith("[?")){const a=JSON.parse(i.data.slice(2));b(j,this,Vs).call(this,a)}else s?b(j,this,Us).call(this):b(j,this,Ks).call(this)}else b(j,this,ii).call(this)},Bs)),E&&g(Z,this,C)}defer_effect(t){Sn(t,l(Ke,this),l(Ve,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!l(lt,this).pending}update_pending_count(t,e){b(j,this,si).call(this,t,e),g(Ft,this,l(Ft,this)+t),l(Et,this)&&!l(ve,this)&&(g(ve,this,!0),Ut(()=>{g(ve,this,!1),l(Et,this)&&or(l(Et,this),l(Ft,this))}))}get_effect_pending(){return l(wr,this).call(this),h(l(Et,this))}error(t){if(!l(lt,this).onerror&&!l(lt,this).failed)throw t;$?.is_fork?(l(tt,this)&&$.skip_effect(l(tt,this)),l(K,this)&&$.skip_effect(l(K,this)),l(et,this)&&$.skip_effect(l(et,this)),$.oncommit(()=>{b(j,this,vn).call(this,t)})):b(j,this,vn).call(this,t)}});function Ks(){try{g(tt,this,xt(()=>l(ie,this).call(this,l(Z,this))))}catch(t){this.error(t)}}function Vs(t){const e=l(lt,this).failed,{reset:r,invoke_onerror:n}=b(j,this,ni).call(this,t);Ut(n),e&&g(et,this,xt(()=>{e(l(Z,this),()=>t,()=>r)}))}function ni(t){var e=!1,r=!1;const n=()=>{if(e){Ji();return}e=!0,r&&ls(),l(et,this)!==null&&Se(l(et,this),()=>{g(et,this,null)}),b(j,this,Ur).call(this,()=>{b(j,this,ii).call(this)})};return{reset:n,invoke_onerror:()=>{try{r=!0,l(lt,this).onerror?.(t,n),r=!1}catch(i){gt(i,l(H,this)&&l(H,this).parent)}}}}function Us(){const t=l(lt,this).pending;t&&(this.is_pending=!0,g(K,this,xt(()=>t(l(Z,this)))),Ut(()=>{var e=g(Mt,this,document.createDocumentFragment()),r=Gt(),n=!1;if(e.append(r),g(tt,this,b(j,this,Ur).call(this,()=>{try{return xt(()=>l(ie,this).call(this,r))}catch(i){try{this.error(i),n=!0}catch(s){gt(s,l(H,this).parent)}return null}})),l(tt,this)===null){g(Mt,this,null),n&&b(j,this,ur).call(this,$);return}l(Nt,this)===0&&(l(Z,this).before(e),g(Mt,this,null),Se(l(K,this),()=>{g(K,this,null)}),b(j,this,ur).call(this,$))}))}function ii(){try{if(this.is_pending=this.has_pending_snippet(),g(Nt,this,0),g(Ft,this,0),g(tt,this,xt(()=>{l(ie,this).call(this,l(Z,this))})),l(Nt,this)>0){var t=g(Mt,this,document.createDocumentFragment());Gn(l(tt,this),t);const e=l(lt,this).pending;g(K,this,xt(()=>e(l(Z,this))))}else b(j,this,ur).call(this,$)}catch(e){this.error(e)}}function ur(t){this.is_pending=!1,t.transfer_effects(l(Ke,this),l(Ve,this))}function Ur(t){var e=y,r=k,n=N;mt(l(H,this)),nt(l(H,this)),le(l(H,this).ctx);try{return ce.ensure(),t()}finally{mt(e),nt(r),le(n)}}function si(t,e){if(!this.has_pending_snippet()){var r;this.parent&&b(j,r=this.parent,si).call(r,t,e);return}g(Nt,this,l(Nt,this)+t),l(Nt,this)===0&&(b(j,this,ur).call(this,e),l(K,this)&&Se(l(K,this),()=>{g(K,this,null)}),l(Mt,this)&&(l(Z,this).before(l(Mt,this)),g(Mt,this,null)))}function vn(t){l(tt,this)&&(V(l(tt,this)),g(tt,this,null)),l(K,this)&&(V(l(K,this)),g(K,this,null)),l(et,this)&&(V(l(et,this)),g(et,this,null)),E&&(wt(l(Je,this)),Ki(),wt(bn()));let e=l(lt,this).failed;const r=n=>{const{reset:i,invoke_onerror:s}=b(j,this,ni).call(this,n);s(),e&&g(et,this,b(j,this,Ur).call(this,()=>{try{return xt(()=>{var a=y;a.b=this,a.f|=128,e(l(Z,this),()=>n,()=>i)})}catch(a){return gt(a,l(H,this).parent),null}}))};Ut(()=>{var n;try{n=this.transform_error(t)}catch(i){gt(i,l(H,this)&&l(H,this).parent);return}n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(r,i=>gt(i,l(H,this)&&l(H,this).parent)):r(n)})}function kr(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t[Ue]??(t[Ue]=t.nodeValue))&&(t[Ue]=r,t.nodeValue=`${r}`)}function li(t,e){return ai(t,e)}function Gs(t,e){jr(),e.intro=e.intro??!1;const r=e.target,n=E,i=C;try{for(var s=ae(r);s&&(s.nodeType!==8||s.data!=="[");)s=Ot(s);if(!s)throw se;re(!0),wt(s);const a=ai(t,{...e,anchor:s});return re(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
- `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==se&&console.warn("Failed to hydrate: ",a),e.recover===!1&&es(),jr(),bs(r),re(!1),li(t,e)}finally{re(n),wt(i)}}var ze=new Map;function ai(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:a=!0,transformError:o}){jr();var u=void 0,c=Cs(()=>{var f=r??e.appendChild(Gt());Hs(f,{pending:()=>{}},v=>{qr({});var m=N;if(s&&(m.c=s),i&&(n.$$events=i),E&&Ze(v,null),u=t(v,n)||zr(),E&&(y.nodes.end=C,C===null||C.nodeType!==8||C.data!=="]"))throw cr(),se;Fr()},o);var d=new Set,w=v=>{for(var m=0;m<v.length;m++){var M=v[m];if(!d.has(M)){d.add(M);var B=zs(M);for(const G of[e,document]){var R=ze.get(G);R===void 0&&(R=new Map,ze.set(G,R));var L=R.get(M);L===void 0?(G.addEventListener(M,hn,{passive:B}),R.set(M,1)):R.set(M,L+1)}}}};return w(Pi(Is)),fn.add(w),()=>{for(var v of d)for(const B of[e,document]){var m=ze.get(B),M=m.get(v);--M==0?(B.removeEventListener(v,hn),m.delete(v),m.size===0&&ze.delete(B)):m.set(v,M)}fn.delete(w),f!==r&&f.parentNode?.removeChild(f)}});return Nr.set(u,c),u}var Nr=new WeakMap;function Qs(t,e){const r=Nr.get(t);return r?(Nr.delete(t),r(e)):Promise.resolve()}var Xs=(ft=new WeakMap,bt=new WeakMap,X=new WeakMap,Xt=new WeakMap,Oe=new WeakMap,Ie=new WeakMap,mr=new WeakMap,class{constructor(t,e=!0){T(this,"anchor",void 0),_(this,ft,new Map),_(this,bt,new Map),_(this,X,new Map),_(this,Xt,new Set),_(this,Oe,!0),_(this,Ie,r=>{if(l(ft,this).has(r)){var n=l(ft,this).get(r),i=l(bt,this).get(n);if(i)an(i),l(Xt,this).delete(n);else{var s=l(X,this).get(n);s&&(an(s.effect),l(bt,this).set(n,s.effect),l(X,this).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[a,o]of l(ft,this)){if(l(ft,this).delete(a),a===r)break;const u=l(X,this).get(o);u&&(V(u.effect),l(X,this).delete(o))}for(const[a,o]of l(bt,this)){if(a===n||l(Xt,this).has(a))continue;const u=()=>{if(Array.from(l(ft,this).values()).includes(a)){var c=document.createDocumentFragment();Gn(o,c),c.append(Gt()),l(X,this).set(a,{effect:o,fragment:c})}else V(o);l(Xt,this).delete(a),l(bt,this).delete(a)};l(Oe,this)||!i?(l(Xt,this).add(a),Se(o,u,!1)):u()}}}),_(this,mr,r=>{l(ft,this).delete(r);const n=Array.from(l(ft,this).values());for(const[i,s]of l(X,this))n.includes(i)||(V(s.effect),l(X,this).delete(i))}),this.anchor=t,g(Oe,this,e)}ensure(t,e){var r=$,n=ks();if(e&&!l(bt,this).has(t)&&!l(X,this).has(t))if(n){var i=document.createDocumentFragment(),s=Gt();i.append(s),l(X,this).set(t,{effect:xt(()=>e(s)),fragment:i})}else l(bt,this).set(t,xt(()=>e(this.anchor)));if(l(ft,this).set(r,t),n){for(const[a,o]of l(bt,this))a===t?r.unskip_effect(o):r.skip_effect(o);for(const[a,o]of l(X,this))a===t?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(l(Ie,this)),r.ondiscard(l(mr,this))}else E&&(this.anchor=C),l(Ie,this).call(this,r)}});function Ys(t){N===null&&Gi("onMount"),hr&&N.l!==null?Zs(N).m.push(t):Xe(()=>{const e=We(t);if(typeof e=="function")return e})}function Zs(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function De(t,e,r=!1){var n;E&&(n=C,Lr());var i=new Xs(t),s=r?Rr:0;function a(o,u){if(E){var c=Vi(n);if(o!==parseInt(c.substring(1))){var f=bn();wt(f),i.anchor=f,re(!1),i.ensure(o,u),re(!0);return}}i.ensure(o,u)}Hn(()=>{var o=!1;e((u,c=0)=>{o=!0,a(c,u)}),o||a(-1,null)},s)}function oi(t,e){Bn(()=>{t=y?.parent?.nodes?.start??t;var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=Hr("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}var dn=[...`
3
- \r\f \v\uFEFF`];function tl(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i of Object.keys(r))if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||dn.includes(n[a-1]))&&(o===n.length||dn.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function el(t,e,r,n,i,s){var a=t[Wr];if(E||a!==r||a===void 0){var o=tl(r,n,s);(!E||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t[Wr]=r}else if(s&&i!==s)for(var u in s){var c=!!s[u];(i==null||c!==!!i[u])&&t.classList.toggle(u,c)}return s}var rl=Symbol("is custom element"),nl=Symbol("is html"),il=Bi?"link":"LINK";function Yt(t,e,r,n){var i=sl(t);E&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===il)||i[e]!==(i[e]=r)&&(e==="loading"&&(t[zi]=r),r==null?t.removeAttribute(e):typeof r!="string"&&ll(t).has(e)?t[e]=r:t.setAttribute(e,r))}function sl(t){return t[Tr]??(t[Tr]={[rl]:t.nodeName.includes("-"),[nl]:t.namespaceURI===Ci})}var pn=new Map;function ll(t){var e=t.getAttribute("is")||t.nodeName,r=pn.get(e);if(r)return r;pn.set(e,r=new Set);for(var n,i=t,s=Element.prototype;s!==i;){n=ji(i);for(var a in n)n[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&r.add(a);i=mn(i)}return r}function Mr(t,e){return t===e||t?.[ge]===e}function gn(t=zr(),e,r,n){var i=N.r,s=y;return Bn(()=>{var a,o;return Kr(()=>{a=o,o=n?.()||[],We(()=>{Mr(r(...o),t)||(e(t,...o),a&&Mr(r(...a),t)&&e(null,...a))})}),()=>{let u=s;for(;u!==i&&u.parent!==null&&u.parent.f&33554432;)u=u.parent;const c=()=>{o&&Mr(r(...o),t)&&e(null,...o)},f=u.teardown;u.teardown=()=>{c(),f?.()}}}),t}var Be=!1;function al(t){var e=Be;try{return Be=!1,[t(),Be]}finally{Be=e}}function vt(t,e,r,n){var i=!hr||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=n,u=!0,c=void 0,f=()=>a&&i?(c??(c=ye(n)),h(c)):(u&&(u=!1,o=a?We(n):n),o);let d;if(s){var w=ge in t||$n in t;d=Kt(t,e)?.set??(w&&e in t?A=>t[e]=A:void 0)}var v,m=!1;s?[v,m]=al(()=>t[e]):v=t[e],v===void 0&&n!==void 0&&(v=f(),d&&(i&&rs(e),d(v)));var M;if(i?M=()=>{var A=t[e];return A===void 0?f():(u=!0,A)}:M=()=>{var A=t[e];return A!==void 0&&(o=void 0),A===void 0?o:A},i&&(r&4)===0)return M;if(d){var B=t.$$legacy;return(function(A,Tt){return arguments.length>0?((!i||!Tt||B||m)&&d(Tt?M():A),A):M()})}var R=!1,L=((r&1)!==0?ye:Wn)(()=>(R=!1,M()));s&&h(L);var G=y;return(function(A,Tt){if(arguments.length>0){const Wt=Tt?h(L):i&&s?ne(A):A;return x(L,Wt),R=!0,o!==void 0&&(o=Wt),A}return St&&R||(G.f&16384)!==0?L.v:h(L)})}function ol(t){return new ul(t)}var ul=(At=new WeakMap,it=new WeakMap,class{constructor(t){_(this,At,void 0),_(this,it,void 0);var e=new Map,r=(i,s)=>{var a=ys(s,!1,!1);return e.set(i,a),a};const n=new Proxy({...t.props||{},$$events:{}},{get(i,s){return h(e.get(s)??r(s,Reflect.get(i,s)))},has(i,s){return s===$n?!0:(h(e.get(s)??r(s,Reflect.get(i,s))),Reflect.has(i,s))},set(i,s,a){return x(e.get(s)??r(s,a),a),Reflect.set(i,s,a)}});g(it,this,(t.hydrate?Gs:li)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!t?.props?.$$host||t.sync===!1)&&at(),g(At,this,n.$$events);for(const i of Object.keys(l(it,this)))i==="$set"||i==="$destroy"||i==="$on"||_e(this,i,{get(){return l(it,this)[i]},set(s){l(it,this)[i]=s},enumerable:!0});l(it,this).$set=i=>{Object.assign(n,i)},l(it,this).$destroy=()=>{Qs(l(it,this))}}$set(t){l(it,this).$set(t)}$on(t,e){l(At,this)[t]=l(At,this)[t]||[];const r=(...n)=>e.call(this,...n);return l(At,this)[t].push(r),()=>{l(At,this)[t]=l(At,this)[t].filter(n=>n!==r)}}$destroy(){l(it,this).$destroy()}}),ui;typeof HTMLElement=="function"&&(ui=class extends HTMLElement{constructor(t,e,r){var n=(...i)=>(super(...i),T(this,"$$ctor",void 0),T(this,"$$s",void 0),T(this,"$$c",void 0),T(this,"$$cn",!1),T(this,"$$d",{}),T(this,"$$r",!1),T(this,"$$p_d",{}),T(this,"$$l",{}),T(this,"$$l_u",new Map),T(this,"$$me",void 0),T(this,"$$shadowRoot",null),this);n(),this.$$ctor=t,this.$$s=e,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return i=>{const s=Hr("slot");n!=="default"&&(s.name=n),ee(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=cl(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=tr(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=ol({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Ws(()=>{Kr(()=>{this.$$r=!0;for(const n of er(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=tr(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=tr(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return er(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function tr(t,e,r,n){const i=r[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function cl(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function ci(t,e,r,n,i,s){let a=class extends ui{constructor(){super(t,r,i),this.$$p_d=e}static get observedAttributes(){return er(e).map(o=>(e[o].attribute||o).toLowerCase())}};return er(e).forEach(o=>{_e(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(u){u=tr(o,u,e),this.$$d[o]=u;var c=this.$$c;c&&(Kt(c,o)?.get?c[o]=u:c.$set({[o]:u}))}})}),n.forEach(o=>{_e(a.prototype,o,{get(){return this.$$c?.[o]}})}),s&&(a=s(a)),t.element=a,a}function fl(t){const e=new Set,r=n=>{if(n===void 0)return{$type:"undefined"};if(typeof n=="bigint")return{$type:"bigint",value:n.toString()};if(typeof n=="function")return{$type:"function",value:n.toString()};if(typeof n=="symbol")return{$type:"symbol",value:n.description??""};if(n===null||typeof n!="object")return n;if(e.has(n))return{$type:"circular-reference"};e.add(n);const i=Array.isArray(n)?n.map(r):Object.fromEntries(Object.entries(n).sort(([s],[a])=>s.localeCompare(a)).map(([s,a])=>[s,r(a)]));return e.delete(n),i};return JSON.stringify(r(t))}var hl=Ce('<a class="pie-tool-calculator__attribution svelte-16ps7c2" target="_blank" rel="noreferrer"> </a>'),vl=Ce('<div class="pie-tool-calculator__loading svelte-16ps7c2"> </div>'),dl=Ce('<div class="pie-tool-calculator__loading pie-tool-calculator__loading--error svelte-16ps7c2">Calculator failed to initialize. <div class="pie-tool-calculator__error-details svelte-16ps7c2"> </div></div>'),pl=Ce('<div role="region" tabindex="-1" translate="no"><div class="pie-tool-calculator__container svelte-16ps7c2"></div> <!> <!> <!></div>'),gl=Ce('<div class="pie-tool-calculator__context-host svelte-16ps7c2"><!></div>'),wl={hash:"svelte-16ps7c2",code:`.pie-tool-calculator__context-host.svelte-16ps7c2 {display:flex;width:100%;height:100%;min-height:0;}.pie-tool-calculator.svelte-16ps7c2 {position:relative;display:flex;flex:1 1 auto;min-width:100%;min-height:0;background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__container.svelte-16ps7c2 {position:relative;width:100%;height:100%;min-width:100%;min-height:100%;
1
+ import{t as W}from"./defineProperty-a20a667d.js";import{i as y,n as g,r as _,t as l}from"./classPrivateFieldGet2-338e0179.js";import{t as wn}from"./classPrivateMethodInitSpec-563cd0a5.js";import{t as Si}from"./attribute-coercion-b93b482c.js";import{t as Ti}from"./custom-element-define-2a92deb0.js";import{r as Wi}from"./tool-host-contract-fae1c415.js";import{i as Ci}from"./provider-4c704118.js";import{n as Ei}from"./tool-instance-id-76ac45e2.js";var Gr,tn,Je,jt,Dt,we,ve,Ft,Pt,ee,lt,_r,Jt,dt,kt,Oe,de,j,Tr,tt,Ke,at,le,B,et,J,rt,Mt,zt,Nt,pe,Ue,Qe,Et,mr,x,ft,bt,Y,Gt,Re,Le,yr,At,st;typeof window<"u"&&((Gr=(tn=window).__svelte??(tn.__svelte={})).v??(Gr.v=new Set)).add("5");var It={},O=Symbol("uninitialized"),Ai="http://www.w3.org/1999/xhtml",Pi=Array.isArray,ji=Array.prototype.indexOf,rr=Array.prototype.includes,Ni=Array.from,nr=Object.keys,$e=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,Ii=Object.getOwnPropertyDescriptors,Oi=Object.prototype,Ri=Array.prototype,_n=Object.getPrototypeOf,en=Object.isExtensible,Li=()=>{};function qi(t){for(var e=0;e<t.length;e++)t[e]()}function mn(){var t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}var nt=1024,ct=2048,Zt=4096,Or=8192,yn=16384,Rr=32768,Wr=1<<25,Lr=65536,fe=1<<19,Fi=1<<20,rn=1<<21,zi=1<<22,ir=1<<23,_e=Symbol("$state"),$n=Symbol("component"),bn=Symbol("legacy props"),Di=Symbol(""),Cr=Symbol("attributes"),Er=Symbol("class"),Bi=Symbol("style"),Xe=Symbol("text"),xe=new class extends Error{constructor(...t){super(...t),W(this,"name","StaleReactionError"),W(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Vi=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Hi(){console.warn("https://svelte.dev/e/derived_inert")}function hr(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ji(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var A=!1;function ie(t){A=t}var E;function wt(t){if(t===null)throw hr(),It;return E=t}function qr(){return wt(Ot(E))}function Ye(t){if(A){if(Ot(E)!==null)throw hr(),It;E=t}}function Ki(t=1){if(A){for(var e=t,r=E;e--;)r=Ot(r);E=r}}function kn(t=!0){for(var e=0,r=E;;){if(r.nodeType===8){var n=r.data;if(n==="]"){if(e===0)return r;e-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=Ot(r);t&&r.remove(),r=i}}function Mn(t){if(!t||t.nodeType!==8)throw hr(),It;return t.data}function xn(t){return t===this.v}function Ui(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Sn(t){return!Ui(t,this.v)}function Qi(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Xi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Yi(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Gi(t){throw new Error("https://svelte.dev/e/effect_orphan")}function ts(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function es(){throw new Error("https://svelte.dev/e/hydration_failed")}function rs(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ns(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function is(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ss(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ls(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var vr=!1,dr=!1,N=null;function oe(t){N=t}function Fr(t,e=!1,r){N={p:N,i:!1,c:null,e:null,s:t,x:null,r:$,l:dr&&!e?{s:null,u:null,$:[]}:null}}function zr(t){var e=N,r=e.e;if(r!==null){e.e=null;for(var n of r)Vn(n)}return t!==void 0&&(e.x=t),e.i=!0,N=e.p,Dr(t)}function Dr(t={}){return $e(t,$n,{value:!0}),t}function Se(){return!dr||N!==null&&N.l===null}var Vt=[];function Tn(){var t=Vt;Vt=[],qi(t)}function Xt(t){if(Vt.length===0&&!me){var e=Vt;queueMicrotask(()=>{e===Vt&&Tn()})}Vt.push(t)}function as(){for(;Vt.length>0;)Tn()}var os=~(ct|Zt|nt);function I(t,e){t.f=t.f&os|e}function Br(t){(t.f&512)!==0||t.deps===null?I(t,nt):I(t,Zt)}function Wn(t,e,r){(t.f&2048)!==0?e.add(t):t.f&4096&&r.add(t),I(t,nt)}function pr(t){var e=b,r=$;it(null),_t(null);try{return t()}finally{it(e),_t(r)}}function us(t,e,r,n){const i=Se()?be:En;var s=t.filter(v=>!v.settled),a=e.map(i);if(r.length===0&&s.length===0){n(a);return}var o=$,u=cs(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(v=>v.promise)):null;function f(v){if((o.f&16384)===0){u();try{n([...a,...v])}catch(m){gt(m,o)}sr()}}var d=Cn();if(r.length===0){c.then(()=>f([])).finally(d);return}function w(){Promise.all(r.map(v=>fs(v))).then(f).catch(v=>gt(v,o)).finally(d)}c?c.then(()=>{if((o.f&16384)!==0){d();return}u(),w(),sr()}):w()}function cs(){var t=$,e=b,r=N,n=M;return function(i=!0){_t(t),it(e),oe(r),i&&!(t.f&16384)&&(n?.activate(),n?.apply())}}function sr(t=!0){_t(null),it(null),oe(null),t&&M?.deactivate()}function Cn(){var t=$,e=t.b,r=M,n=!!e?.is_rendered();return e?.update_pending_count(1,r),r.increment(n,t),()=>{e?.update_pending_count(-1,r),r.decrement(n,t)}}function be(t){var e=2|ct;return $!==null&&($.f|=fe),{ctx:N,deps:null,effects:null,equals:xn,f:e,fn:t,reactions:null,rv:0,v:O,wv:0,parent:$,ac:null}}var ge=Symbol("obsolete");function fs(t,e,r){let n=$;n===null&&Xi();var i=void 0,s=Te(O),a=!b,o=new Set;return Es(()=>{var u=$,c=mn();i=c.promise;try{Promise.resolve(t()).then(c.resolve,v=>{v!==xe&&c.reject(v)}).finally(sr)}catch(v){c.reject(v),sr()}var f=M;if(a){if((u.f&32768)!==0)var d=Cn();if(n.b?.is_rendered())f.async_deriveds.get(u)?.reject(ge);else for(const v of o.values())v.reject(ge);o.add(c),f.async_deriveds.set(u,c)}const w=(v,m=void 0)=>{d?.(),o.delete(c),m!==ge&&(f.activate(),m?(s.f|=ir,cr(s,m)):(s.f&8388608&&(s.f^=ir),cr(s,v)),f.deactivate())};c.promise.then(w,v=>w(null,v||"unknown"))}),Ts(()=>{for(const u of o)u.reject(ge)}),new Promise(u=>{function c(f){function d(){f===i?u(s):c(i)}f.then(d,d)}c(i)})}function qt(t){const e=be(t);return Zn(e),e}function En(t){const e=be(t);return e.equals=Sn,e}function hs(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)K(e[r])}}function Vr(t){var e,r=$,n=t.parent;if(!St&&n!==null&&t.v!==O&&(n.f&24576)!==0)return Hi(),t.v;_t(n);try{hs(t),e=ri(t)}finally{_t(r)}return e}function An(t){var e=Vr(t);if(!t.equals(e)&&(t.wv=ti(),(!M?.is_fork||t.deps===null)&&(M!==null?(M.capture(t,e,!0),ae?.capture(t,e,!0)):t.v=e,t.deps===null))){I(t,nt);return}St||(z!==null?(Jr()||M?.is_fork)&&z.set(t,e):Br(t))}function vs(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac!==null&&pr(()=>{e.ac.abort(xe),e.ac=null}),e.fn!==null&&(e.teardown=Li),Me(e,0),Ur(e))}function Pn(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&ce(e)}var Ar=null,re=null,M=null,ae=null,z=null,Pr=null,me=!1,$r=!1,ke=null,lr=null,jn=0,ds=1,he=(Je=new WeakMap,jt=new WeakMap,Dt=new WeakMap,we=new WeakMap,ve=new WeakMap,Ft=new WeakMap,Pt=new WeakMap,ee=new WeakMap,lt=new WeakMap,_r=new WeakMap,Jt=new WeakMap,dt=new WeakMap,kt=new WeakMap,Oe=new WeakMap,de=new WeakMap,j=new WeakSet,Tr=class Nn{constructor(){wn(this,j),W(this,"id",ds++),y(this,Je,!1),W(this,"linked",!0),y(this,jt,null),y(this,Dt,null),W(this,"async_deriveds",new Map),W(this,"current",new Map),W(this,"previous",new Map),y(this,we,new Set),y(this,ve,new Set),y(this,Ft,0),y(this,Pt,new Map),y(this,ee,null),y(this,lt,[]),y(this,_r,[]),y(this,Jt,new Set),y(this,dt,new Set),y(this,kt,new Map),y(this,Oe,new Set),W(this,"is_fork",!1),y(this,de,!1),re===null?Ar=re=this:(g(Dt,re,this),g(jt,this,re)),re=this}skip_effect(e){l(kt,this).has(e)||l(kt,this).set(e,{d:[],m:[]}),l(Oe,this).delete(e)}unskip_effect(e,r=n=>this.schedule(n)){var n=l(kt,this).get(e);if(n){l(kt,this).delete(e);for(var i of n.d)I(i,ct),r(i);for(i of n.m)I(i,Zt),r(i)}l(Oe,this).add(e)}capture(e,r,n=!1){e.v!==O&&!this.previous.has(e)&&this.previous.set(e,e.v),!(e.f&8388608)&&(this.current.set(e,[r,n]),z?.set(e,r)),this.is_fork||(e.v=r)}activate(){M=this}deactivate(){M=null,z=null}flush(){try{$r=!0,M=this,_(j,this,ar).call(this)}finally{jn=0,Pr=null,ke=null,lr=null,$r=!1,M=null,z=null,pt.clear()}}discard(){for(const e of l(ve,this))e(this);l(ve,this).clear();for(const e of this.async_deriveds.values())e.reject(ge);_(j,this,or).call(this),l(ee,this)?.resolve()}register_created_effect(e){l(_r,this).push(e)}increment(e,r){if(g(Ft,this,l(Ft,this)+1),e){let n=l(Pt,this).get(r)??0;l(Pt,this).set(r,n+1)}}decrement(e,r){if(g(Ft,this,l(Ft,this)-1),e){let n=l(Pt,this).get(r)??0;n===1?l(Pt,this).delete(r):l(Pt,this).set(r,n-1)}l(de,this)||(g(de,this,!0),Xt(()=>{g(de,this,!1),this.linked&&this.flush()}))}transfer_effects(e,r){for(const n of e)l(Jt,this).add(n);for(const n of r)l(dt,this).add(n);e.clear(),r.clear()}oncommit(e){l(we,this).add(e)}ondiscard(e){l(ve,this).add(e)}settled(){return(l(ee,this)??g(ee,this,mn())).promise}static ensure(){if(M===null){const e=M=new Nn;!$r&&!me&&Xt(()=>{l(Je,e)||e.flush()})}return M}apply(){if(!vr||!this.is_fork&&l(jt,this)===null&&l(Dt,this)===null){z=null;return}z=new Map;for(const[r,[n]]of this.current)z.set(r,n);for(let r=Ar;r!==null;r=l(Dt,r))if(!(r===this||r.is_fork)){var e=!1;if(r.id<this.id){for(const[n,[,i]]of r.current)if(!i&&this.current.has(n)){e=!0;break}}if(!e)for(const[n,i]of r.previous)z.has(n)||z.set(n,i)}}schedule(e){if(Pr=e,e.b?.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}l(lt,this).push(e)}},Tr);function nn(){if(this.is_fork)return!0;for(const r of l(Pt,this).keys()){for(var t=r,e=!1;t.parent!==null;){if(l(kt,this).has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}function ps(){var t=[];for(const i of l(lt,this))if(!((i.f&16384)!==0||(i.f&6144)===0)){for(var e=i,r=!1;e.parent!==null;){e=e.parent;var n=e.f;if((n&96)!==0){if((n&1024)===0){r=!0;break}e.f^=nt}}r||t.push(e)}return g(lt,this,[]),t}function ar(){g(Je,this,!0);for(const a of l(Jt,this))l(dt,this).delete(a),I(a,ct),this.schedule(a);for(const a of l(dt,this))I(a,Zt),this.schedule(a);this.apply();for(var t=ke=[],e=[],r=lr=[];l(lt,this).length>0;){jn++>1e3&&(_(j,this,or).call(this),ms());for(const a of _(j,this,ps).call(this))try{_(j,this,gs).call(this,a,t,e)}catch(o){throw Rn(a),_(j,this,nn).call(this)||this.discard(),o}}if(M=null,r.length>0){var n=Tr.ensure();for(const a of r)n.schedule(a)}if(ke=null,lr=null,_(j,this,nn).call(this)){_(j,this,qe).call(this,e),_(j,this,qe).call(this,t);for(const[a,o]of l(kt,this))On(a,o);r.length>0&&_(j,M,ar).call(M);return}const i=_(j,this,ws).call(this);if(i){_(j,this,qe).call(this,e),_(j,this,qe).call(this,t),_(j,i,_s).call(i,this);return}l(Jt,this).clear(),l(dt,this).clear();for(const a of l(we,this))a(this);l(we,this).clear(),ae=this,sn(e),sn(t),ae=null,l(ee,this)?.resolve();var s=M;if(l(Ft,this)===0&&(l(lt,this).length===0||s!==null)&&_(j,this,or).call(this),l(lt,this).length>0)if(s!==null){for(const a of l(lt,this))l(lt,s).push(a);g(lt,this,[])}else s=this;s!==null&&(pt.clear(),_(j,s,ar).call(s))}function gs(t,e,r){t.f^=nt;for(var n=t.first;n!==null;){var i=n.f,s=(i&96)!==0;if(!(s&&(i&1024)!==0||(i&8192)!==0||l(kt,this).has(n))&&n.fn!==null){s?n.f^=nt:(i&4)!==0?e.push(n):vr&&(i&16777224)!==0?r.push(n):Ce(n)&&(i&16&&l(dt,this).add(n),ce(n));var a=n.first;if(a!==null){n=a;continue}}for(;n!==null;){var o=n.next;if(o!==null){n=o;break}n=n.parent}}}function ws(){for(var t=l(jt,this);t!==null;){if(!t.is_fork){for(const[e,[,r]]of this.current)if(t.current.has(e)&&!r)return t}t=l(jt,t)}return null}function _s(t){for(const[r,n]of t.current)!this.previous.has(r)&&t.previous.has(r)&&this.previous.set(r,t.previous.get(r)),this.current.set(r,n);for(const[r,n]of t.async_deriveds){const i=this.async_deriveds.get(r);i&&n.promise.then(i.resolve).catch(i.reject)}t.async_deriveds.clear(),this.transfer_effects(l(Jt,t),l(dt,t));const e=r=>{var n=r.reactions;if(n!==null&&!((r.f&2)!==0&&(r.f&6144)===0))for(const a of n){var i=a.f;if((i&2)!==0)e(a);else{var s=a;i&4194320&&!this.async_deriveds.has(s)&&(l(dt,this).delete(s),I(s,ct),this.schedule(s))}}};for(const r of this.current.keys())e(r);this.oncommit(()=>t.discard()),_(j,t,or).call(t),M=this,_(j,this,ar).call(this)}function qe(t){for(var e=0;e<t.length;e+=1)Wn(t[e],l(Jt,this),l(dt,this))}function or(){if(this.linked){var t=l(jt,this),e=l(Dt,this);t===null?Ar=e:g(Dt,t,e),e===null?re=t:g(jt,e,t),this.linked=!1}}function G(t){var e=me,r=ae;ae=null,me=!0;try{var n;for(t&&(G(),n=t());;){if(as(),M===null)return n;M.flush()}}finally{me=e,ae=r}}function ms(){try{ts()}catch(t){gt(t,Pr)}}var ht=null;function sn(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&24576)===0&&Ce(n)&&(ht=new Set,ce(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&Un(n),ht?.size>0)){pt.clear();for(const i of ht){if((i.f&24576)!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)ht.has(a)&&(ht.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const u=s[o];!(u.f&24576)&&ce(u)}}ht.clear()}}ht=null}}function In(t){M.schedule(t)}function On(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):t.f&4096&&e.m.push(t),I(t,nt);for(var r=t.first;r!==null;)On(r,e),r=r.next}}function Rn(t){I(t,nt);for(var e=t.first;e!==null;)Rn(e),e=e.next}var ur=new Set,pt=new Map,Ln=!1;function Te(t,e){return{f:0,v:t,reactions:null,equals:xn,rv:0,wv:0}}function D(t,e){const r=Te(t,e);return Zn(r),r}function ys(t,e=!1,r=!0){const n=Te(t);return e||(n.equals=Sn),n}function S(t,e,r=!1){return b!==null&&(!ot||b.f&131072)&&Se()&&b.f&4325394&&(ut===null||!ut.has(t))&&ss(),cr(t,r?se(e):e,lr)}var Bt=null,jr=0;function cr(t,e,r=null){if(!t.equals(e)){St?pt.set(t,e):pt.has(t)||pt.set(t,t.v);var n=he.ensure();if(n.capture(t,e),(t.f&2)!==0){const i=t;t.f&2048&&Vr(i),z===null&&Br(i)}t.wv=ti(),Bt=null,jr=0,qn(t,ct,r),Bt=null,Se()&&$!==null&&$.f&1024&&!($.f&96)&&(Z===null?Ns([t]):Z.push(t)),!n.is_fork&&ur.size>0&&!Ln&&$s()}return e}function $s(){Ln=!1;for(const t of ur){t.f&1024&&I(t,Zt);let e;try{e=Ce(t)}catch{e=!0}e&&ce(t)}ur.clear()}function ye(t){S(t,t.v+1)}function qn(t,e,r){var n=t.reactions;if(n!==null){var i=Se(),s=n.length;if(jr+=s,jr>1e5&&Bt===null&&(Bt=new Set),Bt!==null){if(Bt.has(t))return;Bt.add(t)}for(var a=0;a<s;a++){var o=n[a],u=o.f;if(!(!i&&o===$)){var c=(u&ct)===0;if(c&&I(o,e),(u&131072)!==0)ur.add(o);else if((u&2)!==0){var f=o;z?.delete(f),qn(f,Zt,r)}else if(c){var d=o;u&16&&ht!==null&&ht.add(d),r!==null?r.push(d):In(d)}}}}}function se(t){if(typeof t!="object"||t===null||_e in t||$n in t)return t;const e=_n(t);if(e!==Oi&&e!==Ri)return t;var r=new Map,n=Pi(t),i=D(0),s=null,a=Ut,o=u=>{if(Ut===a)return u();var c=b,f=Ut;it(null),un(a);var d=u();return it(c),un(f),d};return n&&r.set("length",D(t.length,s)),new Proxy(t,{defineProperty(u,c,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&ns();var d=r.get(c);return d===void 0?o(()=>{var w=D(f.value,s);return r.set(c,w),w}):S(d,f.value,!0),!0},deleteProperty(u,c){var f=r.get(c);if(f===void 0){if(c in u){const d=o(()=>D(O,s));r.set(c,d),ye(i)}}else S(f,O),ye(i);return!0},get(u,c,f){if(c===_e)return t;var d=r.get(c),w=c in u;if(d===void 0&&(!w||Kt(u,c)?.writable)&&(d=o(()=>D(se(w?u[c]:O),s)),r.set(c,d)),d!==void 0){var v=h(d);return v===O?void 0:v}return Reflect.get(u,c,f)},getOwnPropertyDescriptor(u,c){this.has?.(u,c);var f=Reflect.getOwnPropertyDescriptor(u,c),d=r.get(c);if(d!==void 0){var w=h(d);if(w===O)return;if(f&&"value"in f)f.value=w;else return{enumerable:!0,configurable:!0,value:w,writable:!0}}return f},has(u,c){if(c===_e)return!0;var f=r.get(c),d=f!==void 0&&f.v!==O||Reflect.has(u,c);return(f!==void 0||$!==null&&(!d||Kt(u,c)?.writable))&&(f===void 0&&(f=o(()=>D(d?se(u[c]):O,s)),r.set(c,f)),h(f)===O)?!1:d},set(u,c,f,d){var w=r.get(c),v=c in u;if(n&&c==="length")for(var m=f;m<w.v;m+=1){var k=r.get(m+"");k!==void 0?S(k,O):m in u&&(k=o(()=>D(O,s)),r.set(m+"",k))}if(w===void 0)(!v||Kt(u,c)?.writable)&&(w=o(()=>D(void 0,s)),S(w,se(f)),r.set(c,w));else{v=w.v!==O;var V=o(()=>se(f));S(w,V)}var R=Reflect.getOwnPropertyDescriptor(u,c);if(R?.set&&R.set.call(d,f),!v){if(n&&typeof c=="string"){var L=r.get("length"),Q=Number(c);Number.isInteger(Q)&&Q>=L.v&&S(L,Q+1)}ye(i)}return!0},ownKeys(u){h(i);var c=Reflect.ownKeys(u).filter(w=>{var v=r.get(w);return v===void 0||v.v!==O});for(var[f,d]of r)d.v!==O&&!(f in u)&&c.push(f);return c},setPrototypeOf(){is()}})}var ln,Fn,zn,Dn;function Nr(){if(ln===void 0){ln=window,Fn=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;zn=Kt(e,"firstChild").get,Dn=Kt(e,"nextSibling").get,en(t)&&(t[Er]=void 0,t[Cr]=null,t[Bi]=void 0,t.__e=void 0),en(r)&&(r[Xe]=void 0)}}function Yt(t=""){return document.createTextNode(t)}function ue(t){return zn.call(t)}function Ot(t){return Dn.call(t)}function Ze(t,e){if(!A)return ue(t);var r=ue(E);if(r===null)r=E.appendChild(Yt());else if(e&&r.nodeType!==3){var n=Yt();return r?.before(n),wt(n),n}return e&&Bn(r),wt(r),r}function br(t,e=!1){if(!A)return ue(t);var r=Ze(t,e);return Ye(t),r}function Fe(t,e=1,r=!1){let n=A?E:t;for(var i;e--;)i=n,n=Ot(n);if(!A)return n;if(r){if(n?.nodeType!==3){var s=Yt();return n===null?i?.after(s):n.before(s),wt(s),s}Bn(n)}return wt(n),n}function bs(t){t.textContent=""}function ks(){return!vr||ht!==null?!1:($.f&Rr)!==0}function Hr(t,e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?r?document.createElement(t,{is:r}):document.createElement(t):r?document.createElementNS(e,t,{is:r}):document.createElementNS(e,t)}function Bn(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===3;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Ms(t){var e=$;if(e===null)return b.f|=ir,t;if((e.f&32768)===0&&(e.f&4)===0)throw t;gt(t,e)}function gt(t,e){if(t===It)throw t;if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0&&(e.f&33570816)===0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw t}}function xs(t){$===null&&(b===null&&Gi(t),Zi()),St&&Yi(t)}function Ss(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function mt(t,e){var r=$;r!==null&&r.f&8192&&(t|=Or);var n={ctx:N,deps:null,nodes:null,f:t|ct|512,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};M?.register_created_effect(n);var i=n;if((t&4)!==0)ke!==null?ke.push(n):he.ensure().schedule(n);else if(e!==null){try{ce(n)}catch(a){throw K(n),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,t&16&&t&65536&&i!==null&&(i.f|=Lr))}if(i!==null&&(i.parent=r,r!==null&&Ss(i,r),b!==null&&(b.f&2)!==0&&(t&64)===0)){var s=b;(s.effects??(s.effects=[])).push(i)}return n}function Jr(){return b!==null&&!ot}function Ts(t){const e=mt(8,null);return I(e,nt),e.teardown=t,e}function Ge(t){xs("$effect");var e=$.f;if(!b&&(e&32)!==0&&N!==null&&!N.i){var r=N;(r.e??(r.e=[])).push(t)}else return Vn(t)}function Vn(t){return mt(4|Fi,t)}function Ws(t){he.ensure();const e=mt(64|fe,t);return()=>{K(e)}}function Cs(t){he.ensure();const e=mt(64|fe,t);return(r={})=>new Promise(n=>{r.outro?We(e,()=>{K(e),n(void 0)}):(K(e),n(void 0))})}function Hn(t){return mt(4,t)}function Es(t){return mt(zi|fe,t)}function Kr(t,e=0){return mt(8|e,t)}function ze(t,e=[],r=[],n=[]){us(n,e,r,i=>{mt(8,()=>{t(...i.map(h))})})}function Jn(t,e=0){return mt(16|e,t)}function xt(t){return mt(32|fe,t)}function Kn(t){var e=t.teardown;if(e!==null){const r=St,n=b;on(!0),it(null);try{e.call(null)}catch(i){gt(i,t.parent)}finally{on(r),it(n)}}}function Ur(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&pr(()=>{i.abort(xe)});var n=r.next;(r.f&64)!==0?r.parent=null:K(r,e),r=n}}function As(t){for(var e=t.first;e!==null;){var r=e.next;!(e.f&32)&&K(e),e=r}}function K(t,e=!0){var r=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&(Ps(t.nodes.start,t.nodes.end),r=!0),t.f|=Wr,Ur(t,e&&!r),Me(t,0);var n=t.nodes&&t.nodes.t;if(n!==null)for(const s of n)s.stop();Kn(t),t.f^=Wr,t.f|=yn;var i=t.parent;i!==null&&i.first!==null&&Un(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Ps(t,e){for(;t!==null;){var r=t===e?null:Ot(t);t.remove(),t=r}}function Un(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function We(t,e,r=!0){var n=[];t.f|=256,Qn(t,n,!0);var i=()=>{r&&K(t),e&&e()},s=n.length;if(s>0){var a=()=>--s||i();for(var o of n)o.out(a)}else i()}function Qn(t,e,r){if((t.f&8192)===0){t.f^=Or;var n=t.nodes&&t.nodes.t;if(n!==null)for(const o of n)(o.is_global||r)&&e.push(o);for(var i=t.first;i!==null;){var s=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(t.f&16)!==0;Qn(i,e,a?r:!1)}i=s}}}function an(t){t.f&=-257,Xn(t,!0)}function Xn(t,e){if((t.f&256)===0&&(t.f&8192)!==0){t.f^=Or,!(t.f&1024)&&(I(t,ct),he.ensure().schedule(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;Xn(r,i?e:!1),r=n}var s=t.nodes&&t.nodes.t;if(s!==null)for(const a of s)(a.is_global||e)&&a.in()}}function Yn(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var i=r===n?null:Ot(r);e.append(r),r=i}}var js=null,St=!1;function on(t){St=t}var b=null,ot=!1;function it(t){b=t}var $=null;function _t(t){$=t}var ut=null;function Zn(t){b!==null&&(b.f&2097152||b.f&2)&&(ut??(ut=new Set)).add(t)}var H=null,U=0,Z=null;function Ns(t){Z=t}var Gn=1,Ht=0,Ut=Ht;function un(t){Ut=t}function ti(){return++Gn}function Ce(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var r=t.deps,n=r.length,i=0;i<n;i++){var s=r[i];if(Ce(s)&&An(s),s.wv>t.wv)return!0}e&512&&z===null&&I(t,nt)}return!1}function ei(t,e,r=!0){var n=t.reactions;if(n!==null&&!(!vr&&ut!==null&&ut.has(t)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&2)!==0?ei(s,e,!1):e===s&&(r?I(s,ct):s.f&1024&&I(s,Zt),In(s))}}function ri(t){var e=H,r=U,n=Z,i=b,s=ut,a=N,o=ot,u=Ut,c=t.f;H=null,U=0,Z=null,b=(c&96)===0?t:null,ut=null,oe(t.ctx),ot=!1,Ut=++Ht,t.ac!==null&&(pr(()=>{t.ac.abort(xe)}),t.ac=null);try{t.f|=rn;var f=t.fn,d=f();t.f|=Rr;var w=cn(t);if(Se()&&Z!==null&&!ot&&w!==null&&(t.f&6146)===0)for(var v=0;v<Z.length;v++)ei(Z[v],t);if(i!==null&&i!==t){if(Ht++,i.deps!==null)for(let m=0;m<r;m+=1)i.deps[m].rv=Ht;if(e!==null)for(const m of e)m.rv=Ht;Z!==null&&(n===null?n=Z:n.push(...Z))}return t.f&8388608&&(t.f^=ir),d}catch(m){return cn(t),Ms(m)}finally{t.f^=rn,H=e,U=r,Z=n,b=i,ut=s,oe(a),ot=o,Ut=u}}function cn(t){var e=t.deps,r=M?.is_fork;if(H!==null){var n,i;if(r||Me(t,U),e!==null&&U>0)for(e.length=U+H.length,i=0;i<H.length;i++)e[U+i]=H[i];else t.deps=e=H;if(Jr()&&(t.f&512)!==0)for(i=U;i<e.length;i++)((n=e[i]).reactions??(n.reactions=[])).push(t)}else!r&&e!==null&&U<e.length&&(Me(t,U),e.length=U);return e}function Is(t,e){let r=e.reactions;if(r!==null){var n=ji.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(e.f&2)!==0&&(H===null||!rr.call(H,e))){var s=e;s.f&512&&(s.f^=512),s.v!==O&&Br(s),s.ac!==null&&pr(()=>{s.ac.abort(xe),s.ac=null,I(s,ct)}),vs(s),Me(s,0)}}function Me(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Is(t,r[n])}function ce(t){var e=t.f;if((e&16384)===0){I(t,nt);var r=$;$=t;try{(e&16777232)!==0?As(t):Ur(t),Kn(t);var n=ri(t);t.teardown=typeof n=="function"?n:null,t.wv=Gn}finally{$=r}}}function h(t){var e=(t.f&2)!==0;if(js?.add(t),b!==null&&!ot&&!($!==null&&($.f&16384)!==0)&&(ut===null||!ut.has(t))){var r=b.deps;if((b.f&2097152)!==0)t.rv<Ht&&(t.rv=Ht,H===null&&r!==null&&r[U]===t?U++:H===null?H=[t]:H.push(t));else{var n;(n=b).deps??(n.deps=[]),rr.call(b.deps,t)||b.deps.push(t);var i=t.reactions;i===null?t.reactions=[b]:rr.call(i,b)||i.push(b)}}if(St&&pt.has(t))return pt.get(t);if(e){var s=t;if(St){var a=s.v;return(!(s.f&1024)&&s.reactions!==null||ii(s))&&(a=Vr(s)),pt.set(s,a),a}var o=(s.f&512)===0&&!ot&&b!==null&&(b.f&512)!==0,u=(s.f&Rr)===0;Ce(s)&&(o&&(s.f|=512),An(s)),o&&!u&&(Pn(s),ni(s))}if(z?.has(t))return z.get(t);if((t.f&8388608)!==0)throw t.v;return t.v}function ni(t){if(t.f|=512,t.deps!==null)for(const r of t.deps){var e=r.reactions;e===null?r.reactions=[t]:rr.call(e,t)||e.push(t),r.f&2&&!(r.f&512)&&(Pn(r),ni(r))}}function ii(t){if(t.v===O)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(pt.has(e)||(e.f&2)!==0&&ii(e))return!0;return!1}function Ee(t){var e=ot;try{return ot=!0,t()}finally{ot=e}}var De=Symbol("events"),Os=new Set,fn=new Set,kr=null,Mr=!1;function hn(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;kr=t,Mr||(Mr=!0,setTimeout(()=>{Mr=!1,kr=null}));var a=0,o=kr===t&&t[De];if(o){var u=i.indexOf(o);if(u!==-1&&(e===document||e===window)){t[De]=e;return}var c=i.indexOf(e);if(c===-1)return;u<=c&&(a=u)}if(s=i[a]||t.target,s!==e){$e(t,"currentTarget",{configurable:!0,get(){return s||r}});var f=b,d=$;it(null),_t(null);try{for(var w,v=[];s!==null&&s!==e;){try{var m=s[De]?.[n];m!=null&&(!s.disabled||t.target===s)&&m.call(s,t)}catch(k){w?v.push(k):w=k}if(t.cancelBubble)break;a++,s=a<i.length?i[a]:null}if(w){for(let k of v)queueMicrotask(()=>{throw k});throw w}}finally{t[De]=e,delete t.currentTarget,it(f),_t(d)}}}var Rs=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ls(t){return Rs?.createHTML(t)??t}function qs(t){var e=Hr("template");return e.innerHTML=Ls(t.replaceAll("<!>","<!---->")),e.content}function tr(t,e){var r=$;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function Ae(t,e){var r=(e&1)!==0,n=(e&2)!==0,i,s=!t.startsWith("<!>");return()=>{if(A)return tr(E,null),E;i===void 0&&(i=qs(s?t:"<!>"+t),r||(i=ue(i)));var a=n||Fn?document.importNode(i,!0):i.cloneNode(!0);if(r){var o=ue(a),u=a.lastChild;tr(o,u)}else tr(a,a);return a}}function ne(t,e){if(A){var r=$;(!(r.f&32768)||r.nodes.end===null)&&(r.nodes.end=E),qr();return}t!==null&&t.before(e)}var Fs=["touchstart","touchmove"];function zs(t){return Fs.includes(t)}function Ds(t){let e=0,r=Te(0),n;return()=>{Jr()&&(h(r),Kr(()=>(e===0&&(n=Ee(()=>t(()=>ye(r)))),e+=1,()=>{Xt(()=>{e-=1,e===0&&(n?.(),n=void 0,ye(r))})})))}}var Bs=Lr|fe;function Vs(t,e,r,n){new Hs(t,e,r,n)}var Hs=(tt=new WeakMap,Ke=new WeakMap,at=new WeakMap,le=new WeakMap,B=new WeakMap,et=new WeakMap,J=new WeakMap,rt=new WeakMap,Mt=new WeakMap,zt=new WeakMap,Nt=new WeakMap,pe=new WeakMap,Ue=new WeakMap,Qe=new WeakMap,Et=new WeakMap,mr=new WeakMap,x=new WeakSet,class{constructor(t,e,r,n){wn(this,x),W(this,"parent",void 0),W(this,"is_pending",!1),W(this,"transform_error",void 0),y(this,tt,void 0),y(this,Ke,A?E:null),y(this,at,void 0),y(this,le,void 0),y(this,B,void 0),y(this,et,null),y(this,J,null),y(this,rt,null),y(this,Mt,null),y(this,zt,0),y(this,Nt,0),y(this,pe,!1),y(this,Ue,new Set),y(this,Qe,new Set),y(this,Et,null),y(this,mr,Ds(()=>(g(Et,this,Te(l(zt,this))),()=>{g(Et,this,null)}))),g(tt,this,t),g(at,this,e),g(le,this,i=>{var s=$;s.b=this,s.f|=128,r(i)}),this.parent=$.b,this.transform_error=n??this.parent?.transform_error??(i=>i),g(B,this,Jn(()=>{if(A){const i=Mn(l(Ke,this));qr();const s=i==="[!";if(i.startsWith("[?")){const a=JSON.parse(i.slice(2));_(x,this,Ks).call(this,a)}else s?_(x,this,Us).call(this):_(x,this,Js).call(this)}else _(x,this,li).call(this)},Bs)),A&&g(tt,this,E)}defer_effect(t){Wn(t,l(Ue,this),l(Qe,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!l(at,this).pending}update_pending_count(t,e){_(x,this,ai).call(this,t,e),g(zt,this,l(zt,this)+t),l(Et,this)&&!l(pe,this)&&(g(pe,this,!0),Xt(()=>{g(pe,this,!1),l(Et,this)&&cr(l(Et,this),l(zt,this))}))}get_effect_pending(){return l(mr,this).call(this),h(l(Et,this))}error(t){if(t===It||!l(at,this).onerror&&!l(at,this).failed)throw t;M?.is_fork?(l(et,this)&&M.skip_effect(l(et,this)),l(J,this)&&M.skip_effect(l(J,this)),l(rt,this)&&M.skip_effect(l(rt,this)),M.oncommit(()=>{_(x,this,Qt).call(this)||_(x,this,vn).call(this,t)})):_(x,this,vn).call(this,t)}});function Js(){try{g(et,this,xt(()=>l(le,this).call(this,l(tt,this))))}catch(t){this.error(t)}}function Ks(t){const e=l(at,this).failed,{reset:r,invoke_onerror:n}=_(x,this,si).call(this,t);Xt(n),e&&g(rt,this,xt(()=>{e(l(tt,this),()=>t,()=>r)}))}function si(t){var e=!1,r=!1;const n=()=>{if(!_(x,this,Qt).call(this)){if(e){Ji();return}e=!0,r&&ls(),l(rt,this)!==null&&We(l(rt,this),()=>{g(rt,this,null)}),_(x,this,Qr).call(this,()=>{_(x,this,li).call(this)})}};return{reset:n,invoke_onerror:()=>{if(!_(x,this,Qt).call(this))try{r=!0,l(at,this).onerror?.(t,n),r=!1}catch(i){gt(i,l(B,this)&&l(B,this).parent)}}}}function Qt(){return(l(B,this).f&(yn|Wr))!==0}function Us(){const t=l(at,this).pending;t&&(this.is_pending=!0,g(J,this,xt(()=>t(l(tt,this)))),Xt(()=>{if(!_(x,this,Qt).call(this)){var e=g(Mt,this,document.createDocumentFragment()),r=Yt(),n=!1;if(e.append(r),g(et,this,_(x,this,Qr).call(this,()=>{try{return xt(()=>l(le,this).call(this,r))}catch(i){try{this.error(i),n=!0}catch(s){gt(s,l(B,this).parent)}return null}})),l(et,this)===null){g(Mt,this,null),n&&_(x,this,fr).call(this,M);return}l(Nt,this)===0&&(l(tt,this).before(e),g(Mt,this,null),We(l(J,this),()=>{g(J,this,null)}),_(x,this,fr).call(this,M))}}))}function li(){try{if(this.is_pending=this.has_pending_snippet(),g(Nt,this,0),g(zt,this,0),g(et,this,xt(()=>{l(le,this).call(this,l(tt,this))})),l(Nt,this)>0){var t=g(Mt,this,document.createDocumentFragment());Yn(l(et,this),t);const e=l(at,this).pending;g(J,this,xt(()=>e(l(tt,this))))}else _(x,this,fr).call(this,M)}catch(e){this.error(e)}}function fr(t){this.is_pending=!1,t.transfer_effects(l(Ue,this),l(Qe,this))}function Qr(t){var e=$,r=b,n=N;_t(l(B,this)),it(l(B,this)),oe(l(B,this).ctx);try{return he.ensure(),t()}finally{_t(e),it(r),oe(n)}}function ai(t,e){if(!this.has_pending_snippet()){var r;this.parent&&_(x,r=this.parent,ai).call(r,t,e);return}g(Nt,this,l(Nt,this)+t),l(Nt,this)===0&&(_(x,this,fr).call(this,e),l(J,this)&&We(l(J,this),()=>{g(J,this,null)}),l(Mt,this)&&(l(tt,this).before(l(Mt,this)),g(Mt,this,null)))}function vn(t){l(et,this)&&(K(l(et,this)),g(et,this,null)),l(J,this)&&(K(l(J,this)),g(J,this,null)),l(rt,this)&&(K(l(rt,this)),g(rt,this,null)),A&&(wt(l(Ke,this)),Ki(),wt(kn()));let e=l(at,this).failed;const r=n=>{if(_(x,this,Qt).call(this))return;const{reset:i,invoke_onerror:s}=_(x,this,si).call(this,n);s(),e&&!_(x,this,Qt).call(this)&&g(rt,this,_(x,this,Qr).call(this,()=>{try{return xt(()=>{var a=$;a.b=this,a.f|=128,e(l(tt,this),()=>n,()=>i)})}catch(a){return gt(a,l(B,this).parent),null}}))};Xt(()=>{if(!_(x,this,Qt).call(this)){var n;try{n=this.transform_error(t)}catch(i){gt(i,l(B,this)&&l(B,this).parent);return}n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(r,i=>gt(i,l(B,this)&&l(B,this).parent)):r(n)}})}function xr(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t[Xe]??(t[Xe]=t.nodeValue))&&(t[Xe]=r,t.nodeValue=`${r}`)}function oi(t,e){return ui(t,e)}function Qs(t,e){Nr(),e.intro=e.intro??!1;const r=e.target,n=A,i=E;try{for(var s=ue(r);s&&(s.nodeType!==8||s.data!=="[");)s=Ot(s);if(!s)throw It;ie(!0),wt(s);const a=ui(t,{...e,anchor:s});return ie(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==It&&console.warn("Failed to hydrate: ",a),e.recover===!1&&es(),Nr(),bs(r),ie(!1),oi(t,e)}finally{ie(n),wt(i)}}var Be=new Map;function ui(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:a=!0,transformError:o}){Nr();var u=void 0,c=Cs(()=>{var f=r??e.appendChild(Yt());Vs(f,{pending:()=>{}},v=>{Fr({});var m=N;if(s&&(m.c=s),i&&(n.$$events=i),A&&tr(v,null),u=t(v,n)||Dr(),A&&($.nodes.end=E,E===null||E.nodeType!==8||E.data!=="]"))throw hr(),It;zr()},o);var d=new Set,w=v=>{for(var m=0;m<v.length;m++){var k=v[m];if(!d.has(k)){d.add(k);var V=zs(k);for(const Q of[e,document]){var R=Be.get(Q);R===void 0&&(R=new Map,Be.set(Q,R));var L=R.get(k);L===void 0?(Q.addEventListener(k,hn,{passive:V}),R.set(k,1)):R.set(k,L+1)}}}};return w(Ni(Os)),fn.add(w),()=>{for(var v of d)for(const V of[e,document]){var m=Be.get(V),k=m.get(v);--k==0?(V.removeEventListener(v,hn),m.delete(v),m.size===0&&Be.delete(V)):m.set(v,k)}fn.delete(w),f!==r&&f.parentNode?.removeChild(f)}});return Ir.set(u,c),u}var Ir=new WeakMap;function Xs(t,e){const r=Ir.get(t);return r?(Ir.delete(t),r(e)):Promise.resolve()}var Ys=(ft=new WeakMap,bt=new WeakMap,Y=new WeakMap,Gt=new WeakMap,Re=new WeakMap,Le=new WeakMap,yr=new WeakMap,class{constructor(t,e=!0){W(this,"anchor",void 0),y(this,ft,new Map),y(this,bt,new Map),y(this,Y,new Map),y(this,Gt,new Set),y(this,Re,!0),y(this,Le,r=>{if(l(ft,this).has(r)){var n=l(ft,this).get(r),i=l(bt,this).get(n);if(i)an(i),l(Gt,this).delete(n);else{var s=l(Y,this).get(n);s&&(an(s.effect),l(bt,this).set(n,s.effect),l(Y,this).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[a,o]of l(ft,this)){if(l(ft,this).delete(a),a===r)break;const u=l(Y,this).get(o);u&&(K(u.effect),l(Y,this).delete(o))}for(const[a,o]of l(bt,this)){if(a===n||l(Gt,this).has(a))continue;const u=()=>{if(Array.from(l(ft,this).values()).includes(a)){var c=document.createDocumentFragment();Yn(o,c),c.append(Yt()),l(Y,this).set(a,{effect:o,fragment:c})}else K(o);l(Gt,this).delete(a),l(bt,this).delete(a)};l(Re,this)||!i?(l(Gt,this).add(a),We(o,u,!1)):u()}}}),y(this,yr,r=>{l(ft,this).delete(r);const n=Array.from(l(ft,this).values());for(const[i,s]of l(Y,this))n.includes(i)||(K(s.effect),l(Y,this).delete(i))}),this.anchor=t,g(Re,this,e)}ensure(t,e){var r=M,n=ks();if(e&&!l(bt,this).has(t)&&!l(Y,this).has(t))if(n){var i=document.createDocumentFragment(),s=Yt();i.append(s),l(Y,this).set(t,{effect:xt(()=>e(s)),fragment:i})}else l(bt,this).set(t,xt(()=>e(this.anchor)));if(l(ft,this).set(r,t),n){for(const[a,o]of l(bt,this))a===t?r.unskip_effect(o):r.skip_effect(o);for(const[a,o]of l(Y,this))a===t?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(l(Le,this)),r.ondiscard(l(yr,this))}else A&&(this.anchor=E),l(Le,this).call(this,r)}});function Zs(t){N===null&&Qi("onMount"),dr&&N.l!==null?Gs(N).m.push(t):Ge(()=>{const e=Ee(t);if(typeof e=="function")return e})}function Gs(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function Ve(t,e,r=!1){var n;A&&(n=E,qr());var i=new Ys(t),s=r?Lr:0;function a(o,u){if(A){var c=Mn(n);if(o!==parseInt(c.substring(1))){var f=kn();wt(f),i.anchor=f,ie(!1),i.ensure(o,u),ie(!0);return}}i.ensure(o,u)}Jn(()=>{var o=!1;e((u,c=0)=>{o=!0,a(c,u)}),o||a(-1,null)},s)}function ci(t,e){Hn(()=>{t=$?.parent?.nodes?.start??t;var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=Hr("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}var dn=[...`
3
+ \r\f \v\uFEFF`];function tl(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i of Object.keys(r))if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||dn.includes(n[a-1]))&&(o===n.length||dn.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function el(t,e,r,n,i,s){var a=t[Er];if(A||a!==r||a===void 0){var o=tl(r,n,s);(!A||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t[Er]=r}else if(s&&i!==s)for(var u in s){var c=!!s[u];(i==null||c!==!!i[u])&&t.classList.toggle(u,c)}return s}var rl=Symbol("is custom element"),nl=Symbol("is html"),il=Vi?"link":"LINK";function te(t,e,r,n){var i=sl(t);A&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===il)||i[e]!==(i[e]=r)&&(e==="loading"&&(t[Di]=r),r==null?t.removeAttribute(e):typeof r!="string"&&ll(t).has(e)?t[e]=r:t.setAttribute(e,r))}function sl(t){return t[Cr]??(t[Cr]={[rl]:t.nodeName.includes("-"),[nl]:t.namespaceURI===Ai})}var pn=new Map;function ll(t){var e=t.getAttribute("is")||t.nodeName,r=pn.get(e);if(r)return r;pn.set(e,r=new Set);for(var n,i=t,s=Element.prototype;s!==i;){n=Ii(i);for(var a in n)n[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&r.add(a);i=_n(i)}return r}function Sr(t,e){return t===e||t?.[_e]===e}function gn(t=Dr(),e,r,n){var i=N.r,s=$;return Hn(()=>{var a,o;return Kr(()=>{a=o,o=n?.()||[],Ee(()=>{Sr(r(...o),t)||(e(t,...o),a&&Sr(r(...a),t)&&e(null,...a))})}),()=>{let u=s;for(;u!==i&&u.parent!==null&&u.parent.f&33554432;)u=u.parent;const c=()=>{o&&Sr(r(...o),t)&&e(null,...o)},f=u.teardown;u.teardown=()=>{c(),f?.()}}}),t}var He=!1;function al(t){var e=He;try{return He=!1,[t(),He]}finally{He=e}}function vt(t,e,r,n){var i=!dr||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=n,u=!0,c=void 0,f=()=>a&&i?(c??(c=be(n)),h(c)):(u&&(u=!1,o=a?Ee(n):n),o);let d;if(s){var w=_e in t||bn in t;d=Kt(t,e)?.set??(w&&e in t?P=>t[e]=P:void 0)}var v,m=!1;s?[v,m]=al(()=>t[e]):v=t[e],v===void 0&&n!==void 0&&(v=f(),d&&(i&&rs(e),d(v)));var k;if(i?k=()=>{var P=t[e];return P===void 0?f():(u=!0,P)}:k=()=>{var P=t[e];return P!==void 0&&(o=void 0),P===void 0?o:P},i&&(r&4)===0)return k;if(d){var V=t.$$legacy;return(function(P,Tt){return arguments.length>0?((!i||!Tt||V||m)&&d(Tt?k():P),P):k()})}var R=!1,L=((r&1)!==0?be:En)(()=>(R=!1,k()));s&&h(L);var Q=$;return(function(P,Tt){if(arguments.length>0){const Wt=Tt?h(L):i&&s?se(P):P;return S(L,Wt),R=!0,o!==void 0&&(o=Wt),P}return St&&R||(Q.f&16384)!==0?L.v:h(L)})}function ol(t){return new ul(t)}var ul=(At=new WeakMap,st=new WeakMap,class{constructor(t){y(this,At,void 0),y(this,st,void 0);var e=new Map,r=(i,s)=>{var a=ys(s,!1,!1);return e.set(i,a),a};const n=new Proxy({...t.props||{},$$events:{}},{get(i,s){return h(e.get(s)??r(s,Reflect.get(i,s)))},has(i,s){return s===bn?!0:(h(e.get(s)??r(s,Reflect.get(i,s))),Reflect.has(i,s))},set(i,s,a){return S(e.get(s)??r(s,a),a),Reflect.set(i,s,a)}});g(st,this,(t.hydrate?Qs:oi)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!t?.props?.$$host||t.sync===!1)&&G(),g(At,this,n.$$events);for(const i of Object.keys(l(st,this)))i==="$set"||i==="$destroy"||i==="$on"||$e(this,i,{get(){return l(st,this)[i]},set(s){l(st,this)[i]=s},enumerable:!0});l(st,this).$set=i=>{Object.assign(n,i)},l(st,this).$destroy=()=>{Xs(l(st,this))}}$set(t){l(st,this).$set(t)}$on(t,e){l(At,this)[t]=l(At,this)[t]||[];const r=(...n)=>e.call(this,...n);return l(At,this)[t].push(r),()=>{l(At,this)[t]=l(At,this)[t].filter(n=>n!==r)}}$destroy(){l(st,this).$destroy()}}),fi;typeof HTMLElement=="function"&&(fi=class extends HTMLElement{constructor(t,e,r){var n=(...i)=>(super(...i),W(this,"$$ctor",void 0),W(this,"$$s",void 0),W(this,"$$c",void 0),W(this,"$$cn",!1),W(this,"$$d",{}),W(this,"$$r",!1),W(this,"$$p_d",{}),W(this,"$$l",{}),W(this,"$$l_u",new Map),W(this,"$$me",void 0),W(this,"$$shadowRoot",null),this);n(),this.$$ctor=t,this.$$s=e,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return i=>{const s=Hr("slot");n!=="default"&&(s.name=n),ne(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=cl(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=er(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=ol({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Ws(()=>{Kr(()=>{this.$$r=!0;for(const n of nr(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=er(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=er(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return nr(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function er(t,e,r,n){const i=r[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function cl(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function hi(t,e,r,n,i,s){let a=class extends fi{constructor(){super(t,r,i),this.$$p_d=e}static get observedAttributes(){return nr(e).map(o=>(e[o].attribute||o).toLowerCase())}};return nr(e).forEach(o=>{$e(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(u){u=er(o,u,e),this.$$d[o]=u;var c=this.$$c;c&&(Kt(c,o)?.get?c[o]=u:c.$set({[o]:u}))}})}),n.forEach(o=>{$e(a.prototype,o,{get(){return this.$$c?.[o]}})}),s&&(a=s(a)),t.element=a,a}function fl(t){const e=new Set,r=n=>{if(n===void 0)return{$type:"undefined"};if(typeof n=="bigint")return{$type:"bigint",value:n.toString()};if(typeof n=="function")return{$type:"function",value:n.toString()};if(typeof n=="symbol")return{$type:"symbol",value:n.description??""};if(n===null||typeof n!="object")return n;if(e.has(n))return{$type:"circular-reference"};e.add(n);const i=Array.isArray(n)?n.map(r):Object.fromEntries(Object.entries(n).sort(([s],[a])=>s.localeCompare(a)).map(([s,a])=>[s,r(a)]));return e.delete(n),i};return JSON.stringify(r(t))}var hl=Ae('<a class="pie-tool-calculator__attribution svelte-16ps7c2" target="_blank" rel="noreferrer"> </a>'),vl=Ae('<div class="pie-tool-calculator__loading svelte-16ps7c2"> </div>'),dl=Ae('<div class="pie-tool-calculator__loading pie-tool-calculator__loading--error svelte-16ps7c2">Calculator failed to initialize. <div class="pie-tool-calculator__error-details svelte-16ps7c2"> </div></div>'),pl=Ae('<div role="region" tabindex="-1" translate="no"><div class="pie-tool-calculator__container svelte-16ps7c2"></div> <!> <!> <!></div>'),gl=Ae('<div class="pie-tool-calculator__context-host svelte-16ps7c2"><!></div>'),wl={hash:"svelte-16ps7c2",code:`.pie-tool-calculator__context-host.svelte-16ps7c2 {display:flex;width:100%;height:100%;min-height:0;}.pie-tool-calculator.svelte-16ps7c2 {position:relative;display:flex;flex:1 1 auto;min-width:100%;min-height:0;background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__container.svelte-16ps7c2 {position:relative;width:100%;height:100%;min-width:100%;min-height:100%;
4
4
  /*
5
5
  * \`--pie-white\` inverts by design (#ffffff light, #000000 dark, redefined per
6
6
  * colour scheme), so this backing matches the scheme wherever a provider's own
@@ -9,4 +9,4 @@ import{t as T}from"./defineProperty-a20a667d.js";import{i as _,n as g,r as b,t a
9
9
  */background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__mount {width:100%;height:100%;min-width:100%;min-height:100%;}
10
10
 
11
11
  /* The credit sits below the calculator rather than over it, where it would
12
- cover the vendor's own controls. */.pie-tool-calculator--attributed.svelte-16ps7c2 {flex-direction:column;}.pie-tool-calculator--attributed.svelte-16ps7c2 .pie-tool-calculator__container:where(.svelte-16ps7c2) {flex:1 1 auto;height:auto;min-height:0;}.pie-tool-calculator__attribution.svelte-16ps7c2 {align-self:flex-end;flex:0 0 auto;padding:0.1rem 0.25rem;color:var(--pie-text, #334155);font-size:0.65rem;}.pie-tool-calculator__loading.svelte-16ps7c2 {position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--pie-white, #fff) 90%, transparent);color:var(--pie-text, #334155);font-size:0.9rem;}.pie-tool-calculator__loading--error.svelte-16ps7c2 {flex-direction:column;gap:0.5rem;padding:0.75rem;color:var(--pie-incorrect, #b91c1c);text-align:center;}.pie-tool-calculator__error-details.svelte-16ps7c2 {max-width:95%;color:var(--pie-incorrect, #7f1d1d);font-size:0.8rem;line-height:1.2;word-break:break-word;}.pie-tool-calculator__mount > * {width:100% !important;height:100% !important;}`};function fi(t,e){qr(e,!0),oi(t,wl);let r=vt(e,"visible",7,!1),n=vt(e,"toolId",7,"calculator"),i=vt(e,"calculatorType",7,"basic"),s=vt(e,"availableTypes",23,()=>["basic","scientific","graphing"]),a=vt(e,"calculatorConfig",23,()=>({})),o=D(null),u=D(null),c=D(null),f=D(null),d=D(!1),w=D(null),v=D(!1);const m=Lt(()=>Ti(h(c))),M=Lt(()=>h(c)?.toolkitCoordinator),B=Lt(()=>Wi(n())?.baseToolId??n()),R=Lt(()=>(typeof s()=="string"?s().split(",").map(p=>p.trim()):s()).filter(p=>p==="basic"||p==="scientific"||p==="graphing")),L=Lt(()=>h(R).includes(i())?i():h(R)[0]??"basic"),G=Lt(()=>fl(a())),A=Lt(()=>h(f)?.provider.attribution??null);let Tt=null,Wt=null,yt=null,Ct=0,dr=!1,Ee=null;const Ae=new Set;Xe(()=>{if(h(o))return Si(h(o),p=>{x(c,p,!0)})});function Gr(){Ee?.disconnect(),Ee=null;for(const p of Ae)clearTimeout(p);Ae.clear()}function Pe(){Ct+=1,Gr();const p=h(f),W=yt;x(f,null),yt=null;try{p?.destroy()}catch(S){console.warn("[CalculatorTool] calculator cleanup failed:",S)}W?.remove(),Tt=null,Wt=null,x(d,!1),x(v,!1)}function Qr(){requestAnimationFrame(()=>{if(!r()||!h(f)||!yt?.isConnected)return;const p=document.activeElement;p instanceof Node&&yt.contains(p)||h(f).focus?.()})}function vi(p,W){Gr(),typeof ResizeObserver<"u"&&(Ee=new ResizeObserver(()=>{r()&&W.isConnected&&p.resize?.()}),Ee.observe(W));for(const S of[60,250,1e3]){const q=setTimeout(()=>{Ae.delete(q),r()&&W.isConnected&&p.resize?.()},S);Ae.add(q)}}async function di(p,W,S){const q=()=>p!==Ct||!r()||!S.isConnected;x(d,!0),x(w,null);try{if(!h(M))throw new Error("Calculator provider registry is unavailable");const $t=await h(M).ensureProviderReady(h(B)),pr=await $t.createInstance();if(q()){S.remove();return}const It=await pr.createCalculator(h(L),S,a());if(q()){It.destroy(),S.remove();return}x(f,It,!0),Tt=W,Wt=$t,x(v,S.childElementCount>0),vi(It,S),requestAnimationFrame(()=>{p===Ct&&(It.resize?.(),x(v,S.childElementCount>0),Qr())})}catch($t){if(p!==Ct){S.remove();return}x(w,$t instanceof Error?$t.message:String($t),!0),x(f,null),yt===S&&(yt=null),S.remove(),x(v,!1)}finally{p===Ct&&x(d,!1)}}function pi(){dr=!1;const p=h(u),W=h(M);if(!r()||!p||!p.isConnected||!W){(h(f)||h(d)||yt)&&Pe(),x(w,null);return}const S=`${h(B)}:${h(L)}:${h(G)}`;if(h(f)&&Tt===S&&Wt?.isReady()){Qr();return}(h(f)||h(d)||yt)&&Pe();const q=document.createElement("div");q.className="pie-tool-calculator__mount",p.replaceChildren(q),yt=q,di(++Ct,S,q)}function Xr(){dr||(dr=!0,queueMicrotask(pi))}async function gi(){const p=Wt,W=Ct,S=h(M);if(!p||!S)return;const q=await S.ensureProviderReady(h(B)).catch(()=>null);W!==Ct||p!==Wt||q!==p&&(Pe(),Xr())}Xe(()=>{const p=h(M);if(p)return p.onPolicyChange(()=>{queueMicrotask(()=>{gi()})})}),Xe(()=>{r(),h(B),h(L),a(),h(G),h(u),h(M),We(Xr)}),Ys(()=>()=>Pe());var wi={get visible(){return r()},set visible(p=!1){r(p),at()},get toolId(){return n()},set toolId(p="calculator"){n(p),at()},get calculatorType(){return i()},set calculatorType(p="basic"){i(p),at()},get availableTypes(){return s()},set availableTypes(p=["basic","scientific","graphing"]){s(p),at()},get calculatorConfig(){return a()},set calculatorConfig(p={}){a(p),at()}},je=gl(),mi=Qe(je),_i=p=>{var W=pl();let S;var q=Qe(W);gn(q,F=>x(u,F),()=>h(u));var $t=Le(q,2),pr=F=>{var Q=hl(),Rt=yr(Q,!0);qe(()=>{Yt(Q,"href",h(A).href),kr(Rt,h(A).label)}),ee(F,Q)};De($t,F=>{h(A)&&F(pr)});var It=Le($t,2),yi=F=>{var Q=vl(),Rt=yr(Q,!0);qe(ki=>kr(Rt,ki),[()=>h(m).t("tools.calculator.loading")]),ee(F,Q)};De(It,F=>{(h(d)||!h(w)&&!h(v))&&F(yi)});var $i=Le(It,2),bi=F=>{var Q=dl(),Rt=yr(Le(Qe(Q)),!0);Ge(Q),qe(()=>kr(Rt,h(w))),ee(F,Q)};De($i,F=>{h(w)&&F(bi)}),Ge(W),qe((F,Q,Rt)=>{S=el(W,1,"pie-tool-calculator notranslate svelte-16ps7c2",null,S,{"pie-tool-calculator--attributed":h(A)!==null}),Yt(W,"data-pie-tool-id",n()),Yt(W,"lang",F),Yt(W,"dir",Q),Yt(W,"aria-label",Rt),Yt(q,"data-calculator-type",h(L)),W.dir=W.dir},[()=>h(m).getLocale(),()=>h(m).getDirection?.()??"ltr",()=>h(m).t("tools.calculator.toolA11y")]),ee(p,W)};return De(mi,p=>{r()&&p(_i)}),Ge(je),gn(je,p=>x(o,p),()=>h(o)),ee(t,je),Fr(wi)}ci(fi,{visible:{},toolId:{},calculatorType:{},availableTypes:{},calculatorConfig:{}},[],[],{mode:"open"});var ml={tag:"pie-tool-calculator"},_l={hash:"svelte-1qpsqi4",code:".pie-tool-calculator__container .dcg-container {width:100% !important;height:100% !important;}"};function hi(t,e){qr(e,!0),oi(t,_l);let r=vt(e,"visible",7,!1),n=vt(e,"toolId",7,"calculator"),i=vt(e,"calculatorType",7,"basic"),s=vt(e,"availableTypes",23,()=>["basic","scientific","graphing"]),a=vt(e,"calculatorConfig",23,()=>({}));return fi(t,{get visible(){return r()},get toolId(){return n()},get calculatorType(){return i()},get availableTypes(){return s()},get calculatorConfig(){return a()}}),Fr({get visible(){return r()},set visible(o=!1){r(o),at()},get toolId(){return n()},set toolId(o="calculator"){n(o),at()},get calculatorType(){return i()},set calculatorType(o="basic"){i(o),at()},get availableTypes(){return s()},set availableTypes(o=["basic","scientific","graphing"]){s(o),at()},get calculatorConfig(){return a()},set calculatorConfig(o={}){a(o),at()}})}ci(hi,{visible:{attribute:"visible",type:"Boolean"},toolId:{attribute:"tool-id",type:"String"},calculatorType:{attribute:"calculator-type",type:"String"},availableTypes:{attribute:"available-types",type:"Array"},calculatorConfig:{type:"Object"}},[],[],void 0,Mi);var yl=hi.element;xi(ml.tag,yl);
12
+ cover the vendor's own controls. */.pie-tool-calculator--attributed.svelte-16ps7c2 {flex-direction:column;}.pie-tool-calculator--attributed.svelte-16ps7c2 .pie-tool-calculator__container:where(.svelte-16ps7c2) {flex:1 1 auto;height:auto;min-height:0;}.pie-tool-calculator__attribution.svelte-16ps7c2 {align-self:flex-end;flex:0 0 auto;padding:0.1rem 0.25rem;color:var(--pie-text, #334155);font-size:0.65rem;}.pie-tool-calculator__loading.svelte-16ps7c2 {position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--pie-white, #fff) 90%, transparent);color:var(--pie-text, #334155);font-size:0.9rem;}.pie-tool-calculator__loading--error.svelte-16ps7c2 {flex-direction:column;gap:0.5rem;padding:0.75rem;color:var(--pie-incorrect, #b91c1c);text-align:center;}.pie-tool-calculator__error-details.svelte-16ps7c2 {max-width:95%;color:var(--pie-incorrect, #7f1d1d);font-size:0.8rem;line-height:1.2;word-break:break-word;}.pie-tool-calculator__mount > * {width:100% !important;height:100% !important;}`};function vi(t,e){Fr(e,!0),ci(t,wl);let r=vt(e,"visible",7,!1),n=vt(e,"toolId",7,"calculator"),i=vt(e,"calculatorType",7,"basic"),s=vt(e,"availableTypes",23,()=>["basic","scientific","graphing"]),a=vt(e,"calculatorConfig",23,()=>({})),o=D(null),u=D(null),c=D(null),f=D(null),d=D(!1),w=D(null),v=D(!1);const m=qt(()=>Ci(h(c))),k=qt(()=>h(c)?.toolkitCoordinator),V=qt(()=>Ei(n())?.baseToolId??n()),R=qt(()=>(typeof s()=="string"?s().split(",").map(p=>p.trim()):s()).filter(p=>p==="basic"||p==="scientific"||p==="graphing")),L=qt(()=>h(R).includes(i())?i():h(R)[0]??"basic"),Q=qt(()=>fl(a())),P=qt(()=>h(f)?.provider.attribution??null);let Tt=null,Wt=null,yt=null,Ct=0,gr=!1,Pe=null;const je=new Set;Ge(()=>{if(h(o))return Wi(h(o),p=>{S(c,p,!0)})});function Xr(){Pe?.disconnect(),Pe=null;for(const p of je)clearTimeout(p);je.clear()}function Ne(){Ct+=1,Xr();const p=h(f),C=yt;S(f,null),yt=null;try{p?.destroy()}catch(T){console.warn("[CalculatorTool] calculator cleanup failed:",T)}C?.remove(),Tt=null,Wt=null,S(d,!1),S(v,!1)}function Yr(){requestAnimationFrame(()=>{if(!r()||!h(f)||!yt?.isConnected)return;const p=document.activeElement;p instanceof Node&&yt.contains(p)||h(f).focus?.()})}function pi(p,C){Xr(),typeof ResizeObserver<"u"&&(Pe=new ResizeObserver(()=>{r()&&C.isConnected&&p.resize?.()}),Pe.observe(C));for(const T of[60,250,1e3]){const q=setTimeout(()=>{je.delete(q),r()&&C.isConnected&&p.resize?.()},T);je.add(q)}}async function gi(p,C,T){const q=()=>p!==Ct||!r()||!T.isConnected;S(d,!0),S(w,null);try{if(!h(k))throw new Error("Calculator provider registry is unavailable");const $t=await h(k).ensureProviderReady(h(V)),wr=await $t.createInstance();if(q()){T.remove();return}const Rt=await wr.createCalculator(h(L),T,a());if(q()){Rt.destroy(),T.remove();return}S(f,Rt,!0),Tt=C,Wt=$t,S(v,T.childElementCount>0),pi(Rt,T),requestAnimationFrame(()=>{p===Ct&&(Rt.resize?.(),S(v,T.childElementCount>0),Yr())})}catch($t){if(p!==Ct){T.remove();return}S(w,$t instanceof Error?$t.message:String($t),!0),S(f,null),yt===T&&(yt=null),T.remove(),S(v,!1)}finally{p===Ct&&S(d,!1)}}function wi(){gr=!1;const p=h(u),C=h(k);if(!r()||!p||!p.isConnected||!C){(h(f)||h(d)||yt)&&Ne(),S(w,null);return}const T=`${h(V)}:${h(L)}:${h(Q)}`;if(h(f)&&Tt===T&&Wt?.isReady()){Yr();return}(h(f)||h(d)||yt)&&Ne();const q=document.createElement("div");q.className="pie-tool-calculator__mount",p.replaceChildren(q),yt=q,gi(++Ct,T,q)}function Zr(){gr||(gr=!0,queueMicrotask(wi))}async function _i(){const p=Wt,C=Ct,T=h(k);if(!p||!T)return;const q=await T.ensureProviderReady(h(V)).catch(()=>null);C!==Ct||p!==Wt||q!==p&&(Ne(),Zr())}Ge(()=>{const p=h(k);if(p)return p.onPolicyChange(()=>{queueMicrotask(()=>{_i()})})}),Ge(()=>{r(),h(V),h(L),a(),h(Q),h(u),h(k),Ee(Zr)}),Zs(()=>()=>Ne());var mi={get visible(){return r()},set visible(p=!1){r(p),G()},get toolId(){return n()},set toolId(p="calculator"){n(p),G()},get calculatorType(){return i()},set calculatorType(p="basic"){i(p),G()},get availableTypes(){return s()},set availableTypes(p=["basic","scientific","graphing"]){s(p),G()},get calculatorConfig(){return a()},set calculatorConfig(p={}){a(p),G()}},Ie=gl(),yi=Ze(Ie),$i=p=>{var C=pl();let T;var q=Ze(C);gn(q,F=>S(u,F),()=>h(u));var $t=Fe(q,2),wr=F=>{var X=hl(),Lt=br(X,!0);ze(()=>{te(X,"href",h(P).href),xr(Lt,h(P).label)}),ne(F,X)};Ve($t,F=>{h(P)&&F(wr)});var Rt=Fe($t,2),bi=F=>{var X=vl(),Lt=br(X,!0);ze(xi=>xr(Lt,xi),[()=>h(m).t("tools.calculator.loading")]),ne(F,X)};Ve(Rt,F=>{(h(d)||!h(w)&&!h(v))&&F(bi)});var ki=Fe(Rt,2),Mi=F=>{var X=dl(),Lt=br(Fe(Ze(X)),!0);Ye(X),ze(()=>xr(Lt,h(w))),ne(F,X)};Ve(ki,F=>{h(w)&&F(Mi)}),Ye(C),ze((F,X,Lt)=>{T=el(C,1,"pie-tool-calculator notranslate svelte-16ps7c2",null,T,{"pie-tool-calculator--attributed":h(P)!==null}),te(C,"data-pie-tool-id",n()),te(C,"lang",F),te(C,"dir",X),te(C,"aria-label",Lt),te(q,"data-calculator-type",h(L)),C.dir=C.dir},[()=>h(m).getLocale(),()=>h(m).getDirection?.()??"ltr",()=>h(m).t("tools.calculator.toolA11y")]),ne(p,C)};return Ve(yi,p=>{r()&&p($i)}),Ye(Ie),gn(Ie,p=>S(o,p),()=>h(o)),ne(t,Ie),zr(mi)}hi(vi,{visible:{},toolId:{},calculatorType:{},availableTypes:{},calculatorConfig:{}},[],[],{mode:"open"});var _l={tag:"pie-tool-calculator"},ml={hash:"svelte-1qpsqi4",code:".pie-tool-calculator__container .dcg-container {width:100% !important;height:100% !important;}"};function di(t,e){Fr(e,!0),ci(t,ml);let r=vt(e,"visible",7,!1),n=vt(e,"toolId",7,"calculator"),i=vt(e,"calculatorType",7,"basic"),s=vt(e,"availableTypes",23,()=>["basic","scientific","graphing"]),a=vt(e,"calculatorConfig",23,()=>({}));return vi(t,{get visible(){return r()},get toolId(){return n()},get calculatorType(){return i()},get availableTypes(){return s()},get calculatorConfig(){return a()}}),zr({get visible(){return r()},set visible(o=!1){r(o),G()},get toolId(){return n()},set toolId(o="calculator"){n(o),G()},get calculatorType(){return i()},set calculatorType(o="basic"){i(o),G()},get availableTypes(){return s()},set availableTypes(o=["basic","scientific","graphing"]){s(o),G()},get calculatorConfig(){return a()},set calculatorConfig(o={}){a(o),G()}})}hi(di,{visible:{attribute:"visible",type:"Boolean"},toolId:{attribute:"tool-id",type:"String"},calculatorType:{attribute:"calculator-type",type:"String"},availableTypes:{attribute:"available-types",type:"Array"},calculatorConfig:{type:"Object"}},[],[],void 0,Si);var yl=di.element;Ti(_l.tag,yl);
@@ -1 +1 @@
1
- import{n as f}from"./rolldown-runtime-1287ba31.js";import{t as c}from"./defineProperty-a20a667d.js";import{t as S}from"./preload-helper-6ad28da3.js";var u=class extends Error{constructor(e,r,t={}){var i=(...a)=>(super(...a),c(this,"code",void 0),c(this,"recoverable",void 0),this);i(r,t.cause===void 0?void 0:{cause:t.cause}),this.name="CortexCalculatorError",this.code=e,this.recoverable=t.recoverable??!0}};function F(e,r,t){return e instanceof u?e:new u(r,t,{cause:e,recoverable:r!=="worker-unavailable"})}var k={basicCalculator:"Basic calculator",scientificCalculator:"Scientific calculator",graphingCalculator:"Graphing calculator",expressionLabel:"{calculator} expression",angleMode:"Angle mode",degrees:"Degrees",radians:"Radians",calculate:"Calculate",calculating:"Calculating",backspace:"Backspace",clear:"Clear",result:"Result: {result}",calculationHistory:"Calculation history",clearHistory:"Clear history",virtualKeyboardBasic:"Basic",virtualKeyboardScientific:"Scientific",virtualKeyboardGraphing:"Graphing",keypad:"Keypad",keypadLayer:"Keypad layer",angleModeDegreesShort:"DEG",angleModeRadiansShort:"RAD",angleModeChanged:"Angle mode {mode}. Previous result cleared.",inserted:"{key}",keySine:"sin, sine",keyCosine:"cos, cosine",keyTangent:"tan, tangent",keyInverseSine:"sin, inverse sine",keyInverseCosine:"cos, inverse cosine",keyInverseTangent:"tan, inverse tangent",keyNaturalLog:"ln, natural logarithm",keyCommonLog:"log, common logarithm",keyLogBaseN:"Logarithm with a chosen base",keyFraction:"Fraction",keySquareRoot:"Square root",keyNthRoot:"Nth root",keyPower:"To the power of",keySquared:"Squared",keyCubed:"Cubed",keyExponential:"e to the power of",keyAbsoluteValue:"Absolute value",keyFactorial:"Factorial",keyPi:"Pi",keyEuler:"e, Euler's number",keyPercent:"Percent",keyOpenParenthesis:"Open parenthesis",keyCloseParenthesis:"Close parenthesis",keyDecimalSeparator:"Decimal separator",keyDigit:"{digit}",keyAdd:"Plus",keySubtract:"Minus",keyMultiply:"Times",keyDivide:"Divided by",keyVariableX:"x, variable x",graphExpressions:"Graph expressions",graphExpressionLabel:"Graph expression {index}, {lineStyle} line",seriesDescription:"Series {index}: {lineStyle} line",showExpression:"Show expression {index}",hideExpression:"Hide expression {index}",show:"Show",hide:"Hide",removeExpression:"Remove expression {index}",remove:"Remove",addExpression:"Add expression",graph:"Graph",viewportControls:"Graph view",zoomIn:"Zoom in",zoomOut:"Zoom out",panLeft:"Pan left",panRight:"Pan right",panUp:"Pan up",panDown:"Pan down",resetView:"Reset view",updatingGraph:"Updating graph",graphSummary:"Graph summary",viewportSummary:"Viewport x from {xMin} to {xMax}, y from {yMin} to {yMax}.",seriesSummary:"Series {index}, {lineStyle}: {expression}",keyboardGraphTrace:"Keyboard graph trace",keyboardTrace:"Keyboard trace",series:"Series",seriesOption:"Series {index}",previousPoint:"Previous point",nextPoint:"Next point",tracePoint:"x {x}, y {y}",noSampledPoint:"No sampled graph point is available.",lineStyleSolid:"solid",lineStyleDashed:"dashed",lineStyleDotted:"dotted",errorInvalidExpression:"Check the expression and try again.",errorUnsupportedExpression:"This expression is not available in this calculator.",errorExpressionTooComplex:"Simplify the expression and try again.",errorEvaluationTimeout:"The calculation took too long and was stopped.",errorInvalidState:"The saved calculator state could not be restored.",errorWorkerUnavailable:"The calculator is temporarily unavailable."},v={basicCalculator:"Eenvoudige rekenmachine",scientificCalculator:"Wetenschappelijke rekenmachine",graphingCalculator:"Grafische rekenmachine",expressionLabel:"Uitdrukking voor {calculator}",angleMode:"Hoekeenheid",degrees:"Graden",radians:"Radialen",calculate:"Bereken",calculating:"Bezig met berekenen",backspace:"Wis teken",clear:"Wissen",result:"Resultaat: {result}",calculationHistory:"Berekeningsgeschiedenis",clearHistory:"Geschiedenis wissen",virtualKeyboardBasic:"Eenvoudig",virtualKeyboardScientific:"Wetenschappelijk",virtualKeyboardGraphing:"Grafisch",keypad:"Toetsenblok",keypadLayer:"Laag van het toetsenblok",angleModeDegreesShort:"GR",angleModeRadiansShort:"RAD",angleModeChanged:"Hoekeenheid {mode}. Vorig resultaat gewist.",inserted:"{key}",keySine:"sin, sinus",keyCosine:"cos, cosinus",keyTangent:"tan, tangens",keyInverseSine:"sin, arcsinus",keyInverseCosine:"cos, arccosinus",keyInverseTangent:"tan, arctangens",keyNaturalLog:"ln, natuurlijke logaritme",keyCommonLog:"log, logaritme met grondtal tien",keyLogBaseN:"Logaritme met gekozen grondtal",keyFraction:"Breuk",keySquareRoot:"Vierkantswortel",keyNthRoot:"N-de wortel",keyPower:"Tot de macht",keySquared:"Kwadraat",keyCubed:"Derde macht",keyExponential:"e tot de macht",keyAbsoluteValue:"Absolute waarde",keyFactorial:"Faculteit",keyPi:"Pi",keyEuler:"e, getal van Euler",keyPercent:"Procent",keyOpenParenthesis:"Haakje openen",keyCloseParenthesis:"Haakje sluiten",keyDecimalSeparator:"Decimaalteken",keyDigit:"{digit}",keyAdd:"Plus",keySubtract:"Min",keyMultiply:"Maal",keyDivide:"Gedeeld door",keyVariableX:"x, variabele x",graphExpressions:"Grafiekuitdrukkingen",graphExpressionLabel:"Grafiekuitdrukking {index}, {lineStyle} lijn",seriesDescription:"Reeks {index}: {lineStyle} lijn",showExpression:"Uitdrukking {index} tonen",hideExpression:"Uitdrukking {index} verbergen",show:"Tonen",hide:"Verbergen",removeExpression:"Uitdrukking {index} verwijderen",remove:"Verwijderen",addExpression:"Uitdrukking toevoegen",graph:"Grafiek",viewportControls:"Grafiekweergave",zoomIn:"Inzoomen",zoomOut:"Uitzoomen",panLeft:"Naar links verschuiven",panRight:"Naar rechts verschuiven",panUp:"Naar boven verschuiven",panDown:"Naar beneden verschuiven",resetView:"Weergave herstellen",updatingGraph:"Grafiek wordt bijgewerkt",graphSummary:"Samenvatting van de grafiek",viewportSummary:"Weergave x van {xMin} tot {xMax}, y van {yMin} tot {yMax}.",seriesSummary:"Reeks {index}, {lineStyle}: {expression}",keyboardGraphTrace:"Grafiek volgen met het toetsenbord",keyboardTrace:"Volgen met het toetsenbord",series:"Reeks",seriesOption:"Reeks {index}",previousPoint:"Vorig punt",nextPoint:"Volgend punt",tracePoint:"x {x}, y {y}",noSampledPoint:"Er is geen bemonsterd grafiekpunt beschikbaar.",lineStyleSolid:"ononderbroken",lineStyleDashed:"gestreepte",lineStyleDotted:"gestippelde",errorInvalidExpression:"Controleer de uitdrukking en probeer het opnieuw.",errorUnsupportedExpression:"Deze uitdrukking is niet beschikbaar in deze rekenmachine.",errorExpressionTooComplex:"Vereenvoudig de uitdrukking en probeer het opnieuw.",errorEvaluationTimeout:"De berekening duurde te lang en is gestopt.",errorInvalidState:"De opgeslagen rekenmachinestatus kon niet worden hersteld.",errorWorkerUnavailable:"De rekenmachine is tijdelijk niet beschikbaar."},C={"invalid-expression":"errorInvalidExpression","unsupported-expression":"errorUnsupportedExpression","expression-too-complex":"errorExpressionTooComplex","evaluation-timeout":"errorEvaluationTimeout","invalid-state":"errorInvalidState","worker-unavailable":"errorWorkerUnavailable"},M={solid:"lineStyleSolid",dashed:"lineStyleDashed",dotted:"lineStyleDotted"},E=new Set(["ar","ckb","dv","fa","he","iw","ks","ku","nqo","ps","sd","syr","ug","ur","yi"]);function b(e){try{return new Intl.Locale(e.replaceAll("_","-")).language.toLowerCase()}catch{return e.replaceAll("_","-").split("-")[0]?.toLowerCase()??"en"}}function P(e){try{return new Intl.NumberFormat(e).format(1.1).includes(",")?",":"."}catch{return"."}}function x(e){try{const r=new Intl.Locale(e.replaceAll("_","-")).textInfo;if(r?.direction==="rtl"||r?.direction==="ltr")return r.direction}catch{}return E.has(b(e))?"rtl":"ltr"}function T(e){return b(e)==="nl"?v:k}function D(e,r){return e.replace(/\{([a-zA-Z][a-zA-Z0-9]*)\}/g,(t,i)=>Object.hasOwn(r,i)?String(r[i]):t)}function G(e,r={},t="auto"){const i=Object.freeze({...T(e),...r}),a=t==="auto"?x(e):t,o=P(e);let l=null,p=0;const d=(n,h={})=>D(i[n],h);return Object.freeze({locale:e,direction:a,messages:i,t:d,formatNumber(n,h=6){try{return(!l||p!==h)&&(p=h,l=new Intl.NumberFormat(e,{maximumSignificantDigits:h,useGrouping:!1})),l.format(n)}catch{return n.toPrecision(h)}},formatResult(n){return o==="."?n:n.replace(".",o)},errorMessage(n){return d(C[n])},lineStyle(n){return d(M[n])}})}var w=k,L=v,H=1024,A={xMin:-10,xMax:10,yMin:-10,yMax:10},j=["square-root"],m=["square-root","power","root","exponential","natural-log","common-log","log-base-n","sine","cosine","tangent","inverse-sine","inverse-cosine","inverse-tangent","absolute-value","factorial"];function s(e){throw new u("invalid-state",e)}function y(e,r,t,i,a){return e===void 0?r:((!Number.isInteger(e)||e<t||e>i)&&s(`${a} must be an integer from ${t} to ${i}.`),e)}function z(e){if(e===void 0)return{...A};(!e||typeof e!="object")&&s("Graph viewport must be an object.");const r=e;return[r.xMin,r.xMax,r.yMin,r.yMax].every(t=>typeof t=="number"&&Number.isFinite(t))||s("Graph viewport bounds must be finite numbers."),(r.xMin>=r.xMax||r.yMin>=r.yMax)&&s("Graph viewport minimums must be less than maximums."),r}function I(e,r){const t=e==="basic"?j:m;if(r===void 0)return new Set(t);(!Array.isArray(r)||!r.every(o=>typeof o=="string"))&&s("allowedFunctions must be an array of function identifiers.");const i=new Set(m);for(const o of r)i.has(o)||s(`Unknown calculator function: ${o}.`);const a=new Set(r);return new Set(t.filter(o=>a.has(o)))}function g(e,r,t){return e===void 0?r:(typeof e!="boolean"&&s(`${t} must be a boolean.`),e)}function R(e){if(e===void 0)return{};(!e||typeof e!="object"||Array.isArray(e))&&s("messages must be an object.");const r={};for(const[t,i]of Object.entries(e))Object.hasOwn(w,t)&&(typeof i!="string"&&s(`messages.${t} must be a string.`),r[t]=i);return r}function N(e,r={}){const t=r.settings??{},i=t.angleMode??"degree";i!=="degree"&&i!=="radian"&&s('angleMode must be "degree" or "radian".');const a=t.graph;a!==void 0&&(!a||typeof a!="object")&&s("graph settings must be an object.");const o=r.restrictedMode===!0,l=typeof r.locale=="string"&&r.locale.trim()?r.locale.trim():"en-US",p=r.theme??"auto";p!=="light"&&p!=="dark"&&p!=="auto"&&s('theme must be "light", "dark", or "auto".');const d=t.direction??"auto";d!=="ltr"&&d!=="rtl"&&d!=="auto"&&s('direction must be "ltr", "rtl", or "auto".');const n=G(l,R(t.messages),d);return Object.freeze({type:e,angleMode:i,calculationPrecision:y(t.calculationPrecision,15,1,21,"calculationPrecision"),displayPrecision:y(t.displayPrecision,10,1,12,"displayPrecision"),historyLimit:y(t.historyLimit,20,0,50,"historyLimit"),evaluationTimeLimitMs:y(t.evaluationTimeLimitMs,1e3,100,2e3,"evaluationTimeLimitMs"),allowedFunctions:I(e,t.allowedFunctions),allowClipboard:!o&&g(t.allowClipboard,!0,"allowClipboard"),restrictedMode:o,locale:l,theme:p,localization:n,graph:Object.freeze({viewport:z(a?.viewport),showAxes:g(a?.showAxes,!0,"graph.showAxes"),showGrid:g(a?.showGrid,!0,"graph.showGrid")})})}var B=f({CortexCalculatorError:()=>u,CortexCalculatorProvider:()=>O,cortexDutchMessages:()=>L,cortexEnglishMessages:()=>w,localeDirection:()=>x}),O=class{constructor(e={}){c(this,"providerId","cortex"),c(this,"providerName","PIE Open-Source Calculator"),c(this,"supportedTypes",["basic","scientific","graphing"]),c(this,"version","1"),c(this,"initialized",!1),c(this,"destroyed",!1),c(this,"instances",new Set),c(this,"onTelemetry",void 0),this.onTelemetry=e.onTelemetry}async initialize(e={}){if(!this.initialized){if(this.destroyed)throw new u("worker-unavailable","This calculator provider has been destroyed.",{recoverable:!1});if(typeof window>"u"||typeof document>"u")throw new u("worker-unavailable","Cortex calculators can only be initialized in a browser.",{recoverable:!1});if(typeof Worker>"u")throw new u("worker-unavailable","This browser does not support module workers.",{recoverable:!1});this.onTelemetry=e.onTelemetry??this.onTelemetry,this.initialized=!0}}async createCalculator(e,r,t={}){if(this.initialized||await this.initialize(),!this.supportsType(e))throw new u("unsupported-expression",`Cortex does not support calculator type: ${e}.`);if(!(r instanceof HTMLElement))throw new u("invalid-state","A valid HTML container is required.");const i=N(e,t),{createCortexCalculator:a}=await S(async()=>{const{createCortexCalculator:l}=await import("./runtime-YFqnU6ic-d5c0cb49.js");return{createCortexCalculator:l}},[],import.meta.url),o=a(this,r,i,this.onTelemetry,l=>this.instances.delete(l));return this.instances.add(o),o}supportsType(e){return this.supportedTypes.includes(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(const e of[...this.instances])e.destroy();this.instances.clear(),this.initialized=!1,this.onTelemetry=void 0}}getCapabilities(){return{supportsHistory:!0,supportsGraphing:!0,supportsExpressions:!0,canExport:!0,maxPrecision:21,inputMethods:["keyboard","mouse","touch"]}}};export{u as CortexCalculatorError,O as CortexCalculatorProvider,L as cortexDutchMessages,w as cortexEnglishMessages,P as i,x as localeDirection,F as n,H as r,B as t};
1
+ import{n as f}from"./rolldown-runtime-1287ba31.js";import{t as c}from"./defineProperty-a20a667d.js";import{t as S}from"./preload-helper-6ad28da3.js";var u=class extends Error{constructor(e,r,t={}){var i=(...a)=>(super(...a),c(this,"code",void 0),c(this,"recoverable",void 0),this);i(r,t.cause===void 0?void 0:{cause:t.cause}),this.name="CortexCalculatorError",this.code=e,this.recoverable=t.recoverable??!0}};function F(e,r,t){return e instanceof u?e:new u(r,t,{cause:e,recoverable:r!=="worker-unavailable"})}var k={basicCalculator:"Basic calculator",scientificCalculator:"Scientific calculator",graphingCalculator:"Graphing calculator",expressionLabel:"{calculator} expression",angleMode:"Angle mode",degrees:"Degrees",radians:"Radians",calculate:"Calculate",calculating:"Calculating",backspace:"Backspace",clear:"Clear",result:"Result: {result}",calculationHistory:"Calculation history",clearHistory:"Clear history",virtualKeyboardBasic:"Basic",virtualKeyboardScientific:"Scientific",virtualKeyboardGraphing:"Graphing",keypad:"Keypad",keypadLayer:"Keypad layer",angleModeDegreesShort:"DEG",angleModeRadiansShort:"RAD",angleModeChanged:"Angle mode {mode}. Previous result cleared.",inserted:"{key}",keySine:"sin, sine",keyCosine:"cos, cosine",keyTangent:"tan, tangent",keyInverseSine:"sin, inverse sine",keyInverseCosine:"cos, inverse cosine",keyInverseTangent:"tan, inverse tangent",keyNaturalLog:"ln, natural logarithm",keyCommonLog:"log, common logarithm",keyLogBaseN:"Logarithm with a chosen base",keyFraction:"Fraction",keySquareRoot:"Square root",keyNthRoot:"Nth root",keyPower:"To the power of",keySquared:"Squared",keyCubed:"Cubed",keyExponential:"e to the power of",keyAbsoluteValue:"Absolute value",keyFactorial:"Factorial",keyPi:"Pi",keyEuler:"e, Euler's number",keyPercent:"Percent",keyOpenParenthesis:"Open parenthesis",keyCloseParenthesis:"Close parenthesis",keyDecimalSeparator:"Decimal separator",keyDigit:"{digit}",keyAdd:"Plus",keySubtract:"Minus",keyMultiply:"Times",keyDivide:"Divided by",keyVariableX:"x, variable x",graphExpressions:"Graph expressions",graphExpressionLabel:"Graph expression {index}, {lineStyle} line",seriesDescription:"Series {index}: {lineStyle} line",showExpression:"Show expression {index}",hideExpression:"Hide expression {index}",show:"Show",hide:"Hide",removeExpression:"Remove expression {index}",remove:"Remove",addExpression:"Add expression",graph:"Graph",viewportControls:"Graph view",zoomIn:"Zoom in",zoomOut:"Zoom out",panLeft:"Pan left",panRight:"Pan right",panUp:"Pan up",panDown:"Pan down",resetView:"Reset view",updatingGraph:"Updating graph",graphSummary:"Graph summary",viewportSummary:"Viewport x from {xMin} to {xMax}, y from {yMin} to {yMax}.",seriesSummary:"Series {index}, {lineStyle}: {expression}",keyboardGraphTrace:"Keyboard graph trace",keyboardTrace:"Keyboard trace",series:"Series",seriesOption:"Series {index}",previousPoint:"Previous point",nextPoint:"Next point",tracePoint:"x {x}, y {y}",noSampledPoint:"No sampled graph point is available.",lineStyleSolid:"solid",lineStyleDashed:"dashed",lineStyleDotted:"dotted",errorInvalidExpression:"Check the expression and try again.",errorUnsupportedExpression:"This expression is not available in this calculator.",errorExpressionTooComplex:"Simplify the expression and try again.",errorEvaluationTimeout:"The calculation took too long and was stopped.",errorInvalidState:"The saved calculator state could not be restored.",errorWorkerUnavailable:"The calculator is temporarily unavailable."},v={basicCalculator:"Eenvoudige rekenmachine",scientificCalculator:"Wetenschappelijke rekenmachine",graphingCalculator:"Grafische rekenmachine",expressionLabel:"Uitdrukking voor {calculator}",angleMode:"Hoekeenheid",degrees:"Graden",radians:"Radialen",calculate:"Bereken",calculating:"Bezig met berekenen",backspace:"Wis teken",clear:"Wissen",result:"Resultaat: {result}",calculationHistory:"Berekeningsgeschiedenis",clearHistory:"Geschiedenis wissen",virtualKeyboardBasic:"Eenvoudig",virtualKeyboardScientific:"Wetenschappelijk",virtualKeyboardGraphing:"Grafisch",keypad:"Toetsenblok",keypadLayer:"Laag van het toetsenblok",angleModeDegreesShort:"GR",angleModeRadiansShort:"RAD",angleModeChanged:"Hoekeenheid {mode}. Vorig resultaat gewist.",inserted:"{key}",keySine:"sin, sinus",keyCosine:"cos, cosinus",keyTangent:"tan, tangens",keyInverseSine:"sin, arcsinus",keyInverseCosine:"cos, arccosinus",keyInverseTangent:"tan, arctangens",keyNaturalLog:"ln, natuurlijke logaritme",keyCommonLog:"log, logaritme met grondtal tien",keyLogBaseN:"Logaritme met gekozen grondtal",keyFraction:"Breuk",keySquareRoot:"Vierkantswortel",keyNthRoot:"N-de wortel",keyPower:"Tot de macht",keySquared:"Kwadraat",keyCubed:"Derde macht",keyExponential:"e tot de macht",keyAbsoluteValue:"Absolute waarde",keyFactorial:"Faculteit",keyPi:"Pi",keyEuler:"e, getal van Euler",keyPercent:"Procent",keyOpenParenthesis:"Haakje openen",keyCloseParenthesis:"Haakje sluiten",keyDecimalSeparator:"Decimaalteken",keyDigit:"{digit}",keyAdd:"Plus",keySubtract:"Min",keyMultiply:"Maal",keyDivide:"Gedeeld door",keyVariableX:"x, variabele x",graphExpressions:"Grafiekuitdrukkingen",graphExpressionLabel:"Grafiekuitdrukking {index}, {lineStyle} lijn",seriesDescription:"Reeks {index}: {lineStyle} lijn",showExpression:"Uitdrukking {index} tonen",hideExpression:"Uitdrukking {index} verbergen",show:"Tonen",hide:"Verbergen",removeExpression:"Uitdrukking {index} verwijderen",remove:"Verwijderen",addExpression:"Uitdrukking toevoegen",graph:"Grafiek",viewportControls:"Grafiekweergave",zoomIn:"Inzoomen",zoomOut:"Uitzoomen",panLeft:"Naar links verschuiven",panRight:"Naar rechts verschuiven",panUp:"Naar boven verschuiven",panDown:"Naar beneden verschuiven",resetView:"Weergave herstellen",updatingGraph:"Grafiek wordt bijgewerkt",graphSummary:"Samenvatting van de grafiek",viewportSummary:"Weergave x van {xMin} tot {xMax}, y van {yMin} tot {yMax}.",seriesSummary:"Reeks {index}, {lineStyle}: {expression}",keyboardGraphTrace:"Grafiek volgen met het toetsenbord",keyboardTrace:"Volgen met het toetsenbord",series:"Reeks",seriesOption:"Reeks {index}",previousPoint:"Vorig punt",nextPoint:"Volgend punt",tracePoint:"x {x}, y {y}",noSampledPoint:"Er is geen bemonsterd grafiekpunt beschikbaar.",lineStyleSolid:"ononderbroken",lineStyleDashed:"gestreepte",lineStyleDotted:"gestippelde",errorInvalidExpression:"Controleer de uitdrukking en probeer het opnieuw.",errorUnsupportedExpression:"Deze uitdrukking is niet beschikbaar in deze rekenmachine.",errorExpressionTooComplex:"Vereenvoudig de uitdrukking en probeer het opnieuw.",errorEvaluationTimeout:"De berekening duurde te lang en is gestopt.",errorInvalidState:"De opgeslagen rekenmachinestatus kon niet worden hersteld.",errorWorkerUnavailable:"De rekenmachine is tijdelijk niet beschikbaar."},C={"invalid-expression":"errorInvalidExpression","unsupported-expression":"errorUnsupportedExpression","expression-too-complex":"errorExpressionTooComplex","evaluation-timeout":"errorEvaluationTimeout","invalid-state":"errorInvalidState","worker-unavailable":"errorWorkerUnavailable"},M={solid:"lineStyleSolid",dashed:"lineStyleDashed",dotted:"lineStyleDotted"},E=new Set(["ar","ckb","dv","fa","he","iw","ks","ku","nqo","ps","sd","syr","ug","ur","yi"]);function b(e){try{return new Intl.Locale(e.replaceAll("_","-")).language.toLowerCase()}catch{return e.replaceAll("_","-").split("-")[0]?.toLowerCase()??"en"}}function P(e){try{return new Intl.NumberFormat(e).format(1.1).includes(",")?",":"."}catch{return"."}}function x(e){try{const r=new Intl.Locale(e.replaceAll("_","-")).textInfo;if(r?.direction==="rtl"||r?.direction==="ltr")return r.direction}catch{}return E.has(b(e))?"rtl":"ltr"}function T(e){return b(e)==="nl"?v:k}function D(e,r){return e.replace(/\{([a-zA-Z][a-zA-Z0-9]*)\}/g,(t,i)=>Object.hasOwn(r,i)?String(r[i]):t)}function G(e,r={},t="auto"){const i=Object.freeze({...T(e),...r}),a=t==="auto"?x(e):t,o=P(e);let l=null,p=0;const d=(n,h={})=>D(i[n],h);return Object.freeze({locale:e,direction:a,messages:i,t:d,formatNumber(n,h=6){try{return(!l||p!==h)&&(p=h,l=new Intl.NumberFormat(e,{maximumSignificantDigits:h,useGrouping:!1})),l.format(n)}catch{return n.toPrecision(h)}},formatResult(n){return o==="."?n:n.replace(".",o)},errorMessage(n){return d(C[n])},lineStyle(n){return d(M[n])}})}var w=k,L=v,H=1024,A={xMin:-10,xMax:10,yMin:-10,yMax:10},j=["square-root"],m=["square-root","power","root","exponential","natural-log","common-log","log-base-n","sine","cosine","tangent","inverse-sine","inverse-cosine","inverse-tangent","absolute-value","factorial"];function s(e){throw new u("invalid-state",e)}function y(e,r,t,i,a){return e===void 0?r:((!Number.isInteger(e)||e<t||e>i)&&s(`${a} must be an integer from ${t} to ${i}.`),e)}function z(e){if(e===void 0)return{...A};(!e||typeof e!="object")&&s("Graph viewport must be an object.");const r=e;return[r.xMin,r.xMax,r.yMin,r.yMax].every(t=>typeof t=="number"&&Number.isFinite(t))||s("Graph viewport bounds must be finite numbers."),(r.xMin>=r.xMax||r.yMin>=r.yMax)&&s("Graph viewport minimums must be less than maximums."),r}function I(e,r){const t=e==="basic"?j:m;if(r===void 0)return new Set(t);(!Array.isArray(r)||!r.every(o=>typeof o=="string"))&&s("allowedFunctions must be an array of function identifiers.");const i=new Set(m);for(const o of r)i.has(o)||s(`Unknown calculator function: ${o}.`);const a=new Set(r);return new Set(t.filter(o=>a.has(o)))}function g(e,r,t){return e===void 0?r:(typeof e!="boolean"&&s(`${t} must be a boolean.`),e)}function R(e){if(e===void 0)return{};(!e||typeof e!="object"||Array.isArray(e))&&s("messages must be an object.");const r={};for(const[t,i]of Object.entries(e))Object.hasOwn(w,t)&&(typeof i!="string"&&s(`messages.${t} must be a string.`),r[t]=i);return r}function N(e,r={}){const t=r.settings??{},i=t.angleMode??"degree";i!=="degree"&&i!=="radian"&&s('angleMode must be "degree" or "radian".');const a=t.graph;a!==void 0&&(!a||typeof a!="object")&&s("graph settings must be an object.");const o=r.restrictedMode===!0,l=typeof r.locale=="string"&&r.locale.trim()?r.locale.trim():"en-US",p=r.theme??"auto";p!=="light"&&p!=="dark"&&p!=="auto"&&s('theme must be "light", "dark", or "auto".');const d=t.direction??"auto";d!=="ltr"&&d!=="rtl"&&d!=="auto"&&s('direction must be "ltr", "rtl", or "auto".');const n=G(l,R(t.messages),d);return Object.freeze({type:e,angleMode:i,calculationPrecision:y(t.calculationPrecision,15,1,21,"calculationPrecision"),displayPrecision:y(t.displayPrecision,10,1,12,"displayPrecision"),historyLimit:y(t.historyLimit,20,0,50,"historyLimit"),evaluationTimeLimitMs:y(t.evaluationTimeLimitMs,1e3,100,2e3,"evaluationTimeLimitMs"),allowedFunctions:I(e,t.allowedFunctions),allowClipboard:!o&&g(t.allowClipboard,!0,"allowClipboard"),restrictedMode:o,locale:l,theme:p,localization:n,graph:Object.freeze({viewport:z(a?.viewport),showAxes:g(a?.showAxes,!0,"graph.showAxes"),showGrid:g(a?.showGrid,!0,"graph.showGrid")})})}var B=f({CortexCalculatorError:()=>u,CortexCalculatorProvider:()=>O,cortexDutchMessages:()=>L,cortexEnglishMessages:()=>w,localeDirection:()=>x}),O=class{constructor(e={}){c(this,"providerId","cortex"),c(this,"providerName","PIE Open-Source Calculator"),c(this,"supportedTypes",["basic","scientific","graphing"]),c(this,"version","1"),c(this,"initialized",!1),c(this,"destroyed",!1),c(this,"instances",new Set),c(this,"onTelemetry",void 0),this.onTelemetry=e.onTelemetry}async initialize(e={}){if(!this.initialized){if(this.destroyed)throw new u("worker-unavailable","This calculator provider has been destroyed.",{recoverable:!1});if(typeof window>"u"||typeof document>"u")throw new u("worker-unavailable","Cortex calculators can only be initialized in a browser.",{recoverable:!1});if(typeof Worker>"u")throw new u("worker-unavailable","This browser does not support module workers.",{recoverable:!1});this.onTelemetry=e.onTelemetry??this.onTelemetry,this.initialized=!0}}async createCalculator(e,r,t={}){if(this.initialized||await this.initialize(),!this.supportsType(e))throw new u("unsupported-expression",`Cortex does not support calculator type: ${e}.`);if(!(r instanceof HTMLElement))throw new u("invalid-state","A valid HTML container is required.");const i=N(e,t),{createCortexCalculator:a}=await S(async()=>{const{createCortexCalculator:l}=await import("./runtime-BCz9m_IT-7b48a036.js");return{createCortexCalculator:l}},[],import.meta.url),o=a(this,r,i,this.onTelemetry,l=>this.instances.delete(l));return this.instances.add(o),o}supportsType(e){return this.supportedTypes.includes(e)}destroy(){if(!this.destroyed){this.destroyed=!0;for(const e of[...this.instances])e.destroy();this.instances.clear(),this.initialized=!1,this.onTelemetry=void 0}}getCapabilities(){return{supportsHistory:!0,supportsGraphing:!0,supportsExpressions:!0,canExport:!0,maxPrecision:21,inputMethods:["keyboard","mouse","touch"]}}};export{u as CortexCalculatorError,O as CortexCalculatorProvider,L as cortexDutchMessages,w as cortexEnglishMessages,P as i,x as localeDirection,F as n,H as r,B as t};