@tempots/ui 0.16.2 → 0.17.1
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 +202 -202
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Et=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const o=e.split(".")||[];return o.length>1?"."+o.pop():void 0},Rt=(t,e)=>{const o=Et(e);return o!=null&&(t.length===0||!t.some(n=>o==n))},Qt=(t,e,o,n)=>{let i=t.target;for(;i!=null&&!(i instanceof HTMLAnchorElement);)i=i.parentElement;if(i==null)return!0;const r=i;if(t.button!==0||t.ctrlKey||t.metaKey||r.target!=="_self"&&r.target!==""||r.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=r;if(n){const l=s+c+a,f=r.getAttribute("href");if(!(f!=null&&f.startsWith("#"))&&f!==l)return!0}return e?!1:Rt(o,s)},Ot=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const o=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(n=>n.startsWith(".")?n:"."+n):[];return n=>{Qt(n,e.ignoreUrlWithExtension??!0,o,e.ignoreExternalUrl??!0)||t()&&n.preventDefault()}},ct=u.makeProviderMark("LocationProvider"),Lt=()=>{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}},St=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,kt=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}},Tt=(t,e)=>{const o=kt(e);return t.set(o),t},Pt=t=>{const o=new URLSearchParams(t.search).toString(),n=t.hash;return`${t.pathname}${o?`?${o}`:""}${n?`#${n}`:""}`},Ct=()=>{const t=u.makeProp(Lt(),St),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({},"",Pt(o))}),t},Zt=t=>{const e=Ct();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)}}),Ft=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Ft({href:t},...e);const{href:o,...n}=t;return lt(i=>u.html.a(u.on.click(Ot(()=>(Tt(i,u.Signal.unwrap(o)),!0),n)),u.attr.href(o),...e))},at=u.makeProviderMark("Appearance"),te=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)))},ee=t=>u.UseProvider(at,t),Mt=(t,e)=>{if(typeof e=="function")return Mt(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})},ne=(t=10)=>e=>{const o=setTimeout(()=>{var n;(n=e.element)==null||n.focus()},t);return n=>clearTimeout(o)},oe=(t=10)=>e=>{const o=setTimeout(()=>{var n;(n=e.element)==null||n.select()},t);return n=>{clearTimeout(o)}},ie=t=>{const e=t.element,o=e.style.getPropertyValue(":empty");return e.style.setProperty(":empty","display:none"),n=>{n&&e.style.setProperty(":empty",o)}},re=t=>u.Portal("head > title",u.attr.innerText(t)),se={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},K={partial:new Map,full:new Map},I={partial:null,full:null};function ce(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(o=>{const n=K[t].get(o.target);n==null||n.set(o.isIntersecting)})},se[t])),I[t]}const Wt=(t,e)=>{const o=u.makeProp(u.isSSR());return u.Fragment(u.OnMount(n=>{const i=typeof IntersectionObserver<"u"?ce(t):null;return K[t].set(n,o),i==null||i.observe(n),()=>{var r;i==null||i.unobserve(n),K[t].delete(n),K[t].size===0&&((r=I[t])==null||r.disconnect(),I[t]=null)}}),u.OnUnmount(o.dispose),u.renderableOfTNode(e(o)))},le=(t,e,o)=>Wt(t,n=>u.When(n,e,o??u.Empty)),J=Math.min,M=Math.max,G=Math.round,Y=Math.floor,P=t=>({x:t,y:t}),ae={left:"right",right:"left",bottom:"top",top:"bottom"},ue={start:"end",end:"start"};function wt(t,e,o){return M(t,J(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 Dt(t){return t==="x"?"y":"x"}function Nt(t){return t==="y"?"height":"width"}function _(t){return["top","bottom"].includes(W(t))?"y":"x"}function Vt(t){return Dt(_(t))}function fe(t,e,o){o===void 0&&(o=!1);const n=et(t),i=Vt(t),r=Nt(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 de(t){const e=Q(t);return[st(t),e,st(e)]}function st(t){return t.replace(/start|end/g,e=>ue[e])}function he(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 me(t,e,o,n){const i=et(t);let r=he(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=>ae[e])}function pe(t){return{top:0,right:0,bottom:0,left:0,...t}}function ge(t){return typeof t!="number"?pe(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=_(e),s=Vt(e),c=Nt(s),a=W(e),l=r==="y",f=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[c]/2-i[c]/2;let h;switch(a){case"top":h={x:f,y:n.y-i.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-i.width,y:d};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 we=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:f,y:d}=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:A,reset:b}=await m({x:f,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});f=v??f,d=x??d,h={...h,[y]:{...h[y],...A}},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:f,y:d}=yt(l,p,a)),w=-1)}return{x:f,y:d,placement:p,strategy:i,middlewareData:h}};async function Ut(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:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=tt(e,t),g=ge(h),y=c[p?d==="floating"?"reference":"floating":d],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:f,strategy:a})),v=d==="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)),A=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)/A.y,bottom:(b.bottom-m.bottom+g.bottom)/A.y,left:(m.left-b.left+g.left)/A.x,right:(b.right-m.right+g.right)/A.x}}const ye=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:f=!0,crossAxis:d=!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=_(c),x=W(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=p||(x||!w?[Q(c)]:de(c)),N=g!=="none";!p&&N&&b.push(...me(c,w,g,A));const Jt=[c,...b],it=await Ut(e,y),X=[];let H=((n=r.flip)==null?void 0:n.overflows)||[];if(f&&X.push(it[m]),d){const F=fe(i,s,A);X.push(it[F[0]],it[F[1]])}if(H=[...H,{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=Jt[F];if(gt)return{data:{index:F,overflows:H},reset:{placement:gt}};let B=(mt=H.filter(V=>V.overflows[0]<=0).sort((V,k)=>V.overflows[1]-k.overflows[1])[0])==null?void 0:mt.placement;if(!B)switch(h){case"bestFit":{var pt;const V=(pt=H.filter(k=>{if(N){const T=_(k.placement);return T===v||T==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(T=>T>0).reduce((T,Gt)=>T+Gt,0)]).sort((k,T)=>k[1]-T[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 ve(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=_(o)==="y",l=["left","top"].includes(s)?-1:1,f=r&&a?-1:1,d=tt(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const xe=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 ve(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}}}}},be=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},f=await Ut(e,a),d=_(W(i)),p=Dt(d);let h=l[p],g=l[d];if(r){const y=p==="y"?"top":"left",m=p==="y"?"bottom":"right",v=h+f[y],x=h-f[m];h=wt(v,h,x)}if(s){const y=d==="y"?"top":"left",m=d==="y"?"bottom":"right",v=g+f[y],x=g-f[m];g=wt(v,g,x)}const w=c.fn({...e,[p]:h,[d]:g});return{...w,data:{x:w.x-o,y:w.y-n}}}}};function z(t){return _t(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function S(t){var e;return(e=(_t(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _t(t){return t instanceof Node||t instanceof E(t).Node}function O(t){return t instanceof Element||t instanceof E(t).Element}function L(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function vt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(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 Ae(t){return["table","td","th"].includes(z(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 Ee(t){let e=C(t);for(;L(e)&&!$(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 $(t){return["html","body","#document"].includes(z(t))}function R(t){return E(t).getComputedStyle(t)}function ot(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(z(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vt(t)&&t.host||S(t);return vt(e)?e.host:e}function $t(t){const e=C(t);return $(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&q(e)?e:$t(e)}function j(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=$t(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=E(i);return r?e.concat(s,s.visualViewport||[],q(i)?i:[],s.frameElement&&o?j(s.frameElement):[]):e.concat(i,j(i,[],o))}function zt(t){const e=R(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=L(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 O(t)?t:t.contextElement}function U(t){const e=dt(t);if(!L(e))return P(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=zt(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 Re=P(0);function Ht(t){const e=E(t);return!ft()||!e.visualViewport?Re:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Oe(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==E(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?O(n)&&(s=U(n)):s=U(t));const c=Oe(r,o,n)?Ht(r):P(0);let a=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,f=i.width/s.x,d=i.height/s.y;if(r){const p=E(r),h=n&&O(n)?E(n):n;let g=p,w=g.frameElement;for(;w&&n&&h!==g;){const y=U(w),m=w.getBoundingClientRect(),v=R(w),x=m.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,A=m.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;a*=y.x,l*=y.y,f*=y.x,d*=y.y,a+=x,l+=A,g=E(w),w=g.frameElement}}return Z({width:f,height:d,x:a,y:l})}function Le(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 f=P(0),d=L(n);if((d||!d&&!r)&&((z(n)!=="body"||q(s))&&(a=ot(n)),L(n))){const p=D(n);l=U(n),f.x=p.x+n.clientLeft,f.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+f.x,y:o.y*l.y-a.scrollTop*l.y+f.y}}function Se(t){return Array.from(t.getClientRects())}function Bt(t){return D(S(t)).left+ot(t).scrollLeft}function ke(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+Bt(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 Te(t,e){const o=E(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 Pe(t,e){const o=D(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=L(t)?U(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=Te(t,o);else if(e==="document")n=ke(S(t));else if(O(e))n=Pe(e,o);else{const i=Ht(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Z(n)}function It(t,e){const o=C(t);return o===e||!O(o)||$(o)?!1:R(o).position==="fixed"||It(o,e)}function Ce(t,e){const o=e.get(t);if(o)return o;let n=j(t,[],!1).filter(c=>O(c)&&z(c)!=="body"),i=null;const r=R(t).position==="fixed";let s=r?C(t):t;for(;O(s)&&!$(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&&It(t,s))?n=n.filter(f=>f!==s):i=c,s=C(s)}return e.set(t,n),n}function Fe(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?nt(e)?[]:Ce(e,this._c):[].concat(o),n],c=s[0],a=s.reduce((l,f)=>{const d=xt(e,f,i);return l.top=M(d.top,l.top),l.right=J(d.right,l.right),l.bottom=J(d.bottom,l.bottom),l.left=M(d.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 Me(t){const{width:e,height:o}=zt(t);return{width:e,height:o}}function We(t,e,o){const n=L(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((z(e)!=="body"||q(i))&&(c=ot(e)),n){const d=D(e,!0,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else i&&(a.x=Bt(i));const l=s.left+c.scrollLeft-a.x,f=s.top+c.scrollTop-a.y;return{x:l,y:f,width:s.width,height:s.height}}function rt(t){return R(t).position==="static"}function bt(t,e){return!L(t)||R(t).position==="fixed"?null:e?e(t):t.offsetParent}function jt(t,e){const o=E(t);if(nt(t))return o;if(!L(t)){let i=C(t);for(;i&&!$(i);){if(O(i)&&!rt(i))return i;i=C(i)}return o}let n=bt(t,e);for(;n&&Ae(n)&&rt(n);)n=bt(n,e);return n&&$(n)&&rt(n)&&!ut(n)?o:n||Ee(t)||o}const De=async function(t){const e=this.getOffsetParent||jt,o=this.getDimensions,n=await o(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ne(t){return R(t).direction==="rtl"}const Ve={convertOffsetParentRelativeRectToViewportRelativeRect:Le,getDocumentElement:S,getClippingRect:Fe,getOffsetParent:jt,getElementRects:De,getClientRects:Se,getDimensions:Me,getScale:U,isElement:O,isRTL:Ne};function Ue(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:f,width:d,height:p}=t.getBoundingClientRect();if(c||e(),!d||!p)return;const h=Y(f),g=Y(i.clientWidth-(l+d)),w=Y(i.clientHeight-(f+p)),y=Y(l),v={rootMargin:-h+"px "+-g+"px "+-w+"px "+-y+"px",threshold:M(0,J(1,a))||1};let x=!0;function A(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(A,{...v,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,v)}o.observe(t)}return s(!0),r}function _e(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),f=i||r?[...l?j(l):[],...j(e)]:[];f.forEach(m=>{i&&m.addEventListener("scroll",o,{passive:!0}),r&&m.addEventListener("resize",o)});const d=l&&c?Ue(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;f.forEach(v=>{i&&v.removeEventListener("scroll",o),r&&v.removeEventListener("resize",o)}),d==null||d(),(m=h)==null||m.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const $e=xe,ze=be,At=ye,He=(t,e,o)=>{const n=new Map,i={platform:Ve,...o},r={...i.platform,_c:n};return we(t,e,{...i,platform:r})},Be=({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",_e(s,l,()=>{He(s,l,{placement:o,strategy:"absolute",middleware:[At(),$e({mainAxis:n,crossAxis:i}),ze(),At()]}).then(({x:f,y:d})=>{l.style.top=`${d}px`,l.style.left=`${f}px`})})}),t())))(r)},qt=(t,e)=>{if(typeof e=="function")return qt(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)})},Ie=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),je=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)}},qe=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)}},Xt=(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}},Yt=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!==""),Kt=t=>{const e=t.map(o=>{const n=Yt(o);return{route:o,segments:n}});return function(n){for(const{segments:i,route:r}of e){const s=Xt(i,n);if(s)return{...s,route:r}}return null}},Xe=t=>{const e=Kt(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=Ft;exports.AsyncResultView=Mt;exports.AutoFocus=ne;exports.AutoSelect=oe;exports.ElementSize=je;exports.HTMLTitle=re;exports.HiddenWhenEmpty=ie;exports.InViewport=Wt;exports.LocationProviderMarker=ct;exports.PopOver=Be;exports.ProvideAppearance=te;exports.ProvideLocation=Zt;exports.ResultView=qt;exports.Router=Xe;exports.SelectOnFocus=Ie;exports.UseAppearance=ee;exports.UseLocation=lt;exports.WhenInViewport=le;exports.WindowSize=qe;exports._checkExtensionCondition=Rt;exports._getExtension=Et;exports._makeLocation=Lt;exports._makeLocationProp=Ct;exports._makeRouteMatcher=Kt;exports._parseRouteSegments=Yt;exports.appearanceMarker=at;exports.areLocationsEqual=St;exports.handleAnchorClick=Ot;exports.locationFromURL=kt;exports.matchesRoute=Xt;exports.setLocationFromUrl=Tt;exports.urlFromLocation=Pt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Et=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const o=e.split(".")||[];return o.length>1?"."+o.pop():void 0},Rt=(t,e)=>{const o=Et(e);return o!=null&&(t.length===0||!t.some(n=>o==n))},Qt=(t,e,o,n)=>{let i=t.target;for(;i!=null&&!(i instanceof HTMLAnchorElement);)i=i.parentElement;if(i==null)return!0;const r=i;if(t.button!==0||t.ctrlKey||t.metaKey||r.target!=="_self"&&r.target!==""||r.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=r;if(n){const l=s+c+a,f=r.getAttribute("href");if(!(f!=null&&f.startsWith("#"))&&f!==l)return!0}return e?!1:Rt(o,s)},Ot=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const o=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(n=>n.startsWith(".")?n:"."+n):[];return n=>{Qt(n,e.ignoreUrlWithExtension??!0,o,e.ignoreExternalUrl??!0)||t()&&n.preventDefault()}},ct=u.makeProviderMark("LocationProvider"),Lt=()=>{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}},St=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,kt=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}},Tt=(t,e)=>{const o=kt(e);return t.set(o),t},Pt=t=>{const o=new URLSearchParams(t.search).toString(),n=t.hash;return`${t.pathname}${o?`?${o}`:""}${n?`#${n}`:""}`},Ct=()=>{const t=u.makeProp(Lt(),St),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({},"",Pt(o))}),t},Zt=t=>{const e=Ct();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)}}),Ft=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Ft({href:t},...e);const{href:o,...n}=t;return lt(i=>u.html.a(u.on.click(Ot(()=>(Tt(i,u.Value.get(o)),!0),n)),u.attr.href(o),...e))},at=u.makeProviderMark("Appearance"),te=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)))},ee=t=>u.UseProvider(at,t),Mt=(t,e)=>{if(typeof e=="function")return Mt(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.Value.toSignal(t),{AsyncSuccess:s=>n(s.$.value),AsyncFailure:s=>o(s.$.error),Loading:s=>i(s.$.previousValue??u.makeSignal(void 0)),NotAsked:r})},ne=(t=10)=>e=>{const o=setTimeout(()=>{var n;(n=e.element)==null||n.focus()},t);return n=>clearTimeout(o)},oe=(t=10)=>e=>{const o=setTimeout(()=>{var n;(n=e.element)==null||n.select()},t);return n=>{clearTimeout(o)}},ie=t=>{const e=t.element,o=e.style.getPropertyValue(":empty");return e.style.setProperty(":empty","display:none"),n=>{n&&e.style.setProperty(":empty",o)}},re=t=>u.Portal("head > title",u.attr.innerText(t)),se={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},K={partial:new Map,full:new Map},I={partial:null,full:null};function ce(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(o=>{const n=K[t].get(o.target);n==null||n.set(o.isIntersecting)})},se[t])),I[t]}const Wt=(t,e)=>{const o=u.makeProp(u.isSSR());return u.Fragment(u.OnMount(n=>{const i=typeof IntersectionObserver<"u"?ce(t):null;return K[t].set(n,o),i==null||i.observe(n),()=>{var r;i==null||i.unobserve(n),K[t].delete(n),K[t].size===0&&((r=I[t])==null||r.disconnect(),I[t]=null)}}),u.OnUnmount(o.dispose),u.renderableOfTNode(e(o)))},le=(t,e,o)=>Wt(t,n=>u.When(n,e,o??u.Empty)),J=Math.min,M=Math.max,G=Math.round,Y=Math.floor,P=t=>({x:t,y:t}),ae={left:"right",right:"left",bottom:"top",top:"bottom"},ue={start:"end",end:"start"};function wt(t,e,o){return M(t,J(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 Vt(t){return t==="x"?"y":"x"}function Dt(t){return t==="y"?"height":"width"}function _(t){return["top","bottom"].includes(W(t))?"y":"x"}function Nt(t){return Vt(_(t))}function fe(t,e,o){o===void 0&&(o=!1);const n=et(t),i=Nt(t),r=Dt(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 de(t){const e=Q(t);return[st(t),e,st(e)]}function st(t){return t.replace(/start|end/g,e=>ue[e])}function he(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 me(t,e,o,n){const i=et(t);let r=he(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=>ae[e])}function pe(t){return{top:0,right:0,bottom:0,left:0,...t}}function ge(t){return typeof t!="number"?pe(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=_(e),s=Nt(e),c=Dt(s),a=W(e),l=r==="y",f=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[c]/2-i[c]/2;let h;switch(a){case"top":h={x:f,y:n.y-i.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-i.width,y:d};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 we=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:f,y:d}=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:A,reset:b}=await m({x:f,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});f=v??f,d=x??d,h={...h,[y]:{...h[y],...A}},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:f,y:d}=yt(l,p,a)),w=-1)}return{x:f,y:d,placement:p,strategy:i,middlewareData:h}};async function Ut(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:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=tt(e,t),g=ge(h),y=c[p?d==="floating"?"reference":"floating":d],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:f,strategy:a})),v=d==="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)),A=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)/A.y,bottom:(b.bottom-m.bottom+g.bottom)/A.y,left:(m.left-b.left+g.left)/A.x,right:(b.right-m.right+g.right)/A.x}}const ye=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:f=!0,crossAxis:d=!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=_(c),x=W(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=p||(x||!w?[Q(c)]:de(c)),D=g!=="none";!p&&D&&b.push(...me(c,w,g,A));const Jt=[c,...b],it=await Ut(e,y),X=[];let H=((n=r.flip)==null?void 0:n.overflows)||[];if(f&&X.push(it[m]),d){const F=fe(i,s,A);X.push(it[F[0]],it[F[1]])}if(H=[...H,{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=Jt[F];if(gt)return{data:{index:F,overflows:H},reset:{placement:gt}};let B=(mt=H.filter(N=>N.overflows[0]<=0).sort((N,k)=>N.overflows[1]-k.overflows[1])[0])==null?void 0:mt.placement;if(!B)switch(h){case"bestFit":{var pt;const N=(pt=H.filter(k=>{if(D){const T=_(k.placement);return T===v||T==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(T=>T>0).reduce((T,Gt)=>T+Gt,0)]).sort((k,T)=>k[1]-T[1])[0])==null?void 0:pt[0];N&&(B=N);break}case"initialPlacement":B=c;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function ve(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=_(o)==="y",l=["left","top"].includes(s)?-1:1,f=r&&a?-1:1,d=tt(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const xe=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 ve(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}}}}},be=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},f=await Ut(e,a),d=_(W(i)),p=Vt(d);let h=l[p],g=l[d];if(r){const y=p==="y"?"top":"left",m=p==="y"?"bottom":"right",v=h+f[y],x=h-f[m];h=wt(v,h,x)}if(s){const y=d==="y"?"top":"left",m=d==="y"?"bottom":"right",v=g+f[y],x=g-f[m];g=wt(v,g,x)}const w=c.fn({...e,[p]:h,[d]:g});return{...w,data:{x:w.x-o,y:w.y-n}}}}};function z(t){return _t(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function S(t){var e;return(e=(_t(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _t(t){return t instanceof Node||t instanceof E(t).Node}function O(t){return t instanceof Element||t instanceof E(t).Element}function L(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function vt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(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 Ae(t){return["table","td","th"].includes(z(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 Ee(t){let e=C(t);for(;L(e)&&!$(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 $(t){return["html","body","#document"].includes(z(t))}function R(t){return E(t).getComputedStyle(t)}function ot(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(z(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vt(t)&&t.host||S(t);return vt(e)?e.host:e}function $t(t){const e=C(t);return $(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&q(e)?e:$t(e)}function j(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=$t(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=E(i);return r?e.concat(s,s.visualViewport||[],q(i)?i:[],s.frameElement&&o?j(s.frameElement):[]):e.concat(i,j(i,[],o))}function zt(t){const e=R(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=L(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 O(t)?t:t.contextElement}function U(t){const e=dt(t);if(!L(e))return P(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=zt(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 Re=P(0);function Ht(t){const e=E(t);return!ft()||!e.visualViewport?Re:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Oe(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==E(t)?!1:e}function V(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?O(n)&&(s=U(n)):s=U(t));const c=Oe(r,o,n)?Ht(r):P(0);let a=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,f=i.width/s.x,d=i.height/s.y;if(r){const p=E(r),h=n&&O(n)?E(n):n;let g=p,w=g.frameElement;for(;w&&n&&h!==g;){const y=U(w),m=w.getBoundingClientRect(),v=R(w),x=m.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,A=m.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;a*=y.x,l*=y.y,f*=y.x,d*=y.y,a+=x,l+=A,g=E(w),w=g.frameElement}}return Z({width:f,height:d,x:a,y:l})}function Le(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 f=P(0),d=L(n);if((d||!d&&!r)&&((z(n)!=="body"||q(s))&&(a=ot(n)),L(n))){const p=V(n);l=U(n),f.x=p.x+n.clientLeft,f.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+f.x,y:o.y*l.y-a.scrollTop*l.y+f.y}}function Se(t){return Array.from(t.getClientRects())}function Bt(t){return V(S(t)).left+ot(t).scrollLeft}function ke(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+Bt(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 Te(t,e){const o=E(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 Pe(t,e){const o=V(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=L(t)?U(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=Te(t,o);else if(e==="document")n=ke(S(t));else if(O(e))n=Pe(e,o);else{const i=Ht(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Z(n)}function It(t,e){const o=C(t);return o===e||!O(o)||$(o)?!1:R(o).position==="fixed"||It(o,e)}function Ce(t,e){const o=e.get(t);if(o)return o;let n=j(t,[],!1).filter(c=>O(c)&&z(c)!=="body"),i=null;const r=R(t).position==="fixed";let s=r?C(t):t;for(;O(s)&&!$(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&&It(t,s))?n=n.filter(f=>f!==s):i=c,s=C(s)}return e.set(t,n),n}function Fe(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?nt(e)?[]:Ce(e,this._c):[].concat(o),n],c=s[0],a=s.reduce((l,f)=>{const d=xt(e,f,i);return l.top=M(d.top,l.top),l.right=J(d.right,l.right),l.bottom=J(d.bottom,l.bottom),l.left=M(d.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 Me(t){const{width:e,height:o}=zt(t);return{width:e,height:o}}function We(t,e,o){const n=L(e),i=S(e),r=o==="fixed",s=V(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=P(0);if(n||!n&&!r)if((z(e)!=="body"||q(i))&&(c=ot(e)),n){const d=V(e,!0,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else i&&(a.x=Bt(i));const l=s.left+c.scrollLeft-a.x,f=s.top+c.scrollTop-a.y;return{x:l,y:f,width:s.width,height:s.height}}function rt(t){return R(t).position==="static"}function bt(t,e){return!L(t)||R(t).position==="fixed"?null:e?e(t):t.offsetParent}function jt(t,e){const o=E(t);if(nt(t))return o;if(!L(t)){let i=C(t);for(;i&&!$(i);){if(O(i)&&!rt(i))return i;i=C(i)}return o}let n=bt(t,e);for(;n&&Ae(n)&&rt(n);)n=bt(n,e);return n&&$(n)&&rt(n)&&!ut(n)?o:n||Ee(t)||o}const Ve=async function(t){const e=this.getOffsetParent||jt,o=this.getDimensions,n=await o(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function De(t){return R(t).direction==="rtl"}const Ne={convertOffsetParentRelativeRectToViewportRelativeRect:Le,getDocumentElement:S,getClippingRect:Fe,getOffsetParent:jt,getElementRects:Ve,getClientRects:Se,getDimensions:Me,getScale:U,isElement:O,isRTL:De};function Ue(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:f,width:d,height:p}=t.getBoundingClientRect();if(c||e(),!d||!p)return;const h=Y(f),g=Y(i.clientWidth-(l+d)),w=Y(i.clientHeight-(f+p)),y=Y(l),v={rootMargin:-h+"px "+-g+"px "+-w+"px "+-y+"px",threshold:M(0,J(1,a))||1};let x=!0;function A(b){const D=b[0].intersectionRatio;if(D!==a){if(!x)return s();D?s(!1,D):n=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{o=new IntersectionObserver(A,{...v,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,v)}o.observe(t)}return s(!0),r}function _e(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),f=i||r?[...l?j(l):[],...j(e)]:[];f.forEach(m=>{i&&m.addEventListener("scroll",o,{passive:!0}),r&&m.addEventListener("resize",o)});const d=l&&c?Ue(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?V(t):null;a&&y();function y(){const m=V(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;f.forEach(v=>{i&&v.removeEventListener("scroll",o),r&&v.removeEventListener("resize",o)}),d==null||d(),(m=h)==null||m.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const $e=xe,ze=be,At=ye,He=(t,e,o)=>{const n=new Map,i={platform:Ne,...o},r={...i.platform,_c:n};return we(t,e,{...i,platform:r})},Be=({content:t,open:e,placement:o,offset:{mainAxis:n,crossAxis:i}={mainAxis:0,crossAxis:0}})=>r=>{const s=r.element,c=u.Value.toSignal(e);return u.When(c,u.Portal("body",u.html.div(u.OnMount(a=>{const l=a;return l.style.position="absolute",_e(s,l,()=>{He(s,l,{placement:o,strategy:"absolute",middleware:[At(),$e({mainAxis:n,crossAxis:i}),ze(),At()]}).then(({x:f,y:d})=>{l.style.top=`${d}px`,l.style.left=`${f}px`})})}),t())))(r)},qt=(t,e)=>{if(typeof e=="function")return qt(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.Value.toSignal(t),{Success:i=>n(i.$.value),Failure:i=>o(i.$.error)})},Ie=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),je=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)}},qe=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)}},Xt=(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}},Yt=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!==""),Kt=t=>{const e=t.map(o=>{const n=Yt(o);return{route:o,segments:n}});return function(n){for(const{segments:i,route:r}of e){const s=Xt(i,n);if(s)return{...s,route:r}}return null}},Xe=t=>{const e=Kt(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=Ft;exports.AsyncResultView=Mt;exports.AutoFocus=ne;exports.AutoSelect=oe;exports.ElementSize=je;exports.HTMLTitle=re;exports.HiddenWhenEmpty=ie;exports.InViewport=Wt;exports.LocationProviderMarker=ct;exports.PopOver=Be;exports.ProvideAppearance=te;exports.ProvideLocation=Zt;exports.ResultView=qt;exports.Router=Xe;exports.SelectOnFocus=Ie;exports.UseAppearance=ee;exports.UseLocation=lt;exports.WhenInViewport=le;exports.WindowSize=qe;exports._checkExtensionCondition=Rt;exports._getExtension=Et;exports._makeLocation=Lt;exports._makeLocationProp=Ct;exports._makeRouteMatcher=Kt;exports._parseRouteSegments=Yt;exports.appearanceMarker=at;exports.areLocationsEqual=St;exports.handleAnchorClick=Ot;exports.locationFromURL=kt;exports.matchesRoute=Xt;exports.setLocationFromUrl=Tt;exports.urlFromLocation=Pt;
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { makeProviderMark as Lt, makeProp as H, Fragment as
|
|
2
|
-
const
|
|
1
|
+
import { makeProviderMark as Lt, makeProp as H, Fragment as X, OnUnmount as q, WithProvider as Ot, UseProvider as St, renderableOfTNode as nt, Signal as Gt, html as Tt, on as Ct, Value as ot, attr as kt, Empty as ut, OneOfType as Pt, makeSignal as Qt, Portal as Wt, isSSR as Zt, OnMount as Mt, When as Ft, OneOfTuple as te } from "@tempots/dom";
|
|
2
|
+
const ee = (t) => {
|
|
3
3
|
const e = t.split("/").pop();
|
|
4
4
|
if (e == null || e.startsWith(".")) return;
|
|
5
5
|
const o = e.split(".") || [];
|
|
6
6
|
return o.length > 1 ? "." + o.pop() : void 0;
|
|
7
|
-
},
|
|
8
|
-
const o =
|
|
7
|
+
}, ne = (t, e) => {
|
|
8
|
+
const o = ee(e);
|
|
9
9
|
return o != null && (t.length === 0 || !t.some((n) => o == n));
|
|
10
|
-
},
|
|
10
|
+
}, oe = (t, e, o, n) => {
|
|
11
11
|
let i = t.target;
|
|
12
12
|
for (; i != null && !(i instanceof HTMLAnchorElement); )
|
|
13
13
|
i = i.parentElement;
|
|
@@ -22,8 +22,8 @@ const te = (t) => {
|
|
|
22
22
|
if (!(u != null && u.startsWith("#")) && u !== l)
|
|
23
23
|
return !0;
|
|
24
24
|
}
|
|
25
|
-
return e ? !1 :
|
|
26
|
-
},
|
|
25
|
+
return e ? !1 : ne(o, s);
|
|
26
|
+
}, ie = (t, e = {
|
|
27
27
|
ignoreUrlWithExtension: !0,
|
|
28
28
|
allowedExtensions: [],
|
|
29
29
|
ignoreExternalUrl: !0
|
|
@@ -32,14 +32,14 @@ const te = (t) => {
|
|
|
32
32
|
(n) => n.startsWith(".") ? n : "." + n
|
|
33
33
|
) : [];
|
|
34
34
|
return (n) => {
|
|
35
|
-
|
|
35
|
+
oe(
|
|
36
36
|
n,
|
|
37
37
|
e.ignoreUrlWithExtension ?? !0,
|
|
38
38
|
o,
|
|
39
39
|
e.ignoreExternalUrl ?? !0
|
|
40
40
|
) || t() && n.preventDefault();
|
|
41
41
|
};
|
|
42
|
-
}, Dt = Lt("LocationProvider"),
|
|
42
|
+
}, Dt = Lt("LocationProvider"), re = () => {
|
|
43
43
|
const t = (window == null ? void 0 : window.location.hash) === "" ? void 0 : (window == null ? void 0 : window.location.hash.substring(1)) ?? void 0;
|
|
44
44
|
return {
|
|
45
45
|
pathname: (window == null ? void 0 : window.location.pathname) ?? "",
|
|
@@ -48,7 +48,7 @@ const te = (t) => {
|
|
|
48
48
|
),
|
|
49
49
|
hash: t
|
|
50
50
|
};
|
|
51
|
-
},
|
|
51
|
+
}, se = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, ce = (t) => {
|
|
52
52
|
const e = new URL(t, (window == null ? void 0 : window.location.toString()) ?? ""), o = Object.fromEntries(e.searchParams.entries());
|
|
53
53
|
let n = e.hash;
|
|
54
54
|
return n.startsWith("#") && (n = n.substring(1)), {
|
|
@@ -56,14 +56,14 @@ const te = (t) => {
|
|
|
56
56
|
search: o,
|
|
57
57
|
hash: n === "" ? void 0 : n
|
|
58
58
|
};
|
|
59
|
-
},
|
|
60
|
-
const o =
|
|
59
|
+
}, le = (t, e) => {
|
|
60
|
+
const o = ce(e);
|
|
61
61
|
return t.set(o), t;
|
|
62
|
-
},
|
|
62
|
+
}, ae = (t) => {
|
|
63
63
|
const o = new URLSearchParams(t.search).toString(), n = t.hash;
|
|
64
64
|
return `${t.pathname}${o ? `?${o}` : ""}${n ? `#${n}` : ""}`;
|
|
65
|
-
},
|
|
66
|
-
const t = H(
|
|
65
|
+
}, ue = () => {
|
|
66
|
+
const t = H(re(), se), e = () => {
|
|
67
67
|
let o = (window == null ? void 0 : window.location.hash) ?? "";
|
|
68
68
|
o.startsWith("#") && (o = o.substring(1));
|
|
69
69
|
const n = {
|
|
@@ -78,60 +78,60 @@ const te = (t) => {
|
|
|
78
78
|
return window == null || window.addEventListener("popstate", e), t.onDispose(() => {
|
|
79
79
|
window == null || window.removeEventListener("popstate", e);
|
|
80
80
|
}), t.on((o) => {
|
|
81
|
-
window == null || window.history.pushState({}, "",
|
|
81
|
+
window == null || window.history.pushState({}, "", ae(o));
|
|
82
82
|
}), t;
|
|
83
|
-
},
|
|
84
|
-
const e =
|
|
85
|
-
return
|
|
86
|
-
|
|
83
|
+
}, en = (t) => {
|
|
84
|
+
const e = ue();
|
|
85
|
+
return X(
|
|
86
|
+
q(e.dispose),
|
|
87
87
|
Ot(Dt, e, t)
|
|
88
88
|
);
|
|
89
89
|
}, Nt = (t) => St(Dt, (e) => (o) => {
|
|
90
90
|
const n = H(e.value, e.equals);
|
|
91
91
|
e.feedProp(n), n.on(e.set);
|
|
92
|
-
const i =
|
|
92
|
+
const i = nt(t(n))(o);
|
|
93
93
|
return (r) => {
|
|
94
94
|
n.dispose(), i(r);
|
|
95
95
|
};
|
|
96
|
-
}),
|
|
97
|
-
if (typeof t == "string" ||
|
|
98
|
-
return
|
|
96
|
+
}), fe = (t, ...e) => {
|
|
97
|
+
if (typeof t == "string" || Gt.is(t))
|
|
98
|
+
return fe({ href: t }, ...e);
|
|
99
99
|
const { href: o, ...n } = t;
|
|
100
100
|
return Nt((i) => Tt.a(
|
|
101
101
|
Ct.click(
|
|
102
|
-
|
|
102
|
+
ie(() => (le(i, ot.get(o)), !0), n)
|
|
103
103
|
),
|
|
104
104
|
kt.href(o),
|
|
105
105
|
...e
|
|
106
106
|
));
|
|
107
|
-
},
|
|
107
|
+
}, Vt = Lt("Appearance"), nn = (t) => {
|
|
108
108
|
const e = window.matchMedia != null && window.matchMedia("(prefers-color-scheme: dark)").matches, o = H(e ? "dark" : "light"), n = (r) => {
|
|
109
109
|
o.set(r.matches ? "dark" : "light");
|
|
110
110
|
}, i = window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
|
|
111
|
-
return i == null || i.addEventListener("change", n),
|
|
112
|
-
Ot(
|
|
113
|
-
|
|
111
|
+
return i == null || i.addEventListener("change", n), X(
|
|
112
|
+
Ot(Vt, o, t),
|
|
113
|
+
q(() => i == null ? void 0 : i.removeEventListener("change", n))
|
|
114
114
|
);
|
|
115
|
-
},
|
|
115
|
+
}, on = (t) => St(Vt, t), he = (t, e) => {
|
|
116
116
|
if (typeof e == "function")
|
|
117
|
-
return
|
|
118
|
-
const o = e.failure ?? ((s) =>
|
|
119
|
-
|
|
117
|
+
return he(t, { success: e });
|
|
118
|
+
const o = e.failure ?? ((s) => X(
|
|
119
|
+
q(s.on(console.error)),
|
|
120
120
|
s.map((c) => `Error: ${c}`)
|
|
121
121
|
)), n = e.success, i = e.loading ?? (() => ut), r = e.notAsked ?? (() => ut);
|
|
122
|
-
return Pt(
|
|
122
|
+
return Pt(ot.toSignal(t), {
|
|
123
123
|
AsyncSuccess: (s) => n(s.$.value),
|
|
124
124
|
AsyncFailure: (s) => o(s.$.error),
|
|
125
|
-
Loading: (s) => i(s.$.previousValue ??
|
|
125
|
+
Loading: (s) => i(s.$.previousValue ?? Qt(void 0)),
|
|
126
126
|
NotAsked: r
|
|
127
127
|
});
|
|
128
|
-
},
|
|
128
|
+
}, rn = (t = 10) => (e) => {
|
|
129
129
|
const o = setTimeout(() => {
|
|
130
130
|
var n;
|
|
131
131
|
(n = e.element) == null || n.focus();
|
|
132
132
|
}, t);
|
|
133
133
|
return (n) => clearTimeout(o);
|
|
134
|
-
},
|
|
134
|
+
}, sn = (t = 10) => (e) => {
|
|
135
135
|
const o = setTimeout(() => {
|
|
136
136
|
var n;
|
|
137
137
|
(n = e.element) == null || n.select();
|
|
@@ -139,12 +139,12 @@ const te = (t) => {
|
|
|
139
139
|
return (n) => {
|
|
140
140
|
clearTimeout(o);
|
|
141
141
|
};
|
|
142
|
-
},
|
|
142
|
+
}, cn = (t) => {
|
|
143
143
|
const e = t.element, o = e.style.getPropertyValue(":empty");
|
|
144
144
|
return e.style.setProperty(":empty", "display:none"), (n) => {
|
|
145
145
|
n && e.style.setProperty(":empty", o);
|
|
146
146
|
};
|
|
147
|
-
},
|
|
147
|
+
}, ln = (t) => Wt("head > title", kt.innerText(t)), de = {
|
|
148
148
|
partial: {
|
|
149
149
|
root: null,
|
|
150
150
|
rootMargin: "0px",
|
|
@@ -155,48 +155,48 @@ const te = (t) => {
|
|
|
155
155
|
rootMargin: "0px",
|
|
156
156
|
threshold: 1
|
|
157
157
|
}
|
|
158
|
-
},
|
|
158
|
+
}, G = {
|
|
159
159
|
partial: /* @__PURE__ */ new Map(),
|
|
160
160
|
full: /* @__PURE__ */ new Map()
|
|
161
161
|
}, I = {
|
|
162
162
|
partial: null,
|
|
163
163
|
full: null
|
|
164
164
|
};
|
|
165
|
-
function
|
|
165
|
+
function me(t) {
|
|
166
166
|
return I[t] == null && (I[t] = new IntersectionObserver((e) => {
|
|
167
167
|
e.forEach((o) => {
|
|
168
|
-
const n =
|
|
168
|
+
const n = G[t].get(o.target);
|
|
169
169
|
n == null || n.set(o.isIntersecting);
|
|
170
170
|
});
|
|
171
|
-
},
|
|
171
|
+
}, de[t])), I[t];
|
|
172
172
|
}
|
|
173
|
-
const
|
|
174
|
-
const o = H(
|
|
175
|
-
return
|
|
173
|
+
const pe = (t, e) => {
|
|
174
|
+
const o = H(Zt());
|
|
175
|
+
return X(
|
|
176
176
|
Mt((n) => {
|
|
177
|
-
const i = typeof IntersectionObserver < "u" ?
|
|
178
|
-
return
|
|
177
|
+
const i = typeof IntersectionObserver < "u" ? me(t) : null;
|
|
178
|
+
return G[t].set(n, o), i == null || i.observe(n), () => {
|
|
179
179
|
var r;
|
|
180
|
-
i == null || i.unobserve(n),
|
|
180
|
+
i == null || i.unobserve(n), G[t].delete(n), G[t].size === 0 && ((r = I[t]) == null || r.disconnect(), I[t] = null);
|
|
181
181
|
};
|
|
182
182
|
}),
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
q(o.dispose),
|
|
184
|
+
nt(e(o))
|
|
185
185
|
);
|
|
186
|
-
},
|
|
186
|
+
}, an = (t, e, o) => pe(t, (n) => Ft(n, e, o ?? ut)), Q = Math.min, W = Math.max, Z = Math.round, J = Math.floor, C = (t) => ({
|
|
187
187
|
x: t,
|
|
188
188
|
y: t
|
|
189
|
-
}),
|
|
189
|
+
}), ge = {
|
|
190
190
|
left: "right",
|
|
191
191
|
right: "left",
|
|
192
192
|
bottom: "top",
|
|
193
193
|
top: "bottom"
|
|
194
|
-
},
|
|
194
|
+
}, we = {
|
|
195
195
|
start: "end",
|
|
196
196
|
end: "start"
|
|
197
197
|
};
|
|
198
198
|
function xt(t, e, o) {
|
|
199
|
-
return W(t,
|
|
199
|
+
return W(t, Q(e, o));
|
|
200
200
|
}
|
|
201
201
|
function it(t, e) {
|
|
202
202
|
return typeof t == "function" ? t(e) : t;
|
|
@@ -207,32 +207,32 @@ function M(t) {
|
|
|
207
207
|
function rt(t) {
|
|
208
208
|
return t.split("-")[1];
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function $t(t) {
|
|
211
211
|
return t === "x" ? "y" : "x";
|
|
212
212
|
}
|
|
213
213
|
function zt(t) {
|
|
214
214
|
return t === "y" ? "height" : "width";
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function $(t) {
|
|
217
217
|
return ["top", "bottom"].includes(M(t)) ? "y" : "x";
|
|
218
218
|
}
|
|
219
219
|
function Ht(t) {
|
|
220
|
-
return
|
|
220
|
+
return $t($(t));
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function ye(t, e, o) {
|
|
223
223
|
o === void 0 && (o = !1);
|
|
224
224
|
const n = rt(t), i = Ht(t), r = zt(i);
|
|
225
225
|
let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
226
|
-
return e.reference[r] > e.floating[r] && (s =
|
|
226
|
+
return e.reference[r] > e.floating[r] && (s = tt(s)), [s, tt(s)];
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
const e =
|
|
228
|
+
function xe(t) {
|
|
229
|
+
const e = tt(t);
|
|
230
230
|
return [ft(t), e, ft(e)];
|
|
231
231
|
}
|
|
232
232
|
function ft(t) {
|
|
233
|
-
return t.replace(/start|end/g, (e) =>
|
|
233
|
+
return t.replace(/start|end/g, (e) => we[e]);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function ve(t, e, o) {
|
|
236
236
|
const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
|
|
237
237
|
switch (t) {
|
|
238
238
|
case "top":
|
|
@@ -245,15 +245,15 @@ function xe(t, e, o) {
|
|
|
245
245
|
return [];
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function be(t, e, o, n) {
|
|
249
249
|
const i = rt(t);
|
|
250
|
-
let r =
|
|
250
|
+
let r = ve(M(t), o === "start", n);
|
|
251
251
|
return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ft)))), r;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
253
|
+
function tt(t) {
|
|
254
|
+
return t.replace(/left|right|bottom|top/g, (e) => ge[e]);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function Ae(t) {
|
|
257
257
|
return {
|
|
258
258
|
top: 0,
|
|
259
259
|
right: 0,
|
|
@@ -262,15 +262,15 @@ function be(t) {
|
|
|
262
262
|
...t
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
return typeof t != "number" ?
|
|
265
|
+
function Ee(t) {
|
|
266
|
+
return typeof t != "number" ? Ae(t) : {
|
|
267
267
|
top: t,
|
|
268
268
|
right: t,
|
|
269
269
|
bottom: t,
|
|
270
270
|
left: t
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function et(t) {
|
|
274
274
|
const {
|
|
275
275
|
x: e,
|
|
276
276
|
y: o,
|
|
@@ -293,7 +293,7 @@ function vt(t, e, o) {
|
|
|
293
293
|
reference: n,
|
|
294
294
|
floating: i
|
|
295
295
|
} = t;
|
|
296
|
-
const r =
|
|
296
|
+
const r = $(e), s = Ht(e), c = zt(s), a = M(e), l = r === "y", u = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, m = n[c] / 2 - i[c] / 2;
|
|
297
297
|
let h;
|
|
298
298
|
switch (a) {
|
|
299
299
|
case "top":
|
|
@@ -336,7 +336,7 @@ function vt(t, e, o) {
|
|
|
336
336
|
}
|
|
337
337
|
return h;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const Re = async (t, e, o) => {
|
|
340
340
|
const {
|
|
341
341
|
placement: n = "bottom",
|
|
342
342
|
strategy: i = "absolute",
|
|
@@ -413,7 +413,7 @@ async function _t(t, e) {
|
|
|
413
413
|
elementContext: f = "floating",
|
|
414
414
|
altBoundary: m = !1,
|
|
415
415
|
padding: h = 0
|
|
416
|
-
} = it(e, t), p =
|
|
416
|
+
} = it(e, t), p = Ee(h), w = c[m ? f === "floating" ? "reference" : "floating" : f], d = et(await r.getClippingRect({
|
|
417
417
|
element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
|
|
418
418
|
boundary: l,
|
|
419
419
|
rootBoundary: u,
|
|
@@ -429,7 +429,7 @@ async function _t(t, e) {
|
|
|
429
429
|
} : {
|
|
430
430
|
x: 1,
|
|
431
431
|
y: 1
|
|
432
|
-
}, v =
|
|
432
|
+
}, v = et(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
433
433
|
elements: c,
|
|
434
434
|
rect: y,
|
|
435
435
|
offsetParent: x,
|
|
@@ -442,7 +442,7 @@ async function _t(t, e) {
|
|
|
442
442
|
right: (v.right - d.right + p.right) / b.x
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const Le = function(t) {
|
|
446
446
|
return t === void 0 && (t = {}), {
|
|
447
447
|
name: "flip",
|
|
448
448
|
options: t,
|
|
@@ -466,18 +466,18 @@ const Re = function(t) {
|
|
|
466
466
|
} = it(t, e);
|
|
467
467
|
if ((o = r.arrow) != null && o.alignmentOffset)
|
|
468
468
|
return {};
|
|
469
|
-
const d = M(i), y =
|
|
470
|
-
!m && D && v.push(...
|
|
471
|
-
const Kt = [c, ...v], lt = await _t(e, w),
|
|
469
|
+
const d = M(i), y = $(c), x = M(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (x || !g ? [tt(c)] : xe(c)), D = p !== "none";
|
|
470
|
+
!m && D && v.push(...be(c, g, p, b));
|
|
471
|
+
const Kt = [c, ...v], lt = await _t(e, w), K = [];
|
|
472
472
|
let B = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
473
|
-
if (u &&
|
|
474
|
-
const P =
|
|
475
|
-
|
|
473
|
+
if (u && K.push(lt[d]), f) {
|
|
474
|
+
const P = ye(i, s, b);
|
|
475
|
+
K.push(lt[P[0]], lt[P[1]]);
|
|
476
476
|
}
|
|
477
477
|
if (B = [...B, {
|
|
478
478
|
placement: i,
|
|
479
|
-
overflows:
|
|
480
|
-
}], !
|
|
479
|
+
overflows: K
|
|
480
|
+
}], !K.every((P) => P <= 0)) {
|
|
481
481
|
var pt, gt;
|
|
482
482
|
const P = (((pt = r.flip) == null ? void 0 : pt.index) || 0) + 1, yt = Kt[P];
|
|
483
483
|
if (yt)
|
|
@@ -497,7 +497,7 @@ const Re = function(t) {
|
|
|
497
497
|
var wt;
|
|
498
498
|
const N = (wt = B.filter((S) => {
|
|
499
499
|
if (D) {
|
|
500
|
-
const T =
|
|
500
|
+
const T = $(S.placement);
|
|
501
501
|
return T === y || // Create a bias to the `y` side axis due to horizontal
|
|
502
502
|
// reading directions favoring greater width.
|
|
503
503
|
T === "y";
|
|
@@ -522,12 +522,12 @@ const Re = function(t) {
|
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
};
|
|
525
|
-
async function
|
|
525
|
+
async function Oe(t, e) {
|
|
526
526
|
const {
|
|
527
527
|
placement: o,
|
|
528
528
|
platform: n,
|
|
529
529
|
elements: i
|
|
530
|
-
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = M(o), c = rt(o), a =
|
|
530
|
+
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = M(o), c = rt(o), a = $(o) === "y", l = ["left", "top"].includes(s) ? -1 : 1, u = r && a ? -1 : 1, f = it(e, t);
|
|
531
531
|
let {
|
|
532
532
|
mainAxis: m,
|
|
533
533
|
crossAxis: h,
|
|
@@ -550,7 +550,7 @@ async function Le(t, e) {
|
|
|
550
550
|
y: h * u
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
|
-
const
|
|
553
|
+
const Se = function(t) {
|
|
554
554
|
return t === void 0 && (t = 0), {
|
|
555
555
|
name: "offset",
|
|
556
556
|
options: t,
|
|
@@ -561,7 +561,7 @@ const Oe = function(t) {
|
|
|
561
561
|
y: r,
|
|
562
562
|
placement: s,
|
|
563
563
|
middlewareData: c
|
|
564
|
-
} = e, a = await
|
|
564
|
+
} = e, a = await Oe(e, t);
|
|
565
565
|
return s === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
|
|
566
566
|
x: i + a.x,
|
|
567
567
|
y: r + a.y,
|
|
@@ -572,7 +572,7 @@ const Oe = function(t) {
|
|
|
572
572
|
};
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
|
-
},
|
|
575
|
+
}, Te = function(t) {
|
|
576
576
|
return t === void 0 && (t = {}), {
|
|
577
577
|
name: "shift",
|
|
578
578
|
options: t,
|
|
@@ -600,7 +600,7 @@ const Oe = function(t) {
|
|
|
600
600
|
} = it(t, e), l = {
|
|
601
601
|
x: o,
|
|
602
602
|
y: n
|
|
603
|
-
}, u = await _t(e, a), f =
|
|
603
|
+
}, u = await _t(e, a), f = $(M(i)), m = $t(f);
|
|
604
604
|
let h = l[m], p = l[f];
|
|
605
605
|
if (r) {
|
|
606
606
|
const w = m === "y" ? "top" : "left", d = m === "y" ? "bottom" : "right", y = h + u[w], x = h - u[d];
|
|
@@ -648,7 +648,7 @@ function L(t) {
|
|
|
648
648
|
function bt(t) {
|
|
649
649
|
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function Y(t) {
|
|
652
652
|
const {
|
|
653
653
|
overflow: e,
|
|
654
654
|
overflowX: o,
|
|
@@ -657,7 +657,7 @@ function K(t) {
|
|
|
657
657
|
} = E(t);
|
|
658
658
|
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function Ce(t) {
|
|
661
661
|
return ["table", "td", "th"].includes(_(t));
|
|
662
662
|
}
|
|
663
663
|
function st(t) {
|
|
@@ -673,7 +673,7 @@ function ht(t) {
|
|
|
673
673
|
const e = dt(), o = E(t);
|
|
674
674
|
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));
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function ke(t) {
|
|
677
677
|
let e = k(t);
|
|
678
678
|
for (; L(e) && !z(e); ) {
|
|
679
679
|
if (st(e))
|
|
@@ -716,18 +716,18 @@ function k(t) {
|
|
|
716
716
|
}
|
|
717
717
|
function Ut(t) {
|
|
718
718
|
const e = k(t);
|
|
719
|
-
return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) &&
|
|
719
|
+
return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && Y(e) ? e : Ut(e);
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function j(t, e, o) {
|
|
722
722
|
var n;
|
|
723
723
|
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
724
724
|
const i = Ut(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = A(i);
|
|
725
|
-
return r ? e.concat(s, s.visualViewport || [],
|
|
725
|
+
return r ? e.concat(s, s.visualViewport || [], Y(i) ? i : [], s.frameElement && o ? j(s.frameElement) : []) : e.concat(i, j(i, [], o));
|
|
726
726
|
}
|
|
727
727
|
function It(t) {
|
|
728
728
|
const e = E(t);
|
|
729
729
|
let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
730
|
-
const i = L(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, c =
|
|
730
|
+
const i = L(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, c = Z(o) !== r || Z(n) !== s;
|
|
731
731
|
return c && (o = r, n = s), {
|
|
732
732
|
width: o,
|
|
733
733
|
height: n,
|
|
@@ -737,7 +737,7 @@ function It(t) {
|
|
|
737
737
|
function mt(t) {
|
|
738
738
|
return R(t) ? t : t.contextElement;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function V(t) {
|
|
741
741
|
const e = mt(t);
|
|
742
742
|
if (!L(e))
|
|
743
743
|
return C(1);
|
|
@@ -746,46 +746,46 @@ function $(t) {
|
|
|
746
746
|
height: i,
|
|
747
747
|
$: r
|
|
748
748
|
} = It(e);
|
|
749
|
-
let s = (r ?
|
|
749
|
+
let s = (r ? Z(o.width) : o.width) / n, c = (r ? Z(o.height) : o.height) / i;
|
|
750
750
|
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
751
751
|
x: s,
|
|
752
752
|
y: c
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
const
|
|
755
|
+
const Pe = /* @__PURE__ */ C(0);
|
|
756
756
|
function jt(t) {
|
|
757
757
|
const e = A(t);
|
|
758
|
-
return !dt() || !e.visualViewport ?
|
|
758
|
+
return !dt() || !e.visualViewport ? Pe : {
|
|
759
759
|
x: e.visualViewport.offsetLeft,
|
|
760
760
|
y: e.visualViewport.offsetTop
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function We(t, e, o) {
|
|
764
764
|
return e === void 0 && (e = !1), !o || e && o !== A(t) ? !1 : e;
|
|
765
765
|
}
|
|
766
766
|
function F(t, e, o, n) {
|
|
767
767
|
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
768
768
|
const i = t.getBoundingClientRect(), r = mt(t);
|
|
769
769
|
let s = C(1);
|
|
770
|
-
e && (n ? R(n) && (s =
|
|
771
|
-
const c =
|
|
770
|
+
e && (n ? R(n) && (s = V(n)) : s = V(t));
|
|
771
|
+
const c = We(r, o, n) ? jt(r) : C(0);
|
|
772
772
|
let a = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, u = i.width / s.x, f = i.height / s.y;
|
|
773
773
|
if (r) {
|
|
774
774
|
const m = A(r), h = n && R(n) ? A(n) : n;
|
|
775
775
|
let p = m, g = p.frameElement;
|
|
776
776
|
for (; g && n && h !== p; ) {
|
|
777
|
-
const w =
|
|
777
|
+
const w = V(g), d = g.getBoundingClientRect(), y = E(g), x = d.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, b = d.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
|
|
778
778
|
a *= w.x, l *= w.y, u *= w.x, f *= w.y, a += x, l += b, p = A(g), g = p.frameElement;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
|
-
return
|
|
781
|
+
return et({
|
|
782
782
|
width: u,
|
|
783
783
|
height: f,
|
|
784
784
|
x: a,
|
|
785
785
|
y: l
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Me(t) {
|
|
789
789
|
let {
|
|
790
790
|
elements: e,
|
|
791
791
|
rect: o,
|
|
@@ -800,9 +800,9 @@ function We(t) {
|
|
|
800
800
|
scrollTop: 0
|
|
801
801
|
}, l = C(1);
|
|
802
802
|
const u = C(0), f = L(n);
|
|
803
|
-
if ((f || !f && !r) && ((_(n) !== "body" ||
|
|
803
|
+
if ((f || !f && !r) && ((_(n) !== "body" || Y(s)) && (a = ct(n)), L(n))) {
|
|
804
804
|
const m = F(n);
|
|
805
|
-
l =
|
|
805
|
+
l = V(n), u.x = m.x + n.clientLeft, u.y = m.y + n.clientTop;
|
|
806
806
|
}
|
|
807
807
|
return {
|
|
808
808
|
width: o.width * l.x,
|
|
@@ -811,13 +811,13 @@ function We(t) {
|
|
|
811
811
|
y: o.y * l.y - a.scrollTop * l.y + u.y
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Fe(t) {
|
|
815
815
|
return Array.from(t.getClientRects());
|
|
816
816
|
}
|
|
817
817
|
function Xt(t) {
|
|
818
818
|
return F(O(t)).left + ct(t).scrollLeft;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function De(t) {
|
|
821
821
|
const e = O(t), o = ct(t), n = t.ownerDocument.body, i = W(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = W(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
822
822
|
let s = -o.scrollLeft + Xt(t);
|
|
823
823
|
const c = -o.scrollTop;
|
|
@@ -828,7 +828,7 @@ function Fe(t) {
|
|
|
828
828
|
y: c
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function Ne(t, e) {
|
|
832
832
|
const o = A(t), n = O(t), i = o.visualViewport;
|
|
833
833
|
let r = n.clientWidth, s = n.clientHeight, c = 0, a = 0;
|
|
834
834
|
if (i) {
|
|
@@ -843,8 +843,8 @@ function De(t, e) {
|
|
|
843
843
|
y: a
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
const o = F(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = L(t) ?
|
|
846
|
+
function Ve(t, e) {
|
|
847
|
+
const o = F(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = L(t) ? V(t) : C(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, a = i * r.x, l = n * r.y;
|
|
848
848
|
return {
|
|
849
849
|
width: s,
|
|
850
850
|
height: c,
|
|
@@ -855,11 +855,11 @@ function Ne(t, e) {
|
|
|
855
855
|
function At(t, e, o) {
|
|
856
856
|
let n;
|
|
857
857
|
if (e === "viewport")
|
|
858
|
-
n =
|
|
858
|
+
n = Ne(t, o);
|
|
859
859
|
else if (e === "document")
|
|
860
|
-
n =
|
|
860
|
+
n = De(O(t));
|
|
861
861
|
else if (R(e))
|
|
862
|
-
n =
|
|
862
|
+
n = Ve(e, o);
|
|
863
863
|
else {
|
|
864
864
|
const i = jt(t);
|
|
865
865
|
n = {
|
|
@@ -868,7 +868,7 @@ function At(t, e, o) {
|
|
|
868
868
|
y: e.y - i.y
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
|
-
return
|
|
871
|
+
return et(n);
|
|
872
872
|
}
|
|
873
873
|
function qt(t, e) {
|
|
874
874
|
const o = k(t);
|
|
@@ -878,16 +878,16 @@ function $e(t, e) {
|
|
|
878
878
|
const o = e.get(t);
|
|
879
879
|
if (o)
|
|
880
880
|
return o;
|
|
881
|
-
let n =
|
|
881
|
+
let n = j(t, [], !1).filter((c) => R(c) && _(c) !== "body"), i = null;
|
|
882
882
|
const r = E(t).position === "fixed";
|
|
883
883
|
let s = r ? k(t) : t;
|
|
884
884
|
for (; R(s) && !z(s); ) {
|
|
885
885
|
const c = E(s), a = ht(s);
|
|
886
|
-
!a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) ||
|
|
886
|
+
!a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Y(s) && !a && qt(t, s)) ? n = n.filter((u) => u !== s) : i = c, s = k(s);
|
|
887
887
|
}
|
|
888
888
|
return e.set(t, n), n;
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function ze(t) {
|
|
891
891
|
let {
|
|
892
892
|
element: e,
|
|
893
893
|
boundary: o,
|
|
@@ -896,7 +896,7 @@ function Ve(t) {
|
|
|
896
896
|
} = t;
|
|
897
897
|
const s = [...o === "clippingAncestors" ? st(e) ? [] : $e(e, this._c) : [].concat(o), n], c = s[0], a = s.reduce((l, u) => {
|
|
898
898
|
const f = At(e, u, i);
|
|
899
|
-
return l.top = W(f.top, l.top), l.right =
|
|
899
|
+
return l.top = W(f.top, l.top), l.right = Q(f.right, l.right), l.bottom = Q(f.bottom, l.bottom), l.left = W(f.left, l.left), l;
|
|
900
900
|
}, At(e, c, i));
|
|
901
901
|
return {
|
|
902
902
|
width: a.right - a.left,
|
|
@@ -905,7 +905,7 @@ function Ve(t) {
|
|
|
905
905
|
y: a.top
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function He(t) {
|
|
909
909
|
const {
|
|
910
910
|
width: e,
|
|
911
911
|
height: o
|
|
@@ -915,7 +915,7 @@ function ze(t) {
|
|
|
915
915
|
height: o
|
|
916
916
|
};
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function _e(t, e, o) {
|
|
919
919
|
const n = L(e), i = O(e), r = o === "fixed", s = F(t, !0, r, e);
|
|
920
920
|
let c = {
|
|
921
921
|
scrollLeft: 0,
|
|
@@ -923,7 +923,7 @@ function He(t, e, o) {
|
|
|
923
923
|
};
|
|
924
924
|
const a = C(0);
|
|
925
925
|
if (n || !n && !r)
|
|
926
|
-
if ((_(e) !== "body" ||
|
|
926
|
+
if ((_(e) !== "body" || Y(i)) && (c = ct(e)), n) {
|
|
927
927
|
const f = F(e, !0, r, e);
|
|
928
928
|
a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
|
|
929
929
|
} else i && (a.x = Xt(i));
|
|
@@ -955,14 +955,14 @@ function Yt(t, e) {
|
|
|
955
955
|
return o;
|
|
956
956
|
}
|
|
957
957
|
let n = Et(t, e);
|
|
958
|
-
for (; n &&
|
|
958
|
+
for (; n && Ce(n) && at(n); )
|
|
959
959
|
n = Et(n, e);
|
|
960
|
-
return n && z(n) && at(n) && !ht(n) ? o : n ||
|
|
960
|
+
return n && z(n) && at(n) && !ht(n) ? o : n || ke(t) || o;
|
|
961
961
|
}
|
|
962
|
-
const
|
|
962
|
+
const Be = async function(t) {
|
|
963
963
|
const e = this.getOffsetParent || Yt, o = this.getDimensions, n = await o(t.floating);
|
|
964
964
|
return {
|
|
965
|
-
reference:
|
|
965
|
+
reference: _e(t.reference, await e(t.floating), t.strategy),
|
|
966
966
|
floating: {
|
|
967
967
|
x: 0,
|
|
968
968
|
y: 0,
|
|
@@ -971,22 +971,22 @@ const _e = async function(t) {
|
|
|
971
971
|
}
|
|
972
972
|
};
|
|
973
973
|
};
|
|
974
|
-
function
|
|
974
|
+
function Ue(t) {
|
|
975
975
|
return E(t).direction === "rtl";
|
|
976
976
|
}
|
|
977
|
-
const
|
|
978
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
977
|
+
const Ie = {
|
|
978
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Me,
|
|
979
979
|
getDocumentElement: O,
|
|
980
|
-
getClippingRect:
|
|
980
|
+
getClippingRect: ze,
|
|
981
981
|
getOffsetParent: Yt,
|
|
982
|
-
getElementRects:
|
|
983
|
-
getClientRects:
|
|
984
|
-
getDimensions:
|
|
985
|
-
getScale:
|
|
982
|
+
getElementRects: Be,
|
|
983
|
+
getClientRects: Fe,
|
|
984
|
+
getDimensions: He,
|
|
985
|
+
getScale: V,
|
|
986
986
|
isElement: R,
|
|
987
|
-
isRTL:
|
|
987
|
+
isRTL: Ue
|
|
988
988
|
};
|
|
989
|
-
function
|
|
989
|
+
function je(t, e) {
|
|
990
990
|
let o = null, n;
|
|
991
991
|
const i = O(t);
|
|
992
992
|
function r() {
|
|
@@ -1003,9 +1003,9 @@ function Ie(t, e) {
|
|
|
1003
1003
|
} = t.getBoundingClientRect();
|
|
1004
1004
|
if (c || e(), !f || !m)
|
|
1005
1005
|
return;
|
|
1006
|
-
const h =
|
|
1006
|
+
const h = J(u), p = J(i.clientWidth - (l + f)), g = J(i.clientHeight - (u + m)), w = J(l), y = {
|
|
1007
1007
|
rootMargin: -h + "px " + -p + "px " + -g + "px " + -w + "px",
|
|
1008
|
-
threshold: W(0,
|
|
1008
|
+
threshold: W(0, Q(1, a)) || 1
|
|
1009
1009
|
};
|
|
1010
1010
|
let x = !0;
|
|
1011
1011
|
function b(v) {
|
|
@@ -1032,7 +1032,7 @@ function Ie(t, e) {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
return s(!0), r;
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function Xe(t, e, o, n) {
|
|
1036
1036
|
n === void 0 && (n = {});
|
|
1037
1037
|
const {
|
|
1038
1038
|
ancestorScroll: i = !0,
|
|
@@ -1040,13 +1040,13 @@ function je(t, e, o, n) {
|
|
|
1040
1040
|
elementResize: s = typeof ResizeObserver == "function",
|
|
1041
1041
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1042
1042
|
animationFrame: a = !1
|
|
1043
|
-
} = n, l = mt(t), u = i || r ? [...l ?
|
|
1043
|
+
} = n, l = mt(t), u = i || r ? [...l ? j(l) : [], ...j(e)] : [];
|
|
1044
1044
|
u.forEach((d) => {
|
|
1045
1045
|
i && d.addEventListener("scroll", o, {
|
|
1046
1046
|
passive: !0
|
|
1047
1047
|
}), r && d.addEventListener("resize", o);
|
|
1048
1048
|
});
|
|
1049
|
-
const f = l && c ?
|
|
1049
|
+
const f = l && c ? je(l, o) : null;
|
|
1050
1050
|
let m = -1, h = null;
|
|
1051
1051
|
s && (h = new ResizeObserver((d) => {
|
|
1052
1052
|
let [y] = d;
|
|
@@ -1068,25 +1068,25 @@ function je(t, e, o, n) {
|
|
|
1068
1068
|
}), f == null || f(), (d = h) == null || d.disconnect(), h = null, a && cancelAnimationFrame(p);
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
const
|
|
1071
|
+
const qe = Se, Ye = Te, Rt = Le, Ke = (t, e, o) => {
|
|
1072
1072
|
const n = /* @__PURE__ */ new Map(), i = {
|
|
1073
|
-
platform:
|
|
1073
|
+
platform: Ie,
|
|
1074
1074
|
...o
|
|
1075
1075
|
}, r = {
|
|
1076
1076
|
...i.platform,
|
|
1077
1077
|
_c: n
|
|
1078
1078
|
};
|
|
1079
|
-
return
|
|
1079
|
+
return Re(t, e, {
|
|
1080
1080
|
...i,
|
|
1081
1081
|
platform: r
|
|
1082
1082
|
});
|
|
1083
|
-
},
|
|
1083
|
+
}, un = ({
|
|
1084
1084
|
content: t,
|
|
1085
1085
|
open: e,
|
|
1086
1086
|
placement: o,
|
|
1087
1087
|
offset: { mainAxis: n, crossAxis: i } = { mainAxis: 0, crossAxis: 0 }
|
|
1088
1088
|
}) => (r) => {
|
|
1089
|
-
const s = r.element, c =
|
|
1089
|
+
const s = r.element, c = ot.toSignal(e);
|
|
1090
1090
|
return Ft(
|
|
1091
1091
|
c,
|
|
1092
1092
|
Wt(
|
|
@@ -1094,14 +1094,14 @@ const Xe = Oe, qe = Se, Rt = Re, Ye = (t, e, o) => {
|
|
|
1094
1094
|
Tt.div(
|
|
1095
1095
|
Mt((a) => {
|
|
1096
1096
|
const l = a;
|
|
1097
|
-
return l.style.position = "absolute",
|
|
1098
|
-
|
|
1097
|
+
return l.style.position = "absolute", Xe(s, l, () => {
|
|
1098
|
+
Ke(s, l, {
|
|
1099
1099
|
placement: o,
|
|
1100
1100
|
strategy: "absolute",
|
|
1101
1101
|
middleware: [
|
|
1102
1102
|
Rt(),
|
|
1103
|
-
|
|
1104
|
-
|
|
1103
|
+
qe({ mainAxis: n, crossAxis: i }),
|
|
1104
|
+
Ye(),
|
|
1105
1105
|
Rt()
|
|
1106
1106
|
]
|
|
1107
1107
|
}).then(({ x: u, y: f }) => {
|
|
@@ -1113,33 +1113,33 @@ const Xe = Oe, qe = Se, Rt = Re, Ye = (t, e, o) => {
|
|
|
1113
1113
|
)
|
|
1114
1114
|
)
|
|
1115
1115
|
)(r);
|
|
1116
|
-
},
|
|
1116
|
+
}, Je = (t, e) => {
|
|
1117
1117
|
if (typeof e == "function")
|
|
1118
|
-
return
|
|
1119
|
-
const o = e.failure ?? ((i) =>
|
|
1120
|
-
|
|
1118
|
+
return Je(t, { success: e });
|
|
1119
|
+
const o = e.failure ?? ((i) => X(
|
|
1120
|
+
q(i.on(console.error)),
|
|
1121
1121
|
i.map((r) => `Error: ${r}`)
|
|
1122
1122
|
)), n = e.success;
|
|
1123
|
-
return Pt(
|
|
1123
|
+
return Pt(ot.toSignal(t), {
|
|
1124
1124
|
Success: (i) => n(i.$.value),
|
|
1125
1125
|
Failure: (i) => o(i.$.error)
|
|
1126
1126
|
});
|
|
1127
|
-
},
|
|
1127
|
+
}, fn = () => Ct.focus((t) => {
|
|
1128
1128
|
var e;
|
|
1129
1129
|
return (e = t.target) == null ? void 0 : e.select();
|
|
1130
|
-
}),
|
|
1131
|
-
const o = e.element, n = H({ width: o.clientWidth, height: o.clientHeight }), i =
|
|
1130
|
+
}), hn = (t) => (e) => {
|
|
1131
|
+
const o = e.element, n = H({ width: o.clientWidth, height: o.clientHeight }), i = nt(t(n))(e), r = () => {
|
|
1132
1132
|
n.set({ width: o.clientWidth, height: o.clientHeight });
|
|
1133
1133
|
};
|
|
1134
1134
|
let s;
|
|
1135
1135
|
return typeof ResizeObserver == "function" && (s = new ResizeObserver(r), s.observe(o)), (c) => {
|
|
1136
1136
|
s == null || s.disconnect(), i(c);
|
|
1137
1137
|
};
|
|
1138
|
-
},
|
|
1138
|
+
}, dn = (t) => (e) => {
|
|
1139
1139
|
const o = H({
|
|
1140
1140
|
width: (window == null ? void 0 : window.innerWidth) ?? 0,
|
|
1141
1141
|
height: (window == null ? void 0 : window.innerHeight) ?? 0
|
|
1142
|
-
}), n =
|
|
1142
|
+
}), n = nt(t(o))(e), i = () => {
|
|
1143
1143
|
o.set({
|
|
1144
1144
|
width: (window == null ? void 0 : window.innerWidth) ?? 0,
|
|
1145
1145
|
height: (window == null ? void 0 : window.innerHeight) ?? 0
|
|
@@ -1148,7 +1148,7 @@ const Xe = Oe, qe = Se, Rt = Re, Ye = (t, e, o) => {
|
|
|
1148
1148
|
return window == null || window.addEventListener("resize", i), (r) => {
|
|
1149
1149
|
window == null || window.removeEventListener("resize", i), n(r);
|
|
1150
1150
|
};
|
|
1151
|
-
},
|
|
1151
|
+
}, Ge = (t, e) => {
|
|
1152
1152
|
const o = e.split("/").filter((i) => i !== ""), n = {};
|
|
1153
1153
|
for (let i = 0; i < t.length; i++) {
|
|
1154
1154
|
const r = t[i], s = o[i];
|
|
@@ -1163,21 +1163,21 @@ const Xe = Oe, qe = Se, Rt = Re, Ye = (t, e, o) => {
|
|
|
1163
1163
|
return { params: n, path: e };
|
|
1164
1164
|
}
|
|
1165
1165
|
return o.length !== t.length ? null : { params: n, path: e };
|
|
1166
|
-
},
|
|
1166
|
+
}, Qe = (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 !== ""), Ze = (t) => {
|
|
1167
1167
|
const e = t.map((o) => {
|
|
1168
|
-
const n =
|
|
1168
|
+
const n = Qe(o);
|
|
1169
1169
|
return { route: o, segments: n };
|
|
1170
1170
|
});
|
|
1171
1171
|
return function(n) {
|
|
1172
1172
|
for (const { segments: i, route: r } of e) {
|
|
1173
|
-
const s =
|
|
1173
|
+
const s = Ge(i, n);
|
|
1174
1174
|
if (s)
|
|
1175
1175
|
return { ...s, route: r };
|
|
1176
1176
|
}
|
|
1177
1177
|
return null;
|
|
1178
1178
|
};
|
|
1179
|
-
},
|
|
1180
|
-
const e =
|
|
1179
|
+
}, mn = (t) => {
|
|
1180
|
+
const e = Ze(Object.keys(t));
|
|
1181
1181
|
return Nt((o) => {
|
|
1182
1182
|
const n = o.map((i) => {
|
|
1183
1183
|
const r = e(i.pathname);
|
|
@@ -1191,7 +1191,7 @@ const Xe = Oe, qe = Se, Rt = Re, Ye = (t, e, o) => {
|
|
|
1191
1191
|
hash: i.hash
|
|
1192
1192
|
};
|
|
1193
1193
|
});
|
|
1194
|
-
return
|
|
1194
|
+
return te(
|
|
1195
1195
|
n.map((i) => [i.route, i]),
|
|
1196
1196
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1197
1197
|
t
|
|
@@ -1199,36 +1199,36 @@ const Xe = Oe, qe = Se, Rt = Re, Ye = (t, e, o) => {
|
|
|
1199
1199
|
});
|
|
1200
1200
|
};
|
|
1201
1201
|
export {
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1202
|
+
fe as Anchor,
|
|
1203
|
+
he as AsyncResultView,
|
|
1204
|
+
rn as AutoFocus,
|
|
1205
|
+
sn as AutoSelect,
|
|
1206
|
+
hn as ElementSize,
|
|
1207
|
+
ln as HTMLTitle,
|
|
1208
|
+
cn as HiddenWhenEmpty,
|
|
1209
|
+
pe as InViewport,
|
|
1210
1210
|
Dt as LocationProviderMarker,
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1211
|
+
un as PopOver,
|
|
1212
|
+
nn as ProvideAppearance,
|
|
1213
|
+
en as ProvideLocation,
|
|
1214
|
+
Je as ResultView,
|
|
1215
|
+
mn as Router,
|
|
1216
|
+
fn as SelectOnFocus,
|
|
1217
|
+
on as UseAppearance,
|
|
1218
1218
|
Nt as UseLocation,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1219
|
+
an as WhenInViewport,
|
|
1220
|
+
dn as WindowSize,
|
|
1221
|
+
ne as _checkExtensionCondition,
|
|
1222
|
+
ee as _getExtension,
|
|
1223
|
+
re as _makeLocation,
|
|
1224
|
+
ue as _makeLocationProp,
|
|
1225
|
+
Ze as _makeRouteMatcher,
|
|
1226
|
+
Qe as _parseRouteSegments,
|
|
1227
|
+
Vt as appearanceMarker,
|
|
1228
|
+
se as areLocationsEqual,
|
|
1229
|
+
ie as handleAnchorClick,
|
|
1230
|
+
ce as locationFromURL,
|
|
1231
|
+
Ge as matchesRoute,
|
|
1232
|
+
le as setLocationFromUrl,
|
|
1233
|
+
ae as urlFromLocation
|
|
1234
1234
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@floating-ui/dom": "^1.6.7"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@tempots/dom": "
|
|
43
|
+
"@tempots/dom": "21.0.0",
|
|
44
44
|
"@tempots/std": "0.15.0"
|
|
45
45
|
}
|
|
46
46
|
}
|