@tempots/ui 0.12.0 → 0.14.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 +1 -1
- package/index.js +733 -1352
- package/package.json +2 -2
- package/renderables/anchor.d.ts +10 -1
- package/renderables/appearance.d.ts +5 -1
- package/renderables/async-result-view.d.ts +44 -3
- package/renderables/autofocus.d.ts +7 -0
- package/renderables/autoselect.d.ts +6 -0
- package/renderables/hidden-when-empty.d.ts +7 -0
- package/renderables/html-title.d.ts +8 -1
- package/renderables/inviewport.d.ts +27 -1
- package/renderables/pop-over.d.ts +47 -9
- package/renderables/result-view.d.ts +31 -3
- package/renderables/router/location.d.ts +83 -13
- package/renderables/router/match.d.ts +35 -3
- package/renderables/router/route-info.d.ts +92 -7
- package/renderables/router/router.d.ts +9 -3
- package/renderables/select-on-focus.d.ts +7 -1
- package/renderables/size.d.ts +15 -4
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Be=Object.defineProperty,je=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,d=(t,e,n)=>je(t,typeof e!="symbol"?e+"":e,n);const Xt="$__signal__",Nt="$__prop__",Ft="$__computed__";var Yt;Yt=Xt;const qe=class F{constructor(e,n){d(this,Yt,!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[Xt]===!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 L=qe;const Je=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t);var $t,Vt;class ct extends(Vt=L,$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;Je(()=>{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 Lt extends(Ht=L,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 Lt(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 Lt(t,e)}function Xe(t,e=(n,o)=>n===o){return new L(t,e)}const Kt=new Set(["checked","disabled","hidden","selected"]),Qt=new Set(["rowSpan","colSpan","tabIndex","valueAsNumber"]),Zt=new Set(["valueAsDate"]),Gt=new Set(["value","textContent","innerText","innerHTML","outerHTML","className","classList"]),xt=new Map;function Z(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 Ke(t){return(e,n)=>{n==null?e[t]=null:e[t]=Number(n)}}function Qe(t){return(e,n)=>{n==null?e[t]=null:e[t]=n}}function Ze(t){return(e,n)=>{n==null?e[t]=null:e[t]=String(n)}}function Ge(t){return(e,n)=>{n==null?e.removeAttribute(t):e.setAttribute(t,n)}}function te(t){return Kt.has(t)?Z(t,Ye):Qt.has(t)?Z(t,Ke):Zt.has(t)?Z(t,Qe):Gt.has(t)?Z(t,Ze):Z(t,Ge)}function ee(t){return e=>Kt.has(t)?!!e[t]:Qt.has(t)?Number(e[t]):Zt.has(t)?e[t]:Gt.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 tn(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 en=(t,e={checkExtension:!0,checkExternalUrl:!0})=>n=>{const{checkExtension:o,checkExternalUrl:i}=e;tn(n,o===!0,i===!0)||t()&&n.preventDefault()},nn=t=>e=>{le(e);const n=e.createText(t);return e.appendOrInsert(n),o=>{o&&q(n)}},on=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)}},J=(...t)=>e=>{const n=t.map(o=>b(o)(e));return o=>{n.forEach(i=>i(o))}},tt=()=>()=>{},sn=t=>e=>(re(e),e.element.classList.add(...t),n=>{n&&e.element.classList.remove(...t)}),rn=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)}}},St=new Proxy({},{get:(t,e)=>e==="class"?n=>L.is(n)?rn(n):sn((n??"").split(" ").filter(o=>o.length>0)):n=>L.is(n)?ot(e,n):nt(e,n)});new Proxy({},{get:(t,e)=>n=>L.is(n)?ot(`data-${e}`,n):nt(`data-${e}`,n)});new Proxy({},{get:(t,e)=>n=>L.is(n)?ot(`aria-${e}`,n):nt(`aria-${e}`,n)});new Proxy({},{get:(t,e)=>n=>L.is(n)?ot(e,n):nt(e,n)});new Proxy({},{get:(t,e)=>n=>L.is(n)?ot(e,n):nt(e,n)});function b(t){return t==null?tt:Array.isArray(t)?J(...t.map(b)):typeof t=="string"?nn(t):L.is(t)?on(t):t}function ne(t,...e){return n=>{const o=n.createElement(t,void 0);n.isFirstLevel&&X.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&&X.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",St.type(e),...n)});const cn="http://www.w3.org/2000/svg";new Proxy({},{get:(t,e)=>(...n)=>oe(e,cn,n.flatMap(b))});const ln="http://www.w3.org/1998/Math/MathML";new Proxy({},{get:(t,e)=>(...n)=>oe(e,ln,n.flatMap(b))});const zt="data-tempo-attr",an="data-tempo-class",un="data-tempo-node",fn="data-tempo-text";function hn(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){X.isSSR()&&t.isFirstLevel&&hn(t.element,e)}function dn(t){t.setAttribute(an,t.className)}function re(t){X.isSSR()&&t.isFirstLevel&&dn(t.element)}function ce(t){t.setAttribute(un,"")}function pn(t){t.setAttribute(fn,t.textContent??"")}function le(t){X.isSSR()&&t.isFirstLevel&&pn(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 mn(){return fe("isSSR")}function he(){return fe("counter")}function gn(){ue("counter",(he()??0)+1)}function wn(){ue("counter",(he()??0)-1)}const X={useDone:t=>(gn(),b(t(wn))),isSSR:mn},yn=(t,e)=>n=>(n.element.addEventListener(t,e),o=>{o&&n.element.removeEventListener(t,e)}),de=new Proxy({},{get:(t,e)=>n=>yn(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)}},U={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)=>U.field(t,"kind",e),tuple:(t,e)=>{const n=t.map(([o,i])=>({[o]:i}));return lt(n,e)},type:(t,e)=>U.field(t,"type",e),value:(t,e)=>lt(t.map(n=>({[n]:!0})),e)},vn=(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)=>vn([t],n=>b(e(n[t]))),xn=(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),bn=(t,e,n)=>xn(t.map(o=>o?!0:null),()=>e,n!=null?()=>n:void 0),me=t=>e=>t(e.element)??(()=>{});function An(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 An(b(e),n.withElement(o).withFirstLevel())};function we(t){return Symbol(t)}const Ln=(t,e)=>n=>b(e)(n.withProviders(t)),ye=(t,e,n)=>Ln({[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)}},En=(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=>L.is(n)?En(e,n):Sn(e,n)});const Et=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());let o=e.hash;return o.startsWith("#")&&(o=o.substring(1)),{pathname:e.pathname,search:n,hash:o===""?void 0:o}}function Ae(t,e){const n=be(e);return t.set(n),t}function Le(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=()=>{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({},"",Le(n))}),t}function Rn(t){const e=Se();return J(it(e.dispose),ye(Et,e,t))}function Rt(t){return pe(Et,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 Rt(n=>ie.a(de.click(en(()=>(Ae(n,L.unwrap(t)),!0))),St.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),J(ye(_t,n,t),it(()=>i==null?void 0:i.removeEventListener("change",o)))},Pn=t=>pe(_t,t);function Ee(t,e){if(typeof e=="function")return Ee(t,{success:e});const n=e.failure??(r=>J(it(r.on(console.error)),r.map(c=>`Error: ${c}`))),o=e.success,i=e.loading??(()=>tt),s=e.notAsked??(()=>tt);return U.type(L.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)},kn=(t=10)=>e=>{const n=setTimeout(()=>{var o;(o=e.element)==null||o.select()},t);return o=>{clearTimeout(n)}},Tn=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",St.innerText(t)),Mn={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},ut={partial:new Map,full:new Map},G={partial:null,full:null};function Nn(t){return G[t]==null&&(G[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=ut[t].get(n.target);o==null||o.set(n.isIntersecting)})},Mn[t])),G[t]}function Re(t,e){const n=P(X.isSSR());return J(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=G[t])==null||s.disconnect(),G[t]=null)}}),it(n.dispose),b(e(n)))}const Fn=(t,e,n)=>Re(t,o=>bn(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 _e(t){return t==="x"?"y":"x"}function Oe(t){return t==="y"?"height":"width"}function B(t){return["top","bottom"].includes(V(t))?"y":"x"}function Pe(t){return _e(B(t))}function Wn(t,e,n){n===void 0&&(n=!1);const o=gt(t),i=Pe(t),s=Oe(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 Un(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bn(t){return typeof t!="number"?Un(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 Ut(t,e,n){let{reference:o,floating:i}=t;const s=B(e),r=Pe(e),c=Oe(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}=Ut(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:S,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],...S}},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}=Ut(a,m,l)),w=-1)}return{x:f,y:u,placement:m,strategy:i,middlewareData:h}};async function De(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=Bn(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)),S=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)/S.y,bottom:(A.bottom-p.bottom+g.bottom)/S.y,left:(p.left-A.left+g.left)/S.x,right:(A.right-p.right+g.right)/S.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=B(c),x=V(c)===c,S=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,S));const Ie=[c,...A],vt=await De(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,S);rt.push(vt[N[0]],vt[N[1]])}if(K=[...K,{placement:i,overflows:rt}],!rt.every(N=>N<=0)){var kt,Tt;const N=(((kt=s.flip)==null?void 0:kt.index)||0)+1,Mt=Ie[N];if(Mt)return{data:{index:N,overflows:K},reset:{placement:Mt}};let Q=(Tt=K.filter(z=>z.overflows[0]<=0).sort((z,k)=>z.overflows[1]-k.overflows[1])[0])==null?void 0:Tt.placement;if(!Q)switch(h){case"bestFit":{var Ct;const z=(Ct=K.filter(k=>{if(H){const T=B(k.placement);return T===v||T==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(T=>T>0).reduce((T,Ue)=>T+Ue,0)]).sort((k,T)=>k[1]-T[1])[0])==null?void 0:Ct[0];z&&(Q=z);break}case"initialPlacement":Q=c;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};async function Jn(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=B(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 Xn=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 Jn(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}}}}},Yn=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 De(e,l),u=B(V(i)),m=_e(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 Y(t){return ke(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function D(t){var e;return(e=(ke(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ke(t){return t instanceof Node||t instanceof E(t).Node}function _(t){return t instanceof Element||t instanceof E(t).Element}function O(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function Bt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Kn(t){return["table","td","th"].includes(Y(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=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 Qn(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(Y(t))}function R(t){return E(t).getComputedStyle(t)}function yt(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function M(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bt(t)&&t.host||D(t);return Bt(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=E(i);return s?e.concat(r,r.visualViewport||[],st(i)?i:[],r.frameElement&&n?et(r.frameElement):[]):e.concat(i,et(i,[],n))}function Ce(t){const e=R(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}=Ce(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 Zn=C(0);function Me(t){const e=E(t);return!Pt()||!e.visualViewport?Zn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Gn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(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=Gn(s,n,o)?Me(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=E(s),h=o&&_(o)?E(o):o;let g=m,w=g.frameElement;for(;w&&o&&h!==g;){const y=I(w),p=w.getBoundingClientRect(),v=R(w),x=p.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,S=p.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,a*=y.y,f*=y.x,u*=y.y,l+=x,a+=S,g=E(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)&&((Y(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 Ne(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+Ne(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}function oo(t,e){const n=E(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=Me(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return pt(o)}function Fe(t,e){const n=M(t);return n===e||!_(n)||j(n)?!1:R(n).position==="fixed"||Fe(n,e)}function so(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(c=>_(c)&&Y(c)!=="body"),i=null;const s=R(t).position==="fixed";let r=s?M(t):t;for(;_(r)&&!j(r);){const c=R(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&&Fe(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}=Ce(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((Y(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=Ne(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 R(t).position==="static"}function qt(t,e){return!O(t)||R(t).position==="fixed"?null:e?e(t):t.offsetParent}function $e(t,e){const n=E(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||Qn(t)||n}const ao=async function(t){const e=this.getOffsetParent||$e,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 R(t).direction==="rtl"}const fo={convertOffsetParentRelativeRectToViewportRelativeRect:to,getDocumentElement:D,getClippingRect:ro,getOffsetParent:$e,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 S(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(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,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=Xn,go=Yn,Jt=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=L.wrap(e);return U.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:[Jt(),mo({mainAxis:o,crossAxis:i}),go(),Jt()]}).then(({x:f,y:u})=>{a.style.top=`${u}px`,a.style.left=`${f}px`})})}),t())),false:()=>null})(s)}}function Ve(t,e){if(typeof e=="function")return Ve(t,{success:e});const n=e.failure??(i=>J(it(i.on(console.error)),i.map(s=>`Error: ${s}`))),o=e.success;return U.type(L.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 We(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 He(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 ze(t){const e=t.map(n=>{const o=He(n);return{route:n,segments:o}});return function(o){for(const{segments:i,route:s}of e){const r=We(i,o);if(r)return{...r,route:s}}return null}}function Lo(t){const e=ze(Object.keys(t));return Rt(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 U.tuple(o.map(i=>[i.route,i]),t)})}exports.Anchor=_n;exports.AsyncResultView=Ee;exports.AutoFocus=Dn;exports.AutoSelect=kn;exports.HTMLTitle=Cn;exports.HiddenWhenEmpty=Tn;exports.InViewport=Re;exports.LocationProviderMarker=Et;exports.PopOver=yo;exports.ProvideAppearance=On;exports.ProvideLocation=Rn;exports.ResultView=Ve;exports.Router=Lo;exports.SelectOnFocus=vo;exports.UseAppearance=Pn;exports.UseLocation=Rt;exports.WhenInViewport=Fn;exports.appearanceMarker=_t;exports.equalsLocation=xe;exports.getFullURL=Le;exports.locationFromURL=be;exports.makeLocation=ve;exports.makeLocationProp=Se;exports.makeRouteMatcher=ze;exports.matchesRoute=We;exports.parseRouteSegments=He;exports.setLocationFromUrl=Ae;exports.size=Ao;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),ct=u.makeProviderMark("LocationProvider"),At=()=>{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}},Rt=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Lt=t=>{const e=new URL(t,(window==null?void 0:window.location.toString())??""),o=Object.fromEntries(e.searchParams.entries());let n=e.hash;return n.startsWith("#")&&(n=n.substring(1)),{pathname:e.pathname,search:o,hash:n===""?void 0:n}},Et=(t,e)=>{const o=Lt(e);return t.set(o),t},St=t=>{const o=new URLSearchParams(t.search).toString(),n=t.hash;return`${t.pathname}${o?`?${o}`:""}${n?`#${n}`:""}`},Tt=()=>{const t=u.makeProp(At(),Rt),e=()=>{let o=(window==null?void 0:window.location.hash)??"";o.startsWith("#")&&(o=o.substring(1));const n={pathname:(window==null?void 0:window.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((window==null?void 0:window.location.search)??"").entries()),hash:o===""?void 0:o};t.set(n)};return window==null||window.addEventListener("popstate",e),t.onDispose(()=>{window==null||window.removeEventListener("popstate",e)}),t.on(o=>{window==null||window.history.pushState({},"",St(o))}),t},Yt=t=>{const e=Tt();return u.Fragment(u.OnUnmount(e.dispose),u.WithProvider(ct,e,t))},lt=t=>u.UseProvider(ct,e=>o=>{const n=u.makeProp(e.value,e.equals);e.feedProp(n),n.on(e.set);const i=u.renderableOfTNode(t(n))(o);return r=>{n.dispose(),i(r)}}),Jt=(t,...e)=>lt(o=>u.html.a(u.on.click(u.handleAnchorClick(()=>(Et(o,u.Signal.unwrap(t)),!0))),u.attr.href(t),...e)),at=u.makeProviderMark("Appearance"),Kt=t=>{const e=window.matchMedia!=null&&window.matchMedia("(prefers-color-scheme: dark)").matches,o=u.makeProp(e?"dark":"light"),n=r=>{o.set(r.matches?"dark":"light")},i=window.matchMedia!=null?window.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",n),u.Fragment(u.WithProvider(at,o,t),u.OnUnmount(()=>i==null?void 0:i.removeEventListener("change",n)))},Gt=t=>u.UseProvider(at,t),kt=(t,e)=>{if(typeof e=="function")return kt(t,{success:e});const o=e.failure??(s=>u.Fragment(u.OnUnmount(s.on(console.error)),s.map(c=>`Error: ${c}`))),n=e.success,i=e.loading??(()=>u.Empty),r=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Signal.wrap(t),{AsyncSuccess:s=>n(s.$.value),AsyncFailure:s=>o(s.$.error),Loading:s=>i(s.$.previousValue??u.makeSignal(void 0)),NotAsked:r})},Qt=(t=10)=>e=>{const o=setTimeout(()=>{var n;(n=e.element)==null||n.focus()},t);return n=>clearTimeout(o)},Zt=(t=10)=>e=>{const o=setTimeout(()=>{var n;(n=e.element)==null||n.select()},t);return n=>{clearTimeout(o)}},te=t=>{const e=t.element,o=e.style.getPropertyValue(":empty");return e.style.setProperty(":empty","display:none"),n=>{n&&e.style.setProperty(":empty",o)}},ee=t=>u.Portal("head > title",u.attr.innerText(t)),ne={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},J={partial:new Map,full:new Map},I={partial:null,full:null};function oe(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(o=>{const n=J[t].get(o.target);n==null||n.set(o.isIntersecting)})},ne[t])),I[t]}const Pt=(t,e)=>{const o=u.makeProp(u.isSSR());return u.Fragment(u.OnMount(n=>{const i=typeof IntersectionObserver<"u"?oe(t):null;return J[t].set(n,o),i==null||i.observe(n),()=>{var r;i==null||i.unobserve(n),J[t].delete(n),J[t].size===0&&((r=I[t])==null||r.disconnect(),I[t]=null)}}),u.OnUnmount(o.dispose),u.renderableOfTNode(e(o)))},ie=(t,e,o)=>Pt(t,n=>u.When(n,e,o??u.Empty)),K=Math.min,M=Math.max,G=Math.round,Y=Math.floor,P=t=>({x:t,y:t}),re={left:"right",right:"left",bottom:"top",top:"bottom"},se={start:"end",end:"start"};function wt(t,e,o){return M(t,K(e,o))}function tt(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function Ft(t){return t==="y"?"height":"width"}function z(t){return["top","bottom"].includes(W(t))?"y":"x"}function Mt(t){return Ct(z(t))}function ce(t,e,o){o===void 0&&(o=!1);const n=et(t),i=Mt(t),r=Ft(i);let s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=Q(s)),[s,Q(s)]}function le(t){const e=Q(t);return[st(t),e,st(e)]}function st(t){return t.replace(/start|end/g,e=>se[e])}function ae(t,e,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?r:s;default:return[]}}function ue(t,e,o,n){const i=et(t);let r=ae(W(t),o==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(st)))),r}function Q(t){return t.replace(/left|right|bottom|top/g,e=>re[e])}function fe(t){return{top:0,right:0,bottom:0,left:0,...t}}function de(t){return typeof t!="number"?fe(t):{top:t,right:t,bottom:t,left:t}}function Z(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function yt(t,e,o){let{reference:n,floating:i}=t;const r=z(e),s=Mt(e),c=Ft(s),a=W(e),l=r==="y",d=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,p=n[c]/2-i[c]/2;let h;switch(a){case"top":h={x:d,y:n.y-i.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(et(e)){case"start":h[s]-=p*(o&&l?-1:1);break;case"end":h[s]+=p*(o&&l?-1:1);break}return h}const he=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,c=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=yt(l,n,a),p=n,h={},g=0;for(let w=0;w<c.length;w++){const{name:y,fn:m}=c[w],{x:v,y:x,data:O,reset:b}=await m({x:d,y:f,initialPlacement:n,placement:p,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});d=v??d,f=x??f,h={...h,[y]:{...h[y],...O}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:d,y:f}=yt(l,p,a)),w=-1)}return{x:d,y:f,placement:p,strategy:i,middlewareData:h}};async function Wt(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:r,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=tt(e,t),g=de(h),y=c[p?f==="floating"?"reference":"floating":f],m=Z(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(y)))==null||o?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:a})),v=f==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),O=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},b=Z(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:x,strategy:a}):v);return{top:(m.top-b.top+g.top)/O.y,bottom:(b.bottom-m.bottom+g.bottom)/O.y,left:(m.left-b.left+g.left)/O.x,right:(b.right-m.right+g.right)/O.x}}const me=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...y}=tt(t,e);if((o=r.arrow)!=null&&o.alignmentOffset)return{};const m=W(i),v=z(c),x=W(c)===c,O=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=p||(x||!w?[Q(c)]:le(c)),N=g!=="none";!p&&N&&b.push(...ue(c,w,g,O));const qt=[c,...b],it=await Wt(e,y),X=[];let _=((n=r.flip)==null?void 0:n.overflows)||[];if(d&&X.push(it[m]),f){const F=ce(i,s,O);X.push(it[F[0]],it[F[1]])}if(_=[..._,{placement:i,overflows:X}],!X.every(F=>F<=0)){var ht,mt;const F=(((ht=r.flip)==null?void 0:ht.index)||0)+1,gt=qt[F];if(gt)return{data:{index:F,overflows:_},reset:{placement:gt}};let B=(mt=_.filter(V=>V.overflows[0]<=0).sort((V,T)=>V.overflows[1]-T.overflows[1])[0])==null?void 0:mt.placement;if(!B)switch(h){case"bestFit":{var pt;const V=(pt=_.filter(T=>{if(N){const k=z(T.placement);return k===v||k==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(k=>k>0).reduce((k,Xt)=>k+Xt,0)]).sort((T,k)=>T[1]-k[1])[0])==null?void 0:pt[0];V&&(B=V);break}case"initialPlacement":B=c;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function pe(t,e){const{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=W(o),c=et(o),a=z(o)==="y",l=["left","top"].includes(s)?-1:1,d=r&&a?-1:1,f=tt(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*d,y:p*l}:{x:p*l,y:h*d}}const ge=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:r,placement:s,middlewareData:c}=e,a=await pe(e,t);return s===((o=c.offset)==null?void 0:o.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},we=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:y=>{let{x:m,y:v}=y;return{x:m,y:v}}},...a}=tt(t,e),l={x:o,y:n},d=await Wt(e,a),f=z(W(i)),p=Ct(f);let h=l[p],g=l[f];if(r){const y=p==="y"?"top":"left",m=p==="y"?"bottom":"right",v=h+d[y],x=h-d[m];h=wt(v,h,x)}if(s){const y=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=g+d[y],x=g-d[m];g=wt(v,g,x)}const w=c.fn({...e,[p]:h,[f]:g});return{...w,data:{x:w.x-o,y:w.y-n}}}}};function H(t){return Dt(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function S(t){var e;return(e=(Dt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Dt(t){return t instanceof Node||t instanceof A(t).Node}function L(t){return t instanceof Element||t instanceof A(t).Element}function E(t){return t instanceof HTMLElement||t instanceof A(t).HTMLElement}function vt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof A(t).ShadowRoot}function q(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function ye(t){return["table","td","th"].includes(H(t))}function nt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function ut(t){const e=ft(),o=R(t);return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function ve(t){let e=C(t);for(;E(e)&&!U(e);){if(nt(e))return null;if(ut(e))return e;e=C(e)}return null}function ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function U(t){return["html","body","#document"].includes(H(t))}function R(t){return A(t).getComputedStyle(t)}function ot(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(H(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vt(t)&&t.host||S(t);return vt(e)?e.host:e}function Nt(t){const e=C(t);return U(e)?t.ownerDocument?t.ownerDocument.body:t.body:E(e)&&q(e)?e:Nt(e)}function j(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=Nt(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=A(i);return r?e.concat(s,s.visualViewport||[],q(i)?i:[],s.frameElement&&o?j(s.frameElement):[]):e.concat(i,j(i,[],o))}function Vt(t){const e=R(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=E(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,c=G(o)!==r||G(n)!==s;return c&&(o=r,n=s),{width:o,height:n,$:c}}function dt(t){return L(t)?t:t.contextElement}function $(t){const e=dt(t);if(!E(e))return P(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=Vt(e);let s=(r?G(o.width):o.width)/n,c=(r?G(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const xe=P(0);function $t(t){const e=A(t);return!ft()||!e.visualViewport?xe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function be(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==A(t)?!1:e}function D(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),r=dt(t);let s=P(1);e&&(n?L(n)&&(s=$(n)):s=$(t));const c=be(r,o,n)?$t(r):P(0);let a=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(r){const p=A(r),h=n&&L(n)?A(n):n;let g=p,w=g.frameElement;for(;w&&n&&h!==g;){const y=$(w),m=w.getBoundingClientRect(),v=R(w),x=m.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,O=m.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;a*=y.x,l*=y.y,d*=y.x,f*=y.y,a+=x,l+=O,g=A(w),w=g.frameElement}}return Z({width:d,height:f,x:a,y:l})}function Oe(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r=i==="fixed",s=S(n),c=e?nt(e.floating):!1;if(n===s||c&&r)return o;let a={scrollLeft:0,scrollTop:0},l=P(1);const d=P(0),f=E(n);if((f||!f&&!r)&&((H(n)!=="body"||q(s))&&(a=ot(n)),E(n))){const p=D(n);l=$(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}return{width:o.width*l.x,height:o.height*l.y,x:o.x*l.x-a.scrollLeft*l.x+d.x,y:o.y*l.y-a.scrollTop*l.y+d.y}}function Ae(t){return Array.from(t.getClientRects())}function zt(t){return D(S(t)).left+ot(t).scrollLeft}function Re(t){const e=S(t),o=ot(t),n=t.ownerDocument.body,i=M(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=M(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+zt(t);const c=-o.scrollTop;return R(n).direction==="rtl"&&(s+=M(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:c}}function Le(t,e){const o=A(t),n=S(t),i=o.visualViewport;let r=n.clientWidth,s=n.clientHeight,c=0,a=0;if(i){r=i.width,s=i.height;const l=ft();(!l||l&&e==="fixed")&&(c=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:c,y:a}}function Ee(t,e){const o=D(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=E(t)?$(t):P(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,a=i*r.x,l=n*r.y;return{width:s,height:c,x:a,y:l}}function xt(t,e,o){let n;if(e==="viewport")n=Le(t,o);else if(e==="document")n=Re(S(t));else if(L(e))n=Ee(e,o);else{const i=$t(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Z(n)}function Ut(t,e){const o=C(t);return o===e||!L(o)||U(o)?!1:R(o).position==="fixed"||Ut(o,e)}function Se(t,e){const o=e.get(t);if(o)return o;let n=j(t,[],!1).filter(c=>L(c)&&H(c)!=="body"),i=null;const r=R(t).position==="fixed";let s=r?C(t):t;for(;L(s)&&!U(s);){const c=R(s),a=ut(s);!a&&c.position==="fixed"&&(i=null),(r?!a&&!i:!a&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||q(s)&&!a&&Ut(t,s))?n=n.filter(d=>d!==s):i=c,s=C(s)}return e.set(t,n),n}function Te(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?nt(e)?[]:Se(e,this._c):[].concat(o),n],c=s[0],a=s.reduce((l,d)=>{const f=xt(e,d,i);return l.top=M(f.top,l.top),l.right=K(f.right,l.right),l.bottom=K(f.bottom,l.bottom),l.left=M(f.left,l.left),l},xt(e,c,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ke(t){const{width:e,height:o}=Vt(t);return{width:e,height:o}}function Pe(t,e,o){const n=E(e),i=S(e),r=o==="fixed",s=D(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=P(0);if(n||!n&&!r)if((H(e)!=="body"||q(i))&&(c=ot(e)),n){const f=D(e,!0,r,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&(a.x=zt(i));const l=s.left+c.scrollLeft-a.x,d=s.top+c.scrollTop-a.y;return{x:l,y:d,width:s.width,height:s.height}}function rt(t){return R(t).position==="static"}function bt(t,e){return!E(t)||R(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ht(t,e){const o=A(t);if(nt(t))return o;if(!E(t)){let i=C(t);for(;i&&!U(i);){if(L(i)&&!rt(i))return i;i=C(i)}return o}let n=bt(t,e);for(;n&&ye(n)&&rt(n);)n=bt(n,e);return n&&U(n)&&rt(n)&&!ut(n)?o:n||ve(t)||o}const Ce=async function(t){const e=this.getOffsetParent||Ht,o=this.getDimensions,n=await o(t.floating);return{reference:Pe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Fe(t){return R(t).direction==="rtl"}const Me={convertOffsetParentRelativeRectToViewportRelativeRect:Oe,getDocumentElement:S,getClippingRect:Te,getOffsetParent:Ht,getElementRects:Ce,getClientRects:Ae,getDimensions:ke,getScale:$,isElement:L,isRTL:Fe};function We(t,e){let o=null,n;const i=S(t);function r(){var c;clearTimeout(n),(c=o)==null||c.disconnect(),o=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),r();const{left:l,top:d,width:f,height:p}=t.getBoundingClientRect();if(c||e(),!f||!p)return;const h=Y(d),g=Y(i.clientWidth-(l+f)),w=Y(i.clientHeight-(d+p)),y=Y(l),v={rootMargin:-h+"px "+-g+"px "+-w+"px "+-y+"px",threshold:M(0,K(1,a))||1};let x=!0;function O(b){const N=b[0].intersectionRatio;if(N!==a){if(!x)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{o=new IntersectionObserver(O,{...v,root:i.ownerDocument})}catch{o=new IntersectionObserver(O,v)}o.observe(t)}return s(!0),r}function De(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,l=dt(t),d=i||r?[...l?j(l):[],...j(e)]:[];d.forEach(m=>{i&&m.addEventListener("scroll",o,{passive:!0}),r&&m.addEventListener("resize",o)});const f=l&&c?We(l,o):null;let p=-1,h=null;s&&(h=new ResizeObserver(m=>{let[v]=m;v&&v.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),o()}),l&&!a&&h.observe(l),h.observe(e));let g,w=a?D(t):null;a&&y();function y(){const m=D(t);w&&(m.x!==w.x||m.y!==w.y||m.width!==w.width||m.height!==w.height)&&o(),w=m,g=requestAnimationFrame(y)}return o(),()=>{var m;d.forEach(v=>{i&&v.removeEventListener("scroll",o),r&&v.removeEventListener("resize",o)}),f==null||f(),(m=h)==null||m.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const Ne=ge,Ve=we,Ot=me,$e=(t,e,o)=>{const n=new Map,i={platform:Me,...o},r={...i.platform,_c:n};return he(t,e,{...i,platform:r})},ze=({content:t,open:e,placement:o,offset:{mainAxis:n,crossAxis:i}={mainAxis:0,crossAxis:0}})=>r=>{const s=r.element,c=u.Signal.wrap(e);return u.When(c,u.Portal("body",u.html.div(u.OnMount(a=>{const l=a;return l.style.position="absolute",De(s,l,()=>{$e(s,l,{placement:o,strategy:"absolute",middleware:[Ot(),Ne({mainAxis:n,crossAxis:i}),Ve(),Ot()]}).then(({x:d,y:f})=>{l.style.top=`${f}px`,l.style.left=`${d}px`})})}),t())))(r)},_t=(t,e)=>{if(typeof e=="function")return _t(t,{success:e});const o=e.failure??(i=>u.Fragment(u.OnUnmount(i.on(console.error)),i.map(r=>`Error: ${r}`))),n=e.success;return u.OneOfType(u.Signal.wrap(t),{Success:i=>n(i.$.value),Failure:i=>o(i.$.error)})},Ue=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),He=t=>e=>{const o=e.element,n=u.makeProp({width:o.clientWidth,height:o.clientHeight}),i=u.renderableOfTNode(t(n))(e),r=()=>{n.set({width:o.clientWidth,height:o.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(r),s.observe(o)),c=>{s==null||s.disconnect(),i(c)}},_e=t=>e=>{const o=u.makeProp({width:(window==null?void 0:window.innerWidth)??0,height:(window==null?void 0:window.innerHeight)??0}),n=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(window==null?void 0:window.innerWidth)??0,height:(window==null?void 0:window.innerHeight)??0})};return window==null||window.addEventListener("resize",i),r=>{window==null||window.removeEventListener("resize",i),n(r)}},Bt=(t,e)=>{const o=e.split("/").filter(i=>i!==""),n={};for(let i=0;i<t.length;i++){const r=t[i],s=o[i];if(!s&&r.type!=="catch-all")return null;if(r.type==="literal"){if(r.value!==s)return null}else if(r.type==="param")n[r.name]=s;else if(r.type==="catch-all")return{params:n,path:e}}return o.length!==t.length?null:{params:n,path:e}},It=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!==""),jt=t=>{const e=t.map(o=>{const n=It(o);return{route:o,segments:n}});return function(n){for(const{segments:i,route:r}of e){const s=Bt(i,n);if(s)return{...s,route:r}}return null}},Be=t=>{const e=jt(Object.keys(t));return lt(o=>{const n=o.map(i=>{const r=e(i.pathname);if(r==null)throw console.error("No route found for",i),new Error("No route found");return{params:r.params,route:r.route,path:r.path,search:i.search,hash:i.hash}});return u.OneOfTuple(n.map(i=>[i.route,i]),t)})};exports.Anchor=Jt;exports.AsyncResultView=kt;exports.AutoFocus=Qt;exports.AutoSelect=Zt;exports.ElementSize=He;exports.HTMLTitle=ee;exports.HiddenWhenEmpty=te;exports.InViewport=Pt;exports.LocationProviderMarker=ct;exports.PopOver=ze;exports.ProvideAppearance=Kt;exports.ProvideLocation=Yt;exports.ResultView=_t;exports.Router=Be;exports.SelectOnFocus=Ue;exports.UseAppearance=Gt;exports.UseLocation=lt;exports.WhenInViewport=ie;exports.WindowSize=_e;exports._makeLocation=At;exports._makeLocationProp=Tt;exports._makeRouteMatcher=jt;exports._parseRouteSegments=It;exports.appearanceMarker=at;exports.areLocationsEqual=Rt;exports.locationFromURL=Lt;exports.matchesRoute=Bt;exports.setLocationFromUrl=Et;exports.urlFromLocation=St;
|