kiteline 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/{banner-C1Jj4n4W.mjs → banner-BuOcmDsa.mjs} +2 -1
- package/dist/cli.mjs +8 -8
- package/dist/{control-B4iYGngw.mjs → control-BgN8_tax.mjs} +6 -2
- package/dist/{control-BMOIrur6.mjs → control-C7c3jEfx.mjs} +1 -1
- package/dist/{devices-command-Bv_bsDPa.mjs → devices-command-B3MMYPtN.mjs} +2 -2
- package/dist/{package-CX75B96-.mjs → package-DHOE_RH7.mjs} +1 -1
- package/dist/{pair-command-DyAaiyGn.mjs → pair-command-XALkCQUv.mjs} +2 -2
- package/dist/service-C5qMgcr3.mjs +1 -0
- package/dist/service-DslziQUi.mjs +350 -0
- package/dist/{src-BIPu215q.mjs → src-CTDwjLMW.mjs} +384 -5
- package/dist/web/assets/Check.es-BA1UHLtA.js +1 -0
- package/dist/web/assets/X.es-DJ1WqcAP.js +1 -0
- package/dist/web/assets/composer-BX_w26mL.js +1 -0
- package/dist/web/assets/copy-button-B4svySbV.js +1 -0
- package/dist/web/assets/format-CvRKEalM.js +9 -0
- package/dist/web/assets/index-BuRrTWI4.css +1 -0
- package/dist/web/assets/index-DGeAdCJK.js +11 -0
- package/dist/web/assets/lazy/{core-CU5HQPlE.js → core-d0pVacdC.js} +1 -1
- package/dist/web/assets/new-BoDUmHwx.js +1 -0
- package/dist/web/assets/prefs-CbK1R9ph.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/routes-BccFpSN5.js +1 -0
- package/dist/web/assets/{s._sessionId-BH5Oq7PW.js → s._sessionId-DGue-MjF.js} +12 -12
- package/dist/web/assets/settings-DqB0BC9E.js +1 -0
- package/dist/web/assets/status-ComAJ-QA.js +1 -0
- package/dist/web/assets/version-eBdZEdv0.js +1 -0
- package/dist/web/index.html +4 -3
- package/dist/web/push-sw.js +45 -0
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/service-pIzAzHWX.mjs +0 -223
- package/dist/web/assets/Check.es-BazDUJ8l.js +0 -1
- package/dist/web/assets/Plus.es-BTjK6Adi.js +0 -1
- package/dist/web/assets/X.es-BLVrGeYn.js +0 -1
- package/dist/web/assets/composer-D3-nzQwm.js +0 -1
- package/dist/web/assets/copy-button-B5-YyZiJ.js +0 -1
- package/dist/web/assets/format-qC7-v1aY.js +0 -9
- package/dist/web/assets/index-DLCIIoKU.js +0 -11
- package/dist/web/assets/index-Dfz5hLiZ.css +0 -1
- package/dist/web/assets/new-8iHRF9aP.js +0 -1
- package/dist/web/assets/prefs-CwnnVOOA.js +0 -1
- package/dist/web/assets/routes-BC1QwJvj.js +0 -1
- package/dist/web/assets/settings-CFJIOWmt.js +0 -1
- package/dist/web/assets/status-DNclzjzI.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),a=t(((e,t)=>{t.exports=i()})),o=e(r(),1),s=a(),c=o.createContext(void 0),l=e=>{let t=o.useContext(c);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},u=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(c.Provider,{value:e,children:t})),d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==S(o,t.options))return!1}else if(!w(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function x(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(C(t.options.mutationKey)!==C(a))return!1}else if(!w(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function S(e,t){return(t?.queryKeyHashFn||C)(e)}function C(e){return JSON.stringify(e,(e,t)=>k(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!w(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!w(e[r],t[r]))return!1;return!0}return!1}var T=Object.prototype.hasOwnProperty;function E(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=O(e)&&O(t);if(!r&&!(k(e)&&k(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:T.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=E(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function O(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k(e){if(!A(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!A(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function A(e){return Object.prototype.toString.call(e)===`[object Object]`}function j(e){return new Promise(t=>{f.setTimeout(t,e)})}function M(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:E(e,t)}function N(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function P(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var F=Symbol();function I(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===F?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function L(e,t){return typeof e==`function`?e(...t):!!e}function R(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var z=()=>m,B=()=>z(),ee=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},te=new class extends ee{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ne=p;function V(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ne,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var H=V(),re=new class extends ee{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function U(e){return Math.min(1e3*2**e,3e4)}function W(e){return(e??`online`)!==`online`||re.isOnline()}var G=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function K(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(h);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new G(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>te.isFocused()&&(e.networkMode===`always`||re.isOnline())&&e.canRun(),p=()=>W(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(B()?0:3),a=e.retryDelay??U,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),j(o).then(()=>f()?void 0:_(f)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():_(p).then(v),s)}}var q=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(B()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function J(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{R(e,()=>t.signal,()=>n=!0)},u=I(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?P:N;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ae:ie,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:ie(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function ie(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ae(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var oe=class extends q{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=le(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=le(this.options);e.data!==void 0&&(this.setState(ce(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=M(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===F||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=I(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?J(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=K({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof G&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof G){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...se(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ce(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),H.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function se(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:W(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ce(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function le(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ue=class extends ee{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),fe(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&me(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#h(e){return!B()&&y(this.options.enabled,this.#t)!==!1&&_(e)}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#u=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return y(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=f.setInterval(()=>{(this.options.refetchIntervalInBackground||te.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(f.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(f.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&fe(e,t),o=i&&me(e,n,t,r);(a||o)&&(l={...l,...se(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=M(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=M(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,b=_&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:he(e,t),refetch:this.refetch,isEnabled:y(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),D(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();H.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function de(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||y(t.retryOnMount,e)!==!1)}function fe(e,t){return de(e,t)||e.state.data!==void 0&&pe(e,t,t.refetchOnMount)}function pe(e,t,n){if(y(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=y(n,e);return r===`always`||r!==!1&&he(e,t)}return!1}function me(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&he(e,n)}function he(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}var ge=class extends q{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||_e(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=K({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),H.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function _e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ve=class extends ee{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ge({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ye(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ye(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ye(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ye(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){H.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){return this.getAll().filter(t=>x(e,t))}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return H.batch(()=>Promise.all(e.map(e=>e.continue().catch(h))))}};function ye(e){return e.options.scope?.id}var be=class extends ee{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??S(r,t),a=this.get(i);return a||(a=new oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){H.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>b(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>b(e,t)):t}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){H.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){H.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new be,this.#t=e.mutationCache||new ve,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=te.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=re.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(y(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=g(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return H.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;H.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return H.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=H.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(h).catch(h)}invalidateQueries(e,t={}){return H.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=H.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(h)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(h)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(y(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(y(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(h).catch(h)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(h).catch(h)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return re.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(C(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{w(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(C(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{w(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=S(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===F&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Se=o.createContext(!1),Ce=()=>o.useContext(Se);Se.Provider;function we(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Te=o.createContext(we()),Ee=()=>o.useContext(Te),De=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?L(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Oe=e=>{o.useEffect(()=>{e.clearReset()},[e])},ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||L(n,[e.error,r])),Ae=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},je=(e,t)=>e?.suspense&&t.isPending,Me=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ne(e,t,n){let r=Ce(),i=Ee(),a=l(n),s=a.defaultQueryOptions(e),c=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,Ae(s),De(s,i,c),Oe(i);let[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&u;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(H.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),je(s,f))throw Me(s,d,i);if(ke({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return s.notifyOnChangeProps?f:d.trackResult(f)}function Pe(e,t){return Ne(e,ue,t)}var Fe=o.createContext(null);function Ie(e){return o.useContext(Fe)}var Le=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Re=t(((e,t)=>{t.exports=Le()})),ze=t((e=>{var t=r(),n=Re();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Be=t(((e,t)=>{t.exports=ze()})),Ve=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),He=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ve()}));function Ue(){return typeof window<`u`}function We(e){return qe(e)?(e.nodeName||``).toLowerCase():`#document`}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ke(e){return((qe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qe(e){return Ue()?e instanceof Node||e instanceof Ge(e).Node:!1}function Je(e){return Ue()?e instanceof Element||e instanceof Ge(e).Element:!1}function Ye(e){return Ue()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function Xe(e){return!Ue()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}function Ze(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Qe(e){return/^(table|td|th)$/.test(We(e))}function $e(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var et=/transform|translate|scale|rotate|perspective|filter/,tt=/paint|layout|strict|content/,nt=e=>!!e&&e!==`none`,rt;function it(e){let t=Je(e)?ct(e):e;return nt(t.transform)||nt(t.translate)||nt(t.scale)||nt(t.rotate)||nt(t.perspective)||!ot()&&(nt(t.backdropFilter)||nt(t.filter))||et.test(t.willChange||``)||tt.test(t.contain||``)}function at(e){let t=ut(e);for(;Ye(t)&&!st(t);){if(it(t))return t;if($e(t))return null;t=ut(t)}return null}function ot(){return rt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),rt}function st(e){return/^(html|body|#document)$/.test(We(e))}function ct(e){return Ge(e).getComputedStyle(e)}function lt(e){return Je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ut(e){if(We(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Xe(e)&&e.host||Ke(e);return Xe(t)?t.host:t}function dt(e){let t=ut(e);return st(t)?(e.ownerDocument||e).body:Ye(t)&&Ze(t)?t:dt(t)}function ft(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=dt(e),i=r===e.ownerDocument?.body,a=Ge(r);if(i){let e=pt(a);return t.concat(a,a.visualViewport||[],Ze(r)?r:[],e&&n?ft(e):[])}return t.concat(r,ft(r,[],n))}function pt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var mt={...o},ht={};function gt(e,t){let n=o.useRef(ht);return n.current===ht&&(n.current=e(t)),n}var _t=mt.useInsertionEffect,vt=_t&&_t!==mt.useLayoutEffect?_t:e=>e();function Y(e){let t=gt(yt).current;return t.next=e,vt(t.effect),t.trampoline}function yt(){let e={next:void 0,callback:bt,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function bt(){}var X=typeof document<`u`?o.useLayoutEffect:()=>{};function xt(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var St={};function Ct(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Tt(t);let a=Tt(e);return t&&(a=Et(a,t)),n&&(a=Et(a,n)),r&&(a=Et(a,r)),i&&(a=Et(a,i)),a}function wt(e){if(e.length===0)return St;if(e.length===1)return Tt(e[0]);let t=Tt(e[0]);for(let n=1;n<e.length;n+=1)t=Et(t,e[n]);return t}function Tt(e){return At(e)?{...e(St)}:Dt(e)}function Et(e,t){return At(t)?t(e):Ot(e,t)}function Dt(e){let t={...e};for(let e in t){let n=t[e];kt(e,n)&&(t[e]=Mt(n))}return t}function Ot(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=xt(e.style,r);break;case`className`:e[n]=Pt(e.className,r);break;default:e[n]=kt(n,r)?jt(e[n],r):r}}return e}function kt(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function At(e){return typeof e==`function`}function jt(e,t){return t?e?(...n)=>{let r=n[0];if(Ft(r)){let i=r;Nt(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Mt(t):e}function Mt(e){return e&&((...t)=>{let n=t[0];return Ft(n)&&Nt(n),e(...t)})}function Nt(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pt(e,t){return t?e?t+` `+e:t:e}function Ft(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function It(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Lt=It(`https://base-ui.com/production-error`,`Base UI`),Rt=o.createContext(void 0);function zt(e=!1){let t=o.useContext(Rt);if(t===void 0&&!e)throw Error(Lt(16));return t}function Bt(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,s=r&&t!==!1,c=r&&t===!1;return{props:o.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||s)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,a,i])}}function Z(e){return e?.ownerDocument||document}function Vt(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Ge(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ht(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,s=o.useRef(null),c=zt(!0),l=a??c!==void 0,{props:u}=Bt({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),d=o.useCallback(()=>{let e=s.current;Ut(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return X(d,[d]),{getButtonProps:o.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...c}=e;return Ct({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Nt(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Ut(r),s=!i&&Wt(r),c=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Vt(r,e))}else!c||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Vt(r,e)))},onKeyUp(e){t||(Nt(e),a?.(e),e.target===e.currentTarget&&i&&l&&Ut(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||l||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),Vt(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},u,c)},[t,u,l,i]),buttonRef:Y(e=>{s.current=e,d()})}}function Ut(e){return Ye(e)&&e.tagName===`BUTTON`}function Wt(e){return Ye(e)&&e.tagName===`A`&&!!e.href}function Gt(e,t,n,r){let i=gt(qt).current;return Jt(i,e,t,n,r)&&Xt(i,[e,t,n,r]),i.callback}function Kt(e){let t=gt(qt).current;return Yt(t,e)&&Xt(t,e),t.callback}function qt(){return{callback:null,cleanup:null,refs:[]}}function Jt(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Yt(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Xt(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Zt=19;function Qt(e){return Zt>=e}function $t(e){if(!o.isValidElement(e))return null;let t=e,n=t.props;return(Qt(19)?n?.ref:t.ref)??null}function en(){}var tn=Object.freeze([]),nn=Object.freeze({});function rn(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function an(e,t){return typeof e==`function`?e(t):e}function on(e,t){return typeof e==`function`?e(t):e}function sn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=dn(r));let i=cn(t,n,r);if(n.enabled===!1)return null;let a=n.state??nn;return fn(e,r,i,a)}function cn(e,t,n){let{className:r,style:i}=e,{state:a=nn,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?an(r,a):void 0,d=l?on(i,a):void 0,f=l?rn(a,c):nn,p=l&&s?ln(s):void 0,m=l?xt(f,p)??{}:nn;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Kt([m.ref,$t(n),...o]):Gt(m.ref,$t(n),o):Gt(null,null)),l?(u!==void 0&&(m.className=Pt(m.className,u)),d!==void 0&&(m.style=xt(m.style,d)),m):nn}function ln(e){return Array.isArray(e)?wt(e):Ct(void 0,e)}var un=Symbol.for(`react.lazy`);function dn(e){if(e?.$$typeof!==un)return e;let t=o.Children.toArray(e)[0];return o.isValidElement(t)?t:e}function fn(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ct(n,t.props);return e.ref=n.ref,o.cloneElement(t,e)}return pn(e,n)}function pn(e,t){return e===`button`?(0,o.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,o.createElement)(`img`,{alt:``,...t,key:t.key}):o.createElement(e,t)}var mn=o.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}=Ht({disabled:i,focusableWhenDisabled:a,native:o});return sn(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),hn=48,gn=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-hn-t;return n},_n=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},vn=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-hn;n+=i>>>1^-(i&1),t[r]=n}return t},yn=384,bn=[],xn=_n(gn(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Sn=_n(gn(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Cn=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,wn=(()=>{let e=xn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=xn[n];i<xn[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(xn[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=xn[i];a<xn[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Tn=gn(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),En=_n(gn(`123333359346463635126536711576`)),Dn=gn(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),On=gn(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),kn=vn(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),An=(()=>{let e=new Int32Array(319).fill(-1),t=vn(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=vn(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),jn=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Mn=vn(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Nn=vn(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Pn=vn(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),Fn=new Int32Array(987),In=new Int32Array(987),Ln=new Int32Array(987),Rn=``,zn=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<Mn.length;r++)for(let i of jn[Pn[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),zn[a*2]=Rn.length,zn[a*2+1]=i.length,Rn+=i),Fn[n]=Mn[r],In[n]=Nn[r],Ln[n]=a,n++}}var Bn=vn(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Vn=_n(gn(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Hn=vn(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Un=gn(`ij`),Wn=gn(``),Gn=gn(`1`),Kn={GROUP_COUNT:yn,customValidatorNames:bn,edgeStart:xn,labelStart:Sn,labelText:Cn,edgeTarget:wn,nodeGroup:Tn,nodeVlist:An,vlistPat:En,vlistOps:Dn,vlistRef:On,vlistGroup:kn,litAnchor:Fn,litGroup:In,litPool:Ln,poolOffsets:zn,poolText:Rn,adjGid:Bn,adjStart:Vn,adjTgt:Hn,patGid:Un,patTgt:Wn,postfixLookupGroups:Gn,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},qn=`line`in Error(),Jn=-1,Yn=-1,Xn=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Zn=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Qn=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Xn(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Xn(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,ee=B===``?``:B+`:`,te=ee.length,ne=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),V=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,H=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,re=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=0,G=-1,K=-1,q=-1,J=-1,ie=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ae=e=>/\s/.test(String.fromCharCode(e)),oe=(e,t,n)=>{if(W=0,G=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)W=1;else if(r===40&&i===41)W=2;else return;q=t+1,J=n-1;let a=t+1;if(ie(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ie(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(G=t+1,K=a,q=a+1)}},se=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},ce=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,le=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ue=e=>!!e&&!Number.isNaN(Number(e)),de=(e,t,n)=>{if(n-t<11||!se(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&se(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&se(e,t+10,t+18,`-normal/`)},fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],he=(e,t,n,r)=>{if(e>=10){if(e>=25)return ne[e-25](t.slice(n,r));let i=e-10;if(W!==fe[i])return!1;if(G>=0){for(let e of pe[i])if(se(t,G,K,e))return!0;return!1}switch(me[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(q,J);return V.test(e)&&!H.test(e)}case 3:return ue(t.slice(q,J));case 4:return U.test(t.slice(q,J));default:return re.test(t.slice(q,J))}}switch(e){case 0:return!0;case 1:return W===0;case 2:return W===1;case 3:return W===2;case 4:return ce.test(t.slice(n,r));case 5:return ue(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ue(t.slice(n,r-1));case 8:return le.test(t.slice(n,r));default:return de(t,n,r)}},ge=new Set(typeof E==`string`?E.split(` `):E),_e=(e,t,n,r,i,a)=>{let o=Xn(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ve=new Map,ye=new Map,be=2,xe=4096,Se=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ge.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=ye.get(s);return c===void 0&&ye.set(s,c=be++),c},Ce=new Map,we=r,Te=r+4096,Ee=()=>we++,De=2097152,Oe=8192,ke=new Int32Array(Oe),Ae=Array(Oe).fill(null),je=new Int32Array(Oe),Me=new Int32Array(Oe),Ne=new Uint8Array(Oe),Pe=0,Fe=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ae[e]!==null){if(Ae[e|1]===null)c=e|1;else if(!(Pe++&3))c=e|Pe>>2&1;else return}Ae[c]=t.slice(n,r),ke[c]=i,je[c]=a,Me[c]=o,Ne[c]=s},Ie=()=>Ae.fill(null),Le=256,Re=[new Int32Array(Le),new Int32Array(Le),new Int32Array(Le),new Int32Array(Le)],[ze,Be,Ve,He]=Re,Ue=new Uint8Array(Le),We=new Uint8Array(Le),Ge=()=>{Le*=2,Re=Re.map(e=>{let t=new Int32Array(Le);return t.set(e),t}),[ze,Be,Ve,He]=Re;let e=new Uint8Array(Le);e.set(Ue),Ue=e,We=new Uint8Array(Le)},Ke=64,qe=new Int32Array(Ke),Je=new Int32Array(Ke),Ye=new Int32Array(r),Xe=2048,Ze=21,Qe=new Float64Array(Xe),$e=new Int32Array(Xe),et=0,tt=(e,t)=>{if(e===0&&t<r)return Ye[t]===et?1:(Ye[t]=et,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Ze;for(;$e[i]===et;){if(Qe[i]===n)return 1;i=i+1&Xe-1}return Qe[i]=n,$e[i]=et,0},nt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Jn:_e(Ce,e,t+1,r,0,Ee)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Je[t];if(r>n)continue;let i=qe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;oe(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(he(d[t],e,r,n))return p[h+t]}return Jn},rt=e=>{let t=e.length,n=0,c=0,u=!1;(be>xe||ve.size>xe)&&(ve=new Map,ye=new Map,be=2,Ie()),we>Te&&(Ce=new Map,we=r,Ie());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ae(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ae(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Le&&Ge();let _=n++;ze[_]=p,Be[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ke[y]===v&&Ae[y]!==null&&Ae[y].length===g?t=y:ke[y|1]===v&&Ae[y|1]!==null&&Ae[y|1].length===g&&(t=y|1),t>=0){let n=Ae[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ve[_]=je[t],He[_]=Me[t],Ue[_]=Ne[t];continue}}}let b=p;if(te!==0){if(h-p<=te||!e.startsWith(ee,p)){Ve[_]=Jn,Fe(y,e,p,h,v,Jn,0,0);continue}b=p+te}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(qe[0]=0,Je[0]=M,R=1);let z=Yn,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Yn:P,B=R),P!==Yn){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Yn;else{let e=i[P],t=i[P+1],c=Yn;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ke){Ke*=2;let e=new Int32Array(Ke);e.set(qe),qe=e;let t=new Int32Array(Ke);t.set(Je),Je=t}qe[R]=r,Je[R]=t+2,R++}}A===D&&(z=F<I?Yn:P,B=R);let ne=F<I?Yn:P,V,H=!1;if(A>=0){if(H=!0,V=nt(e,E,A,z,B),V!==Jn&&V<r&&j[V]){let t=nt(e,E,D,ne,R);t!==Jn&&t!==V&&(V=t,H=!1)}else V===Jn&&(V=nt(e,E,D,ne,R),H=!1)}else V=nt(e,E,D,ne,R);let re=0,U=0;V===Jn?Ve[_]=Jn:(U=+!!H,re=b>=C?+!!O:_e(ve,e,b,C,+!!O,e=>Se(e,O)),Ve[_]=V,Ue[_]=U,He[_]=re),Fe(y,e,p,h,v,V,re,U)}if(n===0)return``;if(n===1)return ze[0]===0&&Be[0]===t?e:e.slice(ze[0],Be[0]);if(n*k>Xe){for(;n*k>Xe;)Xe<<=1,Ze--;Qe=new Float64Array(Xe),$e=new Int32Array(Xe)}if(be>=De||we>=De)throw Error(`cn: too many distinct classes in one merge`);et=et+1|0,et===0&&(Ye.fill(0),$e.fill(0),et=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ve[e];if(t===Jn){We[e]=1;continue}let n=He[e];if(tt(n,t)===1)We[e]=0,f=!0;else if(We[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)tt(n,x[e]);if(Ue[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&tt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!We[m]){m++;continue}let t=ze[m],r=Be[m],i=m+1;for(;i<n&&We[i]&&ze[i]===r+1&&e.charCodeAt(r)===32;)r=Be[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},it=16384,at=new Int32Array(it*2),ot=0,st=1,ct=Object.create(null),lt=Object.create(null),ut=new Map,dt=new Map,ft=0,pt=0,mt=()=>{ot^=it,st=st+1|0,pt=0},ht=e=>{let t=ct[e];if(t!==void 0)return t;let n=Zn(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=lt[e],t!==void 0)?(ct[e]=t,t):(t=rt(e),i?(ct[e]=t,++ft>z&&(ft=0,lt=ct,ct=Object.create(null),mt())):(at[r]=n^st,++pt>it&&mt()),t)},gt=e=>{let t=ut.get(e);if(t!==void 0)return t;let n=Zn(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=dt.get(e),t!==void 0)?(ut.set(e,t),t):(t=rt(e),i?(ut.set(e,t),++ft>z&&(ft=0,dt=ut,ut=new Map,mt())):(at[r]=n^st,++pt>it&&mt()),t)},_t=e=>{let t=Zn(e,0,e.length),n=(t&16383)+ot;return at[n]===(t^st)||at[n^it]===(t^st-1)||(at[n]=t^st,++pt>it&&mt(),!1)},vt=z===0?rt:qn?e=>{let t=ut.get(e);return t===void 0?gt(e):t}:ht;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?vt(arguments[0]):vt(tr.apply(null,arguments))},mergeString:vt,seenBefore:z===0?()=>!1:_t,mergeUncached:rt}},$n=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:$n(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},er=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:$n(i,t);a&&(n&&(n+=` `),n+=a)}return n},tr=function(){return er(arguments,!1)},nr=256,rr=16,ir=1024,ar=4096,or=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(ar).fill(``),l=Array(ar).fill(``),u=Array(ar).fill(``));let i=Zn(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=$n(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>rr&&(_.miss=rr,_.skip=ir,_.e.length=0,_.at=0);let u=_.e;u.length<nr?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e($n(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},sr=Qn(Kn),cr=or(sr.mergeString,sr);sr.merge;function lr(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=lr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function ur(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=lr(e))&&(r&&(r+=` `),r+=t);return r}var dr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,fr=ur,pr=((e,t)=>n=>{if(t?.variants==null)return fr(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=dr(t)||dr(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 fr(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)})(`group/button relative inline-flex shrink-0 items-center justify-center gap-2 font-medium whitespace-nowrap transition-[background-color,color,box-shadow,transform,opacity] duration-150 ease-out outline-none select-none active:scale-[0.98] disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-foreground text-background hover:bg-foreground/88 disabled:bg-surface-3 disabled:text-faint disabled:opacity-100`,brand:`bg-brand hover:bg-brand/90 text-white`,secondary:`bg-surface-2 text-foreground hover:bg-surface-3 dark:bg-surface-3 dark:hover:bg-[#333337]`,outline:`bg-surface text-foreground shadow-card hover:bg-surface-2`,ghost:`text-muted-foreground hover:bg-surface-2 hover:text-foreground`,destructive:`bg-destructive-soft text-destructive hover:bg-destructive/15`,link:`text-brand-text underline-offset-4 hover:underline`},size:{default:`h-10 rounded-[10px] px-4 text-[14px]`,sm:`h-8 rounded-lg px-3 text-[13px]`,lg:`h-12 rounded-xl px-5 text-[15px]`,icon:`size-10 rounded-[10px]`,"icon-sm":`size-8 rounded-lg`}},defaultVariants:{variant:`default`,size:`default`}});function mr({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,s.jsx)(mn,{"data-slot":`button`,className:cr(pr({variant:t,size:n,className:e})),...r})}function hr(e){return e[0]??{}}function gr(e){return Array.isArray(e)?e:e==null?[]:[e]}var _r=4300,vr=/^-?(?:0|[1-9]\d*)$/;function yr(e,t){if(!((e.startsWith(`-`)?e.length-1:e.length)>t||!vr.test(e)))return BigInt(e)}var br=`orpc`,xr=`@orpc/shared`,Sr=`1.16.1`,Cr=class extends Error{constructor(...e){super(...e),this.name=`AbortError`}};function wr(e){let t;return()=>{if(t)return t.result;let n=e();return t={result:n},n}}function Tr(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}var Er=2,Dr=`__${xr}@${Sr}/otel/config__`;function Or(){return globalThis[Dr]}function kr(e,t={},n){return(Or()?.tracer)?.startSpan(e,t,n)}function Ar(e,t,n={}){if(!e)return;let r=jr(t);e.recordException(r),n.signal?.aborted&&n.signal.reason===t||e.setStatus({code:Er,message:r.message})}function jr(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};return`code`in e&&(typeof e.code==`string`||typeof e.code==`number`)&&(t.code=e.code),t}return{message:String(e)}}async function Mr({name:e,context:t,...n},r){let i=Or()?.tracer;if(!i)return r();let a=async e=>{try{return await r(e)}catch(t){throw Ar(e,t,n),t}finally{e.end()}};return t?i.startActiveSpan(e,n,t,a):i.startActiveSpan(e,n,a)}async function Nr(e,t){let n=Or();if(!e||!n)return t();let r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}function Pr(e){return!e||typeof e!=`object`?!1:`next`in e&&typeof e.next==`function`&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==`function`}var Fr=Symbol.asyncDispose??Symbol.for(`asyncDispose`),Ir=class{#e=!1;#t=!1;#n;#r;constructor(e,t){this.#n=t,this.#r=Tr(async()=>{if(this.#e)return{done:!0,value:void 0};try{let t=await e();return t.done&&(this.#e=!0),t}catch(e){throw this.#e=!0,e}finally{this.#e&&!this.#t&&(this.#t=!0,await this.#n(`next`))}})}next(){return this.#r()}async return(e){return this.#e=!0,this.#t||(this.#t=!0,await this.#n(`return`)),{done:!0,value:e}}async throw(e){throw this.#e=!0,this.#t||(this.#t=!0,await this.#n(`throw`)),e}async[Fr](){this.#e=!0,this.#t||(this.#t=!0,await this.#n(`dispose`))}[Symbol.asyncIterator](){return this}};function Lr({name:e,...t},n){let r;return new Ir(async()=>{r??=kr(e);try{let e=await Nr(r,()=>n.next());return r?.addEvent(e.done?`completed`:`yielded`),e}catch(e){throw Ar(r,e,t),e}},async e=>{try{e!==`next`&&await Nr(r,()=>n.return?.())}catch(e){throw Ar(r,e,t),e}finally{r?.end()}})}function Rr(e,t,n){let r=(t,i)=>{let a=e[i];return a?a({...t,next:(e=t)=>r(e,i+1)}):n(t)};return r(t,0)}function zr(e){if(e)return JSON.parse(e)}function Br(e){return JSON.stringify(e)}function Vr(e){return Ur(e)?Object.getPrototypeOf(e)?.constructor:null}function Hr(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function Ur(e){return!!e&&(typeof e==`object`||typeof e==`function`)}function Wr(e,t){let n=e;for(let e of t){if(!Ur(n))return;n=n[e]}return n}function Gr(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Kr(e,t,n){let r=e[t];if(r!==n)return r;let i;if(Array.isArray(r))i=r.slice();else if(Hr(r))i={...r};else return r;return Gr(e,t,i),i}function qr(e,...t){return typeof e==`function`?e(...t):e}function Jr(e){return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return t!==`then`||typeof r!=`function`?r:new Proxy(r,{apply(t,n,r){if(r.length!==2||r.some(e=>!Xr(e)))return Reflect.apply(t,n,r);let i=!0;r[0].call(n,Jr(new Proxy(e,{get:(e,t,n)=>{if(i&&t===`then`)i=!1;else return Reflect.get(e,t,n)}})))}})}})}var Yr=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/;function Xr(e){return typeof e==`function`&&Yr.test(e.toString())}var Zr=/^[dgimsuvy]*$/;function Qr(e){return Zr.test(e)&&new Set(e).size===e.length&&!(e.includes(`u`)&&e.includes(`v`))}function $r(e,t){let n,r=0,i=()=>(n===void 0&&(n=new RegExp(e,t),n.lastIndex=r),n);return new Proxy(Object.create(RegExp.prototype),{get(e,t){if(t===Symbol.toStringTag)return`RegExp`;if(n===void 0){if(t===`lastIndex`)return r;if(!(t in RegExp.prototype))return}let a=i(),o=Reflect.get(a,t,a);return typeof o==`function`&&t!==`constructor`?o.bind(a):o},set(e,t,a){if(n===void 0&&t===`lastIndex`)return r=a,!0;let o=i();return Reflect.set(o,t,a,o)},has(e,t){return n===void 0?t===`lastIndex`||t in RegExp.prototype:Reflect.has(n,t)}})}function ei(e){try{return decodeURIComponent(e)}catch{return e}}var ti=`@orpc/client`,ni=`1.16.1`,ri=new Set([`bind`,`valueOf`,`toString`,`toJSON`]),ii={BAD_REQUEST:{status:400,message:`Bad Request`},UNAUTHORIZED:{status:401,message:`Unauthorized`},FORBIDDEN:{status:403,message:`Forbidden`},NOT_FOUND:{status:404,message:`Not Found`},METHOD_NOT_SUPPORTED:{status:405,message:`Method Not Supported`},NOT_ACCEPTABLE:{status:406,message:`Not Acceptable`},TIMEOUT:{status:408,message:`Request Timeout`},CONFLICT:{status:409,message:`Conflict`},PRECONDITION_FAILED:{status:412,message:`Precondition Failed`},PAYLOAD_TOO_LARGE:{status:413,message:`Payload Too Large`},UNSUPPORTED_MEDIA_TYPE:{status:415,message:`Unsupported Media Type`},UNPROCESSABLE_CONTENT:{status:422,message:`Unprocessable Content`},TOO_MANY_REQUESTS:{status:429,message:`Too Many Requests`},CLIENT_CLOSED_REQUEST:{status:499,message:`Client Closed Request`},INTERNAL_SERVER_ERROR:{status:500,message:`Internal Server Error`},NOT_IMPLEMENTED:{status:501,message:`Not Implemented`},BAD_GATEWAY:{status:502,message:`Bad Gateway`},SERVICE_UNAVAILABLE:{status:503,message:`Service Unavailable`},GATEWAY_TIMEOUT:{status:504,message:`Gateway Timeout`}};function ai(e,t){return t??ii[e]?.status??500}function oi(e,t){return t||ii[e]?.message||e}var si,ci=class e extends Error{defined;code;status;data;static{let t=Symbol.for(`__${ti}@${ni}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[t]??=new WeakSet,si=globalThis[t],si.add(e)}constructor(e,...t){let n=hr(t);if(n.status!==void 0&&!ui(n.status))throw Error(`[ORPCError] Invalid error status code.`);let r=oi(e,n.message);super(r,n),this.code=e,this.status=ai(e,n.status),this.defined=n.defined??!1,this.data=n.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(si.has(this)){let t=Vr(e);if(t&&si.has(t))return!0}return super[Symbol.hasInstance](e)}};function li(e){return e instanceof ci?e:new ci(`INTERNAL_SERVER_ERROR`,{message:`Internal server error`,cause:e})}function ui(e){return e<200||e>=400}function di(e){if(!Hr(e))return!1;let t=[`defined`,`code`,`status`,`message`,`data`];return!Object.keys(e).some(e=>!t.includes(e))&&`defined`in e&&typeof e.defined==`boolean`&&`code`in e&&typeof e.code==`string`&&`status`in e&&typeof e.status==`number`&&ui(e.status)&&`message`in e&&typeof e.message==`string`}function fi(e,t={}){return new ci(e.code,{...t,...e})}var pi=class extends TypeError{},mi=class extends TypeError{},hi=class extends Error{data;constructor(e){super(e?.message??`An error event was received`,e),this.data=e?.data}},gi=/\r\n|\r(?!\n)|\n/,_i=/(?:\r\n|\r(?!\n)|\n){2}/,vi=/(?:\r\n|\r(?!\n)|\n){2}/g,yi=13,bi=10,xi=32;function Si(e){let t={data:void 0,event:void 0,id:void 0,retry:void 0,comments:[]};for(let n of e.split(gi)){if(n===``)continue;let e=n.indexOf(`:`),r=e===-1?``:n.slice(n.charCodeAt(e+1)===xi?e+2:e+1);if(e===0)t.comments.push(r);else switch(e===-1?n:n.slice(0,e)){case`data`:t.data=t.data===void 0?r:`${t.data}
|
|
2
|
+
${r}`;break;case`event`:t.event=r;break;case`id`:t.id=r;break;case`retry`:{let e=Number.parseInt(r,10);e>=0&&e.toString()===r&&(t.retry=e);break}}}return t}var Ci=class{constructor(e={}){this.options=e}pending=[];tail=``;discardLeadingLF=!1;feed(e){if(e===``||this.discardLeadingLF&&(this.discardLeadingLF=!1,e.charCodeAt(0)===bi&&(e=e.slice(1),e===``)))return;let t=this.tail+e;if(!_i.test(t)){this.pending.push(e),this.tail=t.slice(-3);return}this.pending.push(e);let n=this.pending.length===1?e:this.pending.join(``),r=n.length-t.length,i=[],a=0;for(let e of t.matchAll(vi))i.push(n.slice(a,r+e.index)),a=r+e.index+e[0].length;let o=n.slice(a);this.pending.length=0,this.tail=o.slice(-3),o===``?this.discardLeadingLF=e.charCodeAt(e.length-1)===yi:this.pending.push(o);for(let e of i){let t=Si(e);this.options.onEvent&&this.options.onEvent(t)}}end(){if(this.pending.length!==0)throw new mi(`Event Iterator ended before complete`)}},wi=class extends TransformStream{constructor(){let e;super({start(t){e=new Ci({onEvent:e=>{t.enqueue(e)}})},transform(t){e.feed(t)},flush(){e.end()}})}},Ti=/\r\n|[\n\r]/,Ei=/\r\n|[\n\r]/g;function Di(e){return Ti.test(e)}function Oi(e){if(Di(e))throw new pi(`Event's id must not contain a carriage return or newline character`)}function ki(e){if(Di(e))throw new pi(`Event's event must not contain a carriage return or newline character`)}function Ai(e){if(!Number.isInteger(e)||e<0)throw new pi(`Event's retry must be a integer and >= 0`)}function ji(e){if(Di(e))throw new pi(`Event's comment must not contain a carriage return or newline character`)}function Mi(e){return e===void 0?``:`data: ${e.replace(Ei,`
|
|
3
|
+
data: `)}
|
|
4
|
+
`}function Ni(e){let t=``;for(let n of e??[])ji(n),t+=`: ${n}
|
|
5
|
+
`;return t}function Pi(e){let t=``;return t+=Ni(e.comments),e.event!==void 0&&(ki(e.event),t+=`event: ${e.event}
|
|
6
|
+
`),e.retry!==void 0&&(Ai(e.retry),t+=`retry: ${e.retry}
|
|
7
|
+
`),e.id!==void 0&&(Oi(e.id),t+=`id: ${e.id}
|
|
8
|
+
`),t+=Mi(e.data),t+=`
|
|
9
|
+
`,t}var Fi=Symbol(`ORPC_EVENT_SOURCE_META`);function Ii(e,t){if(t.id===void 0&&t.retry===void 0&&!t.comments?.length)return e;if(t.id!==void 0&&Oi(t.id),t.retry!==void 0&&Ai(t.retry),t.comments!==void 0)for(let e of t.comments)ji(e);return new Proxy(e,{get(e,n,r){return n===Fi?t:Reflect.get(e,n,r)}})}function Li(e){return Ur(e)?Reflect.get(e,Fi):void 0}function Ri(e,t=`inline`){return`${t}; filename="${e.replace(/[^\x20-\x7E]/g,`_`).replace(/"/g,`\\"`)}"; filename*=utf-8''${encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)))}`}function zi(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==`string`)return ei(t[2]);let n=e.match(/filename="((?:\\"|[^"])*)"/i);if(n&&typeof n[1]==`string`)return n[1].replace(/\\"/g,`"`)}function Bi(e,t){let n={...e};for(let e in t)Array.isArray(t[e])?n[e]=[...gr(n[e]),...t[e]]:t[e]!==void 0&&(n[e]=Array.isArray(n[e])?[...n[e],t[e]]:n[e]===void 0?t[e]:[n[e],t[e]]);return n}function Vi(e,t){let n=async e=>{let n=await t.error(e);if(n!==e){let t=Li(e);t&&Ur(n)&&(n=Ii(n,t))}return n};return new Ir(async()=>{let{done:r,value:i}=await(async()=>{try{return await e.next()}catch(e){throw await n(e)}})(),a=await t.value(i,r);if(a!==i){let e=Li(i);e&&Ur(a)&&(a=Ii(a,e))}return{done:r,value:a}},async()=>{try{await e.return?.()}catch(e){throw await n(e)}})}function Hi(e){return{...e,context:e.context??{}}}function Ui(e,t={}){let n=t.path??[];return Jr(new Proxy(async(...[t,r={}])=>await e.call(n,t,Hi(r)),{get(r,i){return typeof i!=`string`||ri.has(i)?Reflect.get(r,i):Ui(e,{...t,path:[...n,i]})}}))}function Wi(e,t={}){let n=(e?.pipeThrough(new TextDecoderStream).pipeThrough(new wi))?.getReader(),r,i=!1;return new Ir(async()=>{r??=kr(`consume_event_iterator_stream`);try{for(;;){if(n===void 0)return{done:!0,value:void 0};let{done:e,value:t}=await Nr(r,()=>n.read());if(e){if(i)throw new Cr(`Stream was cancelled`);return{done:!0,value:void 0}}switch(t.event??(t.data===void 0?void 0:`message`)){case`message`:{let e=zr(t.data);return Ur(e)&&(e=Ii(e,t)),r?.addEvent(`message`),{done:!1,value:e}}case`error`:{let e=new hi({data:zr(t.data)});throw e=Ii(e,t),r?.addEvent(`error`),e}case`done`:case`close`:{let e=zr(t.data);return Ur(e)&&(e=Ii(e,t)),r?.addEvent(`done`),{done:!0,value:e}}default:r?.addEvent(`maybe_keepalive`)}}}catch(e){throw e instanceof hi||Ar(r,e,t),e}},async e=>{try{e!==`next`&&(i=!0,r?.addEvent(`cancelled`)),await Nr(r,()=>n?.cancel())}catch(e){throw Ar(r,e,t),e}finally{r?.end()}})}function Gi(e,t={}){let n=t.eventIteratorKeepAliveEnabled??!0,r=t.eventIteratorKeepAliveInterval??5e3,i=t.eventIteratorKeepAliveComment??``,a=t.eventIteratorInitialCommentEnabled??!0,o=t.eventIteratorInitialComment??``,s=!1,c,l;return new ReadableStream({start(e){l=kr(`stream_event_iterator`),a&&e.enqueue(Pi({comments:[o]}))},async pull(t){try{n&&(c=setInterval(()=>{t.enqueue(Pi({comments:[i]})),l?.addEvent(`keepalive`)},r));let a=await Nr(l,()=>e.next());if(clearInterval(c),s)return;let o=Li(a.value);if(!a.done||a.value!==void 0||o!==void 0){let e=a.done?`done`:`message`;t.enqueue(Pi({...o,event:e,data:Br(a.value)})),l?.addEvent(e)}a.done&&(t.close(),l?.end())}catch(e){if(clearInterval(c),s)return;e instanceof hi?(t.enqueue(Pi({...Li(e),event:`error`,data:Br(e.data)})),l?.addEvent(`error`),t.close()):(Ar(l,e),t.error(e)),l?.end()}},async cancel(){try{s=!0,clearInterval(c),l?.addEvent(`cancelled`),await Nr(l,()=>e.return?.())}catch(e){throw Ar(l,e),e}finally{l?.end()}}}).pipeThrough(new TextEncoderStream)}function Ki(e,t={}){return Mr({name:`parse_standard_body`,signal:t.signal},async()=>{let n=e.headers.get(`content-disposition`);if(typeof n==`string`){let t=zi(n)??`blob`,r=await e.blob();return new File([r],t,{type:r.type})}let r=e.headers.get(`content-type`);if(!r||r.startsWith(`application/json`))return zr(await e.text());if(r.startsWith(`multipart/form-data`))return await e.formData();if(r.startsWith(`application/x-www-form-urlencoded`)){let t=await e.text();return new URLSearchParams(t)}if(r.startsWith(`text/event-stream`))return Wi(e.body,t);if(r.startsWith(`text/plain`))return await e.text();let i=await e.blob();return new File([i],`blob`,{type:i.type})})}function qi(e,t,n={}){if(e instanceof ReadableStream)return e;let r=t.get(`content-disposition`);if(t.delete(`content-type`),t.delete(`content-disposition`),e!==void 0)return e instanceof Blob?(t.set(`content-type`,e.type),t.set(`content-length`,e.size.toString()),t.set(`content-disposition`,r??Ri(e instanceof File?e.name:`blob`)),e):e instanceof FormData||e instanceof URLSearchParams?e:Pr(e)?(t.set(`content-type`,`text/event-stream`),Gi(e,n)):(t.set(`content-type`,`application/json`),Br(e))}function Ji(e,t={}){return e.forEach((e,n)=>{Array.isArray(t[n])?t[n].push(e):t[n]=t[n]===void 0?e:[t[n],e]}),t}function Yi(e,t=new Headers){for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.append(n,r);return t}function Xi(e,t={}){let n=Yi(e.headers),r=qi(e.body,n,t);return new Request(e.url,{signal:e.signal,method:e.method,headers:n,body:r})}function Zi(e,t={}){return{body:wr(()=>Ki(e,t)),status:e.status,get headers(){let t=Ji(e.headers);return Object.defineProperty(this,"headers",{value:t,writable:!0}),t},set headers(e){Object.defineProperty(this,"headers",{value:e,writable:!0})}}}var Qi=class{plugins;constructor(e=[]){this.plugins=[...e].sort((e,t)=>(e.order??0)-(t.order??0))}init(e){for(let t of this.plugins)t.init?.(e)}},$i=class{constructor(e,t,n={}){this.codec=e,this.sender=t,new Qi(n.plugins).init(n),this.interceptors=gr(n.interceptors),this.clientInterceptors=gr(n.clientInterceptors)}interceptors;clientInterceptors;call(e,t,n){return Mr({name:`${br}.${e.join(`/`)}`,signal:n.signal},r=>(r?.setAttribute(`rpc.system`,br),r?.setAttribute(`rpc.method`,e.join(`.`)),Pr(t)&&(t=Lr({name:`consume_event_iterator_input`,signal:n.signal},t)),Rr(this.interceptors,{...n,path:e,input:t},async({path:e,input:t,...n})=>{let i=Or(),a,o=i?.trace.getActiveSpan()??r;o&&i&&(a=i?.trace.setSpan(i.context.active(),o));let s=await Mr({name:`encode_request`,context:a},()=>this.codec.encode(e,t,n)),c=await Rr(this.clientInterceptors,{...n,input:t,path:e,request:s},({input:e,path:t,request:n,...r})=>Mr({name:`send_request`,signal:r.signal,context:a},()=>this.sender.call(n,r,t,e))),l=await Mr({name:`decode_response`,context:a},()=>this.codec.decode(c,n,e,t));return Pr(l)?Lr({name:`consume_event_iterator_output`,signal:n.signal},l):l})))}},ea={BIGINT:0,DATE:1,NAN:2,UNDEFINED:3,URL:4,REGEXP:5,SET:6,MAP:7},ta=new Set(Object.values(ea)),na=/^\/(.*)\/([a-z]*)$/;function ra(e){return TypeError(`Invalid RPC serialized data: ${e}`)}function ia(e,t,n){return ra(`type ${e} (${t}) expects ${n}.`)}var aa=class{customSerializers;constructor(e={}){if(this.customSerializers=e.customJsonSerializers??[],this.customSerializers.length!==new Set(this.customSerializers.map(e=>e.type)).size)throw Error(`Custom serializer type must be unique.`)}serialize(e,t=[],n=[],r=[],i=[]){for(let a of this.customSerializers)if(a.condition(e)){let o=this.serialize(a.serialize(e),t,n,r,i);return n.push([a.type,...t]),o}if(e instanceof Blob)return r.push(t),i.push(e),[e,n,r,i];if(typeof e==`bigint`)return n.push([ea.BIGINT,...t]),[e.toString(),n,r,i];if(e instanceof Date)return n.push([ea.DATE,...t]),Number.isNaN(e.getTime())?[null,n,r,i]:[e.toISOString(),n,r,i];if(Number.isNaN(e))return n.push([ea.NAN,...t]),[null,n,r,i];if(e instanceof URL)return n.push([ea.URL,...t]),[e.toString(),n,r,i];if(e instanceof RegExp)return n.push([ea.REGEXP,...t]),[e.toString(),n,r,i];if(e instanceof Set){let a=this.serialize(Array.from(e),t,n,r,i);return n.push([ea.SET,...t]),a}if(e instanceof Map){let a=this.serialize(Array.from(e.entries()),t,n,r,i);return n.push([ea.MAP,...t]),a}if(Array.isArray(e))return[e.map((e,a)=>e===void 0?(n.push([ea.UNDEFINED,...t,a]),null):this.serialize(e,[...t,a],n,r,i)[0]),n,r,i];if(Hr(e)){let a={};for(let o in e)(o!==`toJSON`||typeof e[o]!=`function`)&&(a[o]=this.serialize(e[o],[...t,o],n,r,i)[0]);return[a,n,r,i]}return[e,n,r,i]}deserialize(e,t,n,r){let i={data:e},a={data:e};n&&r&&n.forEach((e,t)=>{let n=r(t);if(!(n instanceof Blob))throw ra(`blob ${t} is not a Blob.`);let o=a,s=i,c=`data`;e.forEach(e=>{if(o=o[c],s=Kr(s,c,o),c=e,!Object.hasOwn(s,c))throw ra(`segment "${c}" does not exist.`)}),s[c]=n});for(let e of t){let t=e[0],n=this.customSerializers.find(e=>e.type===t);if(n===void 0&&!ta.has(t))continue;let r=a,o=i,s=`data`;for(let t=1;t<e.length;t++)if(r=r[s],o=Kr(o,s,r),s=e[t],!Object.hasOwn(o,s))throw ra(`segment "${s}" does not exist.`);if(n!==void 0){o[s]=n.deserialize(o[s]);continue}let c=o[s];switch(t){case ea.BIGINT:{if(typeof c!=`string`)throw ia(t,`bigint`,`a string`);let e=yr(c,_r);if(e===void 0)throw ia(t,`bigint`,`a decimal integer string of at most ${_r} digits`);o[s]=e;break}case ea.DATE:if(typeof c!=`string`&&c!==null)throw ia(t,`date`,`a string or null`);o[s]=new Date(c??NaN);break;case ea.NAN:if(c!==null)throw ia(t,`nan`,`null`);o[s]=NaN;break;case ea.UNDEFINED:if(c!==null)throw ia(t,`undefined`,`null`);o[s]=void 0;break;case ea.URL:if(typeof c!=`string`)throw ia(t,`url`,`a string`);o[s]=new URL(c);break;case ea.REGEXP:{if(typeof c!=`string`)throw ia(t,`regexp`,`a string`);let e=c.match(na);if(e===null||!Qr(e[2]))throw ra(`type ${t} (regexp) expects a "/pattern/flags" string.`);o[s]=$r(e[1],e[2]);break}case ea.SET:if(!Array.isArray(c))throw ia(t,`set`,`an array`);o[s]=new Set(c);break;case ea.MAP:if(!Array.isArray(c))throw ia(t,`map`,`an array`);o[s]=new Map(c)}}return i.data}};function oa(e){return`/${e.map(encodeURIComponent).join(`/`)}`}function sa(e){return typeof e.forEach==`function`?Ji(e):e}function ca(e){return Object.entries(ii).find(([,t])=>t.status===e)?.[0]??`MALFORMED_ORPC_ERROR_RESPONSE`}var la=class{constructor(e,t){this.serializer=e,this.baseUrl=t.url,this.maxUrlLength=t.maxUrlLength??2083,this.fallbackMethod=t.fallbackMethod??`POST`,this.expectedMethod=t.method??this.fallbackMethod,this.headers=t.headers??{}}baseUrl;maxUrlLength;fallbackMethod;expectedMethod;headers;async encode(e,t,n){let r=sa(await qr(this.headers,n,e,t));n.lastEventId!==void 0&&(r=Bi(r,{"last-event-id":n.lastEventId}));let i=await qr(this.expectedMethod,n,e,t),a=await qr(this.baseUrl,n,e,t),o=new URL(a);o.pathname=`${o.pathname.replace(/\/$/,``)}${oa(e)}`;let s=this.serializer.serialize(t);if(i===`GET`&&!(s instanceof FormData)&&!Pr(s)){let a=await qr(this.maxUrlLength,n,e,t),c=new URL(o);if(c.searchParams.append(`data`,Br(s)),c.toString().length<=a)return{body:void 0,method:i,headers:r,url:c,signal:n.signal}}return{url:o,method:i===`GET`?this.fallbackMethod:i,headers:r,body:s,signal:n.signal}}async decode(e){let t=!ui(e.status),n=await(async()=>{let t=!1;try{let n=await e.body();return t=!0,this.serializer.deserialize(n)}catch(e){throw Error(t?`Invalid RPC response format.`:`Cannot parse response body, please check the response body and content-type.`,{cause:e})}})();if(!t)throw di(n)?fi(n):new ci(ca(e.status),{status:e.status,data:{...e,body:n}});return n}},ua=class{constructor(e){this.jsonSerializer=e}serialize(e){return Pr(e)?Vi(e,{value:async e=>this.#e(e,!1),error:async e=>new hi({data:this.#e(li(e).toJSON(),!1),cause:e})}):this.#e(e,!0)}#e(e,t){let[n,r,i,a]=this.jsonSerializer.serialize(e),o=r.length===0?void 0:r;if(!t||a.length===0)return{json:n,meta:o};let s=new FormData;return s.set(`data`,Br({json:n,meta:o,maps:i})),a.forEach((e,t)=>{s.set(t.toString(),e)}),s}deserialize(e){return Pr(e)?Vi(e,{value:async e=>this.#t(e),error:async e=>{if(!(e instanceof hi))return e;let t=this.#t(e.data);return di(t)?fi(t,{cause:e}):new hi({data:t,cause:e})}}):this.#t(e)}#t(e){if(e===void 0)return;if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e.json,e.meta??[]);let t=JSON.parse(e.get(`data`));return this.jsonSerializer.deserialize(t.json,t.meta??[],t.maps,t=>e.get(t.toString()))}},da=class extends $i{constructor(e,t){let n=new la(new ua(new aa(t)),t);super(n,e,t)}},fa=class extends Qi{initRuntimeAdapter(e){for(let t of this.plugins)t.initRuntimeAdapter?.(e)}},pa=class{fetch;toFetchRequestOptions;adapterInterceptors;constructor(e){new fa(e.plugins).initRuntimeAdapter(e),this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=e,this.adapterInterceptors=gr(e.adapterInterceptors)}async call(e,t,n,r){let i=Xi(e,this.toFetchRequestOptions);return Zi(await Rr(this.adapterInterceptors,{...t,request:i,path:n,input:r,init:{redirect:`manual`}},({request:e,path:t,input:n,init:r,...i})=>this.fetch(e,r,i,t,n)),{signal:i.signal})}},ma=class extends da{constructor(e){let t=new pa(e);super(t,e)}};function ha(e,t={}){return[e,{...t.input===void 0?{}:{input:t.input},...t.type===void 0?{}:{type:t.type},...t.fnOptions===void 0?{}:{fnOptions:t.fnOptions}}]}function ga(e){return{key(t){return ha(e,t)}}}function _a(e){return async t=>{let n=await e(t),r;for await(let e of n){if(t.signal.aborted)throw t.signal.reason;r={chunk:e},t.client.setQueryData(t.queryKey,e)}if(!r)throw Error(`Live query for ${Br(t.queryKey)} did not yield any data. Ensure the query function returns an AsyncIterable with at least one chunk.`);return r.chunk}}function va(e,{refetchMode:t=`reset`,maxChunks:n=1/0}={}){return async r=>{let i=r.client.getQueryCache().find({queryKey:r.queryKey,exact:!0}),a=!!i&&i.state.data!==void 0;a&&(t===`reset`?i.setState({status:`pending`,data:void 0,error:null,fetchStatus:`fetching`}):r.client.setQueryData(r.queryKey,(e=[])=>ya(e,n)));let o=[],s=await e(r),c=!a||t!==`replace`;r.client.setQueryData(r.queryKey,(e=[])=>ya(e,n));for await(let e of s){if(r.signal.aborted)throw r.signal.reason;o.push(e),o=ya(o,n),c&&r.client.setQueryData(r.queryKey,(t=[])=>ya([...t,e],n))}c||r.client.setQueryData(r.queryKey,o);let l=r.client.getQueryData(r.queryKey);return l?ya(l,n):o}}function ya(e,t){return e.length<=t?e:e.slice(e.length-t)}var ba=Symbol(`ORPC_OPERATION_CONTEXT`);function xa(e,t){let n={call:e,queryKey(...[e={}]){return e={...t.experimental_defaults?.queryKey,...e},e.queryKey??ha(t.path,{type:`query`,input:e.input})},queryOptions(...[r={}]){r={...t.experimental_defaults?.queryOptions,...r};let i=n.queryKey(r);return{queryFn:({signal:t})=>{if(r.input===F)throw Error(`queryFn should not be called with skipToken used as input`);return e(r.input,{signal:t,context:{[ba]:{key:i,type:`query`},...r.context}})},...r.input===F?{enabled:!1}:{},...r,queryKey:i}},experimental_streamedKey(...[e={}]){return e={...t.experimental_defaults?.experimental_streamedKey,...e},e.queryKey??ha(t.path,{type:`streamed`,input:e.input,fnOptions:e.queryFnOptions})},experimental_streamedOptions(...[r={}]){r={...t.experimental_defaults?.experimental_streamedOptions,...r};let i=n.experimental_streamedKey(r);return{queryFn:va(async({signal:t})=>{if(r.input===F)throw Error(`queryFn should not be called with skipToken used as input`);let n=await e(r.input,{signal:t,context:{[ba]:{key:i,type:`streamed`},...r.context}});if(!Pr(n))throw Error(`streamedQuery requires an event iterator output`);return n},r.queryFnOptions),...r.input===F?{enabled:!1}:{},...r,queryKey:i}},experimental_liveKey(...[e={}]){return e={...t.experimental_defaults?.experimental_liveKey,...e},e.queryKey??ha(t.path,{type:`live`,input:e.input})},experimental_liveOptions(...[r={}]){r={...t.experimental_defaults?.experimental_liveOptions,...r};let i=n.experimental_liveKey(r);return{queryFn:_a(async({signal:t})=>{if(r.input===F)throw Error(`queryFn should not be called with skipToken used as input`);let n=await e(r.input,{signal:t,context:{[ba]:{key:i,type:`live`},...r.context}});if(!Pr(n))throw Error(`liveQuery requires an event iterator output`);return n}),...r.input===F?{enabled:!1}:{},...r,queryKey:i}},infiniteKey(e){return e={...t.experimental_defaults?.infiniteKey,...e},e.queryKey??ha(t.path,{type:`infinite`,input:e.input===F?F:e.input(e.initialPageParam)})},infiniteOptions(r){r={...t.experimental_defaults?.infiniteOptions,...r};let i=n.infiniteKey(r);return{queryFn:({pageParam:t,signal:n})=>{if(r.input===F)throw Error(`queryFn should not be called with skipToken used as input`);return e(r.input(t),{signal:n,context:{[ba]:{key:i,type:`infinite`},...r.context}})},...r.input===F?{enabled:!1}:{},...r,queryKey:i}},mutationKey(...[e={}]){return e={...t.experimental_defaults?.mutationKey,...e},e.mutationKey??ha(t.path,{type:`mutation`})},mutationOptions(...[r={}]){r={...t.experimental_defaults?.mutationOptions,...r};let i=n.mutationKey(r);return{mutationFn:t=>e(t,{context:{[ba]:{key:i,type:`mutation`},...r.context}}),...r,mutationKey:i}}};return n}function Sa(e,t={}){let n=gr(t.path),r=ga(n),i=xa(e,{path:n,experimental_defaults:t.experimental_defaults});return new Proxy({...r,...i},{get(r,i){let a=Reflect.get(r,i),o=Ur(e)?Reflect.get(e,i):void 0;if(typeof i!=`string`||ri.has(i)||!Ur(o))return a;let s=Sa(e[i],{...t,path:[...n,i],experimental_defaults:Wr(t.experimental_defaults,[i])});return typeof a==`function`?new Proxy(a,{get(e,t){return typeof t!=`string`||ri.has(t)?Reflect.get(e,t):Reflect.get(s,t)}}):s}})}var Ca=e(He(),1);function wa(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Ta=e=>{switch(e){case`success`:return Oa;case`info`:return Aa;case`warning`:return ka;case`error`:return ja;default:return null}},Ea=Array(12).fill(0),Da=({visible:e,className:t})=>o.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},o.createElement(`div`,{className:`sonner-spinner`},Ea.map((e,t)=>o.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Oa=o.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},o.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),ka=o.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},o.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Aa=o.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},o.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ja=o.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},o.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Ma=o.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},o.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),o.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Na=()=>{let[e,t]=o.useState(document.hidden);return o.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Pa=1,Fa=100,Ia=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Pa++,La=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Fa;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Ia(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,s=r.then(async e=>{if(a=[`resolve`,e],o.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(za(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!o.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...s})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!o.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...s})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!o.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...s})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!o.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=Ia(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Ra=(e,t)=>La.message(e,t),za=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Ba=Object.assign(Ra,{success:La.success,info:La.info,warning:La.warning,error:La.error,custom:La.custom,message:La.message,promise:La.promise,dismiss:La.dismiss,loading:La.loading},{getHistory:()=>La.toasts,getToasts:()=>La.getActiveToasts()});wa(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Va(e){return e.label!==void 0}var Ha=3,Ua=`24px`,Wa=`16px`,Ga=4e3,Ka=356,qa=14,Ja=45,Ya=200;function Xa(...e){return e.filter(Boolean).join(` `)}function Za(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Qa=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:s,heights:c,index:l,toasts:u,expanded:d,removeToast:f,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:_,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=o.useState(null),[k,A]=o.useState(null),[j,M]=o.useState(!1),[N,P]=o.useState(!1),[F,I]=o.useState(!1),[L,R]=o.useState(!1),[z,B]=o.useState(!1),[ee,te]=o.useState(0),[ne,V]=o.useState(0),H=o.useRef(n.duration||b||Ga),re=o.useRef(null),U=o.useRef(null),W=l===0,G=l+1<=s,K=n.type,q=K??`default`,J=n.dismissible!==!1,ie=n.className||``,ae=n.descriptionClassName||``,oe=o.useMemo(()=>c.findIndex(e=>e.toastId===n.id)||0,[c,n.id]),se=o.useMemo(()=>n.closeButton??m,[n.closeButton,m]),ce=o.useMemo(()=>n.duration||b||Ga,[n.duration,b]),le=o.useRef(0),ue=o.useRef(0),de=o.useRef(0),fe=o.useRef(null),[pe,me]=x.split(`-`),he=o.useMemo(()=>c.reduce((e,t,n)=>n>=oe?e:e+t.height,0),[c,oe]),ge=Na(),_e=o.useMemo(()=>e.swipeDirections??Za(x),[e.swipeDirections,x]),ve=n.invert||t,ye=K===`loading`;ue.current=o.useMemo(()=>oe*S+he,[oe,he]),o.useEffect(()=>{H.current=ce},[ce]),o.useEffect(()=>{M(!0)},[]),o.useEffect(()=>{let e=U.current;if(e){let t=e.getBoundingClientRect().height;return V(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),o.useLayoutEffect(()=>{if(!j)return;let e=U.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,V(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let be=o.useCallback(()=>{P(!0),te(ue.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},Ya)},[n,f,a,ue]);o.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return d||i||ge?(()=>{if(de.current<le.current){let e=new Date().getTime()-le.current;H.current-=e}de.current=new Date().getTime()})():H.current!==1/0&&(le.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),be()},H.current)),()=>clearTimeout(e)},[d,i,n,K,ge,be]),o.useEffect(()=>{n.delete&&(be(),n.onDismiss==null||n.onDismiss.call(n,n))},[be,n.delete]);function xe(){return T?.loading?o.createElement(`div`,{className:Xa(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},T.loading):o.createElement(Da,{className:Xa(w?.loader,n?.classNames?.loader),visible:K===`loading`})}let Se=n.icon||T?.[K]||Ta(K);return o.createElement(`li`,{tabIndex:0,ref:U,className:Xa(v,ie,w?.toast,n?.classNames?.toast,w?.[q],n?.classNames?.[q]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":z,"data-removed":N,"data-visible":G,"data-y-position":pe,"data-x-position":me,"data-index":l,"data-front":W,"data-swiping":F,"data-dismissible":J,"data-type":K,"data-invert":ve,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(d||C&&j),"data-testid":n.testId,style:{"--index":l,"--toasts-before":l,"--z-index":u.length-l,"--offset":`${N?ee:ue.current}px`,"--initial-height":C?`auto`:`${ne}px`,...h,...n.style},onDragEnd:()=>{I(!1),O(null),fe.current=null},onPointerDown:e=>{e.button!==2&&!ye&&J&&(re.current=new Date,te(ue.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),fe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(L||!J)return;fe.current=null;let e=Number(U.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(U.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-re.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?_e.includes(e>0?`right`:`left`):_e.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Ja||a>.11))te(ue.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),be(),R(!0);else{var o,s;(o=U.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=U.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),B(!1),I(!1),O(null)}},onPointerMove:e=>{var t,n;if(!fe.current||!J||window.getSelection()?.toString().length>0)return;let r=e.clientY-fe.current.y,i=e.clientX-fe.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(_e.includes(`top`)||_e.includes(`bottom`)){if(_e.includes(`top`)&&r<0||_e.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(_e.includes(`left`)||_e.includes(`right`))){if(_e.includes(`left`)&&i<0||_e.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&B(!0),(t=U.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=U.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},se&&!n.jsx&&K!==`loading`?o.createElement(`button`,{"aria-label":E,"data-disabled":ye,"data-close-button":!0,onClick:ye||!J?()=>{}:()=>{be(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Xa(w?.closeButton,n?.classNames?.closeButton)},T?.close??Ma):null,(K||n.icon||n.promise)&&n.icon!==null&&(T?.[K]!==null||n.icon)?o.createElement(`div`,{"data-icon":``,className:Xa(w?.icon,n?.classNames?.icon)},K===`loading`?n.icon||xe():n.promise?xe():null,K===`loading`?null:Se):null,o.createElement(`div`,{"data-content":``,className:Xa(w?.content,n?.classNames?.content)},o.createElement(`div`,{"data-title":``,className:Xa(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?o.createElement(`div`,{"data-description":``,className:Xa(y,ae,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),o.isValidElement(n.cancel)?n.cancel:n.cancel&&Va(n.cancel)?o.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{Va(n.cancel)&&J&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),be())},className:Xa(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,o.isValidElement(n.action)?n.action:n.action&&Va(n.action)?o.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{Va(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),e.defaultPrevented||be())},className:Xa(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function $a(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function eo(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Wa:Ua;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var to=o.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:s,closeButton:c,className:l,offset:u,mobileOffset:d,theme:f=`light`,richColors:p,duration:m,style:h,visibleToasts:g=Ha,toastOptions:_,dir:v=$a(),gap:y=qa,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=o.useState([]),T=o.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=o.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=o.useState([]),[k,A]=o.useState(!1),[j,M]=o.useState(!1),[N,P]=o.useState(f===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:f),F=o.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=o.useRef(null),R=o.useRef(!1),z=o.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||La.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return o.useEffect(()=>La.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Ca.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),o.useEffect(()=>{if(f!==`system`){P(f);return}if(f===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[f]),o.useEffect(()=>{C.length<=1&&A(!1)},[C]),o.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),o.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),o.createElement(`section`,{ref:t,"aria-label":x??`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?o.createElement(`ol`,{key:t,dir:v===`auto`?$a():v,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Ka}px`,"--gap":`${y}px`,...h,...eo(u,d)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>o.createElement(Qa,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:p,duration:_?.duration??m,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:g,closeButton:_?.closeButton??c,interacting:j,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:s,gap:y,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),no=new TextEncoder;new TextDecoder;var ro=no.encode(`kiteline-tunnel-v2`),io=no.encode(`kiteline-tunnel-v2/message`),ao=16,oo=22,so={Hello:1,Welcome:2,Confirm:3,Sealed:16},co={device:1,pairing:2},lo=class extends Error{};function uo(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function fo(e){return crypto.getRandomValues(new Uint8Array(e))}function po(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function mo(e){let t=po(await yo(no.encode(`kiteline-pair-id/${e}`))).slice(0,oo),n=await crypto.subtle.importKey(`raw`,no.encode(e),{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]);return{id:t,secret:new Uint8Array(await crypto.subtle.sign(`HMAC`,n,no.encode(`kiteline-pair-v2`)))}}function ho(e,t=!1){return crypto.subtle.importKey(`raw`,e,{name:`HMAC`,hash:`SHA-256`},t,[`sign`])}function go(e){if(!/^[\w-]{22}$/.test(e.id))throw new lo(`A key's name is 22 characters.`);return uo(Uint8Array.of(co[e.kind]),no.encode(e.id))}async function _o(){let e=await crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!1,[`deriveBits`]),t=new Uint8Array(await crypto.subtle.exportKey(`raw`,e.publicKey));return{privateKey:e.privateKey,publicKey:t}}async function vo(e,t){let n=await crypto.subtle.importKey(`raw`,t,{name:`ECDH`,namedCurve:`P-256`},!1,[]);return new Uint8Array(await crypto.subtle.deriveBits({name:`ECDH`,public:n},e,256))}async function yo(e){return new Uint8Array(await crypto.subtle.digest(`SHA-256`,e))}async function bo(e,t,n){let r=new Uint8Array(await crypto.subtle.sign(`HMAC`,e,uo(t,n))),i=await crypto.subtle.importKey(`raw`,r,`HKDF`,!1,[`deriveBits`]),a=e=>crypto.subtle.deriveBits({name:`HKDF`,hash:`SHA-256`,salt:n,info:no.encode(e)},i,256),o=async e=>crypto.subtle.importKey(`raw`,await a(e),{name:`AES-GCM`},!1,[`encrypt`,`decrypt`]),s=async e=>crypto.subtle.importKey(`raw`,await a(e),{name:`HMAC`,hash:`SHA-256`},!1,[`sign`,`verify`]);return{c2s:await o(`client-to-host`),s2c:await o(`host-to-client`),hostConfirm:await s(`host-confirm`),clientConfirm:await s(`client-confirm`)}}var xo=class e{sendKey;receiveKey;sent=0n;received=0n;constructor(e,t){this.sendKey=e,this.receiveKey=t}static iv(e){let t=new Uint8Array(12);return new DataView(t.buffer).setBigUint64(4,e),t}async seal(t){let n=e.iv(this.sent++),r=await crypto.subtle.encrypt({name:`AES-GCM`,iv:n,additionalData:io},this.sendKey,t);return uo(Uint8Array.of(so.Sealed),new Uint8Array(r))}async open(t){if(t[0]!==so.Sealed)throw new lo(`Expected a sealed message.`);let n=e.iv(this.received++),r=await crypto.subtle.decrypt({name:`AES-GCM`,iv:n,additionalData:io},this.receiveKey,t.subarray(1));return new Uint8Array(r)}};async function So(e,t,n,r){let i=go(e),a=await _o(),o=fo(ao);n(uo(Uint8Array.of(so.Hello,2),i,a.publicKey,o));let s=await r();if(s[0]!==so.Welcome||s.length!==114)throw new lo(`The computer's answer wasn't a handshake.`);let c=s.slice(1,66),l=s.slice(66,82),u=s.slice(82),d=await yo(uo(ro,i,a.publicKey,o,c,l)),f=await bo(t,await vo(a.privateKey,c),d);if(!await crypto.subtle.verify(`HMAC`,f.hostConfirm,u,d))throw new lo(`The computer doesn't hold this phone's pairing.`);let p=new Uint8Array(await crypto.subtle.sign(`HMAC`,f.clientConfirm,d));return n(uo(Uint8Array.of(so.Confirm),p)),new xo(f.c2s,f.s2c)}var Co={Request:1,Body:2,End:3,Cancel:4,Response:17,Data:18,Done:19,Fail:20,Ping:32,Pong:33},wo=65536,To=new TextEncoder,Eo=new TextDecoder;function Do(e,t,n){let r=new Uint8Array(5);return r[0]=e,new DataView(r.buffer).setUint32(1,t),n?.length?uo(r,n):r}function Oo(e){if(e.length<5)throw Error(`A tunnel message was cut short.`);return{type:e[0],stream:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(1),payload:e.subarray(5)}}var ko=e=>To.encode(JSON.stringify(e)),Ao=e=>JSON.parse(Eo.decode(e)),jo=e=>Eo.decode(e),Mo={host:`/v1/host`,client:`/v1/client/`,data:`/v1/data/`},No={Replaced:4e3,BadRequest:4400,NotPaired:4401,HostOffline:4404,TooMany:4429,ShuttingDown:4503,HostSilent:4504};function Po(e){let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Fo(e,t){let n=new URL(t,e);return n.protocol=n.protocol===`http:`?`ws:`:`wss:`,n.toString()}var Io=class{ws;frames=[];texts=[];waiting=[];ended=null;closeListeners=new Set;constructor(e){this.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,e=>{let t=e.data;typeof t==`string`?this.deliver(!1,t):t instanceof ArrayBuffer&&this.deliver(!0,new Uint8Array(t))}),e.addEventListener(`close`,e=>this.end(e.code,e.reason)),e.addEventListener(`error`,()=>this.end(1006,`connection error`))}get closed(){return this.ended}onClose(e){this.ended?e(this.ended.code,this.ended.reason):this.closeListeners.add(e)}deliver(e,t){let n=this.waiting.findIndex(t=>t.binary===e);if(n!==-1){let[e]=this.waiting.splice(n,1);e?.resolve(t)}else e?this.frames.push(t):this.texts.push(t)}end(e,t){if(this.ended)return;this.ended={code:e,reason:t};let n=new Lo(e,t);for(let e of this.waiting.splice(0))e.reject(n);for(let n of this.closeListeners)n(e,t);this.closeListeners.clear()}take(e,t){let n=e?this.frames.shift():this.texts.shift();return n===void 0?this.ended?Promise.reject(new Lo(this.ended.code,this.ended.reason)):new Promise((n,r)=>{let i={binary:e,resolve:n,reject:r};this.waiting.push(i),t!==void 0&&setTimeout(()=>{let e=this.waiting.indexOf(i);e!==-1&&(this.waiting.splice(e,1),r(new Ro))},t)}):Promise.resolve(n)}next(e){return this.take(!0,e)}nextText(e){return this.take(!1,e)}send(e){this.ws.readyState===WebSocket.OPEN&&this.ws.send(e)}close(e,t){try{this.ws.close(e,t.slice(0,120))}catch{this.ws.close()}this.end(e,t)}},Lo=class extends Error{code;reason;constructor(e,t){super(t||`Connection closed (${e}).`),this.code=e,this.reason=t}},Ro=class extends Error{constructor(){super(`Timed out.`)}};function zo(e,t){return new Promise((n,r)=>{if(e.readyState===WebSocket.OPEN)return n();let i=setTimeout(()=>r(new Ro),t);e.addEventListener(`open`,()=>{clearTimeout(i),n()}),e.addEventListener(`close`,e=>{clearTimeout(i),r(new Lo(e.code,e.reason))})})}var Bo=class extends Error{problem;constructor(e,t){super(t),this.problem=e}},Vo={offline:`Your computer isn't connected to the relay. Check that Kiteline is running there with --relay.`,unpaired:`This phone isn't paired with that computer any more. Pair it again: run kiteline pair there.`,expired:`That pairing code has expired or was already used. Run kiteline pair for a new one.`,silent:`Your computer didn't answer. Check that Kiteline is still running there.`,lost:`Lost the connection to your computer.`};function Ho(e){if(e instanceof Bo)return e.problem;if(e instanceof lo)return`unpaired`;if(e instanceof Lo){if(e.code===No.HostOffline)return`offline`;if(e.code===No.NotPaired)return e.reason===`code expired`?`expired`:`unpaired`;if(e.code===No.HostSilent)return`silent`}return e instanceof Ro?`silent`:`lost`}var Uo=e=>e instanceof Bo?e:new Bo(Ho(e),Vo[Ho(e)]),Wo=new Set([101,103,204,205,304]),Go=2e4,Ko=5e4,qo=4e3,Jo=class e{socket;cipher;nextStream=1;streams=new Map;sending=Promise.resolve();lastHeard=Date.now();heard=0;probing=!1;timer;failure=null;listeners=new Set;constructor(e,t){this.socket=e,this.cipher=t,e.onClose((e,t)=>this.fail(Uo(new Lo(e,t)))),this.timer=setInterval(()=>{Date.now()-this.lastHeard>Ko?this.fail(Uo(new Ro)):this.post(Co.Ping,0)},Go),this.receive()}static async connect(t,n,r,i=2e4){let a=new WebSocket(t),o=new Io(a);try{if(await zo(a,i),await o.nextText(i)!==`{"t":"paired"}`)throw new Bo(`lost`,Vo.lost);let t=await So(n,r,e=>o.send(e),()=>o.next(i));return new e(o,t)}catch(e){throw o.close(1e3,`done`),Uo(e)}}get error(){return this.failure}onClose(e){this.failure?e(this.failure):this.listeners.add(e)}close(){this.fail(new Bo(`lost`,`Closed.`))}probe(e=qo){if(this.failure||this.probing)return;this.probing=!0;let t=this.heard;this.post(Co.Ping,0),setTimeout(()=>{this.probing=!1,this.heard===t&&this.fail(Uo(new Ro))},e)}fail(e){if(!this.failure){this.failure=e,clearInterval(this.timer),this.socket.close(1e3,`closing`);for(let t of this.streams.values())t.body?t.body.error(e):t.reject(e);this.streams.clear();for(let t of this.listeners)t(e);this.listeners.clear()}}post(e,t,n){let r=Do(e,t,n);this.sending=this.sending.then(async()=>{this.failure||this.socket.send(await this.cipher.seal(r))}),this.sending.catch(e=>this.fail(Uo(e)))}async receive(){try{for(;;){let e=await this.socket.next(),{type:t,stream:n,payload:r}=Oo(await this.cipher.open(e));this.lastHeard=Date.now(),this.heard++,this.dispatch(t,n,r)}}catch(e){this.fail(Uo(e))}}dispatch(e,t,n){if(e===Co.Pong||e===Co.Ping)return;let r=this.streams.get(t);if(r)switch(e){case Co.Response:{let e=Ao(n),i=null;Wo.has(e.status)||(i=new ReadableStream({start:e=>{r.body=e},cancel:()=>{this.streams.delete(t),this.post(Co.Cancel,t)}})),r.resolve(new Response(i,{status:e.status,headers:e.headers})),i||this.streams.delete(t);break}case Co.Data:r.body?.enqueue(n.slice());break;case Co.Done:r.body?.close(),this.streams.delete(t);break;case Co.Fail:{let e=TypeError(jo(n)||`The computer couldn't answer that.`);r.body?r.body.error(e):r.reject(e),this.streams.delete(t);break}}}fetch=async(e,t)=>{if(this.failure)throw this.failure;let n=new Request(e,t),r=t?.signal??n.signal;if(r?.aborted)throw r.reason??new DOMException(`Aborted`,`AbortError`);let i=new URL(n.url),a=n.method===`GET`||n.method===`HEAD`?null:new Uint8Array(await n.arrayBuffer()),o=this.nextStream;this.nextStream+=2;let s=new Promise((e,t)=>{this.streams.set(o,{resolve:e,reject:t})});r?.addEventListener(`abort`,()=>{let e=this.streams.get(o);if(!e)return;this.streams.delete(o),this.post(Co.Cancel,o);let t=r?.reason??new DOMException(`Aborted`,`AbortError`);e.body?e.body.error(t):e.reject(t)},{once:!0});let c=[...n.headers].filter(([e])=>e!==`cookie`&&e!==`authorization`);if(this.post(Co.Request,o,ko({method:n.method,path:i.pathname+i.search,headers:c,body:!!a?.length})),a?.length){for(let e=0;e<a.length;e+=wo)this.post(Co.Body,o,a.subarray(e,e+wo));this.post(Co.End,o)}return s}},Yo=typeof document<`u`&&!!document.querySelector(`meta[name="kiteline-relay"]`),Xo=`kiteline-relay`,Zo=`computers`,Qo=`kiteline:relay:computer`;function $o(){return new Promise((e,t)=>{let n=indexedDB.open(Xo,1);n.onupgradeneeded=()=>n.result.createObjectStore(Zo,{keyPath:`id`}),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function es(e,t){let n=await $o();return new Promise((r,i)=>{let a=t(n.transaction(Zo,e).objectStore(Zo));a.onsuccess=()=>r(a.result),a.onerror=()=>i(a.error)}).finally(()=>n.close())}function ts(){try{return localStorage.getItem(Qo)}catch{return null}}async function ns(e){return await es(`readonly`,t=>t.get(e)).catch(()=>void 0)??null}function rs(e){try{e?localStorage.setItem(Qo,e):localStorage.removeItem(Qo)}catch{}}async function is(){return(await es(`readonly`,e=>e.getAll()).catch(()=>[])).filter(e=>e.device)}function as(){if(typeof window>`u`)return null;let e=new URL(window.location.href),t=e.searchParams.get(`computer`);return t===null?null:(e.searchParams.delete(`computer`),history.replaceState(history.state,``,e.pathname+e.search+e.hash),/^[\w-]{22}$/.test(t)?t:null)}var os=as();async function ss(){if(os){let e=os;os=null,e!==ts()&&(await ns(e))?.device&&rs(e)}let e=ts(),t=e?await ns(e):null;if(t)return t;let[n]=(await is()).sort((e,t)=>t.pairedAt-e.pairedAt);return n?(rs(n.id),n):null}async function cs(){let e=(await ss())?.id;return(await is()).map(t=>({id:t.id,name:t.name??null,pairedAt:t.pairedAt,current:t.id===e})).sort((e,t)=>Number(t.current)-Number(e.current)||t.pairedAt-e.pairedAt)}function ls(){return Yo?ts():null}function us(e){rs(e),Ds(),window.location.assign(`/`)}async function ds(e){let t=await ss();t&&t.name!==e&&await es(`readwrite`,n=>n.put({...t,name:e})).catch(()=>{})}async function fs(e){let t=await ns(e);t&&e!==ts()&&(t.device&&await ms(e,t.device,t.key),await es(`readwrite`,t=>t.delete(e)).catch(()=>{}))}async function ps(e,t,n){let r=await ns(e);r?.device&&r.device!==t&&await ms(e,r.device,r.key);let i=await ho(Po(n));await es(`readwrite`,n=>n.put({id:e,device:t,key:i,pairedAt:Date.now(),...r?.name?{name:r.name}:{}})),rs(e),Ds()}async function ms(e,t,n){ts()===e&&Ds();try{let r=Fo(window.location.origin,Mo.client+e),i=await Jo.connect(r,{kind:`device`,id:t},n,1e4);try{await(await i.fetch(`/auth/logout`,{method:`POST`})).body?.cancel()}finally{i.close()}}catch{}}async function hs(){let e=ts();return Ds(),rs(null),e&&await es(`readwrite`,t=>t.delete(e)).catch(()=>{}),(await is()).length>0}async function gs(e,t){let n=await $o();return new Promise((r,i)=>{let a=n.transaction(Zo,`readwrite`),o=a.objectStore(Zo),s=!1,c=o.get(e);c.onsuccess=()=>{let n=c.result;n&&n.device===t&&(o.delete(e),s=!0)},a.oncomplete=()=>r(s),a.onerror=()=>i(a.error),a.onabort=()=>i(a.error)}).finally(()=>n.close())}async function _s(){let e=ts();e&&await gs(e,void 0).catch(()=>!1)}async function vs(){let e=await ss();return e?e.device?`paired`:`outdated`:`none`}var ys=null,bs=null,xs=0,Ss=new Set;function Cs(e){return Ss.add(e),()=>void Ss.delete(e)}var ws=`kiteline:relay:moved`;function Ts(){try{let e=sessionStorage.getItem(ws);return e!==null&&sessionStorage.removeItem(ws),e}catch{return null}}async function Es(e,t){let n=(await ns(e))?.name??``;if(await gs(e,t).catch(()=>!1)&&ts()===e){if((await is()).length){rs(null);try{sessionStorage.setItem(ws,n)}catch{}window.location.assign(`/`)}else for(let e of Ss)e()}}function Ds(){xs++,bs?.close(),bs=null,ys=null}Yo&&(document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&bs?.probe()}),window.addEventListener(`online`,()=>bs?.probe()));function Os(){ys??=(async()=>{let e=xs,t=await ss(),n=t?.device;if(!t||!n)throw new Bo(`unpaired`,`This phone isn't paired with a computer yet.`);let r=t.id,i=Fo(window.location.origin,Mo.client+r),a;try{a=await Jo.connect(i,{kind:`device`,id:n},t.key)}catch(e){let t=Uo(e);throw t.problem===`unpaired`&&await Es(r,n),t}if(e!==xs)throw a.close(),new Bo(`lost`,`Reconnecting.`);return bs=a,a.onClose(e=>{bs===a&&(bs=null,ys=null,e.problem===`unpaired`&&Es(r,n))}),a})();let e=ys;return e.catch(()=>{ys===e&&(ys=null)}),e}async function ks(e,t){let n;try{n=await Os()}catch(e){throw Uo(e)}return n.fetch(e,t)}async function As(e,t){let{id:n,secret:r}=await mo(t),i=Fo(window.location.origin,Mo.client+e);return Jo.connect(i,{kind:`pairing`,id:n},await ho(r))}function js(e){return e instanceof ci&&e.code===`UNAUTHORIZED`}function Ms(e){return e instanceof Error&&e.message?e.message:`Something went wrong.`}function Ns(){Fs.setQueryData([`auth`],{authed:!1,stale:!0})}function Ps(e){if(js(e))return Ns();Ba.error(Ms(e))}var Fs=new xe({queryCache:new be({onError:Ps}),mutationCache:new ve({onError:Ps}),defaultOptions:{queries:{retry:(e,t)=>!js(t)&&e<2,refetchOnWindowFocus:!0}}}),Is=Ui(new ma({url:`${window.location.origin}/rpc`,fetch:Yo?ks:(e,t)=>fetch(e,{...t,credentials:`same-origin`})})),Ls=Sa(Is);Cs(Ns);var Rs=(0,o.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),zs=o.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:s,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=o.useContext(Rs);return o.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??d,viewBox:`0 0 256 256`,transform:s||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&o.createElement(`title`,null,n),c,l.get(a??p))});zs.displayName=`IconBase`;var Bs=o.createContext(void 0);function Vs(e){let t=o.useContext(Bs);if(!e&&t===void 0)throw Error(Lt(27));return t}var Hs=`data-starting-style`,Us=`data-ending-style`,Ws={[Hs]:``},Gs={[Us]:``},Ks={transitionStatus(e){return e===`starting`?Ws:e===`ending`?Gs:null}},qs=`data-open`,Js=`data-closed`,Ys=`data-anchor-hidden`,Xs=`data-popup-open`,Zs=`data-pressed`,Qs={[Xs]:``,[Zs]:``},$s={[qs]:``},ec={[Js]:``},tc={[Ys]:``},nc={open(e){return e?Qs:null}},rc={open(e){return e?$s:ec},anchorHidden(e){return e?tc:null}},ic={...rc,...Ks},ac=`--nested-drawers`,oc=`--drawer-height`,sc=`--drawer-frontmost-height`,cc=`--drawer-swipe-movement-x`,lc=`--drawer-swipe-movement-y`,uc=`--drawer-snap-point-offset`,dc=`--drawer-swipe-strength`,fc=`--drawer-swipe-progress`,pc=o.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Vs(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return sn(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:ic,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[fc]:`0`,[dc]:`1`}},o],enabled:a||!l})});function mc(e,t,n,r){let i=!1,a=!1,o=r??nn;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 hc(e,t,n){let r=n??nn;return{reason:e,event:t??new Event(`base-ui`),...r}}var gc=`none`,_c=`trigger-press`,vc=`trigger-hover`,yc=`trigger-focus`,bc=`outside-press`,xc=`item-press`,Sc=`focus-out`,Cc=`escape-key`,wc=`close-watcher`,Tc=`list-navigation`,Ec=`keyboard`,Dc=`pointer`,Oc=`cancel-open`,kc=`sibling-open`,Ac=`imperative-action`,jc=`swipe`,Mc=`data-drawer-content`,Nc=o.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Vs(),sn(`div`,e,{ref:t,props:[{[Mc]:``},a]})});function Pc(){let[,e]=o.useState({});return o.useCallback(()=>{e({})},[])}var Fc=0;function Ic(e,t=`mui`){let n=o.useRef(void 0),r=Pc(),i=e??n.current;return o.useEffect(()=>{n.current??(Fc+=1,n.current=`${t}-${Fc}`,e??r())},[e,t,r]),i}var Lc=mt.useId;function Rc(e,t){if(Lc!==void 0){let n=Lc();return e??(t?`${t}-${n}`:n)}return Ic(e,t)}function zc(e){return Rc(e,`base-ui`)}var Bc=o.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Vs(),c=zc(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),sn(`p`,e,{ref:t,props:[{id:c},o]})}),Vc=Re(),Hc=Be(),Uc=o.createContext(void 0);function Wc(){return o.useContext(Uc)}function Gc(e){o.useEffect(e,tn)}var Kc=0,qc=class e{static create(){return new e}currentId=Kc;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Kc,t()},e)}isStarted(){return this.currentId!==Kc}clear=()=>{this.currentId!==Kc&&(clearTimeout(this.currentId),this.currentId=Kc)};disposeEffect=()=>this.clear};function Jc(){let e=gt(qc.create).current;return Gc(e.disposeEffect),e}function Yc(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Xc,platform:Zc,maxTouchPoints:Qc}=Yc(),$c=Xc.toLowerCase(),el=Zc.toLowerCase(),tl=/^i(os$|p)/.test(el)||el===`macintel`&&Qc>1,nl=`android`,rl=el===nl||$c.includes(nl),il=!tl&&el.startsWith(`mac`);el.startsWith(`win`),!rl&&/^(linux|chrome os)/.test(el);var al=il||tl,ol=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ol&&$c.includes(`firefox`),!ol&&$c.includes(`chrom`);var sl=al,cl=/jsdom|happydom/.test($c);function ll(e){e.preventDefault(),e.stopPropagation()}function ul(e){return`nativeEvent`in e}function dl(e){return e.pointerType===``&&e.isTrusted?!0:rl&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function fl(e){return cl?!1:!rl&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(rl||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function pl(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ml(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function hl(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Xe(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function gl(e,t){let n=e;for(;n;){if(Je(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Xe(n)?n.host:null)}return null}function _l(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var vl=`data-base-ui-focusable`,yl=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,bl=`ArrowLeft`,xl=`ArrowRight`,Sl=`ArrowUp`,Cl=`ArrowDown`,wl=`data-trigger-disabled`;function Tl(e,t){if(!Je(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(wl);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(wl);return!1}function El(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 Dl(e){return e.matches(`html,body`)}function Ol(e){return Ye(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function kl(e){return gl(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${yl}`)!=null}function Al(e){return e?e.getAttribute(`role`)===`combobox`&&Ol(e):!1}function jl(e){if(!e||cl)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ml(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Nl(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Pl(e){let t=gt(Fl,e).current;return t.next=e,X(t.effect),t}function Fl(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Il=null;globalThis.requestAnimationFrame;var Ll=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)}},Rl=class e{static create(){return new e}static request(e){return Ll.request(e)}static cancel(e){return Ll.cancel(e)}currentId=Il;request(e){this.cancel(),this.currentId=Ll.request(()=>{this.currentId=Il,e()})}cancel=()=>{this.currentId!==Il&&(Ll.cancel(this.currentId),this.currentId=Il)};disposeEffect=()=>this.cancel};function zl(){let e=gt(Rl.create).current;return Gc(e.disposeEffect),e}var Bl={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Vl={...Bl,position:`fixed`,margin:0,top:0,left:0};({...Bl});var Hl=o.forwardRef(function(e,t){let[n,r]=o.useState();X(()=>{sl&&ol&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,s.jsx)(`span`,{...e,ref:t,style:Vl,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Ul(e,t){return t<0||t>=e.length}function Wl(e,t){return ql(e.current,{disabledIndices:t})}function Gl(e,t){return ql(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Kl(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>ql(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:Ul(e,u)?-1:u,wrapped:d}}function ql(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&&Jl(e,a,r));return a}function Jl(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Xl(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Yl(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Xl(e,t=e?ct(e):null){return!e||!e.isConnected||!t||Yl(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Zl=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ql(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Xe(n)?n.host:null}function $l(e){for(let t of Array.from(e.children))if(We(t)===`summary`)return t;return null}function eu(e,t){let n=$l(t);return!!n&&(e===n||Q(n,e))}function tu(e){let t=e?We(e):``;return e!=null&&e.matches(Zl)&&(t!==`summary`||e.parentElement!=null&&We(e.parentElement)===`details`&&$l(e.parentElement)===e)&&(t!==`details`||$l(e)==null)&&(t!==`input`||e.type!==`hidden`)}function nu(e){if(!tu(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ql(t)){let n=t!==e,r=We(t)===`slot`;if(t.hasAttribute(`inert`)||n&&We(t)===`details`&&!t.open&&!eu(e,t)||t.hasAttribute(`hidden`)||!r&&!ru(t,n))return!1}return!0}function ru(e,t){let n=ct(e);return t?n.display!==`none`:Xl(e,n)}function iu(e){let t=e.tabIndex;if(t<0){let t=We(e);if(t===`details`||t===`audio`||t===`video`||Ye(e)&&e.isContentEditable)return 0}return t}function au(e){if(We(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ou(e,t){let n=au(e);if(!n)return!0;let r=t.find(e=>{let t=au(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=au(e);return t?.name===n.name&&t.form===n.form})===n}function su(e){if(Ye(e)&&We(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ye(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function cu(e,t){su(e).forEach(e=>{tu(e)&&t.push(e),cu(e,t)})}function lu(e,t,n){su(e).forEach(e=>{Ye(e)&&e.matches(t)&&n.push(e),lu(e,t,n)})}function uu(e){return nu(e)&&iu(e)>=0}function du(e){let t=[];return cu(e,t),t.filter(nu)}function fu(e){let t=du(e);return t.filter(e=>iu(e)>=0&&ou(e,t))}function pu(e,t){let n=fu(e),r=n.length;if(r===0)return;let i=hl(Z(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function mu(e){return pu(Z(e).body,1)||e}function hu(e){return pu(Z(e).body,-1)||e}function gu(e,t,n){if(!e)return null;let r=[];cu(Z(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(nu);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&uu(o)&&ou(o,a))return o}return r[i]}function _u(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function vu(e){fu(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function yu(e){let t=[];lu(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 bu(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...bu(e,t.id,n)])}function xu(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 Su(e){return`data-base-ui-${e}`}var Cu=0;function wu(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Cu);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),en;let o=requestAnimationFrame(a);return Cu=o,()=>{Cu===o&&(cancelAnimationFrame(o),Cu=0)}}var Tu=`data-base-ui-inert`,Eu=new WeakMap,Du=new WeakSet,Ou=new WeakMap,ku=0;function Au(e){return e?Xe(e)?e.host:Au(e.parentNode):null}var ju=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Au(t);return e.contains(n)?n:null}).filter(e=>e!=null),Mu=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Nu=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{We(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Pu(e,t,n,{mark:r=!0}){let i=ju(t,e),a=r?Nu(t,Mu(i),new Set(i)):[],o=[],s=[];if(n){let e=ju(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Nu(t,Mu(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Eu.get(e)||0)+1;Eu.set(e,r),o.push(e),r===1&&n&&Du.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Ou.get(e)||0)+1;Ou.set(e,t),s.push(e),t===1&&e.setAttribute(Tu,``)}),ku+=1,()=>{o.forEach(e=>{let t=(Eu.get(e)||0)-1;Eu.set(e,t),t||(Du.has(e)||e.removeAttribute(`aria-hidden`),Du.delete(e))}),r&&s.forEach(e=>{let t=(Ou.get(e)||0)-1;Ou.set(e,t),t||e.removeAttribute(Tu)}),--ku,ku||(Eu=new WeakMap,Du=new WeakSet,Ou=new WeakMap)}}function Fu(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Z(e[0]).body;return Pu(e,i,n,{mark:r})}var Iu={style:{transition:`none`}},Lu=`data-base-ui-swipe-ignore`,Ru=`[${Lu}]`,zu={fallbackAxisSide:`none`},Bu={fallbackAxisSide:`end`},Vu={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Hu=o.createContext(null),Uu=()=>o.useContext(Hu),Wu=Su(`portal`);function Gu(e={}){let{ref:t,container:n,componentProps:r=nn,elementProps:i}=e,a=Rc(),s=Uu()?.portalNode,[c,l]=o.useState(null),[u,d]=o.useState(null),f=Y(e=>{e!==null&&d(e)}),p=o.useRef(null);X(()=>{if(n===null){p.current&&(p.current=null,d(null),l(null));return}let e=(n&&(qe(n)?n:n.current))??s??document.body;e==null?p.current&&(p.current=null,d(null),l(null)):p.current!==e&&(p.current=e,d(null),l(e))},[n,s]);let m=sn(`div`,r,{ref:[t,f],props:[{id:a,[Wu]:``},i]}),h=c&&m?Ca.createPortal(m,c):null;return{node:u,nodeId:o.isValidElement(m)?m.props.id:void 0,subtree:h}}var Ku=o.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:c,portalOwnerRole:l,...u}=e,{node:d,nodeId:f,subtree:p}=Gu({container:c,ref:t,componentProps:e,elementProps:u}),m=o.useRef(null),h=o.useRef(null),g=o.useRef(null),_=o.useRef(null),[v,y]=o.useState(null),b=o.useRef(!1),x=v?.modal,S=v?.open,C=!!v&&!v.modal&&v.open&&!!d;o.useEffect(()=>{if(!d||x)return;function e(e){d&&e.relatedTarget&&_u(e)&&(e.type===`focusin`?b.current&&=(yu(d),!1):(vu(d),b.current=!0))}return Nl($(d,`focusin`,e,!0),$(d,`focusout`,e,!0))},[d,x]),X(()=>{d&&S===!0&&b.current&&(yu(d),b.current=!1)},[S,d]);let w=o.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:h,beforeInsideRef:g,afterInsideRef:_,portalNode:d,setFocusManagerState:y}),[d]);return(0,s.jsxs)(o.Fragment,{children:[p,(0,s.jsxs)(Hu.Provider,{value:w,children:[C&&d&&(0,s.jsx)(Hl,{"data-type":`outside`,ref:m,onFocus:e=>{_u(e,d)?g.current?.focus():hu(v?v.domReference:null)?.focus()}}),C&&d&&(0,s.jsx)(`span`,{role:l,"aria-owns":f,style:Vu}),d&&Ca.createPortal(a,d),C&&d&&(0,s.jsx)(Hl,{"data-type":`outside`,ref:h,onFocus:e=>{_u(e,d)?_.current?.focus():(mu(v?v.domReference:null)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,mc(`focus-out`,e.nativeEvent)))}})]})]})});function qu(){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 Ju=class{nodesRef={current:[]};events=qu();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)}},Yu=o.createContext(null),Xu=o.createContext(null),Zu=()=>o.useContext(Yu)?.id||null,Qu=e=>{let t=o.useContext(Xu);return e??t};function $u(e){let t=Rc(),n=Qu(e),r=Zu();return X(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ed(e){let{children:t,id:n}=e,r=Zu();return(0,s.jsx)(Yu.Provider,{value:o.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function td(e){let{children:t,externalTree:n}=e,r=gt(()=>n??new Ju).current;return(0,s.jsx)(Xu.Provider,{value:r,children:t})}function nd(e){return e==null?e:`current`in e?e.current:e}function rd(e,t){let n=Ge(_l(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(dl(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var id=20,ad=[];function od(){ad=ad.filter(e=>e.deref()?.isConnected)}function sd(e){od(),e&&We(e)!==`body`&&(ad.push(new WeakRef(e)),ad.length>id&&(ad=ad.slice(-20)))}function cd(){return od(),ad[ad.length-1]?.deref()}function ld(e){return e?uu(e)?e:fu(e)[0]||e:null}function ud(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=du(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return uu(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 dd(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:c,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:f=``,nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),b=t.useState(`floatingElement`),{events:x,dataRef:S}=t.context,C=Y(()=>S.current.floatingContext?.nodeId),w=i===!1,T=Al(y)&&w,E=Pl(i),D=Pl(a),O=Pl(c),k=Pl(f),A=Pl(v),j=Qu(g),M=Uu(),N=o.useRef(!1),P=o.useRef(!1),F=o.useRef(!1),I=o.useRef(null),L=o.useRef(``),R=o.useRef(``),z=o.useRef(null),B=o.useRef(null),ee=Gt(z,h,M?.beforeInsideRef),te=Gt(B,M?.afterInsideRef),ne=Jc(),V=Jc(),H=zl(),re=M!=null,U=Ml(b),W=Y((e=U)=>e?fu(e):[]),G=Y(()=>_?.().filter(e=>e!=null)??[]);o.useEffect(()=>{if(r||!u)return;function e(e){e.key===`Tab`&&Q(U,hl(Z(U)))&&W().length===0&&!T&&ll(e)}return $(Z(U),`keydown`,e)},[r,U,u,T,W]),o.useEffect(()=>{if(r||!v)return;let e=Z(U);function t(){F.current=!1}function n(e){let t=_l(e),n=G(),r=Q(b,t)||Q(y,t)||Q(M?.portalNode,t)||n.some(e=>e===t||Q(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,gl(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,V.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return Nl($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,b,y,U,v,M,V,G]),o.useEffect(()=>{if(r||!d)return;let e=Z(U);function n(){P.current=!0,V.start(0,()=>{P.current=!1})}function i(e){let t=_l(e);uu(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=_l(n);u&&r==null&&a!=null&&Q(b,a)&&sd(a),queueMicrotask(()=>{let o=C(),s=t.context.triggerElements,c=G(),d=r?.hasAttribute(Su(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,nd(m),nd(p)].includes(r),f=!(Q(y,r)||Q(b,r)||Q(r,b)||Q(M?.portalNode,r)||c.some(e=>e===r||Q(e,r))||s.hasMatchingElement(e=>Q(e,r))||d||j&&(bu(j.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||xu(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,Ml(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&U&&ud(U),l&&i!==y&&!Xl(a)&&hl(e)===e.body){if(Ye(U)&&(U.focus(),l===`popup`)){H.request(()=>{U.focus()});return}let e=W(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;Ye(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!u)&&r&&f&&!P.current&&(T||r!==cd())&&(N.current=!0,t.setOpen(!1,mc(Sc,n)))})}function o(){F.current||(S.current.insideReactTree=!0,ne.start(0,()=>{S.current.insideReactTree=!1}))}let s=Ye(y)?y:null;if(b||s)return Nl(s&&$(s,`focusout`,a),s&&$(s,`pointerdown`,n),b&&$(b,`focusin`,i),b&&$(b,`focusout`,a),b&&M&&$(b,`focusout`,o,!0))},[r,y,b,U,u,j,M,t,d,l,W,T,C,S,ne,V,H,p,m,G]),o.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Su(`portal`)}]`)||[]),t=(j?xu(j.nodesRef.current,C()):[]).find(e=>Al(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Fu([b,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...G(),t,nd(m),nd(p),T?y:null].filter(e=>e!=null),{ariaHidden:u||T,mark:!1}),i=Fu([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,u,M,T,j,C,p,m,G]),X(()=>{if(!v||r||!Ye(U))return;L.current=``,R.current=``;let e=Z(U),t=hl(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Q(U,t))return;let i=null,a=()=>(i??=W(U),i[0]||U),o;o=r===!0||r===null?a():nd(r),o||=a();let s=Q(U,hl(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&dl(c);wu(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=hl(e);return!(t!==o&&Q(U,t))}})})},[r,v,U,W,E,k,A,S]);let K=o.useRef(null);X(()=>{if(r||!U){K.current=null;return}K.current&&=(K.current.cancelled=!0,null);let e=Z(U),t=hl(e),n=k.current==null;sd(t);function i(e){if(e.open||(L.current=rd(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Su(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(dl(e.nativeEvent)||fl(e.nativeEvent))N.current=!1;else{let e=!1;Z(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}x.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&We(t)!==`body`?t:null,s=n?o||a:a||o;return s||=cd()||null,typeof i==`boolean`?s:nd(i)||s||null}return()=>{x.off(`openchange`,i);let t=hl(e),n=G(),r=Q(b,t)||n.some(e=>e===t||Q(e,t))||j&&bu(j.nodesRef.current,C(),!1).some(e=>Q(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};K.current=l,queueMicrotask(()=>{K.current===l&&(K.current=null);let n=ld(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&Ye(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,b,U,D,O,k,x,j,y,C,G]),X(()=>{if(!ol||v||!b)return;let e=hl(Z(b));Ye(e)&&Ol(e)&&Q(b,e)&&e.blur()},[v,b]),X(()=>{if(!r&&M)return M.setFocusManagerState({modal:u,closeOnFocusOut:d,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,u,v,t,d,y]),X(()=>{if(!r&&U)return ud(U),()=>{queueMicrotask(od)}},[r,U]);let q=!r&&(!u||!T)&&(re||u);return(0,s.jsxs)(o.Fragment,{children:[q&&(0,s.jsx)(Hl,{"data-type":`inside`,ref:ee,onFocus:e=>{if(u){let e=W();wu(e[e.length-1])}else M?.portalNode&&(N.current=!1,_u(e,M.portalNode)?mu(y)?.focus():nd(m??M.beforeOutsideRef)?.focus())}}),n,q&&(0,s.jsx)(Hl,{"data-type":`inside`,ref:te,onFocus:e=>{u?wu(W()[0]):M?.portalNode&&(d&&(N.current=!0),_u(e,M.portalNode)?hu(y)?.focus():nd(p??M.afterOutsideRef)?.focus())}})]})}function fd(){return!1}function pd(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function md(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:s=fd,bubbles:c,externalTree:l}=t,u=e.useState(`open`),d=e.useState(`floatingElement`),{dataRef:f,events:p}=e.context,m=Qu(l),h=Y(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Y(()=>a),{escapeKey:y,outsidePress:b}=pd(c),x=o.useRef(!1),S=o.useRef(!1),C=o.useRef(!1),w=o.useRef(!1),T=o.useRef(!1),E=o.useRef(``),D=o.useRef(null),O=Jc(),k=Jc(),A=Jc(),j=Y(()=>{k.clear(),f.current.insideReactTree=!1}),M=Y(e=>{let t=f.current.floatingContext?.nodeId;return(m?bu(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(t=>El(t,e.select(`floatingElement`))||El(t,e.select(`domReferenceElement`))),P=Y(t=>{s()&&e.setOpen(!1,mc(_c,t.nativeEvent))}),F=Y(t=>{if(!u||!n||!r||t.key!==`Escape`)return;let i=ul(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=mc(Cc,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Y(()=>{f.current.insideReactTree=!0,k.start(0,j)}),L=Y(t=>{if(!u||!n||t.button!==0)return;let r=_l(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});o.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),o.useEffect(()=>j,[j]),o.useEffect(()=>{if(!u||!n)return u||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let t=new qc,i=Z(d);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(ol?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function l(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=l();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=f.current.floatingContext?.nodeId,n=m&&bu(m.nodesRef.current,t).some(t=>El(e,t.context?.elements.floating));return N(e)||n}function k(n){if(p(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let r=_l(n),i=`[${Su(`inert`)}]`,a=Je(r)?r.getRootNode():null,o=Array.from((Xe(a)?a:Z(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=Je(r)?r:null;for(;c&&!st(c);){let e=ut(c);if(st(e)||!Je(e))break;c=e}if(!(o.length&&Je(r)&&!Dl(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(Ye(r)&&!(`touches`in n)){let e=st(r),t=ct(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(!h(n)){if(l()===`intentional`){if(n.detail!==0&&!dl(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,mc(bc,n)),j())}}}function P(t){l()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(l()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=_l(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),l()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function ee(e){if(l()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function te(e){L(e,ee)}function ne(e){l()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function V(e){L(e,ne)}let H=Nl(r&&Nl($(i,`keydown`,F),$(i,`compositionstart`,a),$(i,`compositionend`,o)),_&&Nl($(i,`click`,z,!0),$(i,`pointerdown`,z,!0),$(i,`pointerup`,B,!0),$(i,`pointercancel`,B,!0),$(i,`mousedown`,z,!0),$(i,`mouseup`,B,!0),$(i,`touchstart`,R,{capture:!0,passive:!0}),$(i,`touchmove`,te,{capture:!0,passive:!0}),$(i,`touchend`,V,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),C.current=!1}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,e,O,A]);let z=o.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=o.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return o.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function hd(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),X(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Je(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}function gd(e,t=!1,n=!1,r=!1){let[i,a]=o.useState(e&&t?`idle`:void 0),[s,c]=o.useState(e&&!r);return e&&!s&&(c(!0),a(`starting`)),!e&&s&&i!==`ending`&&!n&&a(`ending`),!e&&!s&&i===`ending`&&a(void 0),X(()=>{if(!e&&s&&i!==`ending`&&n){let e=Rl.request(()=>{a(`ending`)});return()=>{Rl.cancel(e)}}},[e,s,i,n]),X(()=>{if(!e||t||i===void 0)return;let n=Rl.request(()=>{a(void 0)});return()=>{Rl.cancel(n)}},[t,e,i]),X(()=>{if(!e||!t)return;e&&s&&i!==`idle`&&a(`starting`);let n=Rl.request(()=>{a(`idle`)});return()=>{Rl.cancel(n)}},[t,e,s,i]),{mounted:s,setMounted:c,transitionStatus:i}}function _d(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var vd=null;function yd(e){if(!vd){let e=[];vd=e,queueMicrotask(()=>{vd=null,Ca.flushSync(()=>{for(let t of e)t()})})}vd.push(e)}function bd(e,t=!1,n=!1){let r=zl();return Y((i,a=null)=>{r.cancel();let o=nd(e);if(o==null)return;let s=o,c=()=>{n?yd(()=>{a?.aborted||i()}):Ca.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(_d(s).map(e=>e.finished.then(en))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(_d(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Hs;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 xd(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,s=Y(a),c=bd(r,n,i);o.useEffect(()=>{if(!t)return;let e=new AbortController;return c(s,e.signal),()=>{e.abort()}},[t,n,s,c])}function Sd(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:s}=e,c=Y(i),{mounted:l,setMounted:u,transitionStatus:d}=gd(t,!1,!1,s),f=!t&&r;X(()=>{t&&c(!1)},[t,c]);let p=o.useRef(l),m=o.useRef(!1),h=Pc(),g=()=>{p.current=!1,u(!1),a()};X(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=Y(()=>{p.current&&(t?(m.current=!0,h()):g())});return xd({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var Cd={tabIndex:-1,[vl]:``};function wd(e,t=!1){let n=Rc(),r=Zu()!=null,i=gt(()=>e(n,r)).current;return hd({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Td({handle:e,store:t}){return X(()=>e.attachStore(t),[e,t]),null}function Ed(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Dd(e,t){let n=o.useRef(null);return Y(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),Ed(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ed(t))})}function Od(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 kd(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ad(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Dd(e,n),o=Y(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=Y(e=>{a(e),e&&o(e)});return X(()=>(s(t.current),()=>s(null)),[s,t,n,e]),X(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function jd(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=o.useRef(null),i=e.useState(`open`);X(()=>{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=mc(gc);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Md(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Sd({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 gt(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Nd(e,t){e.useSyncedValues(t),X(()=>()=>{e.update({activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn})},[e])}function Pd(e,t){X(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),X(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Fd=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}},Id=[],Ld=void 0;function Rd(){return Ld}function zd(e){Id.push(e)}function Bd(e){let t=(t,n)=>{let r=gt(Hd).current,i;try{Ld=r;for(let e of Id)e.before(r);i=e(t,n);for(let e of Id)e.after(r);r.didInitialize=!0}finally{Ld=void 0}return i};return t.displayName=e.displayName||e.name,t}function Vd(e){return o.forwardRef(Bd(e))}function Hd(){return{didInitialize:!1}}var Ud=Qt(19)?Kd:qd;function Wd(e,t,n,r,i){return Ud(e,t,n,r,i)}function Gd(e,t,n,r,i){let a=o.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Vc.useSyncExternalStore)(e.subscribe,a,a)}zd({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,Vc.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Kd(e,t,n,r,i){let a=Rd();if(!a)return Gd(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 qd(e,t,n,r,i){return(0,Hc.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Jd=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 Wd(this,e,t,n,r)}},Yd=class extends Jd{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){o.useDebugValue(e);let n=this;X(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;X(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;X(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){o.useDebugValue(e);let n=this,r=t!==void 0;X(()=>{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 o.useDebugValue(e),Wd(this,this.selectors[e],t,n,r)}useContextCallback(e,t){o.useDebugValue(e);let n=Y(t??en);this.context[e]=n}useStateSetter(e){let t=o.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)}})}},Xd={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},Zd=class extends Yd{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:qu(),nested:n,triggerElements:i},Xd),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ml(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 Qd(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Zd({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:nn,inactiveTriggerProps:nn,popupProps:nn}}var $d=e=>e.triggerIdProp??e.activeTriggerId,ef=e=>e.openProp??e.open,tf=e=>(e.popupElement?.id??e.floatingId)||void 0;function nf(e,t){return t!==void 0&&ef(e)&&$d(e)===t}function rf(e,t){return nf(e,t)?!0:t!==void 0&&ef(e)&&$d(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var af={open:ef,mounted:e=>e.mounted,transitionStatus:e=>ef(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:$d,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:tf,isTriggerActive:(e,t)=>t!==void 0&&$d(e)===t,isOpenedByTrigger:(e,t)=>nf(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&$d(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>rf(e,t)?tf(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},of=`data-expanded`,sf=`data-nested-drawer-open`,cf=`data-nested-drawer-swiping`,lf=`data-swipe-dismiss`,uf=`data-swipe-direction`,df=`data-swiping`,ff=o.createContext(void 0);function pf(){let e=o.useContext(ff);if(e===void 0)throw Error(Lt(26));return e}var mf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),hf=o.createContext(void 0);function gf(e){let t=o.useContext(hf);if(e!==!0&&t===void 0)throw Error(Lt(90));return t}function _f(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function vf(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function yf(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?_f(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function bf(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function xf(){let e=Vs(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=gf(),a=e.useState(`viewportElement`),[s,c]=o.useState(0),[l,u]=o.useState(16),d=Y(()=>{let e=Z(a).documentElement;c(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});X(()=>{if(d(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(d);return e.observe(a),()=>{e.disconnect()}},[d,a]);let f=o.useMemo(()=>{if(!t||t.length===0||s<=0||i<=0)return[];let e=Math.min(i,s),n=t.map(t=>{let n=yf(t,s,l);if(n===null)return null;let r=_f(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,l,t,s]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:s,resolvedSnapPoints:f,activeSnapPointOffset:o.useMemo(()=>{if(n===null)return;let e=f.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,s),r=yf(n,s,l);if(r===null)return;let a=_f(r,0,t);return f[bf(f.map(e=>e.height),a)]},[n,i,f,l,s])?.offset??null}}var Sf=o.createContext(null);function Cf(){return o.useContext(Sf)}var wf=!1;function Tf(){wf||=(typeof CSS<`u`&&`registerProperty`in CSS&&([cc,lc,uc].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:fc,initialValue:`0`},{name:dc,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var Ef={...ic,expanded(e){return e?{[of]:``}:null},nestedDrawerOpen(e){return e?{[sf]:``}:null},nestedDrawerSwiping(e){return e?{[cf]:``}:null},swipeDirection(e){return{[uf]:e}},swiping(e){return e?{[df]:``}:null}},Df=o.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:c,...l}=e,u=Vs(),d=u.context.popupRef,{swipeDirection:f,frontmostHeight:p,hasNestedDrawer:m,nestedSwiping:h,nestedSwipeProgressStore:g,onPopupHeightChange:_,notifyParentFrontmostHeight:v,notifyParentHasNestedDrawer:y}=gf(),b=u.useState(`descriptionElementId`),x=u.useState(`disablePointerDismissal`),S=u.useState(`floatingRootContext`),C=u.useState(`popupProps`),w=u.useState(`modal`),T=u.useState(`mounted`),E=u.useState(`nested`),D=u.useState(`nestedOpenDrawerCount`),O=u.useState(`transitionStatus`),k=u.useState(`open`),A=u.useState(`openMethod`),j=u.useState(`titleElementId`),M=u.useState(`role`),N=S.useState(`floatingId`),P=l.id??N,F=Cf();pf();let{snapPoints:I,activeSnapPoint:L,activeSnapPointOffset:R}=xf(),z=D>0,B=F?.swiping??!1,ee=F?.swipeStrength??null,[te,ne]=o.useState(0),V=o.useRef(0),H=Y(()=>{let e=d.current;if(!e)return;let t=e.offsetHeight;if(V.current>0&&p>V.current&&t>V.current)return;if(V.current>0&&m){let e=V.current;ne(e),_(e);return}let n=t;n!==V.current&&(V.current=n,ne(n),_(n))});X(()=>{if(!T){V.current=0,ne(0),_(0);return}let e=d.current;if(!e||(Tf(),H(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(H);return t.observe(e),()=>{t.disconnect()}},[H,T,z,_,d]),X(()=>{let e=()=>{let e=d.current;if(!e)return;let t=g.getSnapshot();t>0?e.style.setProperty(fc,`${t}`):e.style.setProperty(fc,`0`)};e();let t=g.subscribe(e),n=d.current;return()=>{t(),n&&n.style.setProperty(fc,`0`)}},[g,d]),X(()=>{if(k)return v?.(p),()=>{v?.(0)}},[p,k,v]),X(()=>{if(y)return y(k||O===`ending`),()=>{y(!1)}},[y,k,O]),xd({open:k,ref:d,onComplete(){k&&u.context.onOpenChangeComplete?.(!0)}});let re=c===void 0?d:c,U=u.useStateSetter(`popupElement`),W={open:k,nested:E,transitionStatus:O,expanded:L===1,nestedDrawerOpen:z,nestedDrawerSwiping:h,swipeDirection:f,swiping:B},G;te&&(m||O===`ending`)&&(G=`${te}px`);let K=I&&I.length>0&&(f===`down`||f===`up`),q=null;K&&R!==null&&(q=f===`up`?-R:R);let J=F?F.getDragStyles():nn;if(K&&f===`down`){let e=R??0,t=Number.parseFloat(String(J[lc]));J=B&&Number.isFinite(t)?{...J,transform:void 0,[lc]:`${vf(e,t)}px`}:{...J,transform:void 0}}let ie=sn(`div`,e,{state:W,props:[C,{id:P,"aria-labelledby":j,"aria-describedby":b,role:M,...Cd,hidden:!T,onKeyDown(e){mf.has(e.key)&&e.stopPropagation()},style:{...J,[fc]:`0`,[ac]:D,[oc]:G,[uc]:typeof q==`number`?`${q}px`:`0px`,[sc]:p?`${p}px`:void 0,[dc]:typeof ee==`number`&&Number.isFinite(ee)&&ee>0?`${ee}`:`1`}},l],ref:[t,d,U],stateAttributesMapping:Ef});return(0,s.jsx)(dd,{context:S,openInteractionType:A,disabled:!T,closeOnFocusOut:!x,initialFocus:re,returnFocus:a,modal:w!==!1,restoreFocus:`popup`,children:ie})});function Of(e){return Qt(19)?e:e?`true`:void 0}var kf=o.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,s.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Af=o.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Vs(),a=i.useState(`mounted`),o=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,s.jsx)(ff.Provider,{value:n,children:(0,s.jsxs)(Ku,{ref:t,...r,children:[a&&o===!0&&(0,s.jsx)(kf,{ref:i.context.internalBackdropRef,inert:Of(!c)}),e.children]})}):null});function jf({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=o.useRef(e!==void 0),[a,s]=o.useState(()=>t);return[i&&e!==void 0?e:a,o.useCallback(e=>{i||s(e)},[])]}var Mf={},Nf={},Pf=``;function Ff(e,t){return Ze(e)?e:t}function If(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ff(t,n)).overflowY)}function Lf(e){if(typeof document>`u`)return!1;let t=Z(e);return Ge(t).innerWidth-t.documentElement.clientWidth>0}function Rf(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Z(e),n=t.documentElement,r=t.body,i=Ff(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 zf(e){let t=Z(e),n=t.documentElement,r=t.body,i=Ff(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 Bf(e){let t=Z(e),n=t.documentElement,r=t.body,i=Ge(n),a=0,o=0,s=!1,c=Rl.create();if(ol&&(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,Mf={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Pf=n.style.scrollBehavior,Nf={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=Ff(n,r);s=Rf(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,Mf),Object.assign(r.style,Nf),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Pf)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Vf=new class{lockCount=0;restore=null;timeoutLock=qc.create();timeoutUnlock=qc.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=Z(e),n=t.documentElement,r=t.body,i=Ge(n);if(If(i,n,r)){let t=new i.MutationObserver(()=>{If(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=tl||!Lf(e);this.restore=a?zf(e):Bf(e)}};function Hf(e=!0,t=null){X(()=>{if(e)return Vf.acquire(t)},[e,t])}function Uf({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=o.useState(0),[f,p]=o.useState(0),m=u===0,h=md(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`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=_l(t);if(m&&!a){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Q(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return Hf(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),X(()=>{!r&&!i&&(d(0),p(0))},[r,i]),X(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),Nd(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var Wf={...af,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},Gf=class extends Yd{constructor(e,t,n){let r=new Fd,i=Kf(e,r,t,n);super(i,qf(r),Wf)}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(Od(this.state,e,t.trigger)))}};function Kf(e,t,n,r=!1){return{...Qd(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 qf(e){return{popupRef:o.createRef(),backdropRef:o.createRef(),internalBackdropRef:o.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Jf(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:c,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:d,handle:f,triggerId:p,defaultTriggerId:m=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:u,v=g||l,y=g?`alertdialog`:`dialog`,b=Vs(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=wd((e,t)=>new Gf({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,p),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,c);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);Pd(S,C),jd(S);let{forceUnmount:E}=Md(C,S);o.useImperativeHandle(d,()=>({unmount:E,close:()=>S.setOpen(!1,mc(Ac))}),[E,S]);let D=C||w||f!=null;return(0,s.jsxs)(Bs.Provider,{value:S,children:[f&&(0,s.jsx)(Td,{handle:f,store:S}),D&&(0,s.jsx)(Uf,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var Yf,Xf;function Zf(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null,swipeDirection:m=`down`,snapToSequentialPoints:h=!1,snapPoints:g,snapPoint:_,defaultSnapPoint:v,onSnapPointChange:y}=e,b=gf(!0),x=b?.onNestedSwipeProgressChange,S=b?.onNestedFrontmostHeightChange,C=b?.onNestedSwipingChange,w=b?.onNestedDrawerPresenceChange,[T,E]=o.useState(0),[D,O]=o.useState(0),[k,A]=o.useState(!1),[j,M]=o.useState(!1),[N]=o.useState(Qf),P=v===void 0?g?.[0]??null:v,F=_!==void 0,[I,L]=jf({controlled:_,default:P,name:`Drawer`,state:`snapPoint`}),R=o.useRef(!1),z=o.useRef(!1),B=Y((e,t)=>{let n=t??mc(`none`);y?.(e,n),n.isCanceled||L(e)}),ee=o.useMemo(()=>F||!g||g.length===0?I:I===null||!g.some(e=>Object.is(e,I))?P:I,[I,F,P,g]),te=Y(e=>{E(e),!R.current&&e>0&&O(e)}),ne=Y(e=>{e>0?(R.current=!0,O(e)):(R.current=!1,T>0&&O(T))}),V=Y(e=>{A(e)}),H=Y(e=>{N.set(e),x?.(e)}),re=Y(e=>{M(e),C?.(e)}),U=Y((e,t)=>{i?.(e,t),t.isCanceled||!e&&g&&g.length>0&&B(P,mc(t.reason,t.event,t.trigger))}),W=o.useMemo(()=>({swipeDirection:m,swipeAreaActiveRef:z,snapToSequentialPoints:h,snapPoints:g,activeSnapPoint:ee,setActiveSnapPoint:B,frontmostHeight:D,popupHeight:T,hasNestedDrawer:k,nestedSwiping:j,nestedSwipeProgressStore:N,onNestedDrawerPresenceChange:V,onPopupHeightChange:te,onNestedFrontmostHeightChange:ne,onNestedSwipingChange:re,onNestedSwipeProgressChange:H,notifyParentFrontmostHeight:S,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:x,notifyParentHasNestedDrawer:w}),[ee,D,k,j,N,w,x,C,S,V,ne,H,re,te,T,B,g,h,z,m]),G=Jf(`drawer`,{open:n,defaultOpen:r,onOpenChange:U,onOpenChangeComplete:a,disablePointerDismissal:c,modal:l,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p,children:typeof t==`function`?e=>(0,s.jsxs)(o.Fragment,{children:[Yf||=(0,s.jsx)($f,{}),t(e)]}):(0,s.jsxs)(o.Fragment,{children:[Xf||=(0,s.jsx)($f,{}),t]})});return(0,s.jsx)(hf.Provider,{value:W,children:G})}function Qf(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function $f(){let e=Wc(),t=Vs(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,i=t.useState(`open`),a=t.useState(`nestedOpenDialogCount`),s=t.useState(`popupElement`),c=a===0;return X(()=>{if(r)return()=>{r(t)}},[r,t]),X(()=>{n?.(t,i)},[i,n,t]),o.useEffect(()=>{if(!i||!c||!rl)return;let e=Ge(s).CloseWatcher;if(!e)return;function n(e){if(!t.select(`open`))return;let n=mc(wc,e);e.cancelable||(n.cancel=en),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()}let r=new e,a=$(r,`cancel`,n);return()=>{a(),r.destroy()}},[t,c,i,s]),null}function ep(e,t=!1){let{overflowY:n}=ct(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function tp(e,t=!1){let{overflowX:n}=ct(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function np(e,t,n=!1){return t===`vertical`?ep(e,n):tp(e,n)}function rp(e,t,n,r=!1){let i=e;for(;Je(i)&&i!==t&&!st(i);){if(Ye(i)&&np(i,n,r))return i;i=ut(i)}return null}function ip(e,t,n=`vertical`,r=!1){return rp(e,t,n,r)??(np(t,n,r)?t:null)}function ap(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}function op(e,t){let n=(t??Ge(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var sp=40,cp=10,lp=50,up=4,dp=80,fp=1,pp=`button,a,input,select,textarea,label,[role="button"]`;function mp(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function hp(e){return Number.isFinite(e)&&e>0?e:null}function gp(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function _p(e){return e%2==1}function vp(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function yp(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:i,canStart:a,ignoreSelectorWhenTouch:s=!0,ignoreScrollableAncestors:c=!1,swipeThreshold:l,onDismiss:u,onProgress:d,onCancel:f,onSwipeStart:p,onRelease:m,onSwipingChange:h,trackDrag:g=!0}=e,_=pp,v=n.length===1?n[0]:void 0,y=Math.max(0,typeof l==`number`?l:sp),b=n.includes(`left`),x=n.includes(`right`),S=n.includes(`up`),C=n.includes(`down`),w=b||x,T=S||C,E=w?`horizontal`:`vertical`,[D,O]=o.useState(void 0),[k,A]=o.useState(!1),[j,M]=o.useState(!1),N=o.useRef({x:0,y:0}),P=o.useRef({x:0,y:0}),F=o.useRef(null),I=o.useRef({x:0,y:0,scale:1}),L=o.useRef(void 0),R=o.useRef(0),z=o.useRef(!1),B=o.useRef({x:0,y:0}),ee=o.useRef(!1),te=o.useRef(!1),ne=o.useRef(null),V=o.useRef(!1),H=o.useRef(!1),re=o.useRef({width:0,height:0}),U=o.useRef(0),W=o.useRef(y),G=o.useRef(null),K=o.useRef(null),q=o.useRef(null),J=o.useRef(!1),ie=o.useRef({x:0,y:0}),ae=o.useRef(null),oe=o.useRef(!1),se=o.useRef(null),ce=Y(e=>{oe.current!==e&&(oe.current=e,A(e),h?.(e))});function le(e){if(!e)return;let t=r.current,n=G.current;if(!t||!n)return;let i=n({element:t,direction:e});W.current=Math.max(0,i)}let ue=Y((e,t)=>{let n=Number.isFinite(e)?_f(e,0,1):0,r=n!==U.current,i=!1;if(t){let e=ae.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}(r||i)&&(U.current=n,t?ae.current=t:r&&(ae.current=null),d?.(n,t))}),de=Y(e=>{let t=r.current;if(!g||!t){e||(se.current=null);return}let n=t.style,a=se.current;e?(a||(se.current=[n.transition,n.transform]),n.transition=`none`):a&&([n.transition,n.transform]=a,se.current=null);let o=P.current,s=I.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=gp(o,s.scale)),n.setProperty(i.x,`${c}px`),n.setProperty(i.y,`${l}px`)});function fe(e,t){if(t===null)return;let n=q.current;if(n&&t>n.time){let r=Math.abs(e.x-n.x)<fp&&Math.abs(e.y-n.y)<fp,i=r&&!J.current;if(J.current=r,i)return;let a=Math.max(t-n.time,up);ie.current={x:(e.x-n.x)/a,y:(e.y-n.y)/a}}q.current={x:e.x,y:e.y,time:t}}let pe=o.useCallback(()=>{O(void 0),ce(!1),M(!1),ue(0),W.current=y,G.current=null,N.current={x:0,y:0},P.current={x:0,y:0},I.current={x:0,y:0,scale:1},L.current=void 0,R.current=0,z.current=!1,B.current={x:0,y:0},ee.current=!1,F.current=null,te.current=!1,ne.current=null,V.current=!1,H.current=!1,re.current={width:0,height:0},K.current=null,q.current=null,J.current=!1,ie.current={x:0,y:0},ae.current=null,de(!1)},[ce,y,de,ue]);function me(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function he(e){return`touches`in e||e.pointerType===`touch`}function ge(e,t){let n=r.current?.getRootNode();return ap(n,e.x,e.y)??_l(t)}function _e(e,t){return(n=>{let r=ip(e,t,n),i=Z(r);return r===i.body||r===i.documentElement?null:r})(E)}function ve(e,t,n){V.current=!1;let i=he(e),a=ge(t,e.nativeEvent),o=Z(r.current).body,u=i&&o?_e(a,o):null,d=n?.ignoreScrollableTarget??!1;if(u&&!d||(V.current=!!(u&&d),gl(a,_)&&(!i||s)))return!1;let f=r.current;if(c&&f&&a&&!(n?.ignoreScrollableAncestors??!1)&&rp(a,f,E)!=null)return!1;if(z.current=!1,L.current=void 0,R.current=0,N.current=t,K.current=hp(e.timeStamp),q.current=null,J.current=!1,ie.current={x:0,y:0},B.current=t,F.current=t,W.current=y,G.current=typeof l==`function`?l:null,f){re.current={width:f.offsetWidth,height:f.offsetHeight},le(v);let t=op(f);I.current=t,P.current={x:t.x,y:t.y},fe({x:t.x,y:t.y},K.current),`touches`in e||vp(f,e.pointerId,`setPointerCapture`)}return p?.(e.nativeEvent),ce(!0),ee.current=!0,ue(0),de(!0),!0}function ye(){be(),V.current=!1,F.current=null}function be(){te.current=!1,ne.current=null}function xe(e){if(ye(),!oe.current)return;ce(!1);let t=I.current;P.current={x:t.x,y:t.y},O(void 0),H.current=!1,de(!1);let n=r.current;n&&vp(n,e.pointerId,`releasePointerCapture`),ue(0,{deltaX:0,deltaY:0,direction:void 0}),f?.(e.nativeEvent)}function Se(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:w?r(e,b,x):n(e),y:T?r(t,S,C):n(t)}}function Ce(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i;return T&&n!==0?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,C,S):w&&t!==0?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,x,b):null}let we=Y(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=me(e);n&&(te.current=!0,ne.current=n,V.current=!1,H.current=!(`touches`in e),(!a||a(n,{nativeEvent:e.nativeEvent,direction:v}))&&ve(e,n)&&be())});function Te(e,n,r){if(!t||!oe.current)return;let i=_l(e.nativeEvent);if(he(e)&&!V.current){let t=e.currentTarget;if(_e(i,t))return}if(`touches`in e||e.preventDefault(),ee.current&&(ee.current=!1,g)){N.current=n;let t=hp(e.timeStamp);t!==null&&(K.current=t),q.current=null,J.current=!1}let a=n.x,o=n.y,s=r.x,c=r.y;(c<0&&o>B.current.y||c>0&&o<B.current.y)&&(B.current={x:B.current.x,y:o}),(s<0&&a>B.current.x||s>0&&a<B.current.x)&&(B.current={x:a,y:B.current.y});let l=a-N.current.x,u=o-N.current.y,d=o-B.current.y,f=a-B.current.x,p;if(!L.current)p=Math.abs(l)>=Math.abs(u)?l>0?`right`:`left`:u>0?`down`:`up`,p&&(p===`left`&&b||p===`right`&&x||p===`up`&&S||p===`down`&&C)&&(L.current=p,R.current=mp(p,l,u),O(p),le(p));else{let e=L.current,t=mp(e,f,d);t>W.current?(z.current=!1,O(e)):!(b&&x)&&!(S&&C)&&R.current-t>=cp&&(z.current=!0)}let m=Se(l,u),h=I.current.x,_=I.current.y;w&&(h+=m.x),T&&(_+=m.y);let y=P.current,E=h!==y.x||_!==y.y;P.current={x:h,y:_},E&&de(!0),fe({x:h,y:_},hp(e.timeStamp));let D=h-I.current.x,k=_-I.current.y,A={deltaX:D,deltaY:k,direction:L.current},j=0,M=v??L.current;if(M){let e=M===`left`||M===`right`?re.current.width:re.current.height,t=I.current.scale||1,n=mp(M,D,k);e>0&&t>0&&n>0&&(j=n/(e*t))}ue(j,A)}let Ee=Y(e=>{if(!t)return;let i=P.current,a=I.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:L.current};if(!oe.current){ye(),ue(0,c);return}ce(!1),ye(),H.current=!1;let l=r.current;l&&(`touches`in e||vp(l,e.pointerId,`releasePointerCapture`));let d=o,f=s,p=K.current,h=hp(e.timeStamp),g=p!==null&&h!==null&&h>p?h-p:0,_=g>0?Math.max(g,lp):0,y=_>0?d/_:0,b=_>0?f/_:0,x=ie.current.x,S=ie.current.y,C=q.current;if(C&&h!==null&&h>=C.time){let e=h-C.time;if(e<=dp){let t=Math.max(e,up),n=i.x-C.x,r=i.y-C.y,a=n/t,o=r/t;Math.abs(n)>=fp&&(x=a),Math.abs(r)>=fp&&(S=o)}else x=0,S=0}let w=m?.({event:e.nativeEvent,direction:L.current,deltaX:d,deltaY:f,velocityX:y,velocityY:b,releaseVelocityX:x,releaseVelocityY:S}),T=typeof w==`boolean`;if(z.current&&!T){P.current={x:a.x,y:a.y},O(void 0),de(!1),ue(0,c);return}let E=!1,D;if(T)E=w,D=L.current??v;else for(let e of n)if(mp(e,d,f)>W.current){E=!0,D=e;break}E&&D?(O(D),M(!0),de(!1),u?.(e.nativeEvent,{direction:D})):(P.current={x:a.x,y:a.y},O(void 0),de(!1),ue(0,c))}),De=Y(e=>{let t=me(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=_p(e.buttons);if(t&&(H.current=!0),e.buttons!==0&&!t){xe(e);return}if(e.buttons===0&&H.current){if(!oe.current){Ee(e);return}n=!0}}if(!k&&te.current){if(!he(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){ye();return}if(!a||a(t,{nativeEvent:e.nativeEvent,direction:v})){let n=ne.current,i=!1;if(he(e)){let a=r.current;if(n&&a){let r=ge(t,e.nativeEvent),o=Z(a).body,s=o?_e(r,o):null;if(s&&(Q(a,s)||Q(s,a))){let e=Ce(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}ve(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(be(),N.current=n,B.current=n,F.current=n,ee.current=!1):(be(),V.current=!1))}}let i=F.current,o=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};F.current=t,Te(e,t,o),n&&!(`touches`in e)&&Ee(e)}),Oe=Y((e,t)=>{De({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),ke=o.useCallback(()=>{let e=oe.current,t=P.current,n=I.current,r=t.x-n.x,a=t.y-n.y;return!e&&r===0&&a===0&&!j?{[i.x]:`0px`,[i.y]:`0px`}:{transition:e?`none`:void 0,transform:e?gp(t,n.scale):void 0,[i.x]:`${r}px`,[i.y]:`${a}px`}},[j,i]);return{swiping:k,swipeDirection:D,dragDismissed:j,getPointerProps:o.useCallback(()=>t?{onPointerDown:we,onPointerMove:De,onPointerUp:Ee,onPointerCancel:Ee}:{},[t,Ee,De,we]),getTouchProps:o.useCallback(()=>t?{onTouchStart:we,onTouchMove:De,onTouchEnd:Ee,onTouchCancel:Ee}:{},[t,Ee,De,we]),moveNative:Oe,getDragStyles:ke,reset:pe}}var bp=o.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Vs(),c=zc(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),sn(`h2`,e,{ref:t,props:[{id:c},o]})}),xp=`data-nested-dialog-open`,Sp={...rc,...Ks,nestedDialogOpen(e){return e?{[xp]:``}:null}},Cp=o.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=pf(),c=Vs(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return sn(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:Sp,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),wp=`data-nested-dialog-open`,Tp=o.createContext(void 0);function Ep(){return o.useContext(Tp)}var Dp=10,Op=.5,kp=.5,Ap=300,jp=4,Mp=.2,Np=4,Pp=80,Fp=360,Ip=.1,Lp=6,Rp=2,zp=`[${Mc}]`,Bp={horizontal:`[${Lu}="x"]`,vertical:`[${Lu}="y"]`},Vp=o.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...c}=e,l=Vs(),u=l.context.popupRef,d=l.context.backdropRef,{swipeDirection:f,notifyParentSwipingChange:p,notifyParentSwipeProgressChange:m,frontmostHeight:h,snapToSequentialPoints:g,swipeAreaActiveRef:_}=gf(),v=Wc(),{snapPoints:y,resolvedSnapPoints:b,activeSnapPoint:x,activeSnapPointOffset:S,setActiveSnapPoint:C,popupHeight:w}=xf(),T=l.useState(`open`),E=l.useState(`mounted`),D=l.useState(`nested`),O=l.useState(`nestedOpenDrawerCount`),k=l.useState(`viewportElement`),A=l.useState(`popupElement`),j=v?.visualStateStore,M=O>0,N=f===`left`||f===`right`?`horizontal`:`vertical`,P=N===`vertical`,F=P?`horizontal`:`vertical`,[I,L]=o.useState(null),R=o.useRef(void 0),z=o.useRef(null),B=zl(),ee=o.useRef(!1),te=o.useRef(!1),ne=o.useRef(``),V=o.useRef(!1),H=o.useRef(!1),re=o.useRef(null),U=Ep(),W=o.useMemo(()=>{if(!y||y.length<2||b.length<2||f!==`down`&&f!==`up`)return null;let e=b.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[b,y,f]),G=o.useMemo(()=>!W||S===null?null:_f((S-W.minOffset)/W.range,0,1),[S,W]),K=o.useMemo(()=>y&&y.length>0&&(f===`down`||f===`up`)?f===`down`?[`down`,`up`]:[`up`,`down`]:[f],[y,f]),q=Y(e=>{u.current?.toggleAttribute(lf,e),d.current?.toggleAttribute(lf,e)}),J=Y(()=>{q(!1),u.current?.removeAttribute(Us),L(null)}),ie=Y(()=>{te.current&&(te.current=!1,p?.(!1))}),ae=Y((e,t,n)=>{let r=T&&!D&&t,i=r?e:0,a=T&&t?e:0;n&&m&&(m(a),a<=0&&ie()),j?.set({swipeProgress:i,frontmostHeight:i>0?h:0});let o=d.current;if(!o)return;let s=r&&i>0;o.style.setProperty(fc,s?`${i}`:`0`),s&&h>0?o.style.setProperty(oc,`${h}px`):o.style.removeProperty(oc)});function oe(e,t,n,r,i,a,o,s){let c=Gp(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&y&&y.length>0?S??0:0)+mp(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=mp(t,o,s),f=Math.abs(d)>0?d:mp(t,i,a);return f<=Mp?null:Ip+(_f(u/_f(f,Mp,Np),Pp,Fp)-Pp)/280*.9}function se(e){if(te.current||!e)return;let t=mp(e.direction??f,e.deltaX,e.deltaY);Math.abs(t)<Dp||(te.current=!0,p?.(!0))}let ce=yp({enabled:E&&!M,directions:K,elementRef:l.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:cc,y:lc},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=u.current,n=Z(t).getSelection?.();if(!n||n.isCollapsed)return;let r=Je(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=Je(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(Q(t,r)||Q(t,i))&&n.removeAllRanges()},onSwipingChange(e){ee.current=e,Hp(l.context.backdropRef.current,e),!e&&!m&&ie()},swipeThreshold({element:e,direction:t}){return Kp(e,t)},canStart(e,t){let n=l.context.popupRef.current;if(!n)return!1;let r=t.nativeEvent,i=`touches`in r||r.pointerType===`touch`,a=i?re.current:null,o=n.ownerDocument,s=ap(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!Q(n,s)||i&&Xp(o,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&a.allowSwipe!==!0)},onProgress(e,t){let n=ee.current;n&&se(t);let r=!!(y&&y.length>0);if(n&&f===`down`&&r&&t){let e=l.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(lc,`${vf(S??0,t.deltaY)}px`))}let i=e;if(W&&w>0){let e=S??W.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>_f((e-W.minOffset)/W.range,0,1))(_f(e+t.deltaY,0,w)):G!==null&&(i=G)}n||(m?.(0),ie()),ae(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:i,velocityY:a,releaseVelocityX:o,releaseVelocityY:s}){let c=l.context.popupRef.current;if(!c){J();return}let u=c;function d(e){ie(),q(!0),u.style.removeProperty(`transition`),u.setAttribute(Us,``),Ca.flushSync(()=>{L(oe(u,e,t,n,i,a,o,s))})}if(!y||y.length===0){if(!r){J();return}let e=mp(r,t,n);if(e<=0)return J(),!1;if(mp(r,i,a)>=Op)return d(r),!0;let o=e>Kp(u,r);return o?d(r):J(),o}if(f!==`down`&&f!==`up`){J();return}if(!w)return J(),!1;if(b.length===0){J();return}let p=f===`down`?n:-n,m=Math.sign(p),h=f===`down`?s:-s,_=f===`down`?a:-a,v=h;if(m!==0&&Math.abs(p)>=Dp){let e=Math.sign(v);e!==0&&e!==m&&(v=_)}let T=S??0,E=_f(T+p,0,w),D=Math.abs(v)>=kp?_f(v,-4,jp)*Ap:0,O=g?E:_f(E+D,0,w),k=mc(jc,e),A=()=>(ae(0,!0,!0),J(),!1),j=e=>(C(e.value,k),A()),M=e=>r?(C(null,k),k.isCanceled?A():(R.current=x,d(f),!0)):j(e);if(g){let e=[...b].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=bf(t,T),r=e[bf(t,O)],i=Math.sign(v),a=m!==0&&i!==0&&i===m&&Math.abs(v)>=kp,o=O;if(a){let t=_f(n+m,0,e.length-1);if(t!==n){let n=e[t];(m>0?O<n.offset:O>n.offset)&&(r=n,o=n.offset)}else if(m>0)return M(r)}return Math.abs(o-w)<Math.abs(o-r.offset)?M(r):j(r)}let N=b[bf(b.map(e=>e.offset),O)];return v>=Op&&p>0||Math.abs(O-w)<Math.abs(O-N.offset)?M(N):j(N)},onDismiss(e){j?.set({swipeProgress:0,frontmostHeight:0});let t=l.context.backdropRef.current;t&&(t.style.setProperty(fc,`0`),t.style.removeProperty(oc));let n=mc(jc,e);if(l.setOpen(!1,n),n.isCanceled){let t=R.current;t!==void 0&&C(t,mc(jc,e)),R.current=void 0,z.current?.(),J()}else if(l.select(`open`)){let t=e;B.request(()=>{if(l.select(`open`)){let e=R.current;e!==void 0&&C(e,mc(jc,t)),R.current=void 0,J(),z.current?.()}else R.current=void 0})}else R.current=void 0,q(!0)}}),le=ce.getPointerProps(),ue=ce.getTouchProps(),{moveNative:de,reset:fe}=ce;z.current=fe,o.useEffect(()=>{let e=k??A;if(!e||!T||!E)return;let t=e,n=Z(t);function r(e,r,i){let a=P?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||Xp(n,t)||M||em(r,e,i,P))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body)e.cancelable&&e.preventDefault(),e.stopPropagation(),de(e,t);else if(!tm(o,N))e.cancelable&&e.preventDefault(),e.stopPropagation();else{if(a!==0){let t=im(o,N,f,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),de(e,t))}}function i(e){if(U?.onTouchMove(e),H.current)return;let t=re.current,n=e.touches[0];n&&t&&(r(e,t,n),$p(t,n))}return $(n,`touchmove`,i,{passive:!1,capture:!0})},[E,M,T,A,P,N,f,de,k,U]),X(()=>{W&&!ce.swiping&&ae(!T||D?0:G??0,!0,!1)},[ae,h,D,m,T,G,W,ce.swiping,l,j]),X(()=>{if(m)return T||m(0),()=>{m(0)}},[m,T]),X(()=>{T&&(_.current||fe(),J())},[J,T,fe,_]),X(()=>{let e=d.current;return()=>{j?.set({swipeProgress:0,frontmostHeight:0}),Hp(e,!1);let t=d.current;t!==e&&Hp(t,!1),ie()}},[d,ie,j]);let pe=o.useMemo(()=>({swiping:ce.swiping,getDragStyles:ce.getDragStyles,swipeStrength:I??null,setSwipeDismissed:q}),[q,ce.getDragStyles,ce.swiping,I]);function me(e){H.current=e,re.current=null}function he(){me(!1),ne.current=``,V.current=!1}function ge(e){return ne.current=``,e.pointerType!==`touch`}return(0,s.jsx)(Cp,{ref:t,className:r,style:i,render:n,...Ct(c,{onPointerDown(e){if(ne.current=e.pointerType,V.current=e.pointerType===`pen`,!T||!E||M)return;let t=ap(e.currentTarget.getRootNode(),e.clientX,e.clientY);Up(t)||Wp(t)||e.pointerType!==`touch`&&le.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&le.onPointerMove?.(e)},onPointerUp(e){ge(e)&&le.onPointerUp?.(e)},onPointerCancel(e){ge(e)&&le.onPointerCancel?.(e)},onTouchStart(e){if(ne.current===`pen`&&V.current){V.current=!1,me(!1);return}if(!T||!E||M){me(!1);return}let t=e.touches[0];if(!t)return;if(Qp(e)){me(!1);return}let n=e.currentTarget,r=ap(n.getRootNode(),t.clientX,t.clientY),i=_l(e.nativeEvent),a=Je(i)?i:n;if(!Q(n,a)||(U?.onTouchStart(e),gl(r,`[data-base-ui-swipe-ignore]:not(${Bp[F]})`))){me(!0);return}H.current=!1;let o=ip(a,n,N),s=ip(a,n,F)!=null||gl(r,Bp[F])!=null,c=null;o&&(c=rm(o,N,f)?null:!1),re.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,startedInPopup:Q(u.current,r),scrollTarget:o,hasCrossAxisGestureTarget:s,allowSwipe:c,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},ue.onTouchStart?.(e)},onTouchEnd(e){U?.onTouchEnd(e),he(),ue.onTouchEnd?.(e)},onTouchCancel(e){U?.onTouchCancel(),he(),ue.onTouchCancel?.(e)},[wp]:void 0}),children:(0,s.jsx)(Sf.Provider,{value:pe,children:a})})});function Hp(e,t){e?.toggleAttribute(df,t)}function Up(e){return!!gl(e,Ru)}function Wp(e){return!!gl(e,zp)}function Gp(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function Kp(e,t){return Math.max(Gp(e,t)*.5,Dp)}function qp(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function Jp(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function Yp(e,t){let n=Je(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=Je(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||Q(t,n)||Q(t,r)}function Xp(e,t){let n=hl(e);if(n&&Q(t,n)&&Jp(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:Yp(r,t)}function Zp(e,t){return e.composedPath().some(e=>qp(e,t))}function Qp(e){return Zp(e.nativeEvent,Ge(e.currentTarget))}function $p(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function em(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=Lp&&s>o+Rp?(e.preserveNativeCrossAxisScroll=!0,!0):o>=Lp?(e.drawerAxisAttributed=!0,!1):!0}function tm(e,t){return nm(e,t).max>0}function nm(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function rm(e,t,n){let r=am(n,t),{offset:i,max:a}=nm(e,t);return r?i<=0:i>=a}function im(e,t,n,r){return(am(n,t)?r>0:r<0)&&rm(e,t,n)}function am(e,t){return t===`vertical`?e===`down`:e===`right`}function om({open:e,onOpenChange:t,title:n,description:r,eyebrow:i,children:a,footer:o,className:c,titleClassName:l,dismissible:u=!0}){return(0,s.jsx)(Zf,{open:e,onOpenChange:t,disablePointerDismissal:!u,children:(0,s.jsxs)(Af,{children:[(0,s.jsx)(pc,{className:`fixed inset-0 min-h-dvh bg-black opacity-[calc(var(--backdrop-opacity)*(1-var(--drawer-swipe-progress)))] transition-opacity duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] [--backdrop-opacity:0.18] data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:opacity-0 data-swiping:duration-0 supports-[-webkit-touch-callout:none]:absolute dark:[--backdrop-opacity:0.55]`}),(0,s.jsx)(Vp,{className:`fixed inset-0 z-50 flex items-end justify-center`,children:(0,s.jsxs)(Df,{className:cr(`bg-raised text-foreground shadow-float -mb-12 flex max-h-[calc(90dvh+3rem)] w-full max-w-xl [transform:translateY(var(--drawer-swipe-movement-y))] flex-col overflow-hidden rounded-t-[20px] pb-12 transition-transform duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] outline-none data-ending-style:[transform:translateY(calc(100%-3rem+2px))] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:[transform:translateY(calc(100%-3rem+2px))] data-swiping:select-none sm:mb-[calc(1.5rem-3rem)] sm:rounded-b-[20px]`,c),children:[(0,s.jsx)(`div`,{className:`bg-surface-3 mx-auto mt-2 h-[5px] w-9 shrink-0 rounded-full`}),(0,s.jsxs)(`div`,{className:`shrink-0 px-5 pt-4 pb-3`,children:[i?(0,s.jsx)(`div`,{className:`mb-2`,children:i}):null,(0,s.jsx)(bp,{className:cr(`text-[17px] leading-snug font-semibold tracking-[-0.012em]`,l),children:n}),r?(0,s.jsx)(Bc,{className:`text-muted-foreground mt-1 text-[14px] leading-relaxed`,children:r}):null]}),(0,s.jsx)(Nc,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pb-4`,children:a}),o?(0,s.jsx)(`div`,{className:`shrink-0 px-5 pt-2 pb-[max(env(safe-area-inset-bottom),0.75rem)]`,children:o}):null]})})]})})}var sm=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function cm(e,t=Date.now()){let n=Math.round((e-t)/1e3),r=Math.abs(n);return r<45?`just now`:r<3600?sm.format(Math.round(n/60),`minute`):r<86400?sm.format(Math.round(n/3600),`hour`):r<604800?sm.format(Math.round(n/86400),`day`):new Date(e).toLocaleDateString(`en`,{month:`short`,day:`numeric`})}function lm(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return e>=n?`Today`:e>=n-864e5?`Yesterday`:e>=n-5184e5?`This week`:e>=n-25056e5?`This month`:`Earlier`}var um=``;function dm(e){um=e}function fm(e){return um&&e.startsWith(um)?`~${e.slice(um.length)}`:e}function pm(e){let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}function mm(e,t){return t&&e.startsWith(`${t}/`)?e.slice(t.length+1):fm(e)}function hm(e){return e<.01?`<$0.01`:`$${e.toFixed(e<1?3:2)}`}function gm(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function _m(e=new Date){let t=e.getHours();return t<5?`Up late`:t<12?`Good morning`:t<18?`Good afternoon`:`Good evening`}export{Kl as $,st as $n,Ks as $t,xd as A,en as An,qc as At,Qu as B,gt as Bn,Tc as Bt,Td as C,Ba as Cn,dl as Ct,Md as D,sn as Dn,ol as Dt,jd as E,dn as En,cl as Et,dd as F,zt as Fn,Cc as Ft,Bu as G,We as Gn,yc as Gt,Ku as H,at as Hn,bc as Ht,ed as I,Lt as In,Sc as It,bu as J,ut as Jn,mc as Jt,wu as K,lt as Kn,vc as Kt,td as L,Ct as Ln,Ac as Lt,gd as M,Ht as Mn,Gc as Mt,hd as N,Vt as Nn,zc as Nt,Nd as O,tn as On,tl as Ot,md as P,Z as Pn,Oc as Pt,Wl as Q,Ye as Qn,nc as Qt,$u as R,X as Rn,xc as Rt,Cd as S,to as Sn,pl as St,Od as T,cr as Tn,ll as Tt,Iu as U,Ke as Un,Dc as Ut,Ju as V,ct as Vn,gc as Vt,zu as W,pt as Wn,kc as Wt,_u as X,it as Xn,rc as Xt,gu as Y,Ge as Yn,hc as Yt,Gl as Z,Je as Zn,ic as Zt,af as _,ps as _n,u as _r,Sl as _t,_m as a,Ls as an,Be as ar,Pl as at,Vd as b,Bo as bn,r as br,Q as bt,dm as c,ls as cn,Fe as cr,Ml as ct,Hf as d,_s as dn,H as dr,Al as dt,zs as en,Ze as er,Xl as et,jf as f,cs as fn,ee as fr,Ol as ft,Qd as g,ks as gn,L as gr,xl as gt,mf as h,As as hn,D as hr,bl as ht,gm as i,Ns as in,He as ir,zl as it,bd as j,Gt as jn,Jc as jt,Ad as k,nn as kn,il as kt,fm as l,hs as ln,Pe as lr,kl as lt,Of as m,Yo as mn,h as mr,Cl as mt,lm as n,Ms as nn,$e as nr,Jl as nt,cm as o,Fs as on,Re as or,Nl as ot,kf as p,ds as pn,C as pr,jl as pt,Su as q,ft as qn,_c as qt,hm as r,js as rn,ot as rr,Hl as rt,mm as s,vs as sn,Ie as sr,$ as st,pm as t,Is as tn,Qe as tr,Ul as tt,om as u,fs as un,_e as ur,Tl as ut,Yd as v,us as vn,l as vr,hl as vt,kd as w,mr as wn,fl as wt,Fd as x,Uo as xn,_l as xt,Bd as y,Ts as yn,a as yr,gl as yt,Zu as z,Y as zn,Ec as zt};
|