@deslop/deploy 0.1.1376 → 0.1.1465
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/README.md +1 -3
- package/dist/client/assets/(home)-BUkZA3Ko.js +64 -0
- package/dist/client/assets/{dropdown-menu-DqkM3lC3.js → dropdown-menu-ROEPp4i3.js} +1 -1
- package/dist/client/assets/effect-CctX5eYK.js +17 -0
- package/dist/client/assets/index-XCoju4PZ.css +2 -0
- package/dist/client/assets/index-crHnIFMU.js +2 -0
- package/dist/client/assets/machine-DhN8aM5V.js +2 -0
- package/dist/client/assets/result-error-CZELhOVc.js +1 -0
- package/dist/client/assets/route-BFKMg8pb.js +1 -0
- package/dist/client/index.html +4 -4
- package/dist/server.js +978 -2017
- package/package.json +2 -4
- package/dist/client/assets/(home)-U53G7W8r.js +0 -64
- package/dist/client/assets/effect-B7YZ9Uvm.js +0 -17
- package/dist/client/assets/fleet-BQuXWvFk.js +0 -2
- package/dist/client/assets/index-C9AYaRrI.css +0 -2
- package/dist/client/assets/index-Dc2sgVrG.js +0 -2
- package/dist/client/assets/result-error-zC_Q_JCZ.js +0 -1
- package/dist/client/assets/route-DvuKcY4q.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,i as n,o as r,r as i}from"./react-CS2OHYTO.js";import{$ as a,$r as o,Aa as s,Ai as c,An as l,Ar as u,At as d,B as f,Ba as p,Bn as m,Br as h,Bt as g,C as _,Ca as v,Ci as y,Cn as b,Cr as x,Ct as S,D as C,Da as w,Dn as ee,Dr as te,Dt as T,E as ne,Ei as re,Er as ie,Et as ae,F as oe,Fa as se,Fn as ce,Ft as le,G as ue,Ga as de,Gn as fe,Gt as E,H as pe,Ha as me,Ht as he,Ia as ge,Ii as _e,In as ve,It as ye,J as be,Jt as xe,K as Se,Kn as Ce,Kt as we,L as Te,La as Ee,Ln as De,Lr as Oe,Lt as ke,Mi as Ae,Mn as je,Mr as Me,Na as Ne,Nn as Pe,Nr as Fe,Nt as Ie,O as Le,Oa as Re,On as ze,Or as Be,Ot as D,Pa as Ve,Pn as He,Pt as Ue,Q as We,Qn as Ge,R as Ke,Rn as qe,Rt as Je,S as Ye,Sa as Xe,Si as Ze,Sn as Qe,Sr as $e,St as O,T as et,Ti as tt,Tn as nt,Tr as rt,Tt as it,U as at,Ua as ot,V as st,Va as k,Vi as ct,Vn as lt,Vt as ut,Wa as dt,Wn as ft,Wr as pt,Wt as mt,Xn as ht,Xt as gt,Yt as A,Z as _t,Zn as vt,Zt as yt,_ as bt,_i as xt,_n as St,_r as Ct,_t as wt,a as Tt,ai as Et,ao as Dt,ar as Ot,at as j,b as kt,bi as At,br as M,bt as N,c as jt,ci as Mt,cr as Nt,ct as Pt,d as Ft,di as It,dn as Lt,dr as Rt,dt as P,er as zt,f as Bt,fi as Vt,ft as F,g as Ht,gi as Ut,gt as I,h as Wt,hi as Gt,ht as Kt,i as qt,ii as Jt,io as Yt,ir as Xt,it as L,ja as Zt,ji as Qt,jr as $t,ka as en,kn as tn,kr as nn,kt as R,l as rn,la as an,li as on,ln as sn,lr as cn,lt as ln,m as un,mi as dn,mr as fn,mt as pn,n as mn,ni as hn,nr as gn,o as _n,oi as vn,oo as z,or as yn,ot as bn,p as xn,pi as Sn,pr as Cn,pt as B,q as wn,qi as Tn,qn as En,qt as Dn,r as On,ri as kn,ro as An,rr as jn,s as Mn,si as Nn,sr as Pn,st as Fn,t as In,tr as Ln,u as Rn,ui as zn,ut as Bn,v as Vn,vi as Hn,vn as Un,vr as V,vt as Wn,w as Gn,wa as Kn,wn as qn,wt as Jn,x as Yn,xr as Xn,xt as Zn,y as Qn,yr as $n,yt as er,z as tr,zn as nr,zt as rr}from"./effect-CctX5eYK.js";import{l as ir,r as ar,t as or,z as sr}from"./dist-Cnz9vY_S.js";var H=e(r(),1),cr=e(n(),1);function lr(e){let t=cr.unstable_scheduleCallback(4,e);return()=>cr.unstable_cancelCallback(t)}var ur=H.createContext(be({scheduleTask:lr,defaultIdleTTL:400})),dr=new WeakMap,fr=0,pr=new Set;function mr(e){fr++;try{return e()}finally{fr--}}function hr(e){if(fr===0)return e();pr.size===0&&queueMicrotask(gr),pr.add(e)}function gr(){for(let e of pr)pr.delete(e),e()}function _r(e,t){let n=dr.get(e);n===void 0&&(n=new WeakMap,dr.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>hr(n));return()=>{i--,pr.delete(n),r()}},snapshot(){return mr(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:mr(()=>st(t,e))}),a.value}};return n.set(t,o),o}function vr(e,t){let n=_r(e,t);return H.useEffect(gr),H.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function yr(e,t,n){let r=_r(e,t),i=H.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return H.useEffect(gr),H.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var br=(e,t)=>{let n=H.useContext(ur);return t?yr(n,e,t):vr(n,e)};function xr(e,t){H.useEffect(()=>e.mount(t),[t,e])}function Sr(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?H.useCallback(r=>{e.set(t,r);let i=Cn(wn(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(Cr):i},[e,t,n.mode]):H.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var Cr=e=>{if(Sn(e))return e.value;throw Hn(e.cause)},wr=e=>{xr(H.useContext(ur),e)},Tr=(e,t)=>{let n=H.useContext(ur);return xr(n,e),Sr(n,e,t)},Er=e=>{let t=H.useContext(ur);return xr(t,e),H.useCallback(()=>{t.refresh(e)},[t,e])},Dr=(e,t)=>{let n=H.useContext(ur);return[vr(n,e),Sr(n,e,t)]},Or={suspendOnWaiting:new WeakMap,default:new WeakMap};function kr(e,t,n){let r=n?Or.suspendOnWaiting:Or.default,i=r.get(e);i===void 0&&(i=new WeakMap,r.set(e,i));let a=i.get(t);return a===void 0&&(a=new Promise(r=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),r(),i.delete(t))})}),i.set(t,a)),a}function Ar(e,t,n){let r=vr(e,t);if(r._tag===`Initial`||n&&r.waiting)throw kr(e,t,n);return r}var jr=(e,t)=>{let n=Ar(H.useContext(ur),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw Hn(n.cause);return n},U=i(),Mr=class extends H.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?H.createElement(this.props.errorComponent??Nr,{error:e[0],reset:this.reset}):this.props.children}};function Nr({error:e}){let[t,n]=H.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}var Pr=H.createContext(null);function Fr(e){return H.useContext(Pr)}function W(e){return e[e.length-1]}function Ir(e,t){return typeof e==`function`?e(t):e}var Lr=Object.prototype.hasOwnProperty;function Rr(e){for(let t in e)if(Lr.call(e,t))return!0;return!1}var zr=()=>Object.create(null),Br=(e,t)=>G(e,t,!0);function G(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(Vr(e)&&Vr(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&W(a)!==`${o-1}`||c&&W(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?G(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?G(d,o,n,r):o,i&&=u===d&&(a[l]===f||Lr.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?zr():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?G(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function Vr(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function Hr(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!Hr(a,o,n,r))return!1}return!0}if(Vr(e)&&Vr(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!Hr(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!Hr(e[a],t[a],n,r)))return!1;return i===0}return!1}function Ur(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var Wr=/[\x00-\x1f\x7f"<>`{}]/g;function Gr(e){return e.replace(Wr,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function Kr(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Gr(t)}var qr=[`http:`,`https:`,`mailto:`,`tel:`];function Jr(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var Yr=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Xr(e,t){if(!e)return!1;if(Yr.test(e))return!0;let n=Jr(e);return n?!t.has(n):!1}function Zr(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=Kr(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=Kr(r?e.slice(r):e)}return t}function Qr(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function $r(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ei(){throw Error(`Invariant failed`)}function ti(e){return e.replace(/\/{2,}/g,`/`)}function ni(e){return e===`/`?e:e.replace(/^\/+/,``)}function K(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function ri(e){return K(ni(e))}function ii(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ai(e,t,n=`never`,r){if(t.includes(`//`)&&(t=ti(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=ti(e)),o=e.split(`/`);o.length>1&&W(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(W(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?ti(s):s)||`/`;return a&&r&&r.set(a,c),c}function oi(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function si(e){return e==null||e===``}function ci(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function li(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&si(f)){if(c===`/`&&!d)continue;f=``}o+=c+ci(s,f,r)+(d||``)}}return o+a||`/`}function ui(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function di(e){return e?.isNotFound===!0}function fi(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function pi(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function mi(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=pi(r):Array.isArray(t)?t.push(pi(r)):n[e]=[t,pi(r)]}return n}var hi=/^(?:\s|["[{\d-]|fa|nu|tr)/,gi=vi(JSON.parse),_i=yi(JSON.stringify,JSON.parse);function vi(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=mi(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!hi.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function yi(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!hi.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=fi(e,r);return t?`?${t}`:``}}var bi=`__root__`;function xi(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Si(e){return e instanceof Response&&!!e.options}function Ci(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var q=4,wi=5;function Ti(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Ei(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function Di(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=W(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Ei(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=ki(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=ki(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=ki(r,wi);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=ki(r,q);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function Oi(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ki(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ai(e,t){let n=ki(),r=[];function i(e,t,n,a){let[o,s,c]=Di(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Oi);t.masksTree=n,t.flatCache=Ci(1e3)}function ji(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Fi(e,t.masksTree);return t.flatCache.set(e,r),r}function Mi(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=ki(),Di(t,{from:e},1,o),i.singleCache.set(a,o)),Fi(r,o,n)}function Ni(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Fi(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Li(a.route)),t.matchCache.set(r,a),a}function Pi(e,t=!1){let n=ki(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&ei(),i[e.id]=e,o!==0&&e.path){let t=K(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Di(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Oi);return{processedTree:{segmentTree:n,singleCache:Ci(1e3),matchCache:Ci(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Fi(e,t,n=!1){let r=e.split(`/`),i=zi(e,r,t,n);if(!i)return null;let[a]=Ii(e,r,i);return{route:i.node.route,rawParams:a}}function Ii(e,t,n){let r=Ri(n.node),i=n.node.data&&Ti(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===q)break;if(u.kind===wi){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Li(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ri(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function zi(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!W(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Ui(l,n))continue;if(i.parse){if(!Hi(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==q&&Ui(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===q||i.kind===2)&&Ui(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Hi(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Vi(f,o))return n;Ui(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Bi(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Bi(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Bi(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Bi(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Bi(e,t){return 2**(e-t-1)}function Vi(e,t){return e===2**(t-1)-1}function Hi(e,t,n){let r,i;try{[r,i]=Ii(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Ui(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===q)>(e.node.kind===q)||t.node.kind===q==(e.node.kind===q)&&t.node.depth>e.node.depth)))}function Wi(){try{return sessionStorage}catch{return}}var Gi=`tsr-scroll-restoration-v1_3`,Ki=Wi();function qi(){try{return JSON.parse(Ki?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Ji=qi(),Yi=`data-scroll-restoration-id`,Xi=e=>e.state.__TSR_key||e.href;function Zi(e){let t=e.getAttribute(Yi);if(t)return`[${Yi}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Qi=!1,$i=`window`;function ea(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function ta(e){let t=new Set;for(let n of e){if(n===$i)continue;let e=ea(n);e&&t.add(e)}return t}function na(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Xi,a=new Set,o=e=>{let t=Ji[e]||={};for(let e of a)e===document?t[$i]={scrollX,scrollY}:e.isConnected&&(t[Zi(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Qi=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Qi||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Ki?.setItem(Gi,JSON.stringify(Ji))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),r.r||(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Ji[d];if(e){let t=Ji[u];for(let n in e){if(n===$i){if(s)continue}else{let e=ea(n);if(!e||s&&o&&(l??=ta(o),l.has(e)))continue}t||=Ji[u]={},t[n]??=e[n]}}}Qi=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=ta(o));let t=e&&i&&c,s=r.e?Ji[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===$i){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=ea(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Qi=!1}}))}function ra(e,t,n){let r=ri(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=ti(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>ia(n,s.input({url:e})),output:({url:e})=>s.output({url:aa(n,e)})}:s}function ia(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function aa(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function oa(e){let t=e;return{get(){return t},set(e){t=Ir(e,t)}}}function sa(e){return{get(){return e()}}}function ca(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{$r(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var la=`__TSR_index`,ua=`popstate`,da=`beforeunload`,fa=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function pa(e){let t=fa.exec(e);return t?`/`+e.slice(t[0].length):e}function ma(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
+
\r`.includes(e)?``:encodeURIComponent(e))),pa(e)}function ha(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=va(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[la];i=ga(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[la];i=ga(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[la]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function ga(e,t){let n=ya();return{...t,key:n,__TSR_key:n,[la]:e}}function _a(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>ma(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>va(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ya();t.history.replaceState({[la]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=va(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[la]-l.state[la],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=ha({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(da,x,{capture:!0}),t.removeEventListener(ua,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(da,x,{capture:!0}),t.addEventListener(ua,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function va(e,t){let n=ma(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=ya();t={[la]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function ya(){return(Math.random()+1).toString(36).slice(7)}function ba(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function xa(e){return e.pathname+e.search+e.hash}function Sa(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Ca(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function wa({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ta(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ea(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Da=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:_a()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&ri(n)?ra(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ca(this.latestLocation,e),na(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Pi(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Ai(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Ci(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Zr(e),external:!1,searchStr:o,search:Br(t?.search,i),hash:Zr(r.slice(1)),state:G(t?.state,a)}}let o=ia(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:Zr(pa(o.pathname)),external:!!this.rewrite&&ba(o,this.origin),searchStr:c,search:Br(t?.search,s),hash:Zr(o.hash.slice(1)),state:G(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Ni(K(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=va(n.href,{});n={...n,to:ia(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=ai(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[K(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Li(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Di(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Ma(n.params,e),!Rr(p))break;p===e&&(p=Object.assign(zr(),p));try{Object.assign(p,t(p))}catch{}}}p??=Ma(n.params,Na(n.params,f)?o()[3]:Pa);let m=e.leaveParams?c:pa(Zr(f?li(c,f,p,this.pathParamsDecoder):c)),h=Fa(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,ja(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Ia(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Pa,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Pa,S=`${m}${v}${b}`,C,w,ee=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=aa(this.rewrite,e);C=xa(e),ba(n,t)?(w=n.href,ee=!0):w=pa(xa(n))}else C=Qr(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=ji(r.pathname,this.processedTree);if(t){let i=Object.assign(zr(),t.rawParams),{from:a,params:o,...s}=t.route,c=Ma(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Oa(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=K(this.latestLocation.href)===K(n.href)&&Hr(wa(n.state),wa(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?Jr(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Oa(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await To(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Ca(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Sa(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(Yr.test(n)||(r=Jr(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:ba(e,this.origin)||(n=xa(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Va,this.preloadRoute=e=>Eo(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?ai(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Mi(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Hr(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Hr(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=oi(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??_i,parseSearch:e.parseSearch??gi,protocolAllowlist:e.protocolAllowlist??qr}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Di(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:K(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?La(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=ja(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof ka||(r=new ka(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=zr(),_=i._interpolation?li(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{Ra(i,d)}catch(e){if(x=di(e)||Si(e)?e:new Aa(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:Br(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Sa(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?Br(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?G(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?Br(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=W(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=W(a),c={...e.search};for(let e of a)try{Object.assign(c,ja(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Ra(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function Oa(e,t,{replace:n,ignoreBlocker:r}){if(!Xr(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var ka=class extends Error{},Aa=class extends Error{};function ja(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new ka(`Async validation not supported`);if(n.issues)throw new ka(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Ma(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Na(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!Lr.call(e,t[1]))}var Pa=Object.freeze({});function Fa(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=ja(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Ia(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Ir(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function La(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return bi}function Ra(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function za(e,t){return e.options[t]?.preload?.()}function Ba(e,t){let n=za(e,`component`),r=za(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Va(e,t,n){let r=()=>t===!1?void 0:t?za(e,t):Ba(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Ha(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Ua(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var J=0,Y=1,Wa=2,X=3,Ga=[4];function Ka(e){return typeof e[0]==`number`}function qa(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function Ja(e,t){return e.routesById[t.routeId]}function Ya(e,t,n){return Si(e)?[X,e]:di(e)?(e.routeId||=n,[Wa,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Y,e]):[J,e]}function Xa(e,t){let n=Ya(t,!0,e.id);if(n[0]!==Y)return n;try{e.options.onError?.(n[1])}catch(t){n=Ya(t,!0,e.id)}return n}function Za(e,t,n,r,i){return i[0].signal.aborted?Ga:fo(e,t,n,Xa(n,r),i)}async function Qa(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Ja(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Z(e,r),[i,Za(e,t,u,a,n)]}if(c.aborted)return[i,Ga];let p=r.paramsError??r.searchError;if(p!==void 0)return Z(e,r),[i,Za(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{to(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?qa(a,c):a);if(c.aborted)return[i,Ga];let s=fo(e,t,u,Ya(o,!1,u.id),n);if(s[0]!==J)return Z(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Z(e,r),[i,Za(e,t,u,a,n)]}finally{r.status=h,to(e,r,!1,n[0])}}i()}function $a(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Z(e,t){let n=t._flight;t._flight=void 0,$a(e,t,n)?.abort()}function Q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=$a(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function eo(e){for(let t of e){let e=t._flight;e&&e[2]++}}function to(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function no(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function ro(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Ga;if(!i)return[J,void 0];let l=n._flight;to(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(no(e,t,n,r,s,a,!!o[3]))).then(e=>Ya(e,!1,r.id),e=>Ya(e,!0,r.id)).then(t=>(t[0]!==J&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Y&&l[2]?Xa(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],fo(e,t,r,await qa(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Z(e,n),Ga}finally{to(e,n,!1,s)}}function io(e,t,n){t[0]!==X&&(e.status=`success`,e.error=void 0,t[0]===J?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function ao(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Z(e,r)}function oo(e,t){return t[0]===Y||t[0]===Wa?{...e,status:t[0]===Y?`error`:`notFound`,error:t[1],_flight:void 0}:e}function so(e,t,n,r,i,a,o){let s=t[1][n],c=Ja(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(no(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Ga)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Z(e,s),p=Za(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,$a(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?ro(e,t,s,c,g,i,a).then(t=>(io(s,t,l),t[0]===J&&(m&&!a[0].signal.aborted&&ao(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[J,s.loaderData]),ee=(async()=>{try{let e=Va(c,void 0,C);e&&await qa(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Za(e,t,c,r,a)]}let r=await w;x&&r[0]===J&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,ee]),!y)return w.then(e=>oo(s,e));let te={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let T=ro(e,t,te,c,g,i,a).then(e=>(s.isFetching=!1,io(te,e,!1),e));return(t[2]??=[]).push([n,T,ee,te]),T.then(e=>oo(te,e))}async function co(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Ja(e,t[n]);try{let e=Va(i,!1);e&&await qa(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function lo(e,t){t[2]&&=(Q(e,t[2].map(e=>e[3])),void 0)}async function uo(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=X)throw[a,t];!i&&t[0]!==J&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===X)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function fo(e,t,n,r,i,a){for(;r[0]===X;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[X,t]:[X,t,a]}return[X,o,n]}catch(e){r=a?[Y,e]:Xa(n,e),a=!0}}return r}async function po(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Wa?co(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=X)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==J&&t[0]<X&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=X){let n=s[1];if(n[0]!==X||n[1].options.reloadDocument||n[2])return lo(e,t),n;c=!0,s=[0,[Y,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Y?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Ja(e,u);try{await qa(i?Promise.resolve().then(()=>Va(m,l===Y?`errorComponent`:`notFoundComponent`)):Promise.all([Va(m),Va(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return lo(e,t),Ga}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),lo(e,t),Q(e,o),p()):u.status=`success`}return t}async function mo(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Ja(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await qa(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function ho(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await co(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=so(e,i,t,u,f,r,l)},m=await Qa(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Wa){let t=await co(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=X&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=po(e,i,u,r[0],uo(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=uo(i[2],void 0,void 0,h.then(e=>Ka(e)?0:Ha(n).length,()=>0))),o=await h}catch(t){if(lo(e,i),t===a&&a.aborted)return Ga;throw t}return Ka(o)?o:mo(e,o,a,r[6]===n.length?r[6]:0)}function go(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Ja(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>go(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function _o(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function vo(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Ha(t[3]).some(e=>e.id===n[1]))return;let i;try{await qa(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function yo(e,t){e._committed=t,e.stores.setMatches(t)}function bo(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Ha(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Ja(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Ta(n);yo(e,n),Q(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ea(e,i,n,a,l,t)}async function xo(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function So(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Co(e,t,n,r,i){let a=n.map(e=>({...e}));eo(a);for(let t of r)Z(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await po(e,o,r,t[0],i)}catch(t){throw Q(e,a),t}if(Ka(s))Q(e,a),s[0]===X&&e._tx===t&&e._committed===n&&await So(e,t,s);else if(await mo(e,s,t[0].signal),e._tx!==t||e._committed!==n)Q(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Z(e,n))}yo(e,a),Q(e,n,a)}}async function wo(e,t,n,r,i,a){let o=await ho(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Ka(o)){let n=o[0]===X&&e._tx===t;if((!n||o[1].options.reloadDocument)&&_o(e,t),Q(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){_o(e,t);return}await So(e,t,o);return}let s=o[1];if(e._tx===t&&await vo(e,t),e._tx!==t){_o(e,t),Q(e,s),lo(e,o);return}let c=t[2],l=Ca(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await vo(e,t),e._tx!==t){_o(e,t),Q(e,s),lo(e,o);return}let n=await e.startTransition(()=>{_o(e,t),bo(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&Co(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):lo(e,o)})}async function To(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Ca(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await xo(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});eo(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Q(e,m),await xo(e,n);return}e._preflight=void 0;let g,_=()=>wo(e,y,f,()=>go(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>xo(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&to(e,t,!1)}n[0].abort(),Q(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&go(e,y),g?.(_()),await y[5]):(Q(e,y[3]),y[3]=[],g?.(),await xo(e,y))}async function Eo(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),eo(a),o=(e._preloads??=new Map).set(i,a),s=await ho(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Q(e,a)),i.abort()}if(!Ka(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){di(e)||console.error(e);return}}}function Do(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Ua(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var Oo=H.createContext(void 0),ko=H.createContext(void 0),Ao=sr();function jo(e,t){return e===t}function Mo(e,t=e=>e,n){let r=n?.compare??jo,i=(0,H.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,H.useCallback)(()=>e.get(),[e]);return(0,Ao.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var No=t(),$=class extends Jn()(`AuthError`,{cause:g(Pt()),error:ut(I([`access_denied`,`temporarily_unavailable`])),message:O}){get name(){return this.error===`temporarily_unavailable`?`AuthUnavailable`:`AuthError`}},Po=z(wt,D(`UserId`));function Fo(e){return p(h(/^github:([1-9]\d*)$/u)(e),()=>`https://avatars.githubusercontent.com/u/${pt(7)(e)}?s=96`)}var Io=z(B,D(`GitHubId`));z(F,R(Io));var Lo=S({admin:j,id:Po,name:wt});v()(`@deslop/runtime/shared/auth/CurrentAdmin`);var Ro=class extends qt()(`@deslop/runtime/shared/auth/RpcAdmin`,{error:$}){};S({address:N(wt),onBehalfOf:N(Po),session:N(wt)}),Po.make(`github:0`);function zo(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}vt(function*(e){let t=new URL(e).searchParams,n=t.get(`error`);return n===null?yield*d(wt)(t.get(`session`)):yield*$.make({message:n})});function Bo(e){return Ue($)(e)&&e.error===void 0}function Vo(e){return Ue($)(e)&&e.error!==`temporarily_unavailable`}function Ho(e){return t=>z(t,x(`10 seconds`),Pn(t=>Ue($)(t)?t:$.make({cause:t,error:`temporarily_unavailable`,message:e})))}tt(5),tt(15),v()(`@deslop/runtime/shared/auth/CurrentUser`);var Uo=class extends qt()(`@deslop/runtime/shared/auth/RpcAuth`,{error:$}){},Wo=O.check(rr(e=>w(Xe(Le(e)),e=>Ae([`http:`,`https:`],e.protocol)&&e.username===``&&e.password===``&&e.hash===``),{expected:`an HTTP(S) URL without credentials or a fragment`})).check(rr(e=>w(Xe(Le(e)),e=>e.pathname===`/`&&e.search===``),{expected:`an HTTP(S) origin without a path or query`}));Wo.check(rr(e=>w(Xe(Le(e)),e=>e.protocol===`https:`||Ae([`localhost`,`127.0.0.1`,`[::1]`],e.hostname)),{expected:`HTTPS outside loopback`})),O.check(Je(/^\d{1,5}$/u),rr(e=>w(o(e),e=>e>=1&&e<=65535),{expected:`a port between 1 and 65535`}));var Go=O.check(Je(/^0\.1\.\d+$/u)),Ko=`/api/runtime`,qo=`/api/account`,Jo=S({auth:N(Wo),name:O,traces:N(Wo),version:Go}),Yo=`/api/rpc`,Xo=S({...Lo.fields,signOut:j});S({config:S({port:B}),name:O,version:Go}),I([`web`,`mobile`,`server`]);function Zo(e,t,n,r){return kn(Vt(Ln(function*(){let i=`${yield*hn}`,a=yield*yt,o={attributes:{"scope.run.started_unix_nano":i,"scope.runtime":n,"service.instance.id":i},serviceName:e,serviceVersion:Ve(Ee(r,e=>e!==`0.1.0`))};return Mt(Nn(Mn({resource:o,url:new URL(`/v1/traces`,t).href}),jt({resource:o,url:new URL(`/v1/logs`,t).href}),zn(yt,[...a,`code`,`state`,`request`,`access_token`,`refresh_token`,`id_token`,`client_secret`,`client_assertion`,`code_verifier`,`session`,`token`,`api_key`,`key`])),[rn,Ft])})),e=>Ut(e)?Et(jn):Et(Ot(`Telemetry is unavailable`)))}function Qo(e){return Vt(Ln(function*(){let t=yield*z((yield*Gn).get(Ko),ht(ne),ht(C(Jo)),x(`3 seconds`),$e(e=>Ot(`Telemetry is off: the runtime config did not load`,e)),cn);return k(t,{onNone:()=>vn,onSome:t=>k(t.traces,{onNone:()=>vn,onSome:n=>Zo(`${e}-client`,n,`web`,t.version)})})}))}function $o(e,t){return z(et(`${e}${qo}`,{headers:t}),ht(vt(function*(e){return e.status===401?yield*$.make({message:`Sign in first`}):e.status===403?yield*$.make({error:`access_denied`,message:`This account is refused`}):yield*z(e,ne,ht(C(Xo)))})),Ho(`The server could not be reached`))}var es=class extends qt()(`@deslop/runtime/shared/rpc/RpcStream`){};zn(es,es.of((e,t)=>Qn(t.rpc.successSchema)?m(lt(`rpc.stream`,!0),e):e));var ts=Tt(es,e=>Ln(function*(){return Qn(e.rpc.successSchema)&&(yield*lt(`rpc.stream`,!0)),yield*e.next(e.request)})),ns=tt(1),rs=Jt(xn,Ln(function*(){let e=yield*xn,t=yield*fn,n=te(),r=te();function i(e){let t=Be(r,e);return u(r,e),t}function a(t,r){return $n(()=>k(i(r),{onNone:()=>rt,onSome:i=>{let a=bt.make({reason:Te(i.sent,{onFalse:()=>kt.make({cause:`The socket did not open`,kind:`Timeout`}),onTrue:()=>Yn.make({cause:`No answer within ${Ze(ns)}`})})}),o=z(n,Be(t),k({onNone:()=>rt,onSome:e=>e({_tag:`ClientProtocolError`,error:a,requestIds:[r]})}));return i.sent?m(o,gn(e.send(t,{_tag:`Interrupt`,requestId:r}),{log:`Warn`,message:`The server was not told to stop an unanswered request`})):o}}))}function o(e){return Ge(e,e=>k(i(e),{onNone:()=>rt,onSome:e=>qe(e.deadline)}),{concurrency:1,discard:!0})}function s(e){return z(nn(r),ct,_e(t=>z(r,Be(t),w(t=>t.clientId===e))))}return xn.of({...e,run:(t,r)=>$n(()=>($t(n,t,r),Ce(e.run(t,e=>z(e,oe({Chunk:e=>o([e.requestId]),ClientProtocolError:e=>o(e.requestIds??s(t)),Defect:()=>o(s(t)),Exit:e=>o([e.requestId]),Pong:()=>rt,Request:()=>rt}),m(r(e)))),M(()=>u(n,t))))),send:(n,i,s)=>oe(i,{Ack:()=>e.send(n,i,s),Eof:()=>e.send(n,i,s),Interrupt:t=>m(o([t.requestId]),e.send(n,i)),Ping:()=>e.send(n,i,s),Request:i=>Ln(function*(){let c={clientId:n,deadline:yield*z(a(n,i.id),ft(ns),zt(t)),sent:!1};$t(r,i.id,c),yield*Nt(e.send(n,i,s),()=>o([i.id])),c.sent=!0})})})}));function is(e){return z(rs,Mt(un({pingTimeout:`15 seconds`})),Mt(e),on(Wt()),on(ts))}Jn()(`WriteError`,{cause:Pt(),message:O});var as=ce(me());I([`route`,`caught`,`uncaught`]);var os=f(e=>{let t=Xt(`Web error`,dn(e.error),...de(Zt(e.stack)));return k(Pe(as),{onNone:()=>t,onSome:n=>Rt(z(t,m(fe(e.error)),ie(`Web.error`,{attributes:{"web.error.source":e.source,"web.route.id":e.route},root:!0}),En),n)})}),ss=ue(Ft).atom($o(``)),cs=is(Mt(Ye(M(()=>`${location.origin}${Yo}`)),_));function ls(e){ue.addGlobalLayer(z(Qo(e),Mt(Ft),It(e=>se(Kn(e,Rn))?rt:nr(M(()=>ve(as,dt(e))),()=>M(()=>De(as,Re(t=>t!==e)))))))}function us(e){return an(e.reasons,e=>xt(e)&&Vo(e.error))}function ds(e){return!a(e)||!us(e.cause)&&ge(e.previousSuccess)?me():dt(e.cause)}function fs(e,t,n=Dt){function r(e){let t=_e(e.reasons,e=>xt(e)&&Vo(e.error));return Tn(t)?me():dt(Gt(t))}let i=ce(z(e.self(),Re(a),en(e=>r(e.cause))));function o(e){return k(Pe(i),{onNone:()=>e,onSome:t=>Gt([...t.reasons,..._e(e.reasons,e=>!xt(e)||!Vo(e.error))])})}let s=ce(0),c=l(t,t=>M(()=>{De(i,e=>ot(r(t),()=>e));let n=o(t);ge(Pe(i))?e.setSelf(_t(n)):He(s)<2||e.setSelf(We(n,{previous:e.self()}))}));return z(n(c),tn(()=>M(()=>{ve(i,me()),ve(s,0)})),Qe(e=>nt(o(e))),b(ze(()=>k(Pe(i),{onNone:()=>qn,onSome:nt}))))}function ps(e){return Ue($)(e)?e.error===`temporarily_unavailable`:Ue(bt)(e)&&!Ue(Ht)(e.reason)}function ms(e){return ee(e,e=>Fe(e(Me(`1 second`)),e=>ps(e.input)))}function hs(e,t,n){return je(yn(e,e=>e(t,n)))}function gs(e,t,n){return e.runtime.atom(r=>fs(r,je(yn(e,e=>e(t,n))),ms))}var _s=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=ir({disabled:i,focusableWhenDisabled:a,native:o});return ar(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function vs(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vs(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function ys(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vs(e))&&(r&&(r+=` `),r+=t);return r}var bs=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xs=ys,Ss=(e,t)=>n=>{if(t?.variants==null)return xs(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bs(t)||bs(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xs(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Cs=Ss(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-none [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-none`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function ws(e){let t=(0,No.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a===void 0?`default`:a,c;t[5]!==n||t[6]!==s||t[7]!==o?(c=or(Cs({variant:o,size:s,className:n})),t[5]=n,t[6]=s,t[7]=o,t[8]=c):c=t[8];let l;return t[9]!==r||t[10]!==c?(l=(0,U.jsx)(_s,{"data-slot":`button`,className:c,...r}),t[9]=r,t[10]=c,t[11]=l):l=t[11],l}var Ts=I([`10m`,`1h`,`24h`,`7d`,`30d`]),Es={"1h":y(1),"7d":At(7),"10m":tt(10),"24h":At(1),"30d":At(30)};function Ds(e){return Es[e]}var Os=z(P.check(le({maximum:864e13,minimum:-864e13})),R(bn,{decode:A(e=>Lt(sn(0),()=>e)),encode:A(St)})),ks=z(P,R(Bn));z(P.check(le({maximum:864e10,minimum:-864e10})),R(bn,{decode:A(e=>Lt(sn(0),()=>e*1e3)),encode:A(e=>St(e)/1e3)})),z(B.check(le({maximum:864e10,minimum:-864e10})),R(bn,{decode:A(e=>sn(e*1e3)),encode:A(Un)}));var As=z(P,R(ln,{decode:A(re),encode:A(Qt)})),js=D(`DeployItemId`)(O),Ms=D(`DeployAppId`)(O),Ns=D(`DeployUnitId`)(O),Ps=D(`DeployProcessId`)(B),Fs=D(`DeployContainerId`)(O),Is=D(`DeployJobName`)(O),Ls=D(`DeployExposureName`)(O);z(F,R(Ps)),L(F),z(F,R(P,{decode:A(e=>e*1024),encode:A(e=>e/1024)}));var Rs=z(O,R(Wn(O),{decode:A(e=>Ee(e,Oe)),encode:A(e=>Ne(e,Yt(``)))})),zs=z(N(O),R(Wn(O),{decode:A(e=>Re(e,Oe)),encode:A(Dt)})),Bs=class extends Jn()(`DeployError`,{cause:g(Pt()),message:O}){},Vs=S({detail:O,name:O}),Hs=S({cpu:N(P),label:Vs,memory:P,name:O,parent:Ps,pid:Ps}),Us=I([`user`,`system`]),Ws=S({active:z(j,E(Ct(!1))),address:z(N(O),E(V)),bindings:z(N(L(S({address:O,port:B,protocol:I([`tcp`,`udp`])}))),E(V)),detail:O,failure:z(N(S({at:N(Os),reason:O})),E(V)),health:z(I([`quiet`,`warning`,`error`]),E(Ct(`quiet`))),hostname:z(N(O),E(V)),http:z(N(j),E(V)),id:js,kind:I([`service`,`container`,`port`,`exposure`,`peer`]),links:z(N(L(O)),E(V)),name:O,next:z(N(Os),E(V)),owned:z(N(j),E(V)),port:z(N(B),E(V)),process:z(zs,E(V)),processes:z(N(L(Hs)),E(V)),protocol:z(N(I([`tcp`,`udp`])),E(V)),publicAccess:z(N(j),E(V)),running:z(j,E(Ct(!1))),scheduled:z(N(j),E(V)),scope:z(N(Us),E(V)),self:z(N(j),E(V)),state:O,ui:z(N(j),E(V)),unit:z(zs,R(Wn(Ns)),E(V)),url:Rs}),Gs=T([Ws.mapFields(e=>({...e,kind:Kt(`service`),name:Ns})),Ws.mapFields(e=>({...e,kind:Kt(`exposure`),name:Ls})),Ws.mapFields(e=>({...e,kind:I([`container`,`peer`])}))]),Ks=Ws.mapFields(e=>({...e,kind:Kt(`port`),process:z(N(Rs),R(Wn(O),{decode:A(s),encode:A(dt)}),E(V))}));T([...Gs.members,Ks]),S({address:O,port:P,protocol:I([`tcp`,`udp`])}),S(Dn(Ws.fields,[`address`,`port`,`protocol`]));var qs=S({items:L(T([...Gs.members,Ks.mapFields(e=>({...e,unit:z(N(z(Rs,R(Wn(Ns)))),R(Wn(mt(Ns)),{decode:A(s),encode:A(dt)}),E(V))}))])),sources:L(S({error:Rs,name:O})),time:Os}),Js=S({DNSName:O,HostName:O,OS:O,Online:j,TailscaleIPs:L(O)});S({Self:N(Js)}),S({AllowFunnel:N(Zn(O,j)),TCP:N(Zn(O,pn)),Web:N(Zn(O,S({Handlers:Zn(O,S({Proxy:N(O)}))})))});var Ys=S({name:Ns,scope:I([`system`,`user`])});S({id:js.annotate({description:`A scheduled job’s id as list_apps shows it.`})}),Ie(it([I([`apps`,`exposures`,`jobs`]),js])),S({app:N(O.annotate({description:`A substring of an app or unit name; returns that app's process tree.`})),failing:N(j.annotate({description:`Only failed or warning items.`}))});var Xs=S({children:N(L(he(()=>Xs))),cpu:N(P),detail:N(O),mib:B,name:O}),Zs=S({failure:N(O),id:js,name:O,ports:N(L(B)),processes:N(L(Xs)),since:N(Fn),state:O,url:N(O)}),Qs=S({failure:N(O),id:js,name:Is,next:N(Fn),running:j,since:N(Fn)}),$s=S({access:I([`tailnet`,`public`]),failure:N(O),id:js,name:Ls,port:N(B),url:O});S({apps:L(Zs),errors:N(L(O)),exposures:N(L($s)),jobs:N(L(Qs))}),S({activates:er(Ns),next:er(z(P,R(bn,{decode:A(e=>Lt(sn(0),()=>e/1e3)),encode:A(e=>St(e)*1e3)})))}),S({active:O,description:O,sub:O,unit:Ns}),S({ID:Fs,Labels:N(O),Names:O,Ports:O,State:O,Status:O});var ec=T([Ms,I([`other`,`system`])]);ae(it([F,F,F,F,F]),[F]),L(F),D(`DeployCgroupPath`)(O);var tc=I([10,60,1440,10080,43200]),nc=S({minutes:z(tc,R(ln,{decode:A(tt),encode:gt(e=>z(e,c,xe(tc)))}))}),rc=L(er(P)),ic=S({cpu:N(P),mib:B,name:O}),ac=S({cpuPct:N(P),diskGiB:N(P),diskTotalGiB:N(P),load:N(L(P)),memoryGiB:P,memoryTotalGiB:P});S({apps:L(ic),cpuPct:rc,diskPct:rc,error:N(O),from:Fn,memoryPct:rc,now:N(ac),stale:N(Kt(!0)),stepSeconds:As}),S({cpuIdle:ks,cpuTotal:ks,time:Os,uptime:As});var oc=z(B,R(ks)),sc=S({cpu:N(P),id:Ms,memory:P}),cc=S({...sc.fields,cpuCoverage:oc}),lc=class extends In(`MachineSample`)({appsCoverage:oc,cpu:mn(P),cpuCoverage:oc,memoryCoverage:oc,memoryTotal:P,memoryUsed:P,since:z(B,R(Os)),step:z(B,R(ks)),storageCoverage:oc,storageUsed:mn(P),time:z(B,R(Os))}){static table=`samples`};In(`AppHistory`)({app:Ms,cpu:mn(P),memory:P,since:lc.fields.since,step:lc.fields.step});var uc=class extends In(`Sample`)({...lc.fields,apps:mn(On(L(cc)))}){};S({...we(uc.fields,[`apps`,`since`,`step`]),apps:Wn(L(sc))});var dc=S({mount:O,total:P,used:P}),fc=S({disks:L(dc),error:Rs,load:L(P),samples:L(uc.json),stale:j,time:Os});I([`apps`,`disks`,`sample`,`save`]);var pc=class extends In(`Exposure`)({hostname:O.check(ye(253),Je(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u)),kind:I([`tailnet`,`public`]),name:Ls.check(ke(),ye(260)),owner:mn(O),port:B.check(le({maximum:65535,minimum:1024})),state:I([`active`,`removing`])}){static table=`exposures`},mc=S({...Dn(pc.fields,[`hostname`,`kind`,`name`,`port`]),publicAccess:j}),hc=S({name:Ls}),gc=class extends _n(Vn(`metrics.watch`,{error:T([$,Bs]),payload:nc,stream:!0,success:fc}),Vn(`inventory.watch`,{error:T([$,Bs]),stream:!0,success:qs}),Vn(`exposures.expose`,{error:T([$,Bs]),payload:mc,success:O}).middleware(Ro),Vn(`exposures.hide`,{error:T([$,Bs]),payload:hc}).middleware(Ro),Vn(`inventory.run`,{error:T([$,Bs]),payload:Ys}).middleware(Ro)).middleware(Uo){};ls(`@deslop/deploy`);var _c=class extends Bt()(`@deslop/deploy/lib/machine/RpcClient`,{group:gc.middleware(es),protocol:cs}){},vc=at(me()),yc=pe(_c.runtime.atom(e=>fs(e,l(hs(_c,`inventory.watch`),t=>M(()=>{us(t)&&e.set(vc,me())})),ms))),bc=_c.runtime.fn((e,t)=>z(_c,ht(t=>t(`exposures.expose`,e)),Xn(()=>M(()=>t.set(vc,me()))))),xc=Se(An,(e,t)=>{e.set(bc,Ke),e.set(vc,dt(t))}),Sc=tr(e=>_c.runtime.fn(e=>ht(_c,t=>t(`inventory.run`,e)))),Cc=tr(e=>gs(_c,`metrics.watch`,e));export{Pr as $,Oo as A,ti as B,Fo as C,Mo as D,zo as E,xi as F,Hr as G,ni as H,bi as I,Rr as J,Ir as K,_i as L,Ca as M,oa as N,Do as O,sa as P,Fr as Q,di as R,Xo as S,Bo as T,K as U,ii as V,ei as W,Ur as X,Xr as Y,G as Z,Ss as _,xc as a,Tr as at,ss as b,nc as c,ur as ct,Ls as d,Mr as et,js as f,ws as g,Ds as h,Cc as i,Er as it,Da as j,ko as k,Ms as l,lr as lt,Ts as m,vc as n,Dr as nt,Sc as o,jr as ot,Ns as p,Jr as q,yc as r,wr as rt,ec as s,br as st,bc as t,Nr as tt,Bs as u,ys as v,Vo as w,os as x,ds as y,ui as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,n,o as r,r as i}from"./react-CS2OHYTO.js";import{Ba as a,Pa as o,X as s}from"./effect-CctX5eYK.js";import{_ as c}from"./machine-DhN8aM5V.js";import{A as l,B as u,C as d,D as f,E as p,M as m,N as h,P as g,_,a as v,c as y,d as b,f as x,g as S,h as C,i as w,j as T,k as E,l as D,o as O,p as k,r as A,s as j,t as M,v as N,y as P,z as F}from"./dist-Cnz9vY_S.js";var I=e(r(),1);function L(e){return e?.ownerDocument||document}var R=i(),z=u(),B=F(),V=e(n(),1),H=[],U=void 0;function W(){return U}function G(e){H.push(e)}function K(e){let t=(t,n)=>{let r=_(te).current,i;try{U=r;for(let e of H)e.before(r);i=e(t,n);for(let e of H)e.after(r);r.didInitialize=!0}finally{U=void 0}return i};return t.displayName=e.displayName||e.name,t}function ee(e){return I.forwardRef(K(e))}function te(){return{didInitialize:!1}}function q(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ne(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function re(e){let t=_(ie,e).current;return t.next=e,C(t.effect),t}function ie(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ae(e){I.useEffect(e,w)}var oe=0,se=class e{static create(){return new e}currentId=oe;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=oe,t()},e)}isStarted(){return this.currentId!==oe}clear=()=>{this.currentId!==oe&&(clearTimeout(this.currentId),this.currentId=oe)};disposeEffect=()=>this.clear};function ce(){let e=_(se.create).current;return ae(e.disposeEffect),e}function J(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Y,platform:le,maxTouchPoints:ue}=J(),de=Y.toLowerCase(),fe=le.toLowerCase(),pe=/^i(os$|p)/.test(fe)||fe===`macintel`&&ue>1,me=`android`,he=fe===me||de.includes(me),ge=!pe&&fe.startsWith(`mac`);fe.startsWith(`win`),!he&&/^(linux|chrome os)/.test(fe);var _e=ge||pe,ve=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ve&&de.includes(`firefox`),!ve&&de.includes(`chrom`);var ye=_e,be=/jsdom|happydom/.test(de),xe=null;globalThis.requestAnimationFrame;var Se=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Ce=class e{static create(){return new e}static request(e){return Se.request(e)}static cancel(e){return Se.cancel(e)}currentId=xe;request(e){this.cancel(),this.currentId=Se.request(()=>{this.currentId=xe,e()})}cancel=()=>{this.currentId!==xe&&(Se.cancel(this.currentId),this.currentId=xe)};disposeEffect=()=>this.cancel};function we(){let e=_(Ce.create).current;return ae(e.disposeEffect),e}var Te={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ee={...Te,position:`fixed`,margin:0,top:0,left:0};({...Te});var De=I.forwardRef(function(e,t){let[n,r]=I.useState();C(()=>{ye&&ve&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,R.jsx)(`span`,{...e,ref:t,style:Ee,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function X(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Oe(e,t){let n=e;for(;n;){if(E(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(g(n)?n.host:null)}return null}function Q(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ke=`data-base-ui-focusable`,Ae=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,je=`ArrowLeft`,Me=`ArrowRight`,Ne=`ArrowUp`,Pe=`ArrowDown`,Fe=`data-starting-style`,Ie=`data-ending-style`,Le={[Fe]:``},Re={[Ie]:``},ze={transitionStatus(e){return e===`starting`?Le:e===`ending`?Re:null}},Be=`data-open`,Ve=`data-closed`,He=Fe,Ue=Ie,We=`data-anchor-hidden`,Ge=`data-popup-open`,Ke=`data-pressed`,qe={[Ge]:``},Je={[Ge]:``,[Ke]:``},Ye={[Be]:``},Xe={[Ve]:``},Ze={[We]:``},Qe={open(e){return e?qe:null}},$e={open(e){return e?Je:null}},et={open(e){return e?Ye:Xe},anchorHidden(e){return e?Ze:null}},tt={...et,...ze},nt=`data-trigger-disabled`;function rt(e,t){if(!E(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(nt);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(nt);return!1}function it(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function at(e){return e.matches(`html,body`)}function ot(e){return l(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function st(e){return Oe(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ae}`)!=null}function ct(e){return e?e.getAttribute(`role`)===`combobox`&&ot(e):!1}function lt(e){if(!e||be)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ut(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function dt(e){e.preventDefault(),e.stopPropagation()}function ft(e){return`nativeEvent`in e}function pt(e){return e.pointerType===``&&e.isTrusted?!0:he&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function mt(e){return be?!1:!he&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(he||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ht(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function gt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function _t(e,t){return t<0||t>=e.length}function vt(e,t){return xt(e.current,{disabledIndices:t})}function yt(e,t){return xt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function bt(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>xt(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:_t(e,u)?-1:u,wrapped:d}}function xt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&St(e,a,r));return a}function St(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!wt(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ct(e){return e.visibility===`hidden`||e.visibility===`collapse`}function wt(e,t=e?P(e):null){return!e||!e.isConnected||!t||Ct(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Tt=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Et(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return g(n)?n.host:null}function Dt(e){for(let t of Array.from(e.children))if(d(t)===`summary`)return t;return null}function Ot(e,t){let n=Dt(t);return!!n&&(e===n||Z(n,e))}function kt(e){let t=e?d(e):``;return e!=null&&e.matches(Tt)&&(t!==`summary`||e.parentElement!=null&&d(e.parentElement)===`details`&&Dt(e.parentElement)===e)&&(t!==`details`||Dt(e)==null)&&(t!==`input`||e.type!==`hidden`)}function At(e){if(!kt(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Et(t)){let n=t!==e,r=d(t)===`slot`;if(t.hasAttribute(`inert`)||n&&d(t)===`details`&&!t.open&&!Ot(e,t)||t.hasAttribute(`hidden`)||!r&&!jt(t,n))return!1}return!0}function jt(e,t){let n=P(e);return t?n.display!==`none`:wt(e,n)}function Mt(e){let t=e.tabIndex;if(t<0){let t=d(e);if(t===`details`||t===`audio`||t===`video`||l(e)&&e.isContentEditable)return 0}return t}function Nt(e){if(d(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Pt(e,t){let n=Nt(e);if(!n)return!0;let r=t.find(e=>{let t=Nt(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Nt(e);return t?.name===n.name&&t.form===n.form})===n}function Ft(e){if(l(e)&&d(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return l(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function It(e,t){Ft(e).forEach(e=>{kt(e)&&t.push(e),It(e,t)})}function Lt(e,t,n){Ft(e).forEach(e=>{l(e)&&e.matches(t)&&n.push(e),Lt(e,t,n)})}function Rt(e){return At(e)&&Mt(e)>=0}function zt(e){let t=[];return It(e,t),t.filter(At)}function Bt(e){let t=zt(e);return t.filter(e=>Mt(e)>=0&&Pt(e,t))}function Vt(e,t){let n=Bt(e),r=n.length;if(r===0)return;let i=X(L(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ht(e){return Vt(L(e).body,1)||e}function Ut(e){return Vt(L(e).body,-1)||e}function Wt(e,t,n){if(!e)return null;let r=[];It(L(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(At);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&Rt(o)&&Pt(o,a))return o}return r[i]}function Gt(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function Kt(e){Bt(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function qt(e){let t=[];Lt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Jt(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Jt(e,t.id,n)])}function Yt(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Xt(e,t,n,r){let i=!1,a=!1,o=r??v;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Zt(e,t,n){let r=n??v;return{reason:e,event:t??new Event(`base-ui`),...r}}var Qt=`none`,$t=`trigger-press`,en=`trigger-hover`,tn=`trigger-focus`,nn=`outside-press`,rn=`item-press`,an=`close-press`,on=`focus-out`,sn=`escape-key`,cn=`list-navigation`,ln=`keyboard`,un=`pointer`,dn=`cancel-open`,fn=`sibling-open`,pn=`disabled`,mn=`missing`,hn=`initial`,gn=`imperative-action`;function _n(e){return`data-base-ui-${e}`}var vn=0;function yn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(vn);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),O;let o=requestAnimationFrame(a);return vn=o,()=>{vn===o&&(cancelAnimationFrame(o),vn=0)}}var bn=`data-base-ui-inert`,xn=new WeakMap,Sn=new WeakSet,Cn=new WeakMap,wn=0;function Tn(e){return e?g(e)?e.host:Tn(e.parentNode):null}var En=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Tn(t);return e.contains(n)?n:null}).filter(e=>e!=null),Dn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},On=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{d(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function kn(e,t,n,{mark:r=!0}){let i=En(t,e),a=r?On(t,Dn(i),new Set(i)):[],o=[],s=[];if(n){let e=En(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);On(t,Dn(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(xn.get(e)||0)+1;xn.set(e,r),o.push(e),r===1&&n&&Sn.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Cn.get(e)||0)+1;Cn.set(e,t),s.push(e),t===1&&e.setAttribute(bn,``)}),wn+=1,()=>{o.forEach(e=>{let t=(xn.get(e)||0)-1;xn.set(e,t),t||(Sn.has(e)||e.removeAttribute(`aria-hidden`),Sn.delete(e))}),r&&s.forEach(e=>{let t=(Cn.get(e)||0)-1;Cn.set(e,t),t||e.removeAttribute(bn)}),--wn,wn||(xn=new WeakMap,Sn=new WeakSet,Cn=new WeakMap)}}function An(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=L(e[0]).body;return kn(e,i,n,{mark:r})}function jn(){let[,e]=I.useState({});return I.useCallback(()=>{e({})},[])}var Mn=0;function Nn(e,t=`mui`){let n=I.useRef(void 0),r=jn(),i=e??n.current;return I.useEffect(()=>{n.current??(Mn+=1,n.current=`${t}-${Mn}`,e??r())},[e,t,r]),i}var Pn=N.useId;function Fn(e,t){if(Pn!==void 0){let n=Pn();return e??(t?`${t}-${n}`:n)}return Nn(e,t)}var In={style:{transition:`none`}},Ln=`data-base-ui-click-trigger`,Rn={fallbackAxisSide:`none`},zn={fallbackAxisSide:`end`},Bn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Vn=I.createContext(null),Hn=()=>I.useContext(Vn),Un=_n(`portal`);function Wn(e={}){let{ref:t,container:n,componentProps:r=v,elementProps:i}=e,a=Fn(),o=Hn()?.portalNode,[s,c]=I.useState(null),[l,u]=I.useState(null),d=S(e=>{e!==null&&u(e)}),f=I.useRef(null);C(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(m(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=A(`div`,r,{ref:[t,d],props:[{id:a,[Un]:``},i]}),h=s&&p?V.createPortal(p,s):null;return{node:l,nodeId:I.isValidElement(p)?p.props.id:void 0,subtree:h}}var Gn=I.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Wn({container:o,ref:t,componentProps:e,elementProps:c}),f=I.useRef(null),p=I.useRef(null),m=I.useRef(null),h=I.useRef(null),[g,_]=I.useState(null),v=I.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;I.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Gt(e)&&(e.type===`focusin`?v.current&&=(qt(l),!1):(Kt(l),v.current=!0))}return ne(q(l,`focusin`,e,!0),q(l,`focusout`,e,!0))},[l,y]),C(()=>{l&&b===!0&&v.current&&(qt(l),v.current=!1)},[b,l]);let S=I.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,R.jsxs)(I.Fragment,{children:[d,(0,R.jsxs)(Vn.Provider,{value:S,children:[x&&l&&(0,R.jsx)(De,{"data-type":`outside`,ref:f,onFocus:e=>{Gt(e,l)?m.current?.focus():Ut(g?g.domReference:null)?.focus()}}),x&&l&&(0,R.jsx)(`span`,{role:s,"aria-owns":u,style:Bn}),l&&V.createPortal(a,l),x&&l&&(0,R.jsx)(De,{"data-type":`outside`,ref:p,onFocus:e=>{Gt(e,l)?h.current?.focus():(Ht(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Xt(`focus-out`,e.nativeEvent)))}})]})]})});function Kn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var qn=class{nodesRef={current:[]};events=Kn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Jn=I.createContext(null),Yn=I.createContext(null),Xn=()=>I.useContext(Jn)?.id||null,Zn=e=>{let t=I.useContext(Yn);return e??t};function Qn(e){let t=Fn(),n=Zn(e),r=Xn();return C(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function $n(e){let{children:t,id:n}=e,r=Xn();return(0,R.jsx)(Jn.Provider,{value:I.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function er(e){let{children:t,externalTree:n}=e,r=_(()=>n??new qn).current;return(0,R.jsx)(Yn.Provider,{value:r,children:t})}function tr(e){return e==null?e:`current`in e?e.current:e}function nr(e,t){let n=f(Q(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(pt(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var rr=20,ir=[];function ar(){ir=ir.filter(e=>e.deref()?.isConnected)}function or(e){ar(),e&&d(e)!==`body`&&(ir.push(new WeakRef(e)),ir.length>rr&&(ir=ir.slice(-20)))}function sr(){return ar(),ir[ir.length-1]?.deref()}function cr(e){return e?Rt(e)?e:Bt(e)[0]||e:null}function lr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=zt(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Rt(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ur(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:f=``,nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=t.useState(`open`),b=t.useState(`domReferenceElement`),x=t.useState(`floatingElement`),{events:w,dataRef:T}=t.context,E=S(()=>T.current.floatingContext?.nodeId),D=i===!1,O=ct(b)&&D,k=re(i),A=re(a),j=re(o),M=re(f),N=re(v),P=Zn(g),F=Hn(),z=I.useRef(!1),B=I.useRef(!1),V=I.useRef(!1),H=I.useRef(null),U=I.useRef(``),W=I.useRef(``),G=I.useRef(null),K=I.useRef(null),ee=y(G,h,F?.beforeInsideRef),te=y(K,F?.afterInsideRef),ie=ce(),ae=ce(),oe=we(),se=F!=null,J=ut(x),Y=S((e=J)=>e?Bt(e):[]),le=S(()=>_?.().filter(e=>e!=null)??[]);I.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(J,X(L(J)))&&Y().length===0&&!O&&dt(e)}return q(L(J),`keydown`,e)},[r,J,c,O,Y]),I.useEffect(()=>{if(r||!v)return;let e=L(J);function t(){V.current=!1}function n(e){let t=Q(e),n=le(),r=Z(x,t)||Z(b,t)||Z(F?.portalNode,t)||n.some(e=>e===t||Z(e,t));V.current=!r,W.current=e.pointerType||`keyboard`,Oe(t,`[data-base-ui-click-trigger]`)&&(B.current=!0,ae.start(0,()=>{B.current=!1}))}function i(){W.current=`keyboard`}return ne(q(e,`pointerdown`,n,!0),q(e,`pointerup`,t,!0),q(e,`pointercancel`,t,!0),q(e,`keydown`,i,!0),t)},[r,x,b,J,v,F,ae,le]),I.useEffect(()=>{if(r||!u)return;let e=L(J);function n(){B.current=!0,ae.start(0,()=>{B.current=!1})}function i(e){let t=Q(e);Rt(t)&&(H.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Q(n);c&&r==null&&a!=null&&Z(x,a)&&or(a),queueMicrotask(()=>{let o=E(),u=t.context.triggerElements,d=le(),f=r?.hasAttribute(_n(`focus-guard`))&&[G.current,K.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,tr(m),tr(p)].includes(r),h=!(Z(b,r)||Z(x,r)||Z(r,x)||Z(F?.portalNode,r)||d.some(e=>e===r||Z(e,r))||u.hasMatchingElement(e=>Z(e,r))||f||P&&(Jt(P.nodesRef.current,o).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||Yt(P.nodesRef.current,o).find(e=>[e.context?.elements.floating,ut(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===b&&J&&lr(J),s&&i!==b&&!wt(a)&&X(e)===e.body){if(l(J)&&(J.focus(),s===`popup`)){oe.request(()=>{J.focus()});return}let e=Y(),t=H.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||J;l(n)&&n.focus()}T.current.insideReactTree?T.current.insideReactTree=!1:(O||!c)&&r&&h&&!B.current&&(O||r!==sr())&&(z.current=!0,t.setOpen(!1,Xt(on,n)))})}function o(){V.current||(T.current.insideReactTree=!0,ie.start(0,()=>{T.current.insideReactTree=!1}))}let d=l(b)?b:null;if(x||d)return ne(d&&q(d,`focusout`,a),d&&q(d,`pointerdown`,n),x&&q(x,`focusin`,i),x&&q(x,`focusout`,a),x&&F&&q(x,`focusout`,o,!0))},[r,b,x,J,c,P,F,t,u,s,Y,O,E,T,ie,ae,oe,p,m,le]),I.useEffect(()=>{if(r||!x||!v)return;let e=Array.from(F?.portalNode?.querySelectorAll(`[${_n(`portal`)}]`)||[]),t=(P?Yt(P.nodesRef.current,E()):[]).find(e=>ct(e.context?.elements.domReference||null))?.context?.elements.domReference,n=An([x,...e,G.current,K.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...le(),t,tr(m),tr(p),O?b:null].filter(e=>e!=null),{ariaHidden:c||O,mark:!1}),i=An([x,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,b,x,c,F,O,P,E,p,m,le]),C(()=>{if(!v||r||!l(J))return;U.current=``,W.current=``;let e=L(J),t=X(e);queueMicrotask(()=>{let n=k.current,r=typeof n==`function`?n(M.current||``):n;if(r===void 0||r===!1||Z(J,t))return;let i=null,a=()=>(i??=Y(J),i[0]||J),o;o=r===!0||r===null?a():tr(r),o||=a();let s=Z(J,X(e)),c=T.current.openEvent,l=c?.type===`mousedown`&&pt(c);yn(o,{sync:l,preventScroll:o===J,shouldFocus(){if(!N.current)return!1;if(s)return!0;let t=X(e);return!(t!==o&&Z(J,t))}})})},[r,v,J,Y,k,M,N,T]);let ue=I.useRef(null);C(()=>{if(r||!J){ue.current=null;return}ue.current&&=(ue.current.cancelled=!0,null);let e=L(J),t=X(e),n=M.current==null;or(t);function i(e){if(e.open||(U.current=nr(e.nativeEvent,W.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(_n(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(z.current=!0),e.reason===`outside-press`){if(e.nested)z.current=!1;else if(pt(e.nativeEvent)||mt(e.nativeEvent))z.current=!1;else{let e=!1;L(J).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?z.current=!1:z.current=!0}}}w.on(`openchange`,i);function a(e){let r=A.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=b?.isConnected?b:null,o=t?.isConnected&&d(t)!==`body`?t:null,s=n?o||a:a||o;return s||=sr()||null,typeof i==`boolean`?s:tr(i)||s||null}return()=>{w.off(`openchange`,i);let t=X(e),n=le(),r=Z(x,t)||n.some(e=>e===t||Z(e,t))||P&&Jt(P.nodesRef.current,E(),!1).some(e=>Z(e.context?.elements.floating,t)),o=A.current,s=U.current,c=a(s),u={cancelled:!1};ue.current=u,queueMicrotask(()=>{ue.current===u&&(ue.current=null);let n=cr(c),i=j.current??typeof o!=`boolean`;if(!u.cancelled&&o&&!z.current&&l(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}z.current=!1})}},[r,x,J,A,j,M,w,P,b,E,le]),C(()=>{if(!ve||v||!x)return;let e=X(L(x));l(e)&&ot(e)&&Z(x,e)&&e.blur()},[v,x]),C(()=>{if(!r&&F)return F.setFocusManagerState({modal:c,closeOnFocusOut:u,open:v,onOpenChange:t.setOpen,domReference:b}),()=>{F.setFocusManagerState(null)}},[r,F,c,v,t,u,b]),C(()=>{if(!r&&J)return lr(J),()=>{queueMicrotask(ar)}},[r,J]);let de=!r&&(!c||!O)&&(se||c);return(0,R.jsxs)(I.Fragment,{children:[de&&(0,R.jsx)(De,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=Y();yn(e[e.length-1])}else F?.portalNode&&(z.current=!1,Gt(e,F.portalNode)?Ht(b)?.focus():tr(m??F.beforeOutsideRef)?.focus())}}),n,de&&(0,R.jsx)(De,{"data-type":`inside`,ref:te,onFocus:e=>{c?yn(Y()[0]):F?.portalNode&&(u&&(z.current=!0),Gt(e,F.portalNode)?Ut(b)?.focus():tr(p??F.afterOutsideRef)?.focus())}})]})}function dr(){return!1}function fr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function pr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=dr,bubbles:s,externalTree:c}=t,u=e.useState(`open`),d=e.useState(`floatingElement`),{dataRef:f,events:m}=e.context,h=Zn(c),_=S(typeof i==`function`?i:()=>!1),v=typeof i==`function`?_:i,y=v!==!1,b=S(()=>a),{escapeKey:x,outsidePress:C}=fr(s),w=I.useRef(!1),D=I.useRef(!1),O=I.useRef(!1),k=I.useRef(!1),A=I.useRef(!1),j=I.useRef(``),M=I.useRef(null),N=ce(),F=ce(),R=ce(),z=S(()=>{F.clear(),f.current.insideReactTree=!1}),B=S(e=>{let t=f.current.floatingContext?.nodeId;return(h?Jt(h.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),V=S(t=>it(t,e.select(`floatingElement`))||it(t,e.select(`domReferenceElement`))),H=S(t=>{o()&&e.setOpen(!1,Xt($t,t.nativeEvent))}),U=S(t=>{if(!u||!n||!r||t.key!==`Escape`)return;let i=ft(t)?t.nativeEvent:t;if(A.current||i.isComposing||!x&&B(`__escapeKeyBubbles`))return;let a=Xt(sn,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!x&&!a.isPropagationAllowed&&t.stopPropagation()}),W=S(()=>{f.current.insideReactTree=!0,F.start(0,z)}),G=S(t=>{if(!u||!n||t.button!==0)return;let r=Q(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(w.current||(w.current=!0,D.current=!1))}),K=S(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&w.current&&(D.current=!0)});I.useEffect(()=>{function e(e){e.open||(k.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),I.useEffect(()=>z,[z]),I.useEffect(()=>{if(!u||!n)return u||(k.current=!1,A.current=!1,j.current=``,M.current=null),z;f.current.__escapeKeyBubbles=x,f.current.__outsidePressBubbles=C;let t=new se,i=L(d);function a(){R.clear(),A.current=!0}function o(){A.current=!0,R.start(ve?5:0,()=>{A.current=!1})}function s(){O.current=!0,t.start(0,()=>{O.current=!1})}function c(){w.current=!1,D.current=!1}function m(){let e=j.current,t=e===`pen`||!e?`mouse`:e,n=b(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function _(e){let t=m();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function S(e){let t=f.current.floatingContext?.nodeId,n=h&&Jt(h.nodesRef.current,t).some(t=>it(e,t.context?.elements.floating));return V(e)||n}function F(n){if(_(n)){n.type!==`click`&&!V(n)&&(t.clear(),O.current=!1),z();return}if(f.current.insideReactTree){z();return}let r=Q(n),i=`[${_n(`inert`)}]`,a=E(r)?r.getRootNode():null,o=Array.from((g(a)?a:L(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=E(r)?r:null;for(;c&&!T(c);){let e=p(c);if(T(e)||!E(e))break;c=e}if(!(o.length&&E(r)&&!at(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(l(r)&&!(`touches`in n)){let e=T(r),t=P(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!S(n)){if(m()===`intentional`){if(n.detail!==0&&!pt(n)&&!k.current)return;if(O.current){t.clear(),O.current=!1;return}}typeof v==`function`&&!v(n)||B(`__outsidePressBubbles`)||(e.setOpen(!1,Xt(nn,n)),z())}}}function I(t){m()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!V(t)&&F(t)}function H(t){if(m()!==`sloppy`||!e.select(`open`)||!n||V(t))return;let r=t.touches[0];r&&(M.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function W(e,t){let n=Q(e);if(!n)return;let r=q(n,e.type,()=>{t(e),r()})}function G(e){j.current=`touch`,W(e,H)}function K(e){N.clear(),e.type===`pointerdown`&&(e.button===0&&(k.current=!0),j.current=e.pointerType),(e.type!==`mousedown`||!M.current||M.current.dismissOnMouseDown)&&W(e,e=>{e.type===`pointerdown`?I(e):F(e)})}function ee(e){if(e.type===`pointercancel`&&(k.current=!1),!w.current)return;let n=D.current;c(),m()===`intentional`&&(e.type===`pointercancel`?n&&s():S(e)||(n?s():(typeof v!=`function`||v(e))&&(t.clear(),O.current=!0,z())))}function te(e){if(m()!==`sloppy`||!M.current||V(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-M.current.startX),r=Math.abs(t.clientY-M.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(M.current.dismissOnTouchEnd=!0),i>10&&(F(e),N.clear(),M.current=null)}function re(e){W(e,te)}function ie(e){m()===`sloppy`&&M.current&&!V(e)&&(M.current.dismissOnTouchEnd&&F(e),N.clear(),M.current=null)}function ae(e){W(e,ie)}let oe=ne(r&&ne(q(i,`keydown`,U),q(i,`compositionstart`,a),q(i,`compositionend`,o)),y&&ne(q(i,`click`,K,!0),q(i,`pointerdown`,K,!0),q(i,`pointerup`,ee,!0),q(i,`pointercancel`,ee,!0),q(i,`mousedown`,K,!0),q(i,`mouseup`,ee,!0),q(i,`touchstart`,G,{capture:!0,passive:!0}),q(i,`touchmove`,re,{capture:!0,passive:!0}),q(i,`touchend`,ae,{capture:!0,passive:!0})));return()=>{oe(),t.clear(),c(),O.current=!1}},[f,d,r,y,v,u,n,x,C,U,z,b,B,V,h,e,N,R]);let ee=I.useMemo(()=>({onKeyDown:U,onPointerDown:H,onClick:H}),[U,H]),te=I.useMemo(()=>({onKeyDown:U,onPointerDown:K,onMouseDown:K,onClickCapture:W,onMouseDownCapture(e){W(),G(e)},onPointerDownCapture(e){W(),G(e)},onMouseUpCapture:W,onTouchEndCapture:W,onTouchMoveCapture:W}),[U,W,G,K]);return I.useMemo(()=>n?{reference:ee,floating:te,trigger:ee}:{},[n,ee,te])}function mr(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),C(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};E(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}var hr=j(19)?vr:yr;function gr(e,t,n,r,i){return hr(e,t,n,r,i)}function _r(e,t,n,r,i){let a=I.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,z.useSyncExternalStore)(e.subscribe,a,a)}G({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,z.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function vr(e,t,n,r,i){let a=W();if(!a)return _r(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function yr(e,t,n,r,i){return(0,B.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var br=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return gr(this,e,t,n,r)}},xr=class extends br{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){I.useDebugValue(e);let n=this;C(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;C(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);C(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){I.useDebugValue(e);let n=this,r=t!==void 0;C(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return I.useDebugValue(e),gr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){I.useDebugValue(e);let n=S(t??O);this.context[e]=n}useStateSetter(e){let t=I.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Sr(e,t=!1,n=!1,r=!1){let[i,a]=I.useState(e&&t?`idle`:void 0),[o,s]=I.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),C(()=>{if(!e&&o&&i!==`ending`&&n){let e=Ce.request(()=>{a(`ending`)});return()=>{Ce.cancel(e)}}},[e,o,i,n]),C(()=>{if(!e||t||i===void 0)return;let n=Ce.request(()=>{a(void 0)});return()=>{Ce.cancel(n)}},[t,e,i]),C(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Ce.request(()=>{a(`idle`)});return()=>{Ce.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Cr(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var wr=null;function Tr(e){if(!wr){let e=[];wr=e,queueMicrotask(()=>{wr=null,V.flushSync(()=>{for(let t of e)t()})})}wr.push(e)}function Er(e,t=!1,n=!1){let r=we();return S((i,a=null)=>{r.cancel();let o=tr(e);if(o==null)return;let s=o,c=()=>{n?Tr(()=>{a?.aborted||i()}):V.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Cr(s).map(e=>e.finished.then(O))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Cr(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Fe;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Dr(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=S(a),s=Er(r,n,i);I.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Or(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=S(i),{mounted:c,setMounted:l,transitionStatus:u}=Sr(t,!1,!1,o),d=!t&&r;C(()=>{t&&s(!1)},[t,s]);let f=I.useRef(c),p=I.useRef(!1),m=jn(),h=()=>{f.current=!1,l(!1),a()};C(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=S(()=>{f.current&&(t?(p.current=!0,m()):h())});return Dr({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var kr={tabIndex:-1,[ke]:``};function Ar(e){return t=>t!==`touch`||e.current}function jr(e,t=!1){let n=Fn(),r=Xn()!=null,i=_(()=>e(n,r)).current;return mr({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Mr({handle:e,store:t}){return C(()=>e.attachStore(t),[e,t]),null}function Nr(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Pr(e,t){let n=I.useRef(null);return S(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Nr(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Nr(t))})}function Fr(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Ir(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Lr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Pr(e,n),o=S(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=S(e=>{a(e),e&&o(e)});return C(()=>(s(t.current),()=>s(null)),[s,t,n,e]),C(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Rr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=I.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);C(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Xt(Qt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function zr(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Or({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return _(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Br(e,t){e.useSyncedValues(t),C(()=>()=>{e.update({activeTriggerProps:v,inactiveTriggerProps:v,popupProps:v})},[e])}function Vr(e,t){C(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),C(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Hr=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Ur={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Wr=class extends xr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Kn(),nested:n,triggerElements:i},Ur),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&>(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Gr(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Wr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:v,inactiveTriggerProps:v,popupProps:v}}var Kr=e=>e.triggerIdProp??e.activeTriggerId,qr=e=>e.openProp??e.open,Jr=e=>(e.popupElement?.id??e.floatingId)||void 0;function Yr(e,t){return t!==void 0&&qr(e)&&Kr(e)===t}function Xr(e,t){return Yr(e,t)?!0:t!==void 0&&qr(e)&&Kr(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Zr={open:qr,mounted:e=>e.mounted,transitionStatus:e=>qr(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Kr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Jr,isTriggerActive:(e,t)=>t!==void 0&&Kr(e)===t,isOpenedByTrigger:(e,t)=>Yr(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Kr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Xr(e,t)?Jr(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Qr(e){return Fn(e,`base-ui`)}function $r(e,t){let n=I.useRef(e),r=S(t);C(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function ei(e){return j(19)?e:e?`true`:void 0}var ti=I.createContext(void 0);function ni(){return I.useContext(ti)?.direction??`ltr`}var ri=I.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,R.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),ii={},ai={},oi=``;function si(e,t){return h(e)?e:t}function ci(e,t,n){return/hidden|clip/.test(e.getComputedStyle(si(t,n)).overflowY)}function li(e){if(typeof document>`u`)return!1;let t=L(e);return f(t).innerWidth-t.documentElement.clientWidth>0}function ui(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=L(e),n=t.documentElement,r=t.body,i=si(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function di(e){let t=L(e),n=t.documentElement,r=t.body,i=si(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function fi(e){let t=L(e),n=t.documentElement,r=t.body,i=f(n),a=0,o=0,s=!1,c=Ce.create();if(ve&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,ii={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},oi=n.style.scrollBehavior,ai={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=si(n,r);s=ui(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,ii),Object.assign(r.style,ai),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=oi)}function d(){u(),c.request(l)}l();let p=q(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&p()}}var pi=new class{lockCount=0;restore=null;timeoutLock=se.create();timeoutUnlock=se.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=L(e),n=t.documentElement,r=t.body,i=f(n);if(ci(i,n,r)){let t=new i.MutationObserver(()=>{ci(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=pe||!li(e);this.restore=a?di(e):fi(e)}};function mi(e=!0,t=null){C(()=>{if(e)return pi.acquire(t)},[e,t])}var hi=`ArrowUp`,gi=`ArrowDown`,_i=`ArrowLeft`,vi=`ArrowRight`,yi=new Set([hi,gi,_i,vi,`Home`,`End`]),bi=[`Shift`,`Control`,`Alt`,`Meta`];function xi(e){return l(e)&&e.tagName===`INPUT`}function Si(e){return!!(xi(e)&&e.selectionStart!=null||l(e)&&e.tagName===`TEXTAREA`)}function Ci(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=wi(e,t,`left`),a=Ti(e),o=Ti(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=wi(e,t,`top`),r=Ti(e),i=Ti(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function wi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Ti(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Ei({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=I.useRef(e!==void 0),[a,o]=I.useState(()=>t);return[i&&e!==void 0?e:a,I.useCallback(e=>{i||o(e)},[])]}var Di=I.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Oi(){return I.useContext(Di)}function ki(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=S(i),[,o]=I.useState(0),s=_(ji).current,c=_(Ai).current,l=I.useRef(0),u=I.useRef(!0),d=I.useRef(null),f=I.useRef(null),p=S(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=S((e,t)=>{c.set(e,t),p()}),h=S(e=>{c.delete(e),p()}),g=S(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Pi(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Fi(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Ni(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=S(()=>{let[e,t]=Mi(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});C(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),C(()=>{u.current&&y()}),C(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=S(e=>(s.add(e),()=>{s.delete(e)})),x=I.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,R.jsx)(Di.Provider,{value:x,children:t})}function Ai(){return new Map}function ji(){return new Set}function Mi(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Fi(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Ni(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Pi(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Fi(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Ii=I.createContext(void 0);function Li(){let e=I.useContext(Ii);if(e===void 0)throw Error(k(64));return e}var Ri=`data-activation-direction`,zi={tabActivationDirection:e=>({[Ri]:e})},Bi=I.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=I.useRef([]),[f,p]=I.useState(()=>new Map),[m,h]=Ei({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=I.useState(()=>new Map),y=I.useRef(void 0),b=I.useCallback(e=>Vi(_,e),[_]),[x,w]=I.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:T,tabActivationDirection:E}=x,D=E,O=!1;T!==m&&(D=Hi(T,m,a,_),O=T!=null&&m!=null&&b(m)==null);let k=O?T:m,j=T!==k||E!==D;C(()=>{j&&w({previousValue:k,tabActivationDirection:D})},[k,j,D]);let M=S((e,t)=>{t.activationDirection=Hi(m,e,a,_),i?.(e,t),t.isCanceled||h(()=>e)}),N=S((e,t)=>{i?.(e,Xt(t,void 0,void 0,{activationDirection:`none`}))}),P=S((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),F=I.useCallback(e=>f.get(e),[f]),L=I.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),z=I.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:L,getTabPanelIdByValue:F,onValueChange:M,orientation:a,registerMountedTabPanel:P,setTabMap:v,tabActivationDirection:D,value:m}),[b,L,F,M,a,P,v,D,m]),B=I.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),V=I.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),H=I.useRef(!u),U=I.useRef(r),W=I.useRef(u),G=I.useRef(!1);C(()=>{if(g)return;function e(e,t){h(()=>e),w({previousValue:e,tabActivationDirection:`none`}),N(e,t),H.current=!1}if(_.size===0){G.current&&m!==null&&!y.current?.isConnected&&e(null,mn);return}G.current=!0,y.current=_.keys().next().value;let t=B?.disabled,n=B==null&&m!==null;if(!t&&m===U.current&&(W.current=!1),W.current&&t&&m===U.current)return;let r=H.current;if(t||n){let n=V??null;if(m===n){H.current=!1;return}let i=mn;r?i=hn:t&&(i=pn),e(n,i)}else r&&B!=null&&(N(m,hn),H.current=!1)},[V,g,N,B,h,_,m]);let K=A(`div`,e,{state:{orientation:a,tabActivationDirection:D},ref:t,props:l,stateAttributesMapping:zi});return(0,R.jsx)(Ii.Provider,{value:z,children:(0,R.jsx)(ki,{elementsRef:d,children:K})})});function Vi(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function Hi(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=Vi(r,e),c=Vi(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var Ui=`data-composite-item-active`;function Wi(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Oi(),u=I.useRef(-1),[d,f]=I.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=I.useRef(null),h=I.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return C(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function Gi(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=x(),{ref:i,index:a}=Wi(e),o=n===a,s=I.useRef(null),c=y(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var Ki=I.createContext(void 0);function qi(){let e=I.useContext(Ki);if(e===void 0)throw Error(k(65));return e}var Ji=I.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=Li(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=qi(),{highlightedIndex:v,onHighlightedIndexChange:y}=x(),b=Qr(o),{compositeProps:w,compositeRef:T,index:E}=Gi({metadata:I.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),O=a===u,k=I.useRef(!1),j=I.useRef(null),M=S(e=>{j.current?.(),j.current=e?g(e):null});C(()=>{if(k.current){k.current=!1;return}if(!(O&&E>-1&&v!==E))return;let e=_;if(e!=null){let t=X(L(e));if(t&&Z(e,t))return}r||y(E)},[O,E,v,y,r,_]);let{getButtonProps:N,buttonRef:P}=D({disabled:r,native:s,focusableWhenDisabled:!0}),F=d(a),R=I.useRef(!1),z=I.useRef(!1);function B(e){f(a,Xt(Qt,e.nativeEvent,void 0,{activationDirection:`none`}))}function V(e){O||r||B(e)}function H(e){O||r||h&&(!R.current||z.current)&&B(e)}function U(e){if(O||r)return;R.current=!0,z.current=e.button===0;let t=L(e.currentTarget);function n(){R.current=!1,z.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return A(`button`,e,{state:{disabled:r,active:O,orientation:p,tabActivationDirection:m},ref:[t,P,T,M],props:[w,{role:`tab`,"aria-controls":F,"aria-selected":O,id:b,onClick:V,onFocus:H,onPointerDown:U,[Ui]:O?``:void 0,onKeyDownCapture(){k.current=!0}},l,N],stateAttributesMapping:zi})}),Yi=`data-index`,Xi={...zi,...ze},Zi=I.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=Li(),p=Qr(),{ref:m,index:h}=Wi(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=Sr(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},w=I.useRef(null),T=A(`div`,e,{state:S,ref:[t,m,w],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:ei(!g),[Yi]:h},s],stateAttributesMapping:Xi});return Dr({open:g,ref:w,onComplete(){g||y(!1)}}),C(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?T:null});function Qi(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function $i(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=w}=e,[p,m]=I.useState(0),h=r!=null,g=I.useRef(null),_=y(g,c),v=I.useRef([]),b=I.useRef(!1),x=I.useRef(null),T=o??p,E=S((e,t=!1)=>{if(x.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];Ci(g.current,t,a,n)}}),D=S(e=>{if(e.size===0)return;if(b.current){let e=v.current,t=e.indexOf(x.current);if(t===-1){let t=e[T];!t||St(e,T,d)?E(ea(e,d)):x.current=t}else t!==T&&E(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)E(i);else if(St(t,T,d)){let e=xt(t,{disabledIndices:d});_t(t,e)||E(e)}Ci(g.current,r,a,n)});C(()=>{if(d==null||o!=null||!b.current)return;let e=v.current;if(St(e,T,d)){let t=xt(e,{disabledIndices:d});_t(e,t)||E(t)}},[d,o,T,v,E]);let O=S((e,t,n)=>i?i(e,t,n,v):n),k=S(e=>{let o=e.key===`Home`||e.key===`End`;if(!yi.has(e.key)||!l&&o||ta(e,f)||!g.current)return;let s=a===`rtl`,c=s?_i:vi,p=s?vi:_i,m=n===`vertical`?gi:c,_=n===`vertical`?hi:p,y=Q(e.nativeEvent);if(y!=null&&Si(y)&&!Qi(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=T,x=vt(v,d),S=yt(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:T,loopFocus:t,maxIndex:S,minIndex:x,onLoop:O,orientation:n,rtl:s}));let C=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,w=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=S)),b===T&&(C||w)&&(t&&b===S&&C?(b=x,i&&(b=i(e,T,b,v))):t&&b===x&&w?(b=S,i&&(b=i(e,T,b,v))):b=xt(v.current,{startingIndex:b,decrement:w,disabledIndices:d})),b!==T&&!_t(v.current,b)&&(u&&e.stopPropagation(),(h||o||C||w)&&e.preventDefault(),E(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=Q(e.nativeEvent);t&&n!=null&&Si(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:k},highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:v,onMapChange:D,relayKeyboardEvent:k}}function ea(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!St(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function ta(e,t){for(let n of bi)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function na(e){let{render:t,className:n,style:r,refs:i=w,props:a=w,state:o=v,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:y,modifierKeys:x,highlightItemOnHover:S=!1,tag:C=`div`,...T}=e,{props:E,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,onMapChange:j,relayKeyboardEvent:M}=$i({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:ni(),disabledIndices:y,modifierKeys:x}),N=A(C,e,{state:o,ref:i,props:[E,...a,T],stateAttributesMapping:s}),P=I.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:O,highlightItemOnHover:S,relayKeyboardEvent:M}),[D,O,S,M]);return(0,R.jsx)(b.Provider,{value:P,children:(0,R.jsx)(ki,{elementsRef:k,onMapChange:e=>{h?.(e),j(e)},children:N})})}var ra=I.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Li(),[d,f]=I.useState(0),[p,m]=I.useState(null),h=I.useRef(new Set),g=I.useRef(new Set),_=I.useRef(null);C(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=S(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=S(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},T=I.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,R.jsx)(Ki.Provider,{value:T,children:(0,R.jsx)(na,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:zi,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:w})})}),$=t();function ia(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`horizontal`:i,o;t[4]===n?o=t[5]:(o=M(`group/tabs flex gap-2 data-horizontal:flex-col`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,R.jsx)(Bi,{"data-slot":`tabs`,"data-orientation":a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var aa=c(`group/tabs-list inline-flex w-fit items-center justify-center rounded-none p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function oa(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]!==n||t[5]!==a?(o=M(aa({variant:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o||t[9]!==a?(s=(0,R.jsx)(ra,{"data-slot":`tabs-list`,"data-variant":a,className:o,...r}),t[7]=r,t[8]=o,t[9]=a,t[10]=s):s=t[10],s}function sa(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-none border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:py-[calc(--spacing(1.25))] hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(Ji,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ca(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`flex-1 text-xs/relaxed outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(Zi,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function la(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(`label`,{"data-slot":`label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ua(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(`div`,{"data-slot":`field-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var da=c(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function fa(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]!==n||t[5]!==a?(o=M(da({orientation:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,R.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":a,className:o,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function pa(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=M(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-1 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(la,{"data-slot":`field-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ma(e){let t=(0,$.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,errors:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;bb0:{if(n){o=n;break bb0}if(!i?.length){o=null;break bb0}let e;t[5]===i?e=t[6]:(e=[...new Map(i.map(ga)).values()],t[5]=i,t[6]=e);let r=e;if(r?.length==1){o=r[0]?.message;break bb0}let a;t[7]===r?a=t[8]:(a=(0,R.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(ha)}),t[7]=r,t[8]=a),o=a}let s=o;if(!s)return null;let c;t[9]===r?c=t[10]:(c=M(`text-xs font-normal text-destructive`,r),t[9]=r,t[10]=c);let l;return t[11]!==s||t[12]!==a||t[13]!==c?(l=(0,R.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:c,...a,children:s}),t[11]=s,t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function ha(e,t){return e?.message&&(0,R.jsx)(`li`,{children:e.message},t)}function ga(e){return[e?.message,e]}function _a(e){let t=(0,$.c)(4),n;t[0]===e.result?n=t[1]:(n=o(a(s(e.result),va)),t[0]=e.result,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(ma,{children:n}),t[2]=n,t[3]=r),r}function va(e){return e.message}export{zn as $,Z as $t,Br as A,mt as At,mr as B,$e as Bt,kr as C,vt as Ct,Fr as D,St as Dt,Ar as E,_t as Et,Dr as F,ct as Ft,Qn as G,He as Gt,ur as H,Ve as Ht,Er as I,ot as It,qn as J,je as Jt,Xn as K,ze as Kt,Cr as L,lt as Lt,Vr as M,ut as Mt,Lr as N,st as Nt,Rr as O,ht as Ot,Pr as P,rt as Pt,Rn as Q,Oe as Qt,Sr as R,et as Rt,Hr as S,yt as St,Ir as T,wt as Tt,$n as U,Ue as Ut,pr as V,Qe as Vt,er as W,Be as Wt,Ln as X,Ne as Xt,Gn as Y,Me as Yt,In as Z,X as Zt,ei as _,Xt as _t,ia as a,ve as an,on as at,Gr as b,Wt as bt,sa as c,se as cn,ln as ct,ki as d,re as dn,nn as dt,Q as en,yn as et,Ei as f,ne as fn,un as ft,ni as g,L as gn,$t as gt,ri as h,ee as hn,en as ht,pa as i,ye as in,sn as it,jr as j,dt as jt,zr as k,pt as kt,Gi as l,ce as ln,cn as lt,mi as m,K as mn,tn as mt,fa as n,we as nn,dn as nt,ca as o,pe as on,gn as ot,yi as p,q as pn,fn as pt,Zn as q,Pe as qt,ua as r,be as rn,an as rt,oa as s,ge as sn,rn as st,_a as t,De as tn,_n as tt,Wi as u,ae as un,Qt as ut,$r as v,Zt as vt,Mr as w,bt as wt,Zr as x,Gt as xt,Qr as y,Jt as yt,xr as z,tt as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,o as n,r}from"./react-CS2OHYTO.js";import{u as i}from"./index-crHnIFMU.js";import{d as a,g as o,n as s,nt as c,r as l,st as u,t as d}from"./machine-DhN8aM5V.js";import{Ea as f,Fr as p,Ha as m,L as h,Li as g,Na as _,Pa as v,Pt as y,Ta as b,Va as x,ea as ee,gt as S,io as C,ka as w,nt as T,oo as te,qr as ne,rt as E,to as D}from"./effect-CctX5eYK.js";import{$t as O,A as k,C as A,D as j,E as M,F as N,H as re,Kt as P,M as F,O as I,Rt as ie,S as L,V as R,Y as z,_ as B,_t as V,a as ae,b as oe,c as se,en as H,h as U,i as ce,j as W,k as G,ln as le,m as ue,mn as de,n as fe,o as pe,ot as me,p as he,r as ge,rt as _e,s as ve,t as ye,ut as be,v as xe,w as Se,x as Ce,y as we,z as Te,zt as Ee}from"./result-error-CZELhOVc.js";import{R as De,_ as Oe,a as ke,g as Ae,h as K,l as je,o as q,p as Me,r as J,t as Y}from"./dist-Cnz9vY_S.js";var X=e(n(),1),Ne=new Map([[`bold`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),X.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),Pe=X.forwardRef((e,t)=>X.createElement(De,{ref:t,...e,weights:Ne}));Pe.displayName=`XIcon`;var Fe=X.createContext(void 0);function Z(e){let t=X.useContext(Fe);if(!e&&t===void 0)throw Error(Me(27));return t}var Ie=X.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Z(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return J(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:Ee,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Le=X.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Z(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=je({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,V(_e,e.nativeEvent))}return J(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Re=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=we(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),J(`p`,e,{ref:t,props:[{id:c},o]})}),ze=X.createContext(void 0);function Be(){let e=X.useContext(ze);if(e===void 0)throw Error(Me(26));return e}var Ve=`--nested-dialogs`,He=`data-nested-dialog-open`,Ue={...ie,...P,nestedDialogOpen(e){return e?{[He]:``}:null}},Q=r(),We=X.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Z(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),ee=d.useState(`floatingId`);Be(),N({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let S=o===void 0?M(c.context.popupRef):o,C=g>0,w=c.useStateSetter(`popupElement`),T=J(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:C},props:[f,{id:ee,"aria-labelledby":y,"aria-describedby":l,role:x,...A,hidden:!m,onKeyDown(e){he.has(e.key)&&e.stopPropagation()},style:{[Ve]:g}},s],ref:[t,c.context.popupRef,w],stateAttributesMapping:Ue});return(0,Q.jsx)(re,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:S,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:T})}),Ge=X.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Z(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(ze.Provider,{value:n,children:(0,Q.jsxs)(z,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(U,{ref:i.context.internalBackdropRef,inert:B(!s)}),e.children]})}):null});function Ke({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=X.useState(0),[d,f]=X.useState(0),p=l===0,m=R(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=H(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||O(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return ue(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),K(()=>{!r&&!i&&(u(0),f(0))},[r,i]),K(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),k(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var qe={...Ce,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Je=class extends Te{constructor(e,t,n){let r=new L,i=Ye(e,r,t,n);super(i,Xe(r),qe)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(j(this.state,e,t.trigger)))}};function Ye(e,t,n,r=!1){return{...oe(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Xe(e){return{popupRef:X.createRef(),backdropRef:X.createRef(),internalBackdropRef:X.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Ze(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Z(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=W((e,t)=>new Je({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),ee=b.useState(`mounted`),S=b.useState(`payload`);F(b,x),I(b);let{forceUnmount:C}=G(x,b);X.useImperativeHandle(l,()=>({unmount:C,close:()=>b.setOpen(!1,V(me))}),[C,b]);let w=x||ee||u!=null;return(0,Q.jsxs)(Fe.Provider,{value:b,children:[u&&(0,Q.jsx)(Se,{handle:u,store:b}),w&&(0,Q.jsx)(Ke,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:S}):n]})}var Qe=de(function(e){return Ze(`dialog`,e)}),$e=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=we(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),J(`h2`,e,{ref:t,props:[{id:c},o]})}),$=t();function et(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Qe,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function tt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Ge,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function nt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Le,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function rt(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Ie,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function it(e){let t=(0,$.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0||a,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(rt,{}),t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=Y(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=l);let u;t[8]===s?u=t[9]:(u=s&&(0,Q.jsxs)(Le,{"data-slot":`dialog-close`,render:(0,Q.jsx)(o,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(Pe,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=s,t[9]=u);let d;return t[10]!==n||t[11]!==i||t[12]!==l||t[13]!==u?(d=(0,Q.jsxs)(tt,{children:[c,(0,Q.jsxs)(We,{"data-slot":`dialog-content`,className:l,...i,children:[n,u]})]}),t[10]=n,t[11]=i,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function at(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex flex-col gap-1 text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ot(e){let t=(0,$.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a!==void 0&&a,c;t[5]===r?c=t[6]:(c=Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=c);let l;t[7]===s?l=t[8]:(l=s&&(0,Q.jsx)(Le,{render:(0,Q.jsx)(o,{variant:`outline`}),children:`Close`}),t[7]=s,t[8]=l);let u;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:c,...i,children:[n,l]}),t[9]=n,t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function st(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`font-heading text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)($e,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ct(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Re,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var lt=`data-valid`,ut=`data-invalid`,dt={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ft={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},pt={valid(e){return e===null?null:e?{[lt]:``}:{[ut]:``}}},mt={invalid:void 0,name:void 0,validityData:{state:dt,errors:[],error:``,value:``,initialValue:null},setValidityData:q,disabled:void 0,setTouched:q,setDirty:q,setFilled:q,setFocused:q,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:ft,registerFieldControl:q,validation:{getValidationProps:(e,t=ke)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:q,getInputControl:()=>null,commit:async()=>{},change:q}},ht=X.createContext(mt);function gt(e=!0){let t=X.useContext(ht);if(t.setValidityData===q&&!e)throw Error(Me(28));return t}var _t=X.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:q,validationMode:`onSubmit`,submitCountRef:{current:0}});function vt(){return X.useContext(_t)}var yt=X.createContext({controlId:void 0,registerControlId:q,resetControlId:q,labelId:void 0,setLabelId:q,messageIds:[],setMessageIds:q,getDescriptionProps:e=>e});function bt(){return X.useContext(yt)}function xt(e,t,n){let{setFocused:r,focusOwnerRef:i}=gt(),a=Ae(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return K(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function St(e,t,n,r,i=!0,a){let{registerFieldControl:o}=gt(),s=Oe(()=>Symbol());K(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),K(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Ct(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=bt(),o=we(),s=Oe(()=>Symbol()),c=X.useRef(!1),l=X.useRef(!1),u=Ae(()=>{c.current&&i!==q&&(c.current=!1,i(s.current,void 0))});return K(()=>{if(!n||i===q){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),K(()=>u,[u]),(n?r:void 0)??t??o}var wt=X.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=gt(),{clearErrors:ee,elementRef:S,submitCountRef:C}=vt(),w=h||s,T=m??a,te={...p,disabled:w},{labelId:ne}=bt(),E=Ct({id:i}),D=o!==void 0,O=o==null?void 0:String(o),k=Ae(()=>x.inputRef.current?.value);St(x.inputRef,E,O,k,!w,a),K(()=>{let e=O??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[O,l,x.inputRef,y]),xe(O,()=>{O!==void 0&&(ee(T),_(O!==(v.initialValue??``)),x.change(O))});let A=X.useRef(null),j=xt(w,A),M=le();return J(`input`,e,{ref:[t,A],state:te,props:[{id:E,disabled:w,name:T,ref:x.inputRef,"aria-labelledby":ne,autoFocus:u,...D?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=V(be,e.nativeEvent);c?.(t,n),D||(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(ee(T),x.change(t)))},onFocus(){j(!0)},onBlur(e){if(g(!0),j(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),D&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===S.current&&!e.defaultPrevented){let t=e.currentTarget,n=C.current;M.start(0,()=>{C.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(w,e)],stateAttributesMapping:pt})}),Tt=X.forwardRef(function(e,t){return(0,Q.jsx)(wt,{ref:t,...e})});function Et(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`h-8 w-full min-w-0 rounded-none border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Q.jsx)(Tt,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}var Dt=S([`tailnet`,`public`]);function Ot(e){let t=(0,$.c)(66),[n,r]=c(d),[i,s]=(0,X.useState)(`tailnet`),[l,u]=(0,X.useState)(``),f;t[0]===e.items?f=t[1]:(f=_(te(e.items,g(At),w(kt)),C(``)),t[0]=e.items,t[1]=f);let m=f,b;t[2]===n?b=t[3]:(b=T(n),t[2]=n,t[3]=b);let x=b,S;t[4]!==r||t[5]!==l||t[6]!==i||t[7]!==e.portNumber||t[8]!==m?(S=t=>{t.preventDefault(),r({hostname:h(i===`public`,{onFalse:()=>m,onTrue:()=>l}),kind:i,name:a.make(h(i===`public`,{onFalse:()=>`tailnet:${e.portNumber}`,onTrue:()=>`public:${l}`})),port:e.portNumber,publicAccess:i===`public`})},t[4]=r,t[5]=l,t[6]=i,t[7]=e.portNumber,t[8]=m,t[9]=S):S=t[9];let E;if(t[10]!==e.port.name||t[11]!==e.port.process){let n;t[13]===e.port.name?n=t[14]:(n=()=>e.port.name,t[13]=e.port.name,t[14]=n),E=_(e.port.process,n),t[10]=e.port.name,t[11]=e.port.process,t[12]=E}else E=t[12];let D;t[15]===E?D=t[16]:(D=(0,Q.jsx)(st,{children:E}),t[15]=E,t[16]=D);let O;t[17]===e.port.port?O=t[18]:(O=v(e.port.port),t[17]=e.port.port,t[18]=O);let k;t[19]===O?k=t[20]:(k=(0,Q.jsxs)(ct,{children:[`Port `,O]}),t[19]=O,t[20]=k);let A;t[21]!==D||t[22]!==k?(A=(0,Q.jsxs)(at,{children:[D,k]}),t[21]=D,t[22]=k,t[23]=A):A=t[23];let j;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{y(Dt)(e)&&s(e)},t[24]=j):j=t[24];let M;t[25]===x?M=t[26]:(M=ee(Dt.literals,e=>(0,Q.jsx)(se,{value:e,disabled:x,children:p(e)},e)),t[25]=x,t[26]=M);let N;t[27]===M?N=t[28]:(N=(0,Q.jsx)(ve,{className:`w-full`,children:M}),t[27]=M,t[28]=N);let re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(ce,{htmlFor:`expose-tailnet`,children:`Address`}),t[29]=re):re=t[29];let P;t[30]!==e.port.port||t[31]!==m?(P=h(m===``,{onFalse:()=>`https://${m}:${v(e.port.port)}`,onTrue:C(``)}),t[30]=e.port.port,t[31]=m,t[32]=P):P=t[32];let F;t[33]===P?F=t[34]:(F=(0,Q.jsx)(pe,{value:`tailnet`,children:(0,Q.jsxs)(fe,{children:[re,(0,Q.jsx)(Et,{id:`expose-tailnet`,readOnly:!0,value:P})]})}),t[33]=P,t[34]=F);let I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(ce,{htmlFor:`expose-public`,children:`Hostname`}),t[35]=I):I=t[35];let ie=i===`public`,L;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>u(ne(e.target.value)),t[36]=L):L=t[36];let R;t[37]!==l||t[38]!==x||t[39]!==ie?(R=(0,Q.jsx)(pe,{value:`public`,children:(0,Q.jsxs)(fe,{children:[I,(0,Q.jsx)(Et,{id:`expose-public`,required:ie,placeholder:`app.example.com`,autoCapitalize:`none`,spellCheck:!1,value:l,disabled:x,onChange:L})]})}),t[37]=l,t[38]=x,t[39]=ie,t[40]=R):R=t[40];let z;t[41]!==i||t[42]!==N||t[43]!==F||t[44]!==R?(z=(0,Q.jsxs)(ae,{value:i,onValueChange:j,children:[N,F,R]}),t[41]=i,t[42]=N,t[43]=F,t[44]=R,t[45]=z):z=t[45];let B;t[46]===n?B=t[47]:(B=(0,Q.jsx)(ye,{result:n}),t[46]=n,t[47]=B);let V;t[48]===x?V=t[49]:(V=(0,Q.jsx)(nt,{render:(0,Q.jsx)(o,{variant:`outline`,type:`button`,disabled:x}),children:`Cancel`}),t[48]=x,t[49]=V);let oe=x||i===`tailnet`&&m===``||i===`public`&&l===``,H;t[50]===x?H=t[51]:(H=h(x,{onFalse:C(`Expose`),onTrue:C(`Exposing…`)}),t[50]=x,t[51]=H);let U;t[52]!==oe||t[53]!==H?(U=(0,Q.jsx)(o,{type:`submit`,disabled:oe,children:H}),t[52]=oe,t[53]=H,t[54]=U):U=t[54];let W;t[55]!==V||t[56]!==U?(W=(0,Q.jsxs)(ot,{children:[V,U]}),t[55]=V,t[56]=U,t[57]=W):W=t[57];let G;t[58]!==z||t[59]!==B||t[60]!==W||t[61]!==A?(G=(0,Q.jsxs)(ge,{children:[A,z,B,W]}),t[58]=z,t[59]=B,t[60]=W,t[61]=A,t[62]=G):G=t[62];let le;return t[63]!==S||t[64]!==G?(le=(0,Q.jsx)(`form`,{onSubmit:S,children:G}),t[63]=S,t[64]=G,t[65]=le):le=t[65],le}function kt(e){return e.hostname}function At(e){return f(e.self,!0)}function jt(){let e=(0,$.c)(2),[t,n]=c(s),r;return e[0]===n?r=e[1]:(r=e=>(0,Q.jsx)(et,{open:!0,onOpenChange:e=>{e||n(m())},children:(0,Q.jsx)(it,{showCloseButton:!1,children:x(e.port.port,{onNone:D,onSome:t=>(0,Q.jsx)(Ot,{items:e.snapshot.items,port:e.port,portNumber:t},e.port.id)})})}),e[0]=n,e[1]=r),x(b({port:t,snapshot:E(u(l))}),{onNone:D,onSome:r})}function Mt(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(jt,{}),(0,Q.jsx)(i,{})]}),e[0]=t):t=e[0],t}export{Mt as component};
|
package/dist/client/index.html
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
<link rel="preload" href="/api/account" as="fetch" crossorigin />
|
|
19
19
|
|
|
20
20
|
<title>Deploy</title>
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/assets/index-crHnIFMU.js"></script>
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/react-CS2OHYTO.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/effect-
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/effect-CctX5eYK.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/dist-Cnz9vY_S.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
27
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/machine-DhN8aM5V.js">
|
|
27
|
+
<link rel="stylesheet" crossorigin href="/assets/index-XCoju4PZ.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
|
30
30
|
<div id="root"></div>
|