@tempots/ui 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Be=Object.defineProperty,Ue=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,d=(t,e,n)=>Ue(t,typeof e!="symbol"?e+"":e,n);const Yt="$__signal__",Nt="$__prop__",Ft="$__computed__";var Jt;Jt=Yt;const je=class F{constructor(e,n){d(this,Jt,!0),d(this,"_value"),d(this,"_derivatives",[]),d(this,"_onValueListeners",[]),d(this,"_onDisposeListeners",[]),d(this,"get",()=>this._value),d(this,"hasListeners",()=>this._onValueListeners.length>0),d(this,"on",o=>(o(this.get()),this._onValueListeners.push(o),()=>{this._onValueListeners.splice(this._onValueListeners.indexOf(o),1)})),d(this,"_setAndNotify",(o,i)=>{const s=this.equals(this._value,o);s||(this._value=o),(i||!s)&&this._onValueListeners.forEach(r=>r(o))}),d(this,"_disposed",!1),d(this,"isDisposed",()=>this._disposed),d(this,"onDispose",o=>{this._onDisposeListeners.push(o)}),d(this,"dispose",()=>{this._disposed||(this._disposed=!0,this._onDisposeListeners.forEach(o=>o()),this._onDisposeListeners.length=0,this._derivatives.length=0)}),d(this,"map",(o,i=(s,r)=>s===r)=>{const s=new ct(()=>{try{return o(this.get())}catch(r){throw console.error("Error in Signal.map:",r),r}},i);return this.setDerivative(s),s}),d(this,"flatMap",(o,i=(s,r)=>s===r)=>{const s=new ct(()=>{try{return o(this.get()).get()}catch(r){throw console.error("Error in Signal.flatMap:",r),r}},i);return this.setDerivative(s),s}),d(this,"tap",o=>this.map(i=>(o(i),i))),d(this,"at",o=>this.map(i=>i[o])),d(this,"$",new Proxy(this,{get:(o,i)=>this.at(i)})),d(this,"filter",(o,i)=>{let s=i??this.get();const r=new ct(()=>{try{const c=this.get();return s=o(c)?c:s}catch(c){throw console.error("Error in Signal.filter:",c),c}},this.equals);return this.setDerivative(r),r}),d(this,"filterMap",(o,i,s=(r,c)=>r===c)=>{let r=i;const c=new ct(()=>{try{const l=this.get();return r=o(l)??r}catch(l){throw console.error("Error in Signal.filterMap:",l),l}},s);return this.setDerivative(c),c}),d(this,"mapAsync",(o,i,s,r=(c,l)=>c===l)=>{const c=P(i,r);let l=0;return c.onDispose(this.on(a=>{const f=++l;try{o(a).then(u=>{f===l&&c.set(u)}).catch(u=>{f===l&&(s!=null?c.set(s(u)):console.error("Unhandled promise rejection in Signal.mapAsync:",u))})}catch(u){throw console.error("Error in Signal.mapAsync:",u),u}})),c}),d(this,"mapMaybe",(o,i)=>this.map(s=>o(s)??i)),d(this,"feedProp",(o,i=!1)=>{const s=this.on(o.set);return o.onDispose(s),i?this.onDispose(o.dispose):this.onDispose(s),o}),d(this,"deriveProp",(o=!0)=>this.feedProp(P(this.get()),o)),d(this,"count",()=>{let o=0;return this.map(()=>++o)}),d(this,"setDerivative",o=>{this._derivatives.push(o),o.onDispose(()=>{this._derivatives.splice(this._derivatives.indexOf(o),1)}),o.onDispose(this.on(o.setDirty)),this.onDispose(o.dispose)}),this.equals=n,this._value=e}static ofPromise(e,n,o,i=(s,r)=>s===r){const s=new F(n,i);return e.then(r=>s._setAndNotify(r,!1)).catch(r=>{o!=null?s._setAndNotify(o(r),!1):console.error("Unhandled promise rejection in Signal.ofPromise:",r)}),s}static is(e){return e!=null&&e[Yt]===!0}static wrap(e,n=(o,i)=>o===i){return F.is(e)?e:new F(e,n)}static maybeWrap(e){return e==null?e:F.wrap(e)}static unwrap(e){return F.is(e)?e.get():e}static map(e,n){return F.is(e)?e.map(n):n(e)}get value(){return this._value}};let S=je;const qe=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t);var $t,Vt;class ct extends(Vt=S,$t=Ft,Vt){constructor(e,n){super(void 0,n),d(this,$t,!0),d(this,"_isDirty",!1),d(this,"setDirty",()=>{this._isDirty||this._disposed||(this._isDirty=!0,this._derivatives.forEach(o=>o.setDirty()),this.scheduleNotify())}),d(this,"_scheduleCount",0),d(this,"scheduleNotify",()=>{const o=++this._scheduleCount;qe(()=>{this._scheduleCount!==o||this._disposed!==!1||this._isDirty&&(this._isDirty=!1,this._setAndNotify(this._fn(),!1))})}),d(this,"get",()=>(this._isDirty&&(this._isDirty=!1,this._value=this._fn(),this._setAndNotify(this._value,!0)),this._value)),this._fn=e,this.setDirty()}static is(e){return e!=null&&e[Ft]===!0}get value(){return this.get()}}var Wt,Ht;class St extends(Ht=S,Wt=Nt,Ht){constructor(){super(...arguments),d(this,Wt,!0),d(this,"set",e=>{this._setAndNotify(e,!1)}),d(this,"update",e=>{this._setAndNotify(e(this.get()),!1)}),d(this,"reducer",(e,...n)=>{const o=this;return function i(s){const r=o.value;o.update(c=>e(c,s)),!o.equals(r,o.value)&&n.forEach(c=>c({previousState:r,state:o.value,action:s,dispatch:i}))}}),d(this,"iso",(e,n,o=(i,s)=>i===s)=>{const i=new St(e(this.get()),o);return i.onDispose(this.on(s=>i.set(e(s)))),i.on(s=>this._setAndNotify(n(s),!1)),i}),d(this,"atProp",e=>this.iso(n=>n[e],n=>({...this.value,[e]:n})))}static is(e){return e!=null&&e[Nt]===!0}get value(){return this.get()}set value(e){this._setAndNotify(e,!1)}}function P(t,e=(n,o)=>n===o){return new St(t,e)}function Xe(t,e=(n,o)=>n===o){return new S(t,e)}const Kt=new Set(["checked","disabled","hidden","selected"]),Gt=new Set(["rowSpan","colSpan","tabIndex","valueAsNumber"]),Qt=new Set(["valueAsDate"]),Zt=new Set(["value","textContent","innerText","innerHTML","outerHTML","className","classList"]),xt=new Map;function Q(t,e){if(xt.has(t))return xt.get(t);{const n=e(t);return xt.set(t,n),n}}function Ye(t){return(e,n)=>{n==null?e[t]=null:e[t]=!!n}}function Je(t){return(e,n)=>{n==null?e[t]=null:e[t]=Number(n)}}function Ke(t){return(e,n)=>{n==null?e[t]=null:e[t]=n}}function Ge(t){return(e,n)=>{n==null?e[t]=null:e[t]=String(n)}}function Qe(t){return(e,n)=>{n==null?e.removeAttribute(t):e.setAttribute(t,n)}}function te(t){return Kt.has(t)?Q(t,Ye):Gt.has(t)?Q(t,Je):Qt.has(t)?Q(t,Ke):Zt.has(t)?Q(t,Ge):Q(t,Qe)}function ee(t){return e=>Kt.has(t)?!!e[t]:Gt.has(t)?Number(e[t]):Qt.has(t)?e[t]:Zt.has(t)?String(e[t]):e.getAttribute(t)}function q(t){const e=t;e&&e.onblur&&(e.onblur=null),!(!t||t.ownerDocument===void 0)&&t.parentElement&&t.parentElement.removeChild(t)}function Ze(t,e,n){let o=t.target;for(;o!=null&&!(o instanceof HTMLAnchorElement);)o=o.parentElement;if(o==null)return!0;const i=o;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;if(n){const{pathname:s,search:r,hash:c}=i,l=s+r+c;if(i.getAttribute("href")!==l||e&&!/\/[^/.]*$/.test(s))return!0}return!1}const tn=(t,e={checkExtension:!0,checkExternalUrl:!0})=>n=>{const{checkExtension:o,checkExternalUrl:i}=e;Ze(n,o===!0,i===!0)||t()&&n.preventDefault()},en=t=>e=>{le(e);const n=e.createText(t);return e.appendOrInsert(n),o=>{o&&q(n)}},nn=t=>e=>{le(e);const n=e.createText(t.value);e.appendOrInsert(n);const o=t.on(i=>n.data=i);return i=>{o(),i&&q(n)}},X=(...t)=>e=>{const n=t.map(o=>b(o)(e));return o=>{n.forEach(i=>i(o))}},tt=()=>()=>{},on=t=>e=>(re(e),e.element.classList.add(...t),n=>{n&&e.element.classList.remove(...t)}),sn=t=>e=>{re(e);const n=e.element;let o=[];const i=t.on(s=>{o.forEach(r=>n.classList.remove(r)),o=(s??"").split(" ").filter(r=>r.length>0),n.classList.add(...o)});return s=>{i(),s&&o.forEach(r=>n.classList.remove(r)),o.length=0}},nt=(t,e)=>{const n=te(t),o=ee(t);return i=>{se(i,t);const s=o(i.element);return n(i.element,e),r=>{r&&n(i.element,s)}}},ot=(t,e)=>{const n=te(t),o=ee(t);return i=>{se(i,t);const s=o(i.element);return e.on(r=>n(i.element,r)),r=>{r&&n(i.element,s)}}},Lt=new Proxy({},{get:(t,e)=>e==="class"?n=>S.is(n)?sn(n):on((n??"").split(" ").filter(o=>o.length>0)):n=>S.is(n)?ot(e,n):nt(e,n)});new Proxy({},{get:(t,e)=>n=>S.is(n)?ot(`data-${e}`,n):nt(`data-${e}`,n)});new Proxy({},{get:(t,e)=>n=>S.is(n)?ot(`aria-${e}`,n):nt(`aria-${e}`,n)});new Proxy({},{get:(t,e)=>n=>S.is(n)?ot(e,n):nt(e,n)});new Proxy({},{get:(t,e)=>n=>S.is(n)?ot(e,n):nt(e,n)});function b(t){return t==null?tt:Array.isArray(t)?X(...t.map(b)):typeof t=="string"?en(t):S.is(t)?nn(t):t}function ne(t,...e){return n=>{const o=n.createElement(t,void 0);n.isFirstLevel&&Y.isSSR()&&ce(o),n.appendOrInsert(o),n=n.withElement(o);const i=e.map(s=>b(s)(n));return s=>{i.forEach(r=>r(!1)),s&&q(o)}}}function oe(t,e,...n){return o=>{const i=o.createElement(t,e);o.isFirstLevel&&Y.isSSR()&&ce(i),o.appendOrInsert(i),o=o.withElement(i);const s=n.map(r=>b(r)(o));return r=>{s.forEach(c=>c(!1)),r&&q(i)}}}const ie=new Proxy({},{get:(t,e)=>(...n)=>ne(e,n.flatMap(b))});new Proxy({},{get:(t,e)=>(...n)=>ne("input",Lt.type(e),...n)});const rn="http://www.w3.org/2000/svg";new Proxy({},{get:(t,e)=>(...n)=>oe(e,rn,n.flatMap(b))});const cn="http://www.w3.org/1998/Math/MathML";new Proxy({},{get:(t,e)=>(...n)=>oe(e,cn,n.flatMap(b))});const zt="data-tempo-attr",ln="data-tempo-class",an="data-tempo-node",un="data-tempo-text";function fn(t,e){const n=t.getAttribute(e);if(n!=null){const o=t.getAttribute(zt)??"{}",i={...JSON.parse(o),name:n};t.setAttribute(zt,JSON.stringify(i))}}function se(t,e){Y.isSSR()&&t.isFirstLevel&&fn(t.element,e)}function hn(t){t.setAttribute(ln,t.className)}function re(t){Y.isSSR()&&t.isFirstLevel&&hn(t.element)}function ce(t){t.setAttribute(an,"")}function dn(t){t.setAttribute(un,t.textContent??"")}function le(t){Y.isSSR()&&t.isFirstLevel&&dn(t.element)}function ae(){const t=globalThis;return t.__tempoSSR__==null&&(t.__tempoSSR__={isSSR:!1,counter:0}),t.__tempoSSR__}function ue(t,e){const n=ae();n[t]=e}function fe(t){return ae()[t]}function pn(){return fe("isSSR")}function he(){return fe("counter")}function mn(){ue("counter",(he()??0)+1)}function gn(){ue("counter",(he()??0)-1)}const Y={useDone:t=>(mn(),b(t(gn))),isSSR:pn},wn=(t,e)=>n=>(n.element.addEventListener(t,e),o=>{o&&n.element.removeEventListener(t,e)}),de=new Proxy({},{get:(t,e)=>n=>wn(e,n)}),lt=(t,e)=>n=>{n=n.makeRef();let o,i;const s=t.map(l=>Object.keys(l)[0]);let r;const c=s.on(l=>{if(l!==r){i==null||i.dispose(),o==null||o(!0),i=t.map(f=>f[l]);const a=e[l](i);o=b(a)(n),r=l}});return l=>{c(),l&&n.reference!=null&&q(n.reference),o==null||o(!0)}},B={bool:(t,e)=>lt(t.map(n=>n?{true:!0}:{false:!0}),e),field:(t,e,n)=>lt(t.map(o=>({[o[e]]:o})),n),kind:(t,e)=>B.field(t,"kind",e),tuple:(t,e)=>{const n=t.map(([o,i])=>({[o]:i}));return lt(n,e)},type:(t,e)=>B.field(t,"type",e),value:(t,e)=>lt(t.map(n=>({[n]:!0})),e)},yn=(t,e)=>n=>{const o=Object.values(t).reduce((i,s)=>{const r=n.getProvider(s);if(r==null)throw new Error(`No provider found for mark: ${s.description}`);return i[s]=r,i},{});return b(e(o))(n)},pe=(t,e)=>yn([t],n=>b(e(n[t]))),vn=(t,e,n)=>o=>{o=o.makeRef();let i=null,s=!1;const r=P(null),c=t.on(l=>{l==null?(i==null||i(!0),i=b((n==null?void 0:n())??tt)(o),s=!1):(r.value=l,s||(i==null||i(!0),i=b(e(r))(o),s=!0))});return l=>{c(),i==null||i(l),l&&o.reference&&q(o.reference)}},it=t=>e=>n=>t(n,e),xn=(t,e,n)=>vn(t.map(o=>o?!0:null),()=>e,n!=null?()=>n:void 0),me=t=>e=>t(e.element)??(()=>{});function bn(t,e){const n=t(e);return()=>n(!0)}const ge=(t,e)=>n=>{const o=n.document.querySelector(t);if(o===null)throw new Error(`Cannot find element by selector for portal: ${t}`);return bn(b(e),n.withElement(o).withFirstLevel())};function we(t){return Symbol(t)}const An=(t,e)=>n=>b(e)(n.withProviders(t)),ye=(t,e,n)=>An({[t]:e},b(n)),Sn=(t,e)=>n=>{const o=n.element,i=o.style.getPropertyValue(t);return o.style.setProperty(t,e),s=>{s&&o.style.setProperty(t,i)}},Ln=(t,e)=>n=>{const o=n.element,i=o.style.getPropertyValue(t);return e.on(s=>o.style.setProperty(t,s)),s=>{s&&o.style.setProperty(t,i)}};new Proxy({},{get:(t,e)=>n=>S.is(n)?Ln(e,n):Sn(e,n)});const Rt=we("LocationProvider");function ve(){const t=(window==null?void 0:window.location.hash)===""?void 0:(window==null?void 0:window.location.hash.substring(1))??void 0;return{pathname:(window==null?void 0:window.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((window==null?void 0:window.location.search)??"").entries()),hash:t}}function xe(t,e){return t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash}function be(t){const e=new URL(t,(window==null?void 0:window.location.toString())??""),n=Object.fromEntries(e.searchParams.entries());return{pathname:e.pathname,search:n,hash:e.hash}}function Ae(t,e){const n=be(e);return t.set(n),t}function Rn(t){const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`}function Se(){const t=P(ve(),xe),e=()=>{const n={...t.value,pathname:(window==null?void 0:window.location.pathname)??""};t.set(n)};return window==null||window.addEventListener("popstate",e),t.onDispose(()=>{window==null||window.removeEventListener("popstate",e)}),t.on(n=>{const i=new URLSearchParams(n.search).toString(),s=n.hash,r=`${n.pathname}${i?`?${i}`:""}${s?`#${s}`:""}`;window==null||window.history.pushState({},"",r)}),t}function En(t){const e=Se();return X(it(e.dispose),ye(Rt,e,t))}function Et(t){return pe(Rt,e=>n=>{const o=P(e.value,e.equals);e.feedProp(o),o.on(e.set);const i=b(t(o))(n);return s=>{o.dispose(),i(s)}})}function _n(t,...e){return Et(n=>ie.a(de.click(tn(()=>(Ae(n,S.unwrap(t)),!0))),Lt.href(t),...e))}const _t=we("Appearance"),On=t=>{const e=window.matchMedia!=null&&window.matchMedia("(prefers-color-scheme: dark)").matches,n=P(e?"dark":"light"),o=s=>{n.set(s.matches?"dark":"light")},i=window.matchMedia!=null?window.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",o),X(ye(_t,n,t),it(()=>i==null?void 0:i.removeEventListener("change",o)))},Pn=t=>pe(_t,t);function Le(t,e){if(typeof e=="function")return Le(t,{success:e});const n=e.failure??(r=>X(it(r.on(console.error)),r.map(c=>`Error: ${c}`))),o=e.success,i=e.loading??(()=>tt),s=e.notAsked??(()=>tt);return B.type(S.wrap(t),{AsyncSuccess:r=>o(r.$.value),AsyncFailure:r=>n(r.$.error),Loading:r=>i(r.$.previousValue??Xe(void 0)),NotAsked:s})}const Dn=(t=10)=>e=>{const n=setTimeout(()=>{var o;(o=e.element)==null||o.focus()},t);return o=>clearTimeout(n)},Tn=(t=10)=>e=>{const n=setTimeout(()=>{var o;(o=e.element)==null||o.select()},t);return o=>{clearTimeout(n)}},kn=t=>{const e=t.element,n=e.style.getPropertyValue(":empty");return e.style.setProperty(":empty","display:none"),o=>{o&&e.style.setProperty(":empty",n)}},Cn=t=>ge("head title",Lt.innerText(t)),Mn={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},ut={partial:new Map,full:new Map},Z={partial:null,full:null};function Nn(t){return Z[t]==null&&(Z[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=ut[t].get(n.target);o==null||o.set(n.isIntersecting)})},Mn[t])),Z[t]}function Re(t,e){const n=P(Y.isSSR());return X(me(o=>{const i=typeof IntersectionObserver<"u"?Nn(t):null;return ut[t].set(o,n),i==null||i.observe(o),()=>{var s;i==null||i.unobserve(o),ut[t].delete(o),ut[t].size===0&&((s=Z[t])==null||s.disconnect(),Z[t]=null)}}),it(n.dispose),b(e(n)))}const Fn=(t,e,n)=>Re(t,o=>xn(o,e,n??tt)),ft=Math.min,$=Math.max,ht=Math.round,at=Math.floor,C=t=>({x:t,y:t}),$n={left:"right",right:"left",bottom:"top",top:"bottom"},Vn={start:"end",end:"start"};function It(t,e,n){return $(t,ft(e,n))}function mt(t,e){return typeof t=="function"?t(e):t}function V(t){return t.split("-")[0]}function gt(t){return t.split("-")[1]}function Ee(t){return t==="x"?"y":"x"}function _e(t){return t==="y"?"height":"width"}function U(t){return["top","bottom"].includes(V(t))?"y":"x"}function Oe(t){return Ee(U(t))}function Wn(t,e,n){n===void 0&&(n=!1);const o=gt(t),i=Oe(t),s=_e(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=dt(r)),[r,dt(r)]}function Hn(t){const e=dt(t);return[At(t),e,At(e)]}function At(t){return t.replace(/start|end/g,e=>Vn[e])}function zn(t,e,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:r;default:return[]}}function In(t,e,n,o){const i=gt(t);let s=zn(V(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(At)))),s}function dt(t){return t.replace(/left|right|bottom|top/g,e=>$n[e])}function Bn(t){return{top:0,right:0,bottom:0,left:0,...t}}function Un(t){return typeof t!="number"?Bn(t):{top:t,right:t,bottom:t,left:t}}function pt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Bt(t,e,n){let{reference:o,floating:i}=t;const s=U(e),r=Oe(e),c=_e(r),l=V(e),a=s==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-i.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-i.width,y:u};break;default:h={x:o.x,y:o.y}}switch(gt(e)){case"start":h[r]-=m*(n&&a?-1:1);break;case"end":h[r]+=m*(n&&a?-1:1);break}return h}const jn=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=Bt(a,o,l),m=o,h={},g=0;for(let w=0;w<c.length;w++){const{name:y,fn:p}=c[w],{x:v,y:x,data:L,reset:A}=await p({x:f,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:a,platform:r,elements:{reference:t,floating:e}});f=v??f,u=x??u,h={...h,[y]:{...h[y],...L}},A&&g<=50&&(g++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(a=A.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:f,y:u}=Bt(a,m,l)),w=-1)}return{x:f,y:u,placement:m,strategy:i,middlewareData:h}};async function Pe(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:h=0}=mt(e,t),g=Un(h),y=c[m?u==="floating"?"reference":"floating":u],p=pt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),v=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),L=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},A=pt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:x,strategy:l}):v);return{top:(p.top-A.top+g.top)/L.y,bottom:(A.bottom-p.bottom+g.bottom)/L.y,left:(p.left-A.left+g.left)/L.x,right:(A.right-p.right+g.right)/L.x}}const qn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...y}=mt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=V(i),v=U(c),x=V(c)===c,L=await(l.isRTL==null?void 0:l.isRTL(a.floating)),A=m||(x||!w?[dt(c)]:Hn(c)),H=g!=="none";!m&&H&&A.push(...In(c,w,g,L));const ze=[c,...A],vt=await Pe(e,y),rt=[];let K=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&rt.push(vt[p]),u){const N=Wn(i,r,L);rt.push(vt[N[0]],vt[N[1]])}if(K=[...K,{placement:i,overflows:rt}],!rt.every(N=>N<=0)){var Tt,kt;const N=(((Tt=s.flip)==null?void 0:Tt.index)||0)+1,Mt=ze[N];if(Mt)return{data:{index:N,overflows:K},reset:{placement:Mt}};let G=(kt=K.filter(z=>z.overflows[0]<=0).sort((z,T)=>z.overflows[1]-T.overflows[1])[0])==null?void 0:kt.placement;if(!G)switch(h){case"bestFit":{var Ct;const z=(Ct=K.filter(T=>{if(H){const k=U(T.placement);return k===v||k==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(k=>k>0).reduce((k,Ie)=>k+Ie,0)]).sort((T,k)=>T[1]-k[1])[0])==null?void 0:Ct[0];z&&(G=z);break}case"initialPlacement":G=c;break}if(i!==G)return{reset:{placement:G}}}return{}}}};async function Xn(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=V(n),c=gt(n),l=U(n)==="y",a=["left","top"].includes(r)?-1:1,f=s&&l?-1:1,u=mt(e,t);let{mainAxis:m,crossAxis:h,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),l?{x:h*f,y:m*a}:{x:m*a,y:h*f}}const Yn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await Xn(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},Jn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:c={fn:y=>{let{x:p,y:v}=y;return{x:p,y:v}}},...l}=mt(t,e),a={x:n,y:o},f=await Pe(e,l),u=U(V(i)),m=Ee(u);let h=a[m],g=a[u];if(s){const y=m==="y"?"top":"left",p=m==="y"?"bottom":"right",v=h+f[y],x=h-f[p];h=It(v,h,x)}if(r){const y=u==="y"?"top":"left",p=u==="y"?"bottom":"right",v=g+f[y],x=g-f[p];g=It(v,g,x)}const w=c.fn({...e,[m]:h,[u]:g});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function J(t){return De(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function D(t){var e;return(e=(De(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function De(t){return t instanceof Node||t instanceof R(t).Node}function _(t){return t instanceof Element||t instanceof R(t).Element}function O(t){return t instanceof HTMLElement||t instanceof R(t).HTMLElement}function Ut(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Kn(t){return["table","td","th"].includes(J(t))}function wt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Ot(t){const e=Pt(),n=E(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Gn(t){let e=M(t);for(;O(e)&&!j(e);){if(wt(e))return null;if(Ot(e))return e;e=M(e)}return null}function Pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function j(t){return["html","body","#document"].includes(J(t))}function E(t){return R(t).getComputedStyle(t)}function yt(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function M(t){if(J(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ut(t)&&t.host||D(t);return Ut(e)?e.host:e}function Te(t){const e=M(t);return j(e)?t.ownerDocument?t.ownerDocument.body:t.body:O(e)&&st(e)?e:Te(e)}function et(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Te(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);return s?e.concat(r,r.visualViewport||[],st(i)?i:[],r.frameElement&&n?et(r.frameElement):[]):e.concat(i,et(i,[],n))}function ke(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=O(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=ht(n)!==s||ht(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function Dt(t){return _(t)?t:t.contextElement}function I(t){const e=Dt(t);if(!O(e))return C(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=ke(e);let r=(s?ht(n.width):n.width)/o,c=(s?ht(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Qn=C(0);function Ce(t){const e=R(t);return!Pt()||!e.visualViewport?Qn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Zn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function W(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Dt(t);let r=C(1);e&&(o?_(o)&&(r=I(o)):r=I(t));const c=Zn(s,n,o)?Ce(s):C(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,f=i.width/r.x,u=i.height/r.y;if(s){const m=R(s),h=o&&_(o)?R(o):o;let g=m,w=g.frameElement;for(;w&&o&&h!==g;){const y=I(w),p=w.getBoundingClientRect(),v=E(w),x=p.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,L=p.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,a*=y.y,f*=y.x,u*=y.y,l+=x,a+=L,g=R(w),w=g.frameElement}}return pt({width:f,height:u,x:l,y:a})}function to(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=D(o),c=e?wt(e.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=C(1);const f=C(0),u=O(o);if((u||!u&&!s)&&((J(o)!=="body"||st(r))&&(l=yt(o)),O(o))){const m=W(o);a=I(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x,y:n.y*a.y-l.scrollTop*a.y+f.y}}function eo(t){return Array.from(t.getClientRects())}function Me(t){return W(D(t)).left+yt(t).scrollLeft}function no(t){const e=D(t),n=yt(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Me(t);const c=-n.scrollTop;return E(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}function oo(t,e){const n=R(t),o=D(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,c=0,l=0;if(i){s=i.width,r=i.height;const a=Pt();(!a||a&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:s,height:r,x:c,y:l}}function io(t,e){const n=W(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=O(t)?I(t):C(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,a=o*s.y;return{width:r,height:c,x:l,y:a}}function jt(t,e,n){let o;if(e==="viewport")o=oo(t,n);else if(e==="document")o=no(D(t));else if(_(e))o=io(e,n);else{const i=Ce(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return pt(o)}function Ne(t,e){const n=M(t);return n===e||!_(n)||j(n)?!1:E(n).position==="fixed"||Ne(n,e)}function so(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(c=>_(c)&&J(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?M(t):t;for(;_(r)&&!j(r);){const c=E(r),l=Ot(r);!l&&c.position==="fixed"&&(i=null),(s?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||st(r)&&!l&&Ne(t,r))?o=o.filter(f=>f!==r):i=c,r=M(r)}return e.set(t,o),o}function ro(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?wt(e)?[]:so(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((a,f)=>{const u=jt(e,f,i);return a.top=$(u.top,a.top),a.right=ft(u.right,a.right),a.bottom=ft(u.bottom,a.bottom),a.left=$(u.left,a.left),a},jt(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function co(t){const{width:e,height:n}=ke(t);return{width:e,height:n}}function lo(t,e,n){const o=O(e),i=D(e),s=n==="fixed",r=W(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=C(0);if(o||!o&&!s)if((J(e)!=="body"||st(i))&&(c=yt(e)),o){const u=W(e,!0,s,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else i&&(l.x=Me(i));const a=r.left+c.scrollLeft-l.x,f=r.top+c.scrollTop-l.y;return{x:a,y:f,width:r.width,height:r.height}}function bt(t){return E(t).position==="static"}function qt(t,e){return!O(t)||E(t).position==="fixed"?null:e?e(t):t.offsetParent}function Fe(t,e){const n=R(t);if(wt(t))return n;if(!O(t)){let i=M(t);for(;i&&!j(i);){if(_(i)&&!bt(i))return i;i=M(i)}return n}let o=qt(t,e);for(;o&&Kn(o)&&bt(o);)o=qt(o,e);return o&&j(o)&&bt(o)&&!Ot(o)?n:o||Gn(t)||n}const ao=async function(t){const e=this.getOffsetParent||Fe,n=this.getDimensions,o=await n(t.floating);return{reference:lo(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function uo(t){return E(t).direction==="rtl"}const fo={convertOffsetParentRelativeRectToViewportRelativeRect:to,getDocumentElement:D,getClippingRect:ro,getOffsetParent:Fe,getElementRects:ao,getClientRects:eo,getDimensions:co,getScale:I,isElement:_,isRTL:uo};function ho(t,e){let n=null,o;const i=D(t);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const{left:a,top:f,width:u,height:m}=t.getBoundingClientRect();if(c||e(),!u||!m)return;const h=at(f),g=at(i.clientWidth-(a+u)),w=at(i.clientHeight-(f+m)),y=at(a),v={rootMargin:-h+"px "+-g+"px "+-w+"px "+-y+"px",threshold:$(0,ft(1,l))||1};let x=!0;function L(A){const H=A[0].intersectionRatio;if(H!==l){if(!x)return r();H?r(!1,H):o=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(L,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,v)}n.observe(t)}return r(!0),s}function po(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Dt(t),f=i||s?[...a?et(a):[],...et(e)]:[];f.forEach(p=>{i&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const u=a&&c?ho(a,n):null;let m=-1,h=null;r&&(h=new ResizeObserver(p=>{let[v]=p;v&&v.target===a&&h&&(h.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),a&&!l&&h.observe(a),h.observe(e));let g,w=l?W(t):null;l&&y();function y(){const p=W(t);w&&(p.x!==w.x||p.y!==w.y||p.width!==w.width||p.height!==w.height)&&n(),w=p,g=requestAnimationFrame(y)}return n(),()=>{var p;f.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),u==null||u(),(p=h)==null||p.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const mo=Yn,go=Jn,Xt=qn,wo=(t,e,n)=>{const o=new Map,i={platform:fo,...n},s={...i.platform,_c:o};return jn(t,e,{...i,platform:s})};function yo({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:i}={mainAxis:0,crossAxis:0}}){return s=>{const r=s.element,c=S.wrap(e);return B.bool(c,{true:()=>ge("body",ie.div(me(l=>{const a=l;return a.style.position="absolute",po(r,a,()=>{wo(r,a,{placement:n,strategy:"absolute",middleware:[Xt(),mo({mainAxis:o,crossAxis:i}),go(),Xt()]}).then(({x:f,y:u})=>{a.style.top=`${u}px`,a.style.left=`${f}px`})})}),t())),false:()=>null})(s)}}function $e(t,e){if(typeof e=="function")return $e(t,{success:e});const n=e.failure??(i=>X(it(i.on(console.error)),i.map(s=>`Error: ${s}`))),o=e.success;return B.type(S.wrap(t),{Success:i=>o(i.$.value),Failure:i=>n(i.$.error)})}function vo(){return de.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()})}const xo=t=>e=>{const n=e.element,o=P({width:n.clientWidth,height:n.clientHeight}),i=b(t(o))(e),s=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let r;return typeof ResizeObserver=="function"&&(r=new ResizeObserver(s),r.observe(n)),c=>{r==null||r.disconnect(),i(c)}},bo=t=>e=>{const n=P({width:(window==null?void 0:window.innerWidth)??0,height:(window==null?void 0:window.innerHeight)??0}),o=b(t(n))(e),i=()=>{n.set({width:(window==null?void 0:window.innerWidth)??0,height:(window==null?void 0:window.innerHeight)??0})};return window==null||window.addEventListener("resize",i),s=>{window==null||window.removeEventListener("resize",i),o(s)}},Ao={element:xo,window:bo};function Ve(t,e){const n=e.split("/").filter(i=>i!==""),o={};for(let i=0;i<t.length;i++){const s=t[i],r=n[i];if(!r&&s.type!=="catch-all")return null;if(s.type==="literal"){if(s.value!==r)return null}else if(s.type==="param")o[s.name]=r;else if(s.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}}function We(t){return t.split("/").map(e=>e.startsWith(":")?{type:"param",name:e.slice(1)}:e==="*"?{type:"catch-all"}:{type:"literal",value:e}).filter(e=>e.type!=="literal"||e.value!=="")}function He(t){const e=t.map(n=>{const o=We(n);return{route:n,segments:o}});return function(o){for(const{segments:i,route:s}of e){const r=Ve(i,o);if(r)return{...r,route:s}}return null}}function So(t){const e=He(Object.keys(t));return Et(n=>{const o=n.map(i=>{const s=e(i.pathname);if(s==null)throw console.error("No route found for",i),new Error("No route found");return{params:s.params,route:s.route,path:s.path,search:i.search,hash:i.hash}});return B.tuple(o.map(i=>[i.route,i]),t)})}exports.Anchor=_n;exports.AsyncResultView=Le;exports.AutoFocus=Dn;exports.AutoSelect=Tn;exports.HTMLTitle=Cn;exports.HiddenWhenEmpty=kn;exports.InViewport=Re;exports.LocationProviderMarker=Rt;exports.PopOver=yo;exports.ProvideAppearance=On;exports.ProvideLocation=En;exports.ResultView=$e;exports.Router=So;exports.SelectOnFocus=vo;exports.UseAppearance=Pn;exports.UseLocation=Et;exports.WhenInViewport=Fn;exports.appearanceMarker=_t;exports.equalsLocation=xe;exports.getFullURL=Rn;exports.locationFromURL=be;exports.makeLocation=ve;exports.makeLocationProp=Se;exports.makeRouteMatcher=He;exports.matchesRoute=Ve;exports.parseRouteSegments=We;exports.setLocationFromUrl=Ae;exports.size=Ao;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Me=Object.defineProperty,Fe=(t,e,n)=>e in t?Me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,h=(t,e,n)=>Fe(t,typeof e!="symbol"?e+"":e,n);const E=class{constructor(e,n){h(this,"$__signal__",!0),h(this,"_value"),h(this,"_derivatives",[]),h(this,"_onValueListeners",[]),h(this,"_onDisposeListeners",[]),h(this,"get",()=>this._value),h(this,"hasListeners",()=>this._onValueListeners.length>0),h(this,"on",o=>(o(this.get()),this._onValueListeners.push(o),()=>{this._onValueListeners.splice(this._onValueListeners.indexOf(o),1)})),h(this,"_setAndNotify",(o,s)=>{const i=this.equals(this._value,o);i||(this._value=o),(s||!i)&&this._onValueListeners.forEach(r=>r(o))}),h(this,"_disposed",!1),h(this,"isDisposed",()=>this._disposed),h(this,"onDispose",o=>{this._onDisposeListeners.push(o)}),h(this,"dispose",()=>{this._disposed||(this._disposed=!0,this._onDisposeListeners.forEach(o=>o()),this._onDisposeListeners.length=0,this._derivatives.length=0)}),h(this,"map",(o,s=(i,r)=>i===r)=>{const i=new rt(()=>{try{return o(this.get())}catch(r){throw console.error("Error in Signal.map:",r),r}},s);return this.setDerivative(i),i}),h(this,"flatMap",(o,s=(i,r)=>i===r)=>{const i=new rt(()=>{try{return o(this.get()).get()}catch(r){throw console.error("Error in Signal.flatMap:",r),r}},s);return this.setDerivative(i),i}),h(this,"tap",o=>this.map(s=>(o(s),s))),h(this,"at",o=>this.map(s=>s[o])),h(this,"$",new Proxy(this,{get:(o,s)=>this.at(s)})),h(this,"filter",(o,s)=>{let i=s??this.get();const r=new rt(()=>{try{const c=this.get();return i=o(c)?c:i}catch(c){throw console.error("Error in Signal.filter:",c),c}},this.equals);return this.setDerivative(r),r}),h(this,"filterMap",(o,s,i=(r,c)=>r===c)=>{let r=s;const c=new rt(()=>{try{const l=this.get();return r=o(l)??r}catch(l){throw console.error("Error in Signal.filterMap:",l),l}},i);return this.setDerivative(c),c}),h(this,"mapAsync",(o,s,i,r=(c,l)=>c===l)=>{const c=D(s,r);let l=0,a=new AbortController;return c.onDispose(this.on(async f=>{const u=++l;a.abort(),a=new AbortController;try{const p=await o(f,{abortSignal:a.signal});u===l&&c.set(p)}catch(p){if(u===l)if(i!=null)c.set(i(p));else throw p}})),c}),h(this,"mapMaybe",(o,s)=>this.map(i=>o(i)??s)),h(this,"feedProp",(o,s=!1)=>{const i=this.on(o.set);return o.onDispose(i),s?this.onDispose(o.dispose):this.onDispose(i),o}),h(this,"deriveProp",(o=!0)=>this.feedProp(D(this.get()),o)),h(this,"count",()=>{let o=0;return this.map(()=>++o)}),h(this,"setDerivative",o=>{this._derivatives.push(o),o.onDispose(()=>{this._derivatives.splice(this._derivatives.indexOf(o),1)}),o.onDispose(this.on(o.setDirty)),this.onDispose(o.dispose)}),this.equals=n,this._value=e}get value(){return this._value}};h(E,"ofPromise",(t,e,n,o=(s,i)=>s===i)=>{const s=new E(e,o);return t.then(i=>s._setAndNotify(i,!1)).catch(i=>{n!=null?s._setAndNotify(n(i),!1):console.error("Unhandled promise rejection in Signal.ofPromise:",i)}),s}),h(E,"is",t=>t!=null&&t.$__signal__===!0),h(E,"wrap",(t,e=(n,o)=>n===o)=>E.is(t)?t:new E(t,e)),h(E,"maybeWrap",t=>t==null?t:E.wrap(t)),h(E,"unwrap",t=>E.is(t)?t.get():t),h(E,"map",(t,e)=>E.is(t)?t.map(e):e(t));let A=E;const Ne=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t);class rt extends A{constructor(e,n){super(void 0,n),h(this,"$__computed__",!0),h(this,"_isDirty",!1),h(this,"setDirty",()=>{this._isDirty||this._disposed||(this._isDirty=!0,this._derivatives.forEach(o=>o.setDirty()),this._scheduleNotify())}),h(this,"_scheduleCount",0),h(this,"_scheduleNotify",()=>{const o=++this._scheduleCount;Ne(()=>{this._scheduleCount!==o||this._disposed!==!1||this._isDirty&&(this._isDirty=!1,this._setAndNotify(this._fn(),!1))})}),h(this,"get",()=>(this._isDirty&&(this._isDirty=!1,this._value=this._fn(),this._setAndNotify(this._value,!0)),this._value)),this._fn=e,this.setDirty()}static is(e){return e!=null&&e.$__computed__===!0}get value(){return this.get()}}const Wt=class Ht extends A{constructor(){super(...arguments),h(this,"$__prop__",!0),h(this,"set",e=>{this._setAndNotify(e,!1)}),h(this,"update",e=>{this._setAndNotify(e(this.get()),!1)}),h(this,"reducer",(e,...n)=>{const o=this;return function s(i){const r=o.value;o.update(c=>e(c,i)),!o.equals(r,o.value)&&n.forEach(c=>c({previousState:r,state:o.value,action:i,dispatch:s}))}}),h(this,"iso",(e,n,o=(s,i)=>s===i)=>{const s=new Ht(e(this.get()),o);return s.onDispose(this.on(i=>s.set(e(i)))),s.on(i=>this._setAndNotify(n(i),!1)),s}),h(this,"atProp",e=>this.iso(n=>n[e],n=>({...this.value,[e]:n})))}get value(){return this.get()}set value(e){this._setAndNotify(e,!1)}};h(Wt,"is",t=>t!=null&&t.$__prop__===!0);let $e=Wt;const D=(t,e=(n,o)=>n===o)=>new $e(t,e),Ve=(t,e=(n,o)=>n===o)=>new A(t,e),zt=new Set(["checked","disabled","hidden","selected"]),It=new Set(["rowSpan","colSpan","tabIndex","valueAsNumber"]),Bt=new Set(["valueAsDate"]),Ut=new Set(["value","textContent","innerText","innerHTML","outerHTML","className","classList"]),yt=new Map,G=(t,e)=>{if(yt.has(t))return yt.get(t);{const n=e(t);return yt.set(t,n),n}},We=t=>(e,n)=>{n==null?e[t]=null:e[t]=!!n},He=t=>(e,n)=>{n==null?e[t]=null:e[t]=Number(n)},ze=t=>(e,n)=>{n==null?e[t]=null:e[t]=n},Ie=t=>(e,n)=>{n==null?e[t]=null:e[t]=String(n)},Be=t=>(e,n)=>{n==null?e.removeAttribute(t):e.setAttribute(t,n)},qt=t=>zt.has(t)?G(t,We):It.has(t)?G(t,He):Bt.has(t)?G(t,ze):Ut.has(t)?G(t,Ie):G(t,Be),jt=t=>e=>zt.has(t)?!!e[t]:It.has(t)?Number(e[t]):Bt.has(t)?e[t]:Ut.has(t)?String(e[t]):e.getAttribute(t),q=t=>{const e=t;e&&e.onblur&&(e.onblur=null),!(!t||t.ownerDocument===void 0)&&t.parentElement&&t.parentElement.removeChild(t)};function Ue(t,e,n){let o=t.target;for(;o!=null&&!(o instanceof HTMLAnchorElement);)o=o.parentElement;if(o==null)return!0;const s=o;if(t.button!==0||t.ctrlKey||t.metaKey||s.target!=="_self"&&s.target!==""||s.getAttribute("download")!=null)return!0;if(n){const{pathname:i,search:r,hash:c}=s,l=i+r+c;if(s.getAttribute("href")!==l||e===!0&&!/\/[^/.]*$/.test(i)||Array.isArray(e)&&!e.some(a=>i.endsWith(a)))return!0}return!1}const qe=(t,{checkExtension:e=[".html"],checkExternalUrl:n=!0}={})=>o=>{Ue(o,e,n)||t()&&o.preventDefault()},je=t=>e=>{Qt(e);const n=e.createText(t);return e.appendOrInsert(n),o=>{o&&q(n)}},Je=t=>e=>{Qt(e);const n=e.createText(t.value);e.appendOrInsert(n);const o=t.on(s=>n.data=s);return s=>{o(),s&&q(n)}},j=(...t)=>e=>{const n=t.map(o=>b(o)(e));return o=>{n.forEach(s=>s(o))}},Q=()=>()=>{},Ke=t=>e=>(Gt(e),e.element.classList.add(...t),n=>{n&&e.element.classList.remove(...t)}),Xe=t=>e=>{Gt(e);const n=e.element;let o=[];const s=t.on(i=>{o.forEach(r=>n.classList.remove(r)),o=(i??"").split(" ").filter(r=>r.length>0),n.classList.add(...o)});return i=>{s(),i&&o.forEach(r=>n.classList.remove(r)),o.length=0}},et=(t,e)=>{const n=qt(t),o=jt(t);return s=>{Yt(s,t);const i=o(s.element);return n(s.element,e),r=>{r&&n(s.element,i)}}},nt=(t,e)=>{const n=qt(t),o=jt(t);return s=>{Yt(s,t);const i=o(s.element),r=e.on(c=>n(s.element,c));return c=>{r(),c&&n(s.element,i)}}},bt=new Proxy({},{get:(t,e)=>e==="class"?n=>A.is(n)?Xe(n):Ke((n??"").split(" ").filter(o=>o.length>0)):n=>A.is(n)?nt(e,n):et(e,n)});new Proxy({},{get:(t,e)=>n=>A.is(n)?nt(`data-${e}`,n):et(`data-${e}`,n)});new Proxy({},{get:(t,e)=>n=>A.is(n)?nt(`aria-${e}`,n):et(`aria-${e}`,n)});new Proxy({},{get:(t,e)=>n=>A.is(n)?nt(e,n):et(e,n)});new Proxy({},{get:(t,e)=>n=>A.is(n)?nt(e,n):et(e,n)});const b=t=>t==null?Q:Array.isArray(t)?j(...t.map(b)):typeof t=="string"?je(t):A.is(t)?Je(t):t,Jt=(t,...e)=>n=>{const o=n.createElement(t,void 0);n.isFirstLevel&&J()&&Zt(o),n.appendOrInsert(o),n=n.withElement(o);const s=e.map(i=>b(i)(n));return i=>{s.forEach(r=>r(!1)),i&&q(o)}},Kt=(t,e,...n)=>o=>{const s=o.createElement(t,e);o.isFirstLevel&&J()&&Zt(s),o.appendOrInsert(s),o=o.withElement(s);const i=n.map(r=>b(r)(o));return r=>{i.forEach(c=>c(!1)),r&&q(s)}},Xt=new Proxy({},{get:(t,e)=>(...n)=>Jt(e,n.flatMap(b))});new Proxy({},{get:(t,e)=>(...n)=>Jt("input",bt.type(e),...n)});const Ye="http://www.w3.org/2000/svg";new Proxy({},{get:(t,e)=>(...n)=>Kt(e,Ye,n.flatMap(b))});const Ge="http://www.w3.org/1998/Math/MathML";new Proxy({},{get:(t,e)=>(...n)=>Kt(e,Ge,n.flatMap(b))});const Ct="data-tempo-attr",Ze="data-tempo-class",Qe="data-tempo-node",tn="data-tempo-text",en=(t,e)=>{const n=t.getAttribute(e);if(n!=null){const o=t.getAttribute(Ct)??"{}",s={...JSON.parse(o),name:n};t.setAttribute(Ct,JSON.stringify(s).replace(/"/g,"&quot;"))}},Yt=(t,e)=>{J()&&t.isFirstLevel&&en(t.element,e)};function nn(t){t.setAttribute(Ze,t.className)}const Gt=t=>{J()&&t.isFirstLevel&&nn(t.element)},Zt=t=>{t.setAttribute(Qe,"")},on=t=>{t.setAttribute(tn,t.textContent??"")},Qt=t=>{J()&&t.isFirstLevel&&on(t.element)},sn=()=>{const t=globalThis;return t.__tempoSSR__==null&&(t.__tempoSSR__={isSSR:!1,counter:0}),t.__tempoSSR__},rn=t=>sn()[t],J=()=>rn("isSSR"),cn=(t,e)=>n=>(n.element.addEventListener(t,e),o=>{o&&n.element.removeEventListener(t,e)}),te=new Proxy({},{get:(t,e)=>n=>cn(e,n)}),ee=(t,e)=>n=>{n=n.makeRef();let o,s;const i=t.map(l=>Object.keys(l)[0]);let r;const c=i.on(l=>{if(l!==r){s==null||s.dispose(),o==null||o(!0),s=t.map(f=>f[l]);const a=e[l](s);o=b(a)(n),r=l}});return l=>{c(),l&&n.reference!=null&&q(n.reference),o==null||o(!0)}},ln=(t,e,n)=>ee(t.map(o=>({[o[e]]:o})),n),an=(t,e)=>{const n=t.map(([o,s])=>({[o]:s}));return ee(n,e)},ne=(t,e)=>ln(t,"type",e),un=(t,e)=>n=>{const o=Object.values(t).reduce((s,i)=>{const r=n.getProvider(i);if(r==null)throw new Error(`No provider found for mark: ${i.description}`);return s[i]=r,s},{});return b(e(o))(n)},oe=(t,e)=>un([t],n=>b(e(n[t]))),fn=(t,e,n)=>o=>{o=o.makeRef();let s=null,i=!1;const r=D(null),c=t.on(l=>{l==null?(s==null||s(!0),s=b((n==null?void 0:n())??Q)(o),i=!1):(r.value=l,i||(s==null||s(!0),s=b(e(r))(o),i=!0))});return l=>{c(),s==null||s(l),l&&o.reference&&q(o.reference)}},ot=t=>e=>n=>t(n,e),se=(t,e,n)=>fn(t.map(o=>o?!0:null),()=>e,n!=null?()=>n:void 0),ie=t=>e=>t(e.element)??(()=>{}),hn=(t,e)=>{const n=t(e);return()=>n(!0)},re=(t,e)=>n=>{const o=n.document.querySelector(t);if(o===null)throw new Error(`Cannot find element by selector for portal: ${t}`);return hn(b(e),n.withElement(o).withFirstLevel())},ce=t=>Symbol(t),dn=(t,e)=>n=>b(e)(n.withProviders(t)),le=(t,e,n)=>dn({[t]:e},b(n)),pn=(t,e)=>n=>{const o=n.element,s=o.style.getPropertyValue(t);return o.style.setProperty(t,e),i=>{i&&o.style.setProperty(t,s)}},mn=(t,e)=>n=>{const o=n.element,s=o.style.getPropertyValue(t);return e.on(i=>o.style.setProperty(t,i)),i=>{i&&o.style.setProperty(t,s)}};new Proxy({},{get:(t,e)=>n=>A.is(n)?mn(e,n):pn(e,n)});const _t=ce("LocationProvider"),ae=()=>{const t=(window==null?void 0:window.location.hash)===""?void 0:(window==null?void 0:window.location.hash.substring(1))??void 0;return{pathname:(window==null?void 0:window.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((window==null?void 0:window.location.search)??"").entries()),hash:t}},ue=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,fe=t=>{const e=new URL(t,(window==null?void 0:window.location.toString())??""),n=Object.fromEntries(e.searchParams.entries());let o=e.hash;return o.startsWith("#")&&(o=o.substring(1)),{pathname:e.pathname,search:n,hash:o===""?void 0:o}},he=(t,e)=>{const n=fe(e);return t.set(n),t},de=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},pe=()=>{const t=D(ae(),ue),e=()=>{let n=(window==null?void 0:window.location.hash)??"";n.startsWith("#")&&(n=n.substring(1));const o={pathname:(window==null?void 0:window.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((window==null?void 0:window.location.search)??"").entries()),hash:n===""?void 0:n};t.set(o)};return window==null||window.addEventListener("popstate",e),t.onDispose(()=>{window==null||window.removeEventListener("popstate",e)}),t.on(n=>{window==null||window.history.pushState({},"",de(n))}),t},gn=t=>{const e=pe();return j(ot(e.dispose),le(_t,e,t))},At=t=>oe(_t,e=>n=>{const o=D(e.value,e.equals);e.feedProp(o),o.on(e.set);const s=b(t(o))(n);return i=>{o.dispose(),s(i)}}),wn=(t,...e)=>At(n=>Xt.a(te.click(qe(()=>(he(n,A.unwrap(t)),!0))),bt.href(t),...e)),Lt=ce("Appearance"),yn=t=>{const e=window.matchMedia!=null&&window.matchMedia("(prefers-color-scheme: dark)").matches,n=D(e?"dark":"light"),o=i=>{n.set(i.matches?"dark":"light")},s=window.matchMedia!=null?window.matchMedia("(prefers-color-scheme: dark)"):void 0;return s==null||s.addEventListener("change",o),j(le(Lt,n,t),ot(()=>s==null?void 0:s.removeEventListener("change",o)))},vn=t=>oe(Lt,t),me=(t,e)=>{if(typeof e=="function")return me(t,{success:e});const n=e.failure??(r=>j(ot(r.on(console.error)),r.map(c=>`Error: ${c}`))),o=e.success,s=e.loading??(()=>Q),i=e.notAsked??(()=>Q);return ne(A.wrap(t),{AsyncSuccess:r=>o(r.$.value),AsyncFailure:r=>n(r.$.error),Loading:r=>s(r.$.previousValue??Ve(void 0)),NotAsked:i})},xn=(t=10)=>e=>{const n=setTimeout(()=>{var o;(o=e.element)==null||o.focus()},t);return o=>clearTimeout(n)},bn=(t=10)=>e=>{const n=setTimeout(()=>{var o;(o=e.element)==null||o.select()},t);return o=>{clearTimeout(n)}},_n=t=>{const e=t.element,n=e.style.getPropertyValue(":empty");return e.style.setProperty(":empty","display:none"),o=>{o&&e.style.setProperty(":empty",n)}},An=t=>re("head > title",bt.innerText(t)),Ln={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},lt={partial:new Map,full:new Map},Z={partial:null,full:null};function En(t){return Z[t]==null&&(Z[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=lt[t].get(n.target);o==null||o.set(n.isIntersecting)})},Ln[t])),Z[t]}const ge=(t,e)=>{const n=D(J());return j(ie(o=>{const s=typeof IntersectionObserver<"u"?En(t):null;return lt[t].set(o,n),s==null||s.observe(o),()=>{var i;s==null||s.unobserve(o),lt[t].delete(o),lt[t].size===0&&((i=Z[t])==null||i.disconnect(),Z[t]=null)}}),ot(n.dispose),b(e(n)))},Sn=(t,e,n)=>ge(t,o=>se(o,e,n??Q)),at=Math.min,$=Math.max,ut=Math.round,ct=Math.floor,M=t=>({x:t,y:t}),Rn={left:"right",right:"left",bottom:"top",top:"bottom"},On={start:"end",end:"start"};function kt(t,e,n){return $(t,at(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function V(t){return t.split("-")[0]}function pt(t){return t.split("-")[1]}function we(t){return t==="x"?"y":"x"}function ye(t){return t==="y"?"height":"width"}function B(t){return["top","bottom"].includes(V(t))?"y":"x"}function ve(t){return we(B(t))}function Pn(t,e,n){n===void 0&&(n=!1);const o=pt(t),s=ve(t),i=ye(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=ft(r)),[r,ft(r)]}function Dn(t){const e=ft(t);return[xt(t),e,xt(e)]}function xt(t){return t.replace(/start|end/g,e=>On[e])}function Tn(t,e,n){const o=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:o:e?o:s;case"left":case"right":return e?i:r;default:return[]}}function Cn(t,e,n,o){const s=pt(t);let i=Tn(V(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(xt)))),i}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Rn[e])}function kn(t){return{top:0,right:0,bottom:0,left:0,...t}}function Mn(t){return typeof t!="number"?kn(t):{top:t,right:t,bottom:t,left:t}}function ht(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Mt(t,e,n){let{reference:o,floating:s}=t;const i=B(e),r=ve(e),c=ye(r),l=V(e),a=i==="y",f=o.x+o.width/2-s.width/2,u=o.y+o.height/2-s.height/2,p=o[c]/2-s[c]/2;let d;switch(l){case"top":d={x:f,y:o.y-s.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-s.width,y:u};break;default:d={x:o.x,y:o.y}}switch(pt(e)){case"start":d[r]-=p*(n&&a?-1:1);break;case"end":d[r]+=p*(n&&a?-1:1);break}return d}const Fn=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,c=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:u}=Mt(a,o,l),p=o,d={},g=0;for(let w=0;w<c.length;w++){const{name:y,fn:m}=c[w],{x:v,y:x,data:L,reset:_}=await m({x:f,y:u,initialPlacement:o,placement:p,strategy:s,middlewareData:d,rects:a,platform:r,elements:{reference:t,floating:e}});f=v??f,u=x??u,d={...d,[y]:{...d[y],...L}},_&&g<=50&&(g++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(a=_.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):_.rects),{x:f,y:u}=Mt(a,p,l)),w=-1)}return{x:f,y:u,placement:p,strategy:s,middlewareData:d}};async function xe(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=dt(e,t),g=Mn(d),y=c[p?u==="floating"?"reference":"floating":u],m=ht(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),v=u==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),L=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},_=ht(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:x,strategy:l}):v);return{top:(m.top-_.top+g.top)/L.y,bottom:(_.bottom-m.bottom+g.bottom)/L.y,left:(m.left-_.left+g.left)/L.x,right:(_.right-m.right+g.right)/L.x}}const Nn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...y}=dt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const m=V(s),v=B(c),x=V(c)===c,L=await(l.isRTL==null?void 0:l.isRTL(a.floating)),_=p||(x||!w?[ft(c)]:Dn(c)),H=g!=="none";!p&&H&&_.push(...Cn(c,w,g,L));const Ce=[c,..._],wt=await xe(e,y),it=[];let X=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&it.push(wt[m]),u){const N=Pn(s,r,L);it.push(wt[N[0]],wt[N[1]])}if(X=[...X,{placement:s,overflows:it}],!it.every(N=>N<=0)){var Ot,Pt;const N=(((Ot=i.flip)==null?void 0:Ot.index)||0)+1,Tt=Ce[N];if(Tt)return{data:{index:N,overflows:X},reset:{placement:Tt}};let Y=(Pt=X.filter(z=>z.overflows[0]<=0).sort((z,C)=>z.overflows[1]-C.overflows[1])[0])==null?void 0:Pt.placement;if(!Y)switch(d){case"bestFit":{var Dt;const z=(Dt=X.filter(C=>{if(H){const k=B(C.placement);return k===v||k==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(k=>k>0).reduce((k,ke)=>k+ke,0)]).sort((C,k)=>C[1]-k[1])[0])==null?void 0:Dt[0];z&&(Y=z);break}case"initialPlacement":Y=c;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};async function $n(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=V(n),c=pt(n),l=B(n)==="y",a=["left","top"].includes(r)?-1:1,f=i&&l?-1:1,u=dt(e,t);let{mainAxis:p,crossAxis:d,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&typeof g=="number"&&(d=c==="end"?g*-1:g),l?{x:d*f,y:p*a}:{x:p*a,y:d*f}}const Vn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:c}=e,l=await $n(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},Wn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:c={fn:y=>{let{x:m,y:v}=y;return{x:m,y:v}}},...l}=dt(t,e),a={x:n,y:o},f=await xe(e,l),u=B(V(s)),p=we(u);let d=a[p],g=a[u];if(i){const y=p==="y"?"top":"left",m=p==="y"?"bottom":"right",v=d+f[y],x=d-f[m];d=kt(v,d,x)}if(r){const y=u==="y"?"top":"left",m=u==="y"?"bottom":"right",v=g+f[y],x=g-f[m];g=kt(v,g,x)}const w=c.fn({...e,[p]:d,[u]:g});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function K(t){return be(t)?(t.nodeName||"").toLowerCase():"#document"}function S(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function T(t){var e;return(e=(be(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function be(t){return t instanceof Node||t instanceof S(t).Node}function O(t){return t instanceof Element||t instanceof S(t).Element}function P(t){return t instanceof HTMLElement||t instanceof S(t).HTMLElement}function Ft(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof S(t).ShadowRoot}function st(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(s)}function Hn(t){return["table","td","th"].includes(K(t))}function mt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Et(t){const e=St(),n=R(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function zn(t){let e=F(t);for(;P(e)&&!U(e);){if(mt(e))return null;if(Et(e))return e;e=F(e)}return null}function St(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function U(t){return["html","body","#document"].includes(K(t))}function R(t){return S(t).getComputedStyle(t)}function gt(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function F(t){if(K(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ft(t)&&t.host||T(t);return Ft(e)?e.host:e}function _e(t){const e=F(t);return U(e)?t.ownerDocument?t.ownerDocument.body:t.body:P(e)&&st(e)?e:_e(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=_e(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=S(s);return i?e.concat(r,r.visualViewport||[],st(s)?s:[],r.frameElement&&n?tt(r.frameElement):[]):e.concat(s,tt(s,[],n))}function Ae(t){const e=R(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=P(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,c=ut(n)!==i||ut(o)!==r;return c&&(n=i,o=r),{width:n,height:o,$:c}}function Rt(t){return O(t)?t:t.contextElement}function I(t){const e=Rt(t);if(!P(e))return M(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=Ae(e);let r=(i?ut(n.width):n.width)/o,c=(i?ut(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const In=M(0);function Le(t){const e=S(t);return!St()||!e.visualViewport?In:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Bn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==S(t)?!1:e}function W(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Rt(t);let r=M(1);e&&(o?O(o)&&(r=I(o)):r=I(t));const c=Bn(i,n,o)?Le(i):M(0);let l=(s.left+c.x)/r.x,a=(s.top+c.y)/r.y,f=s.width/r.x,u=s.height/r.y;if(i){const p=S(i),d=o&&O(o)?S(o):o;let g=p,w=g.frameElement;for(;w&&o&&d!==g;){const y=I(w),m=w.getBoundingClientRect(),v=R(w),x=m.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,L=m.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,a*=y.y,f*=y.x,u*=y.y,l+=x,a+=L,g=S(w),w=g.frameElement}}return ht({width:f,height:u,x:l,y:a})}function Un(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=T(o),c=e?mt(e.floating):!1;if(o===r||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=M(1);const f=M(0),u=P(o);if((u||!u&&!i)&&((K(o)!=="body"||st(r))&&(l=gt(o)),P(o))){const p=W(o);a=I(o),f.x=p.x+o.clientLeft,f.y=p.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x,y:n.y*a.y-l.scrollTop*a.y+f.y}}function qn(t){return Array.from(t.getClientRects())}function Ee(t){return W(T(t)).left+gt(t).scrollLeft}function jn(t){const e=T(t),n=gt(t),o=t.ownerDocument.body,s=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ee(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:c}}function Jn(t,e){const n=S(t),o=T(t),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,c=0,l=0;if(s){i=s.width,r=s.height;const a=St();(!a||a&&e==="fixed")&&(c=s.offsetLeft,l=s.offsetTop)}return{width:i,height:r,x:c,y:l}}function Kn(t,e){const n=W(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=P(t)?I(t):M(1),r=t.clientWidth*i.x,c=t.clientHeight*i.y,l=s*i.x,a=o*i.y;return{width:r,height:c,x:l,y:a}}function Nt(t,e,n){let o;if(e==="viewport")o=Jn(t,n);else if(e==="document")o=jn(T(t));else if(O(e))o=Kn(e,n);else{const s=Le(t);o={...e,x:e.x-s.x,y:e.y-s.y}}return ht(o)}function Se(t,e){const n=F(t);return n===e||!O(n)||U(n)?!1:R(n).position==="fixed"||Se(n,e)}function Xn(t,e){const n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>O(c)&&K(c)!=="body"),s=null;const i=R(t).position==="fixed";let r=i?F(t):t;for(;O(r)&&!U(r);){const c=R(r),l=Et(r);!l&&c.position==="fixed"&&(s=null),(i?!l&&!s:!l&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||st(r)&&!l&&Se(t,r))?o=o.filter(f=>f!==r):s=c,r=F(r)}return e.set(t,o),o}function Yn(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?mt(e)?[]:Xn(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((a,f)=>{const u=Nt(e,f,s);return a.top=$(u.top,a.top),a.right=at(u.right,a.right),a.bottom=at(u.bottom,a.bottom),a.left=$(u.left,a.left),a},Nt(e,c,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gn(t){const{width:e,height:n}=Ae(t);return{width:e,height:n}}function Zn(t,e,n){const o=P(e),s=T(e),i=n==="fixed",r=W(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=M(0);if(o||!o&&!i)if((K(e)!=="body"||st(s))&&(c=gt(e)),o){const u=W(e,!0,i,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else s&&(l.x=Ee(s));const a=r.left+c.scrollLeft-l.x,f=r.top+c.scrollTop-l.y;return{x:a,y:f,width:r.width,height:r.height}}function vt(t){return R(t).position==="static"}function $t(t,e){return!P(t)||R(t).position==="fixed"?null:e?e(t):t.offsetParent}function Re(t,e){const n=S(t);if(mt(t))return n;if(!P(t)){let s=F(t);for(;s&&!U(s);){if(O(s)&&!vt(s))return s;s=F(s)}return n}let o=$t(t,e);for(;o&&Hn(o)&&vt(o);)o=$t(o,e);return o&&U(o)&&vt(o)&&!Et(o)?n:o||zn(t)||n}const Qn=async function(t){const e=this.getOffsetParent||Re,n=this.getDimensions,o=await n(t.floating);return{reference:Zn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function to(t){return R(t).direction==="rtl"}const eo={convertOffsetParentRelativeRectToViewportRelativeRect:Un,getDocumentElement:T,getClippingRect:Yn,getOffsetParent:Re,getElementRects:Qn,getClientRects:qn,getDimensions:Gn,getScale:I,isElement:O,isRTL:to};function no(t,e){let n=null,o;const s=T(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const{left:a,top:f,width:u,height:p}=t.getBoundingClientRect();if(c||e(),!u||!p)return;const d=ct(f),g=ct(s.clientWidth-(a+u)),w=ct(s.clientHeight-(f+p)),y=ct(a),v={rootMargin:-d+"px "+-g+"px "+-w+"px "+-y+"px",threshold:$(0,at(1,l))||1};let x=!0;function L(_){const H=_[0].intersectionRatio;if(H!==l){if(!x)return r();H?r(!1,H):o=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(L,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,v)}n.observe(t)}return r(!0),i}function oo(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Rt(t),f=s||i?[...a?tt(a):[],...tt(e)]:[];f.forEach(m=>{s&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const u=a&&c?no(a,n):null;let p=-1,d=null;r&&(d=new ResizeObserver(m=>{let[v]=m;v&&v.target===a&&d&&(d.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(e)})),n()}),a&&!l&&d.observe(a),d.observe(e));let g,w=l?W(t):null;l&&y();function y(){const m=W(t);w&&(m.x!==w.x||m.y!==w.y||m.width!==w.width||m.height!==w.height)&&n(),w=m,g=requestAnimationFrame(y)}return n(),()=>{var m;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u==null||u(),(m=d)==null||m.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const so=Vn,io=Wn,Vt=Nn,ro=(t,e,n)=>{const o=new Map,s={platform:eo,...n},i={...s.platform,_c:o};return Fn(t,e,{...s,platform:i})},co=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:s}={mainAxis:0,crossAxis:0}})=>i=>{const r=i.element,c=A.wrap(e);return se(c,re("body",Xt.div(ie(l=>{const a=l;return a.style.position="absolute",oo(r,a,()=>{ro(r,a,{placement:n,strategy:"absolute",middleware:[Vt(),so({mainAxis:o,crossAxis:s}),io(),Vt()]}).then(({x:f,y:u})=>{a.style.top=`${u}px`,a.style.left=`${f}px`})})}),t())))(i)},Oe=(t,e)=>{if(typeof e=="function")return Oe(t,{success:e});const n=e.failure??(s=>j(ot(s.on(console.error)),s.map(i=>`Error: ${i}`))),o=e.success;return ne(A.wrap(t),{Success:s=>o(s.$.value),Failure:s=>n(s.$.error)})},lo=()=>te.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),ao=t=>e=>{const n=e.element,o=D({width:n.clientWidth,height:n.clientHeight}),s=b(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let r;return typeof ResizeObserver=="function"&&(r=new ResizeObserver(i),r.observe(n)),c=>{r==null||r.disconnect(),s(c)}},uo=t=>e=>{const n=D({width:(window==null?void 0:window.innerWidth)??0,height:(window==null?void 0:window.innerHeight)??0}),o=b(t(n))(e),s=()=>{n.set({width:(window==null?void 0:window.innerWidth)??0,height:(window==null?void 0:window.innerHeight)??0})};return window==null||window.addEventListener("resize",s),i=>{window==null||window.removeEventListener("resize",s),o(i)}},Pe=(t,e)=>{const n=e.split("/").filter(s=>s!==""),o={};for(let s=0;s<t.length;s++){const i=t[s],r=n[s];if(!r&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==r)return null}else if(i.type==="param")o[i.name]=r;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},De=t=>t.split("/").map(e=>e.startsWith(":")?{type:"param",name:e.slice(1)}:e==="*"?{type:"catch-all"}:{type:"literal",value:e}).filter(e=>e.type!=="literal"||e.value!==""),Te=t=>{const e=t.map(n=>{const o=De(n);return{route:n,segments:o}});return function(o){for(const{segments:s,route:i}of e){const r=Pe(s,o);if(r)return{...r,route:i}}return null}},fo=t=>{const e=Te(Object.keys(t));return At(n=>{const o=n.map(s=>{const i=e(s.pathname);if(i==null)throw console.error("No route found for",s),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:s.search,hash:s.hash}});return an(o.map(s=>[s.route,s]),t)})};exports.Anchor=wn;exports.AsyncResultView=me;exports.AutoFocus=xn;exports.AutoSelect=bn;exports.ElementSize=ao;exports.HTMLTitle=An;exports.HiddenWhenEmpty=_n;exports.InViewport=ge;exports.LocationProviderMarker=_t;exports.PopOver=co;exports.ProvideAppearance=yn;exports.ProvideLocation=gn;exports.ResultView=Oe;exports.Router=fo;exports.SelectOnFocus=lo;exports.UseAppearance=vn;exports.UseLocation=At;exports.WhenInViewport=Sn;exports.WindowSize=uo;exports._makeLocation=ae;exports._makeLocationProp=pe;exports._makeRouteMatcher=Te;exports._parseRouteSegments=De;exports.appearanceMarker=Lt;exports.areLocationsEqual=ue;exports.locationFromURL=fe;exports.matchesRoute=Pe;exports.setLocationFromUrl=he;exports.urlFromLocation=de;