@tempots/ui 0.23.0-next.9 → 1.0.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/LICENSE.txt +202 -0
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.js +465 -444
- package/package.json +2 -3
- package/renderables/inviewport.d.ts +1 -1
- package/utils/ticker.d.ts +5 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Ct=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Ft=(t,e)=>{const n=Ct(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},oe=(t,e,n,o)=>{let r=t.target;for(;r!=null&&!(r instanceof HTMLAnchorElement);)r=r.parentElement;if(r==null)return!0;const i=r;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=i;if(o){const l=s+c+a,f=i.getAttribute("href");if(!(f!=null&&f.startsWith("#"))&&f!==l)return!0}return e?!1:Ft(n,s)},Wt=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const n=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(o=>o.startsWith(".")?o:"."+o):[];return o=>{oe(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Dt=u.makeProviderMark("LocationProvider"),re=t=>u.Fragment(u.OnBrowserCtx(e=>u.Async(Promise.resolve().then(()=>require("./browser-location-D36kVbd7.cjs")).then(n=>n.ProvideBrowserLocation),n=>n(t))(e)),u.OnHeadlessCtx(e=>u.Async(Promise.resolve().then(()=>require("./headless-location-8Va85S-Q.cjs")).then(n=>n.ProvideHeadlessLocation),n=>n(e.container.currentURL,t))(e))),dt=t=>u.UseProvider(Dt,e=>n=>{const o=u.makeProp(e.value,e.equals);e.feedProp(o),o.on(e.set);const r=u.renderableOfTNode(t(o))(n);return i=>{o.dispose(),r(i)}}),ie=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Mt=(t,e)=>{var i;const n=new URL(t,e??((i=u.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let r=n.hash;return r.startsWith("#")&&(r=r.substring(1)),{pathname:n.pathname,search:o,hash:r===""?void 0:r}},Vt=(t,e)=>{const n=Mt(e);return t.set(n),t},se=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Nt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Nt({href:t},...e);const{href:n,...o}=t;return dt(r=>u.html.a(u.on.click(Wt(()=>(Vt(r,u.Value.get(n)),!0),o)),u.attr.href(n),...e))},ht=u.makeProviderMark("Appearance"),ce=t=>{const e=u.getWindow(),n=e!=null&&e.matchMedia!=null&&e.matchMedia("(prefers-color-scheme: dark)").matches,o=u.makeProp(n?"dark":"light"),r=s=>{o.set(s.matches?"dark":"light")},i=e!=null&&e.matchMedia!=null?e.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",r),u.Fragment(u.WithProvider(ht,o,t),u.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},le=t=>u.UseProvider(ht,t),Ht=(t,e)=>{if(typeof e=="function")return Ht(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(c=>`Error: ${c}`))),o=e.success,r=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:s=>o(s.$.value),AsyncFailure:s=>n(s.$.error),Loading:s=>r(s.$.previousValue??u.makeSignal(void 0)),NotAsked:i})},ae=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),ue=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),fe=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),me=t=>u.Portal("head > title",u.attr.innerText(t)),de={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 he(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=J[t].get(n.target);o==null||o.set(n.isIntersecting)})},de[t])),I[t]}const $t=(t,e)=>{const n=u.makeProp(!1);return u.Fragment(u.OnElement(o=>{const r=typeof IntersectionObserver<"u"?he(t):null;return J[t].set(o,n),r==null||r.observe(o),()=>{var i;n.dispose(),r==null||r.unobserve(o),J[t].delete(o),J[t].size===0&&((i=I[t])==null||i.disconnect(),I[t]=null)}}),u.renderableOfTNode(e(n)))},pe=(t,e,n)=>$t(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,K=Math.floor,P=t=>({x:t,y:t}),ge={left:"right",right:"left",bottom:"top",top:"bottom"},ye={start:"end",end:"start"};function At(t,e,n){return W(t,G(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function D(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Bt(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function Ut(t){return zt($(t))}function we(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=Ut(t),i=Bt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Z(s)),[s,Z(s)]}function xe(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>ye[e])}function ve(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function be(t,e,n,o){const r=ot(t);let i=ve(D(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(at)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>ge[e])}function Ae(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ee(t){return typeof t!="number"?Ae(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=Ut(e),c=Bt(s),a=D(e),l=i==="y",f=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let d;switch(a){case"top":d={x:f,y:o.y-r.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:m};break;case"left":d={x:o.x-r.width,y:m};break;default:d={x:o.x,y:o.y}}switch(ot(e)){case"start":d[s]-=h*(n&&l?-1:1);break;case"end":d[s]+=h*(n&&l?-1:1);break}return d}const Re=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:m}=Et(l,o,a),h=o,d={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:p}=c[y],{x,y:v,data:A,reset:b}=await p({x:f,y:m,initialPlacement:o,placement:h,strategy:r,middlewareData:d,rects:l,platform:s,elements:{reference:t,floating:e}});f=x??f,m=v??m,d={...d,[w]:{...d[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:f,y:m}=Et(l,h,a)),y=-1)}return{x:f,y:m,placement:h,strategy:r,middlewareData:d}};async function _t(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:h=!1,padding:d=0}=nt(e,t),g=Ee(d),w=c[h?m==="floating"?"reference":"floating":m],p=tt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:a})),x=m==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:a}):x);return{top:(p.top-b.top+g.top)/A.y,bottom:(b.bottom-p.bottom+g.bottom)/A.y,left:(p.left-b.left+g.left)/A.x,right:(b.right-p.right+g.right)/A.x}}const Oe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const p=D(r),x=$(c),v=D(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=h||(v||!y?[Z(c)]:xe(c)),V=g!=="none";!h&&V&&b.push(...be(c,y,g,A));const ee=[c,...b],ct=await _t(e,w),X=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&X.push(ct[p]),m){const F=we(r,s,A);X.push(ct[F[0]],ct[F[1]])}if(U=[...U,{placement:r,overflows:X}],!X.every(F=>F<=0)){var wt,xt;const F=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=ee[F];if(bt)return{data:{index:F,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,k)=>N.overflows[1]-k.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(d){case"bestFit":{var vt;const N=(vt=U.filter(k=>{if(V){const S=$(k.placement);return S===x||S==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(S=>S>0).reduce((S,ne)=>S+ne,0)]).sort((k,S)=>k[1]-S[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Le(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=D(n),c=ot(n),a=$(n)==="y",l=["left","top"].includes(s)?-1:1,f=i&&a?-1:1,m=nt(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof g=="number"&&(d=c==="end"?g*-1:g),a?{x:d*f,y:h*l}:{x:h*l,y:d*f}}const Te=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,a=await Le(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},ke=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:p,y:x}=w;return{x:p,y:x}}},...a}=nt(t,e),l={x:n,y:o},f=await _t(e,a),m=$(D(r)),h=zt(m);let d=l[h],g=l[m];if(i){const w=h==="y"?"top":"left",p=h==="y"?"bottom":"right",x=d+f[w],v=d-f[p];d=At(x,d,v)}if(s){const w=m==="y"?"top":"left",p=m==="y"?"bottom":"right",x=g+f[w],v=g-f[p];g=At(x,g,v)}const y=c.fn({...e,[h]:d,[m]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[h]:i,[m]:s}}}}}};function rt(){return typeof window<"u"}function B(t){return It(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function T(t){var e;return(e=(It(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function It(t){return rt()?t instanceof Node||t instanceof E(t).Node:!1}function R(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function L(t){return rt()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Rt(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=O(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function Se(t){return["table","td","th"].includes(B(t))}function it(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function pt(t){const e=gt(),n=R(t)?O(t):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 Pe(t){let e=C(t);for(;L(e)&&!z(e);){if(pt(e))return e;if(it(e))return null;e=C(e)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function O(t){return E(t).getComputedStyle(t)}function st(t){return R(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Rt(t)&&t.host||T(t);return Rt(e)?e.host:e}function jt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&Y(e)?e:jt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=E(r);if(i){const c=ut(s);return e.concat(s,s.visualViewport||[],Y(r)?r:[],c&&n?j(c):[])}return e.concat(r,j(r,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qt(t){const e=O(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=L(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=Q(n)!==i||Q(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function yt(t){return R(t)?t:t.contextElement}function H(t){const e=yt(t);if(!L(e))return P(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=qt(e);let s=(i?Q(n.width):n.width)/o,c=(i?Q(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Ce=P(0);function Yt(t){const e=E(t);return!gt()||!e.visualViewport?Ce:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Fe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=yt(t);let s=P(1);e&&(o?R(o)&&(s=H(o)):s=H(t));const c=Fe(i,n,o)?Yt(i):P(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,f=r.width/s.x,m=r.height/s.y;if(i){const h=E(i),d=o&&R(o)?E(o):o;let g=h,y=ut(g);for(;y&&o&&d!==g;){const w=H(y),p=y.getBoundingClientRect(),x=O(y),v=p.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=p.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,f*=w.x,m*=w.y,a+=v,l+=A,g=E(y),y=ut(g)}}return tt({width:f,height:m,x:a,y:l})}function We(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=T(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=P(1);const f=P(0),m=L(o);if((m||!m&&!i)&&((B(o)!=="body"||Y(s))&&(a=st(o)),L(o))){const h=M(o);l=H(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+f.x,y:n.y*l.y-a.scrollTop*l.y+f.y}}function De(t){return Array.from(t.getClientRects())}function ft(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(T(t)).left+n}function Me(t){const e=T(t),n=st(t),o=t.ownerDocument.body,r=W(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=W(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ft(t);const c=-n.scrollTop;return O(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Ve(t,e){const n=E(t),o=T(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=gt();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function Ne(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=L(t)?H(t):P(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function Ot(t,e,n){let o;if(e==="viewport")o=Ve(t,n);else if(e==="document")o=Me(T(t));else if(R(e))o=Ne(e,n);else{const r=Yt(t);o={...e,x:e.x-r.x,y:e.y-r.y}}return tt(o)}function Xt(t,e){const n=C(t);return n===e||!R(n)||z(n)?!1:O(n).position==="fixed"||Xt(n,e)}function He(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>R(c)&&B(c)!=="body"),r=null;const i=O(t).position==="fixed";let s=i?C(t):t;for(;R(s)&&!z(s);){const c=O(s),a=pt(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!a&&Xt(t,s))?o=o.filter(f=>f!==s):r=c,s=C(s)}return e.set(t,o),o}function $e(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:He(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,f)=>{const m=Ot(e,f,r);return l.top=W(m.top,l.top),l.right=G(m.right,l.right),l.bottom=G(m.bottom,l.bottom),l.left=W(m.left,l.left),l},Ot(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ze(t){const{width:e,height:n}=qt(t);return{width:e,height:n}}function Be(t,e,n){const o=L(e),r=T(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=P(0);if(o||!o&&!i)if((B(e)!=="body"||Y(r))&&(c=st(e)),o){const d=M(e,!0,i,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else r&&(a.x=ft(r));let l=0,f=0;if(r&&!o&&!i){const d=r.getBoundingClientRect();f=d.top+c.scrollTop,l=d.left+c.scrollLeft-ft(r,d)}const m=s.left+c.scrollLeft-a.x-l,h=s.top+c.scrollTop-a.y-f;return{x:m,y:h,width:s.width,height:s.height}}function lt(t){return O(t).position==="static"}function Lt(t,e){if(!L(t)||O(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return T(t)===n&&(n=n.ownerDocument.body),n}function Kt(t,e){const n=E(t);if(it(t))return n;if(!L(t)){let r=C(t);for(;r&&!z(r);){if(R(r)&&!lt(r))return r;r=C(r)}return n}let o=Lt(t,e);for(;o&&Se(o)&<(o);)o=Lt(o,e);return o&&z(o)&<(o)&&!pt(o)?n:o||Pe(t)||n}const Ue=async function(t){const e=this.getOffsetParent||Kt,n=this.getDimensions,o=await n(t.floating);return{reference:Be(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function _e(t){return O(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:We,getDocumentElement:T,getClippingRect:$e,getOffsetParent:Kt,getElementRects:Ue,getClientRects:De,getDimensions:ze,getScale:H,isElement:R,isRTL:_e};function je(t,e){let n=null,o;const r=T(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:f,width:m,height:h}=t.getBoundingClientRect();if(c||e(),!m||!h)return;const d=K(f),g=K(r.clientWidth-(l+m)),y=K(r.clientHeight-(f+h)),w=K(l),x={rootMargin:-d+"px "+-g+"px "+-y+"px "+-w+"px",threshold:W(0,G(1,a))||1};let v=!0;function A(b){const V=b[0].intersectionRatio;if(V!==a){if(!v)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return s(!0),i}function qe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=yt(t),f=r||i?[...l?j(l):[],...j(e)]:[];f.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const m=l&&c?je(l,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(p=>{let[x]=p;x&&x.target===l&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(e)})),n()}),l&&!a&&d.observe(l),d.observe(e));let g,y=a?M(t):null;a&&w();function w(){const p=M(t);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,g=requestAnimationFrame(w)}return n(),()=>{var p;f.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),m==null||m(),(p=d)==null||p.disconnect(),d=null,a&&cancelAnimationFrame(g)}}const Ye=Te,Xe=ke,Tt=Oe,Ke=(t,e,n)=>{const o=new Map,r={platform:Ie,...n},i={...r.platform,_c:o};return Re(t,e,{...r,platform:i})},Je=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:r}={mainAxis:0,crossAxis:0}})=>u.OnBrowserCtx(i=>{const s=u.Value.toSignal(e),c=i.element;return u.When(s,u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",qe(c,l,()=>{Ke(c,l,{placement:n,strategy:"absolute",middleware:[Tt(),Ye({mainAxis:o,crossAxis:r}),Xe(),Tt()]}).then(({x:f,y:m})=>{l.style.top=`${m}px`,l.style.left=`${f}px`})})}),t())))(i)}),Jt=(t,e)=>{if(typeof e=="function")return Jt(t,{success:e});const n=e.failure??(r=>u.Fragment(u.OnDispose(r.on(console.error)),r.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:r=>o(r.$.value),Failure:r=>n(r.$.error)})},Ge=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),Qe=t=>u.OnBrowserCtx(e=>{const{element:n}=e,o=u.makeProp({width:n.clientWidth,height:n.clientHeight}),r=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(i),s.observe(n)),c=>{s==null||s.disconnect(),r(c)}}),Ze=t=>e=>{const n=u.getWindow(),o=u.makeProp({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),r=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0})};return n==null||n.addEventListener("resize",i),s=>{n==null||n.removeEventListener("resize",i),r(s)}},Gt=(t,e)=>{const n=e.split("/").filter(r=>r!==""),o={};for(let r=0;r<t.length;r++){const i=t[r],s=n[r];if(!s&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==s)return null}else if(i.type==="param")o[i.name]=s;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},Qt=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!==""),Zt=t=>{const e=t.map(n=>{const o=Qt(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Gt(r,o);if(s)return{...s,route:i}}return null}},tn=t=>{const e=Zt(Object.keys(t));return dt(n=>{const o=n.map(r=>{const i=e(r.pathname);if(i==null)throw console.error("No route found for",r),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:r.search,hash:r.hash}});return u.OneOfTuple(o.map(r=>[r.route,r]),t)})},et=60*1e3,mt=60*et,q=24*mt,kt=7*q,St=30*q,en=365*q,nn=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:mt*36,value:mt,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:q*10,value:q,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:kt*6,value:kt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:St*18,value:St,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:en,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Pt(t,e,n,o){const r=Math.round(t/e);return r<=1?n:o.replace("{}",r.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}function te(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of nn)if(e<n.max)return t<0?Pt(e,n.value,n.past.singular,n.past.plural):Pt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const on=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.map(i=>i):u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return te(c)}),r=u.Prop.is(n)?setInterval(()=>n.set(new Date),5e3):void 0;return o.onDispose(()=>{r!=null&&clearInterval(r),n.dispose()}),o};exports.Anchor=Nt;exports.AsyncResultView=Ht;exports.AutoFocus=ae;exports.AutoSelect=ue;exports.ElementSize=Qe;exports.HTMLTitle=me;exports.HiddenWhenEmpty=fe;exports.InViewport=$t;exports.LocationProviderMarker=Dt;exports.PopOver=Je;exports.ProvideAppearance=ce;exports.ProvideLocation=re;exports.ResultView=Jt;exports.Router=tn;exports.SelectOnFocus=Ge;exports.UseAppearance=le;exports.UseLocation=dt;exports.WhenInViewport=pe;exports.WindowSize=Ze;exports._checkExtensionCondition=Ft;exports._getExtension=Ct;exports._makeRouteMatcher=Zt;exports._parseRouteSegments=Qt;exports.appearanceMarker=ht;exports.areLocationsEqual=ie;exports.handleAnchorClick=Wt;exports.locationFromURL=Mt;exports.makeRelativeTime=on;exports.matchesRoute=Gt;exports.setLocationFromUrl=Vt;exports.timeDiffToString=te;exports.urlFromLocation=se;
|
|
1
|
+
"use strict";var se=Object.defineProperty;var ce=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var At=(t,e,n)=>ce(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@tempots/dom"),Dt=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Ft=(t,e)=>{const n=Dt(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},le=(t,e,n,o)=>{let r=t.target;for(;r!=null&&!(r instanceof HTMLAnchorElement);)r=r.parentElement;if(r==null)return!0;const i=r;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:u}=i;if(o){const a=s+c+u,m=i.getAttribute("href");if(!(m!=null&&m.startsWith("#"))&&m!==a)return!0}return e?!1:Ft(n,s)},Wt=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const n=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(o=>o.startsWith(".")?o:"."+o):[];return o=>{le(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Mt=l.makeProviderMark("LocationProvider"),ae=t=>l.Fragment(l.OnBrowserCtx(()=>l.Async(Promise.resolve().then(()=>require("./browser-location-D36kVbd7.cjs")).then(e=>e.ProvideBrowserLocation),e=>e(t))),l.OnHeadlessCtx(e=>l.Async(Promise.resolve().then(()=>require("./headless-location-8Va85S-Q.cjs")).then(n=>n.ProvideHeadlessLocation),n=>n(e.container.currentURL,t)))),mt=t=>l.UseProvider(Mt,e=>n=>{const o=l.makeProp(e.value,e.equals);e.feedProp(o),o.on(e.set);const r=l.renderableOfTNode(t(o))(n);return i=>{o.dispose(),r(i)}}),ue=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Vt=(t,e)=>{var i;const n=new URL(t,e??((i=l.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let r=n.hash;return r.startsWith("#")&&(r=r.substring(1)),{pathname:n.pathname,search:o,hash:r===""?void 0:r}},Nt=(t,e)=>{const n=Vt(e);return t.set(n),t},fe=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Ht=(t,...e)=>{if(typeof t=="string"||l.Signal.is(t))return Ht({href:t},...e);const{href:n,...o}=t;return mt(r=>l.html.a(l.on.click(Wt(()=>(Nt(r,l.Value.get(n)),!0),o)),l.attr.href(n),...e))},dt=l.makeProviderMark("Appearance"),me=t=>{const e=l.getWindow(),n=e!=null&&e.matchMedia!=null&&e.matchMedia("(prefers-color-scheme: dark)").matches,o=l.makeProp(n?"dark":"light"),r=s=>{o.set(s.matches?"dark":"light")},i=e!=null&&e.matchMedia!=null?e.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",r),l.Fragment(l.WithProvider(dt,o,t),l.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},de=t=>l.UseProvider(dt,t),$t=(t,e)=>{if(typeof e=="function")return $t(t,{success:e});const n=e.failure??(s=>l.Fragment(l.OnDispose(s.on(console.error)),s.map(c=>`Error: ${c}`))),o=e.success,r=e.loading??(()=>l.Empty),i=e.notAsked??(()=>l.Empty);return l.OneOfType(l.Value.toSignal(t),{AsyncSuccess:s=>o(s.$.value),AsyncFailure:s=>n(s.$.error),Loading:s=>r(s.$.previousValue??l.makeSignal(void 0)),NotAsked:i})},he=(t=10)=>l.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return l.OnDispose(()=>clearTimeout(n))}),pe=(t=10)=>l.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return l.OnDispose(()=>clearTimeout(n))}),ge=l.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),l.OnDispose(n=>{n&&t.style.setProperty(":empty",e)})}),ye=t=>l.Portal("head > title",l.attr.innerText(t)),we={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 xe(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=J[t].get(n.target);o==null||o.set(n.isIntersecting)})},we[t])),I[t]}const zt=(t,e)=>{const n=l.makeProp(!1);return l.Fragment(l.OnElement(o=>{const r=typeof IntersectionObserver<"u"?xe(t):null;return J[t].set(o,n),r==null||r.observe(o),l.OnDispose(()=>{var i;n.dispose(),r==null||r.unobserve(o),J[t].delete(o),J[t].size===0&&((i=I[t])==null||i.disconnect(),I[t]=null)})}),l.renderableOfTNode(e(n)))},ve=(t,e,n)=>zt(t,o=>l.When(o,e,n??(()=>l.Empty))),G=Math.min,F=Math.max,Q=Math.round,X=Math.floor,k=t=>({x:t,y:t}),be={left:"right",right:"left",bottom:"top",top:"bottom"},Ae={start:"end",end:"start"};function Ot(t,e,n){return F(t,G(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function Bt(t){return t==="x"?"y":"x"}function Ut(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(W(t))?"y":"x"}function _t(t){return Bt($(t))}function Oe(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=_t(t),i=Ut(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Z(s)),[s,Z(s)]}function Ee(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>Ae[e])}function Re(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function ke(t,e,n,o){const r=ot(t);let i=Re(W(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(at)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>be[e])}function Te(t){return{top:0,right:0,bottom:0,left:0,...t}}function Le(t){return typeof t!="number"?Te(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=_t(e),c=Ut(s),u=W(e),a=i==="y",m=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let d;switch(u){case"top":d={x:m,y:o.y-r.height};break;case"bottom":d={x:m,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-r.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ot(e)){case"start":d[s]-=h*(n&&a?-1:1);break;case"end":d[s]+=h*(n&&a?-1:1);break}return d}const Se=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:f}=Et(a,o,u),h=o,d={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:p}=c[y],{x,y:v,data:A,reset:b}=await p({x:m,y:f,initialPlacement:o,placement:h,strategy:r,middlewareData:d,rects:a,platform:s,elements:{reference:t,floating:e}});m=x??m,f=v??f,d={...d,[w]:{...d[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(a=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:m,y:f}=Et(a,h,u)),y=-1)}return{x:m,y:f,placement:h,strategy:r,middlewareData:d}};async function It(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:u}=t,{boundary:a="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=nt(e,t),g=Le(d),w=c[h?f==="floating"?"reference":"floating":f],p=tt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:m,strategy:u})),x=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:u}):x);return{top:(p.top-b.top+g.top)/A.y,bottom:(b.bottom-p.bottom+g.bottom)/A.y,left:(p.left-b.left+g.left)/A.x,right:(b.right-p.right+g.right)/A.x}}const Pe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:u,elements:a}=e,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const p=W(r),x=$(c),v=W(c)===c,A=await(u.isRTL==null?void 0:u.isRTL(a.floating)),b=h||(v||!y?[Z(c)]:Ee(c)),V=g!=="none";!h&&V&&b.push(...ke(c,y,g,A));const re=[c,...b],ct=await It(e,w),K=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(m&&K.push(ct[p]),f){const D=Oe(r,s,A);K.push(ct[D[0]],ct[D[1]])}if(U=[...U,{placement:r,overflows:K}],!K.every(D=>D<=0)){var wt,xt;const D=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=re[D];if(bt)return{data:{index:D,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(d){case"bestFit":{var vt;const N=(vt=U.filter(S=>{if(V){const P=$(S.placement);return P===x||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,ie)=>P+ie,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Ce(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=W(n),c=ot(n),u=$(n)==="y",a=["left","top"].includes(s)?-1:1,m=i&&u?-1:1,f=nt(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(d=c==="end"?g*-1:g),u?{x:d*m,y:h*a}:{x:h*a,y:d*m}}const De=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,u=await Ce(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:i+u.y,data:{...u,placement:s}}}}},Fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:p,y:x}=w;return{x:p,y:x}}},...u}=nt(t,e),a={x:n,y:o},m=await It(e,u),f=$(W(r)),h=Bt(f);let d=a[h],g=a[f];if(i){const w=h==="y"?"top":"left",p=h==="y"?"bottom":"right",x=d+m[w],v=d-m[p];d=Ot(x,d,v)}if(s){const w=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+m[w],v=g-m[p];g=Ot(x,g,v)}const y=c.fn({...e,[h]:d,[f]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[h]:i,[f]:s}}}}}};function rt(){return typeof window<"u"}function B(t){return jt(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jt(t){return rt()?t instanceof Node||t instanceof O(t).Node:!1}function E(t){return rt()?t instanceof Element||t instanceof O(t).Element:!1}function T(t){return rt()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function Rt(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function We(t){return["table","td","th"].includes(B(t))}function it(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function ht(t){const e=pt(),n=E(t)?R(t):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 Me(t){let e=C(t);for(;T(e)&&!z(e);){if(ht(e))return e;if(it(e))return null;e=C(e)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function R(t){return O(t).getComputedStyle(t)}function st(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Rt(t)&&t.host||L(t);return Rt(e)?e.host:e}function qt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&Y(e)?e:qt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=qt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=O(r);if(i){const c=ut(s);return e.concat(s,s.visualViewport||[],Y(r)?r:[],c&&n?j(c):[])}return e.concat(r,j(r,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yt(t){const e=R(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=T(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=Q(n)!==i||Q(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function gt(t){return E(t)?t:t.contextElement}function H(t){const e=gt(t);if(!T(e))return k(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=Yt(e);let s=(i?Q(n.width):n.width)/o,c=(i?Q(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Ve=k(0);function Kt(t){const e=O(t);return!pt()||!e.visualViewport?Ve:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ne(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=gt(t);let s=k(1);e&&(o?E(o)&&(s=H(o)):s=H(t));const c=Ne(i,n,o)?Kt(i):k(0);let u=(r.left+c.x)/s.x,a=(r.top+c.y)/s.y,m=r.width/s.x,f=r.height/s.y;if(i){const h=O(i),d=o&&E(o)?O(o):o;let g=h,y=ut(g);for(;y&&o&&d!==g;){const w=H(y),p=y.getBoundingClientRect(),x=R(y),v=p.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=p.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;u*=w.x,a*=w.y,m*=w.x,f*=w.y,u+=v,a+=A,g=O(y),y=ut(g)}}return tt({width:m,height:f,x:u,y:a})}function yt(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(L(t)).left+n}function Xt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:yt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function He(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=L(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=k(1);const m=k(0),f=T(o);if((f||!f&&!i)&&((B(o)!=="body"||Y(s))&&(u=st(o)),T(o))){const d=M(o);a=H(o),m.x=d.x+o.clientLeft,m.y=d.y+o.clientTop}const h=s&&!f&&!i?Xt(s,u,!0):k(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+m.x+h.x,y:n.y*a.y-u.scrollTop*a.y+m.y+h.y}}function $e(t){return Array.from(t.getClientRects())}function ze(t){const e=L(t),n=st(t),o=t.ownerDocument.body,r=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+yt(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(s+=F(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Be(t,e){const n=O(t),o=L(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,u=0;if(r){i=r.width,s=r.height;const a=pt();(!a||a&&e==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}return{width:i,height:s,x:c,y:u}}function Ue(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=T(t)?H(t):k(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,u=r*i.x,a=o*i.y;return{width:s,height:c,x:u,y:a}}function kt(t,e,n){let o;if(e==="viewport")o=Be(t,n);else if(e==="document")o=ze(L(t));else if(E(e))o=Ue(e,n);else{const r=Kt(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return tt(o)}function Jt(t,e){const n=C(t);return n===e||!E(n)||z(n)?!1:R(n).position==="fixed"||Jt(n,e)}function _e(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>E(c)&&B(c)!=="body"),r=null;const i=R(t).position==="fixed";let s=i?C(t):t;for(;E(s)&&!z(s);){const c=R(s),u=ht(s);!u&&c.position==="fixed"&&(r=null),(i?!u&&!r:!u&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!u&&Jt(t,s))?o=o.filter(m=>m!==s):r=c,s=C(s)}return e.set(t,o),o}function Ie(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:_e(e,this._c):[].concat(n),o],c=s[0],u=s.reduce((a,m)=>{const f=kt(e,m,r);return a.top=F(f.top,a.top),a.right=G(f.right,a.right),a.bottom=G(f.bottom,a.bottom),a.left=F(f.left,a.left),a},kt(e,c,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function je(t){const{width:e,height:n}=Yt(t);return{width:e,height:n}}function qe(t,e,n){const o=T(e),r=L(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const u=k(0);if(o||!o&&!i)if((B(e)!=="body"||Y(r))&&(c=st(e)),o){const h=M(e,!0,i,e);u.x=h.x+e.clientLeft,u.y=h.y+e.clientTop}else r&&(u.x=yt(r));const a=r&&!o&&!i?Xt(r,c):k(0),m=s.left+c.scrollLeft-u.x-a.x,f=s.top+c.scrollTop-u.y-a.y;return{x:m,y:f,width:s.width,height:s.height}}function lt(t){return R(t).position==="static"}function Tt(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function Gt(t,e){const n=O(t);if(it(t))return n;if(!T(t)){let r=C(t);for(;r&&!z(r);){if(E(r)&&!lt(r))return r;r=C(r)}return n}let o=Tt(t,e);for(;o&&We(o)&<(o);)o=Tt(o,e);return o&&z(o)&<(o)&&!ht(o)?n:o||Me(t)||n}const Ye=async function(t){const e=this.getOffsetParent||Gt,n=this.getDimensions,o=await n(t.floating);return{reference:qe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ke(t){return R(t).direction==="rtl"}const Xe={convertOffsetParentRelativeRectToViewportRelativeRect:He,getDocumentElement:L,getClippingRect:Ie,getOffsetParent:Gt,getElementRects:Ye,getClientRects:$e,getDimensions:je,getScale:H,isElement:E,isRTL:Ke};function Je(t,e){let n=null,o;const r=L(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),i();const{left:a,top:m,width:f,height:h}=t.getBoundingClientRect();if(c||e(),!f||!h)return;const d=X(m),g=X(r.clientWidth-(a+f)),y=X(r.clientHeight-(m+h)),w=X(a),x={rootMargin:-d+"px "+-g+"px "+-y+"px "+-w+"px",threshold:F(0,G(1,u))||1};let v=!0;function A(b){const V=b[0].intersectionRatio;if(V!==u){if(!v)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return s(!0),i}function Ge(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,a=gt(t),m=r||i?[...a?j(a):[],...j(e)]:[];m.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const f=a&&c?Je(a,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(p=>{let[x]=p;x&&x.target===a&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(e)})),n()}),a&&!u&&d.observe(a),d.observe(e));let g,y=u?M(t):null;u&&w();function w(){const p=M(t);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,g=requestAnimationFrame(w)}return n(),()=>{var p;m.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(p=d)==null||p.disconnect(),d=null,u&&cancelAnimationFrame(g)}}const Qe=De,Ze=Fe,Lt=Pe,tn=(t,e,n)=>{const o=new Map,r={platform:Xe,...n},i={...r.platform,_c:o};return Se(t,e,{...r,platform:i})},en=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:r}={mainAxis:0,crossAxis:0}})=>l.OnBrowserCtx(i=>{const s=l.Value.toSignal(e),c=i.element;return l.When(s,()=>l.Portal("body",l.html.div(l.OnElement(u=>{const a=u;return a.style.position="absolute",l.OnDispose(Ge(c,a,()=>{tn(c,a,{placement:n,strategy:"absolute",middleware:[Lt(),Qe({mainAxis:o,crossAxis:r}),Ze(),Lt()]}).then(({x:m,y:f})=>{a.style.top=`${f}px`,a.style.left=`${m}px`})}))}),t())))}),Qt=(t,e)=>{if(typeof e=="function")return Qt(t,{success:e});const n=e.failure??(r=>l.Fragment(l.OnDispose(r.on(console.error)),r.map(i=>`Error: ${i}`))),o=e.success;return l.OneOfType(l.Value.toSignal(t),{Success:r=>o(r.$.value),Failure:r=>n(r.$.error)})},nn=()=>l.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),on=t=>l.OnBrowserCtx(e=>{const{element:n}=e,o=l.makeProp({width:n.clientWidth,height:n.clientHeight}),r=l.renderableOfTNode(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(i),s.observe(n)),l.OnDispose(c=>{s==null||s.disconnect(),r(c)})}),rn=t=>e=>{const n=l.getWindow(),o=l.makeProp({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),r=l.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0})};return n==null||n.addEventListener("resize",i),s=>{n==null||n.removeEventListener("resize",i),r(s)}},Zt=(t,e)=>{const n=e.split("/").filter(r=>r!==""),o={};for(let r=0;r<t.length;r++){const i=t[r],s=n[r];if(!s&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==s)return null}else if(i.type==="param")o[i.name]=s;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},te=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!==""),ee=t=>{const e=t.map(n=>{const o=te(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Zt(r,o);if(s)return{...s,route:i}}return null}},sn=t=>{const e=ee(Object.keys(t));return mt(n=>{const o=n.map(r=>{const i=e(r.pathname);if(i==null)throw console.error("No route found for",r),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:r.search,hash:r.hash}});return l.OneOfTuple(o.map(r=>[r.route,r]),t)})},et=60*1e3,ft=60*et,q=24*ft,St=7*q,Pt=30*q,cn=365*q,ln=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:ft*36,value:ft,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:q*10,value:q,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:St*6,value:St,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:Pt*18,value:Pt,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:cn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Ct(t,e,n,o){const r=Math.round(t/e);return r<=1?n:o.replace("{}",r.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}function ne(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of ln)if(e<n.max)return t<0?Ct(e,n.value,n.past.singular,n.past.plural):Ct(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const an=(t,e)=>{const n=e!=null?l.Signal.is(e)?e.derive():l.makeProp(e):l.makeProp(new Date),o=l.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return ne(c)}),r=l.Prop.is(n)?setInterval(()=>n.set(new Date),5e3):void 0;return o.onDispose(()=>{r!=null&&clearInterval(r),n.dispose()}),o};class oe extends l.Prop{constructor(){super(...arguments);At(this,"tick",()=>this.update(n=>n+1))}}const un=(t=0)=>new oe(t,(e,n)=>e===n);exports.Anchor=Ht;exports.AsyncResultView=$t;exports.AutoFocus=he;exports.AutoSelect=pe;exports.ElementSize=on;exports.HTMLTitle=ye;exports.HiddenWhenEmpty=ge;exports.InViewport=zt;exports.LocationProviderMarker=Mt;exports.PopOver=en;exports.ProvideAppearance=me;exports.ProvideLocation=ae;exports.ResultView=Qt;exports.Router=sn;exports.SelectOnFocus=nn;exports.Ticker=oe;exports.UseAppearance=de;exports.UseLocation=mt;exports.WhenInViewport=ve;exports.WindowSize=rn;exports._checkExtensionCondition=Ft;exports._getExtension=Dt;exports._makeRouteMatcher=ee;exports._parseRouteSegments=te;exports.appearanceMarker=dt;exports.areLocationsEqual=ue;exports.handleAnchorClick=Wt;exports.locationFromURL=Vt;exports.makeRelativeTime=an;exports.makeTicker=un;exports.matchesRoute=Zt;exports.setLocationFromUrl=Nt;exports.timeDiffToString=ne;exports.urlFromLocation=fe;
|
package/index.d.ts
CHANGED