s3deck 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +501 -2
- package/dist/cli.mjs +3522 -0
- package/dist/web/assets/common-Dl4G8lb6.js +5 -0
- package/dist/web/assets/index-CAIqJdER.js +193 -0
- package/dist/web/assets/index-CVZMJqoo.css +2 -0
- package/dist/web/favicon.svg +1 -0
- package/dist/web/index.html +15 -0
- package/package.json +104 -4
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();try{let e=localStorage.getItem(`s3deck-theme`)??`system`,t=e===`dark`||e===`system`&&matchMedia(`(prefers-color-scheme: dark)`).matches;document.documentElement.classList.toggle(`dark`,t)}catch{}var l=o((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 ee(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,ee(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,`$&/`)+`/`),ee(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+=ee(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+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(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 te(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(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 ne=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 re(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,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ie(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 re(ie.bind(null,e))}var ae={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(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=ae,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=ie,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:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,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`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=d.createContext(!1),p=()=>d.useContext(f);f.Provider;var m=o((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})),h=o(((e,t)=>{t.exports=m()}))(),g=d.createContext(void 0),_=e=>{let t=d.useContext(g);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},v=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,h.jsx)(g.Provider,{value:e,children:t}));function y(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var b=d.createContext(y()),x=()=>d.useContext(b),S=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(){}},C=new class extends S{#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`}},w={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=w;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 E(e){setTimeout(e,0)}var D=typeof window>`u`||`Deno`in globalThis;function O(){}function k(e,t){return typeof e==`function`?e(t):e}function A(e){return typeof e==`number`&&e>=0&&e!==1/0}function j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function M(e,t){return typeof e==`function`?e(t):e}function N(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==te(o,t.options))return!1}else if(!ne(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 ee(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(P(t.options.mutationKey)!==P(a))return!1}else if(!ne(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function te(e,t){return(t?.queryKeyHashFn||P)(e)}function P(e){return JSON.stringify(e,(e,t)=>oe(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ne(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(!ne(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ne(e[r],t[r]))return!1;return!0}return!1}var re=Object.prototype.hasOwnProperty;function ie(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=F(e)&&F(t);if(!r&&!(oe(e)&&oe(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:re.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ie(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ae(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!re.call(t,n)||e[n]!==t[n])return!1;return!0}function F(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function oe(e){if(!I(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!(!I(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function I(e){return Object.prototype.toString.call(e)===`[object Object]`}function se(e){return new Promise(t=>{T.setTimeout(t,e)})}function ce(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ie(e,t)}function le(e){return e}function ue(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function de(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var L=Symbol();function R(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===L?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fe(e,t){return typeof e==`function`?e(...t):!!e}var pe=Symbol();function me(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[pe]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var he=()=>D,z=()=>he();function ge(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=t,u=e=>{me(e,()=>t.signal,()=>n=!0,l[pe])},d=R(t.options,t.fetchOptions),f=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 u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?de:ue;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ve:_e,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:_e(r,s);if(c>0&&e==null)break;s=await f(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 _e(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 ve(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ye(e,t){return t?_e(e,t)!=null:!1}function be(e,t){return!t||!e.getPreviousPageParam?!1:ve(e,t)!=null}var xe=E;function Se(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=xe,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 Ce=Se(),we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(z()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(T.clearTimeout(this.#e),this.#e=void 0)}},Te=new class extends S{#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 Ee(e){return Math.min(1e3*2**e,3e4)}function De(e){return(e??`online`)!==`online`||Te.isOnline()}var Oe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ke(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(O);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Oe(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>C.isFocused()&&(e.networkMode===`always`||Te.isOnline())&&e.canRun(),p=()=>De(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{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??(z()?0:3),a=e.retryDelay??Ee,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),se(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Ae=class extends we{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=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=Ne(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.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ne(this.options);e.data!==void 0&&(this.setState(Me(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ce(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(O).catch(O):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=>M(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===L||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>M(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:!j(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.#c||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.#l({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&&this.#o)return this.#a.continueRetry(),this.#o}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.defineProperties(e,{[pe]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=R(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!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`?ge(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=ke({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Oe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;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 Oe){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({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.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(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,...je(t.data,this.options),fetchMeta:e.meta??null};case`success`:{let n={...t,...Me(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 n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:`idle`,status:`error`,isInvalidated:!0}}case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ce.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function je(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:De(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ne(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 Pe=class extends S{#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),Ie(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Le(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Le(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 M(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&&!ae(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Re(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||M(this.options.enabled,this.#t)!==M(t.enabled,this.#t)||M(this.options.staleTime,this.#t)!==M(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||M(this.options.enabled,this.#t)!==M(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 ae(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(O)),t}#h(e){return!z()&&M(this.options.enabled,this.#t)!==!1&&A(e)}#g(){this.#b();let e=M(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=j(this.#r.dataUpdatedAt,e)+1;this.#u=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return M(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=T.setInterval(()=>{(this.options.refetchIntervalInBackground||C.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(T.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(T.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&&Ie(e,t),o=i&&Re(e,n,t,r);(a||o)&&(l={...l,...je(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=ce(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=ce(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=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ze(e,t),refetch:this.refetch,isEnabled:M(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),ae(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||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();Ce.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 Fe(e,t){return M(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||M(t.retryOnMount,e)!==!1)}function Ie(e,t){return Fe(e,t)||e.state.data!==void 0&&Le(e,t,t.refetchOnMount)}function Le(e,t,n){if(M(t.enabled,e)!==!1&&M(t.staleTime,e)!==`static`){let r=M(n,e);return r===`always`||r!==!1&&ze(e,t)}return!1}function Re(e,t,n,r){return(e!==t||M(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ze(e,n)}function ze(e,t){return M(t.enabled,e)!==!1&&e.isStaleByTime(M(t.staleTime,e))}var Be=class extends Pe{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ye(t,n.data),hasPreviousPage:be(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Ve=class extends we{#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||He(),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=ke({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})}this.state.isPaused&&r.canStart()&&t();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),Ce.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function He(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ue=class extends S{#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 Ve({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=We(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=We(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=We(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=We(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ce.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=>ee(t,e))}findAll(e={}){return this.getAll().filter(t=>ee(e,t))}notify(e){Ce.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ce.batch(()=>Promise.all(e.map(e=>e.continue().catch(O))))}};function We(e){return e.options.scope?.id}var Ge=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ae(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&P(t.mutationKey)!==P(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??He();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Ce.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ke=class extends S{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??te(r,t),a=this.get(i);return a||(a=new Ae({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(){Ce.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=>N(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>N(e,t)):t}notify(e){Ce.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ce.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ce.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ke,this.#t=e.mutationCache||new Ue,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Te.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(M(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=k(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ce.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;Ce.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ce.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=Ce.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(O).catch(O)}invalidateQueries(e,t={}){return Ce.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=Ce.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(O)),r?Promise.resolve():t}));return Promise.all(r).then(O)}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(M(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(M(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(O).catch(O)}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(O).catch(O)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Te.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(P(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ne(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(P(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ne(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||=te(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===L&&(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()}},Je=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?fe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ye=e=>{d.useEffect(()=>{e.clearReset()},[e])},Xe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||fe(n,[e.error,r])),Ze=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))}},Qe=(e,t)=>e?.suspense&&t.isPending,$e=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function et(e,t,n){let r=p(),i=x(),a=_(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ze(o),Je(o,i,s),Ye(i);let[l]=d.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);d.useEffect(()=>{l.setOptions(o)},[o,l]);let f=!r&&c;if(d.useSyncExternalStore(d.useCallback(e=>{let t=f?l.subscribe(Ce.batchCalls(e)):O;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Qe(o,u))throw $e(o,l,i);if(Xe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function tt(e,t){return et(e,Pe,t)}function nt(e,t){let n=_(t),[r]=d.useState(()=>new Ge(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);let i=d.useSyncExternalStore(d.useCallback(e=>r.subscribe(Ce.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=d.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(O)},[r]);if(i.error&&fe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function rt(e,t){return et(e,Be,t)}var it=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),at=o(((e,t)=>{t.exports=it()})),ot=o((e=>{var t=u();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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=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=i,e.browser=function(e){return{$$typeof:o,_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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.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,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.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),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,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);i.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??i.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);i.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);i.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 i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),st=o(((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=ot()})),ct=o((e=>{var t=at(),n=u(),r=st();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),P=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),F=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.for(`react.view_transition`),I=Symbol.for(`react.recoverable`),se=Symbol.iterator;function ce(e){return typeof e!=`object`||!e?null:(e=se&&e[se]||e[`@@iterator`],typeof e==`function`?e:null)}var le=Symbol.for(`react.client.reference`);function ue(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case te:return`Suspense`;case P:return`SuspenseList`;case ie:return`Activity`;case oe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ue(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var de=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},pe=[],me=-1;function he(e){return{current:e}}function z(e){0>me||(e.current=pe[me],pe[me]=null,me--)}function ge(e,t){me++,pe[me]=e.current,e.current=t}var _e=he(null),ve=he(null),ye=he(null),be=he(null);function xe(e,t){switch(ge(ye,t),ge(ve,e),ge(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hp(t),e=gp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(_e),ge(_e,e)}function Se(){z(_e),z(ve),z(ye)}function Ce(e){var t=e.memoizedState;t!==null&&(fh._currentValue=t.memoizedState,ge(be,e)),t=_e.current;var n=gp(t,e.type);t!==n&&(ge(ve,e),ge(_e,n))}function we(e){ve.current===e&&(z(_e),z(ve)),be.current===e&&(z(be),fh._currentValue=fe)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ct(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lt(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ft(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&pt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function pt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=n&42?1:gt(n),(n&(e.suspendedLanes|t))===0?n:0}function gt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _t(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:Oh(e.type)):e}function B(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var V=Math.random().toString(36).slice(2),yt=`__reactFiber$`+V,bt=`__reactProps$`+V,xt=`__reactContainer$`+V,St=`__reactEvents$`+V,Ct=`__reactListeners$`+V,wt=`__reactHandles$`+V,Tt=`__reactResources$`+V,Et=`__reactMarker$`+V,Dt=`__reactLoad$`+V;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_m(e);e!==null;){if(n=e[yt])return n;e=_m(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var Ut=!1;function Wt(){var e=Ut;return Ut=!1,e}function Gt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Xt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zt(e){if(!e._valueTracker){var t=Yt(e)?`checked`:`value`;e._valueTracker=Xt(e,t,``+e[t])}}function Qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Yt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var $t=/[\n"\\]/g;function en(e){return e.replace($t,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function tn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Jt(t)):e.value!==``+Jt(t)&&(e.value=``+Jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):rn(e,Jt(n)):o===`number`&&e.value==t?rn(e,Jt(e.value)):rn(e,Jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Jt(s):e.removeAttribute(`name`)}function nn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Zt(e);return}n=n==null?``:``+Jt(n),t=t==null?n:``+Jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Zt(e)}function rn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function an(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function on(e,t,n){t!=null&&(t=``+Jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Jt(n)}function sn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(de(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Zt(e)}function cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ln=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function un(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||ln.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function dn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Ut=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(un(e,a,r),Ut=!0)}else for(var o in t)t.hasOwnProperty(o)&&un(e,o,t[o])}function fn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var H=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),pn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(tn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+en(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[bt]||null;if(!a)throw Error(i(90));tn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Qt(r)}break a;case`textarea`:on(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&an(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Vd(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function jn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mn(){return!0}function Nn(){return!1}function Pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Mn:Nn,this.isPropagationStopped=Nn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=T({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=T({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(T({},Hn,{dataTransfer:0})),Gn=Pn(T({},Ln,{relatedTarget:0})),Kn=Pn(T({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(T({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(T({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(T({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(T({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(T({},Fn,{submitter:0})),rr=Pn(T({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(T({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(T({},Hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),or=Pn(T({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=Qf(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Wf(e,0)}function Tr(e){if(Qt(jt(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(wn){var Or;if(wn){var kr=`oninput`in document;if(!kr){var Ar=document.createElement(`div`);Ar.setAttribute(`oninput`,`return;`),kr=typeof Ar.oninput==`function`}Or=kr}else Or=!1;Dr=Or&&(!document.documentMode||9<document.documentMode)}function jr(){Sr&&(Sr.detachEvent(`onpropertychange`,Mr),Cr=Sr=null)}function Mr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,_n(e)),Sn(wr,t)}}function Nr(e,t,n){e===`focusin`?(jr(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,Mr)):e===`focusout`&&jr()}function Pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Fr(e,t){if(e===`click`)return Tr(t)}function Ir(e,t){if(e===`input`||e===`change`)return Tr(t)}function Lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Rr=typeof Object.is==`function`?Object.is:Lr;function zr(e,t){if(Rr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!Rr(e[i],t[i]))return!1}return!0}function Br(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hr(e,t){var n=Vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Vr(n)}}function Ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ur(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Br(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Br(e.document)}return t}function Gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Kr=wn&&`documentMode`in document&&11>=document.documentMode,qr=null,Jr=null,Yr=null,Xr=!1;function Zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xr||qr==null||qr!==Br(r)||(r=qr,`selectionStart`in r&&Gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yr&&zr(Yr,r)||(Yr=r,r=Qf(Jr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=qr)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var $r={animationend:Qr(`Animation`,`AnimationEnd`),animationiteration:Qr(`Animation`,`AnimationIteration`),animationstart:Qr(`Animation`,`AnimationStart`),transitionrun:Qr(`Transition`,`TransitionRun`),transitionstart:Qr(`Transition`,`TransitionStart`),transitioncancel:Qr(`Transition`,`TransitionCancel`),transitionend:Qr(`Transition`,`TransitionEnd`)},ei={},ti={};wn&&(ti=document.createElement(`div`).style,`AnimationEvent`in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),`TransitionEvent`in window||delete $r.transitionend.transition);function ni(e){if(ei[e])return ei[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ti)return ei[e]=t[n];return e}var ri=ni(`animationend`),ii=ni(`animationiteration`),ai=ni(`animationstart`),oi=ni(`transitionrun`),si=ni(`transitionstart`),ci=ni(`transitioncancel`),li=ni(`transitionend`),ui=new Map,di=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);di.push(`scrollEnd`);function fi(e,t){ui.set(e,t),Lt(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Sd.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ad;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=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)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<jd)throw jd=0,Md=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var n=e.alternate;return n===null?(n=ki(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Mi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ni(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ai(r)&&(s=1);else if(typeof r==`string`)s=Qm(e,n,_e.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=ki(31,n,t,a),e.elementType=ie,e.lanes=o,e;case k:return Pi(n.children,a,o,t);case A:s=8,a|=24;break;case j:return e=ki(12,n,t,a|2),e.elementType=j,e.lanes=o,e;case te:return e=ki(13,n,t,a),e.elementType=te,e.lanes=o,e;case P:return e=ki(19,n,t,a),e.elementType=P,e.lanes=o,e;case ae:case oe:return e=a|32,e=ki(30,n,t,e),e.elementType=oe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case ee:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Pi(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Fi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Ii(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Li(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ri=new WeakMap;function zi(e,t){if(typeof e==`object`&&e){var n=Ri.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Ri.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Bi=[],Vi=0,Hi=null,Ui=0,Wi=[],Gi=0,Ki=null,qi=1,Ji=``;function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e,Ui=t}function Xi(e,t,n){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,Ki=e;var r=qi;e=Ji;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,qi=1<<32-Ye(t)+i|n<<i|r,Ji=a+e}else qi=1<<a|n<<i|r,Ji=e}function Zi(e){e.return!==null&&(Yi(e,1),Xi(e,1,0))}function Qi(e){for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null;for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,Ji=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null}function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,qi=t.id,Ji=t.overflow,Ki=e}var ea=null,ta=null,na=!1,ra=null,ia=!1,aa=Error(i(519));function oa(e){throw fa(zi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),aa}function sa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:Gf(`cancel`,t),Gf(`close`,t);break;case`iframe`:case`object`:case`embed`:Gf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Hf.length;n++)Gf(Hf[n],t);break;case`source`:Gf(`error`,t);break;case`img`:case`image`:case`link`:Gf(`error`,t),Gf(`load`,t);break;case`details`:Gf(`toggle`,t);break;case`input`:Gf(`invalid`,t),nn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Gf(`invalid`,t);break;case`textarea`:Gf(`invalid`,t),sn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ip(t.textContent,n)?(r.popover!=null&&(Gf(`beforetoggle`,t),Gf(`toggle`,t)),r.onScroll!=null&&Gf(`scroll`,t),r.onScrollEnd!=null&&Gf(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||oa(e,!0)}function ca(e){for(ea=e.return;ea;)switch(ea.tag){case 5:case 31:case 13:ia=!1;return;case 27:case 3:ia=!0;return;default:ea=ea.return}}function la(e){if(e!==ea)return!1;if(!na)return ca(e),na=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||vp(e.type,e.memoizedProps)),n=!n),n&&ta&&oa(e),ca(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ta=gm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ta=gm(e)}else t===27?(t=ta,Dp(e.type)?(e=hm,hm=null,ta=e):ta=t):ta=ea?mm(e.stateNode.nextSibling):null;return!0}function ua(){ta=ea=null,na=!1}function da(){var e=ra;return e!==null&&(md===null?md=e:md.push.apply(md,e),ra=null),e}function fa(e){ra===null?ra=[e]:ra.push(e)}var pa=he(null),ma=null,ha=null;function ga(e,t,n){ge(pa,t._currentValue),t._currentValue=n}function _a(e){e._currentValue=pa.current,z(pa)}function va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ya(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),va(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),va(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),va(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ba(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Rr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===be.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[fh]:e.push(fh))}a=a.return}return e!==null&&ya(t,e,n,r),t.flags|=262144,e!==null}function xa(e){for(e=e.firstContext;e!==null;){if(!Rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function U(e){ma=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(ma,e)}function Ca(e,t){return ma===null&&U(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ha===null){if(e===null)throw Error(i(308));ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ha=ha.next=t;return n}var Ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Lf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Va=L.S;L.S=function(e,t){if(_d=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Cf;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Cf;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=he(null);function Ua(){var e=Ha.current;return e===null?Qu.pooledCache:e}function Wa(e,t){t===null?ge(Ha,Ha.current):ge(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=Qu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function so(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ji(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Fi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===re&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Ni(n.type,n.key,n.props,null,e.mode,r),ao(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Pi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ni(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case O:return t=Li(t,e.mode,n),t.return=e,t;case re:return t=Qa(t),f(e,t,n)}if(de(t)||ce(t))return t=Pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===N)return f(e,Ca(e,t),n);oo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case re:return n=Qa(n),p(e,t,n,r)}if(de(n)||ce(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===N)return p(e,t,Ca(e,n),r);oo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Qa(r),m(e,t,n,r,i)}if(de(r)||ce(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===N)return m(e,t,n,Ca(t,r),i);oo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),na&&Yi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return na&&Yi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),na&&Yi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),na&&Yi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return na&&Yi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),na&&Yi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ao(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Pi(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Ni(o.type,o.key,o.props,null,e.mode,c),ao(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Li(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Qa(o),_(e,r,o,c)}if(de(o))return h(e,r,o,c);if(ce(o)){if(l=ce(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,io(o),c);if(o.$$typeof===N)return _(e,r,Ca(e,o),c);oo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}function _o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(ed&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:uo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),cd|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=he(null),wo=he(0);function To(e,t){e=od,ge(wo,e),ge(Co,t),od=e|t.baseLanes}function Eo(){ge(wo,od),ge(Co,Co.current)}function Do(){od=wo.current,z(Co),z(wo)}var Oo=he(null),ko=null;function Ao(e){var t=e.alternate;ge(Fo,Fo.current&1),ge(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){ge(Fo,Fo.current),ge(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(ge(Fo,Fo.current),ge(Oo,e),ko===null&&(ko=e)):No()}function No(){ge(Fo,Fo.current),ge(Oo,Oo.current)}function Po(e){z(Oo),ko===e&&(ko=null),z(Fo)}var Fo=he(0);function Io(e,t){ge(Oo,Oo.current),ge(Fo,t)}function Lo(e){z(Fo),z(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||dm(n)||fm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zo=0,Bo=null,Vo=null,Ho=null,Uo=!1,W=!1,Wo=!1,Go=0,Ko=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return zo=a,Bo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?dc:fc,Wo=!1,a=n(r,i),Wo=!1,W&&(a=Qo(t,n,r,i)),G(e),a}function G(e){L.H=uc;var t=Vo!==null&&Vo.next!==null;if(zo=0,Ho=Vo=Bo=null,Uo=!1,Ko=0,qo=null,t)throw Error(i(300));e===null||Oc||(e=e.dependencies,e!==null&&xa(e)&&(Oc=!0))}function Qo(e,t,n,r){Bo=e;var a=0;do{if(W&&(qo=null),Ko=0,W=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}L.H=pc,o=t(n,r)}while(W);return o}function $o(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(Bo.flags|=1024),t}function es(){var e=Go!==0;return Go=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}zo=0,Ho=Vo=Bo=null,W=!1,Ko=Go=0,qo=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function is(){if(Vo===null){var e=Bo.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?Bo.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw Bo.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Ko;return Ko+=1,qo===null&&(qo=[]),e=Za(qo,e,t),t=Bo,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?dc:fc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===I)return;if(e.$$typeof===N)return Sa(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=Bo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Bo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),Bo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=F;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),Vo,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(zo&f)===f:(ed&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ia&&(d=!0);else if((zo&p)===p){u=u.next,p===Ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Bo.lanes|=p,cd|=p;f=u.action,Wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Bo.lanes|=f,cd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Rr(o,e.memoizedState)&&(Oc=!0,d&&(n=La,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Rr(o,t.memoizedState)||(Oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=Bo,a=is(),o=na;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Rr((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Oc=!0),a=a.queue,Ls(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Qu===null)throw Error(i(349));o||zo&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Bo.updateQueue,t===null?(t=as(),Bo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&K(e)}function gs(e,t,n){return n(function(){_s(t)&&K(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function K(e){var t=wi(e,2);t!==null&&Id(t,e,2)}function vs(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Wo){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,ds(e,Vo,typeof r==`function`?r:ls)}function bs(e,t,n,r,a){if(sc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};L.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,xs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(na){var n=Qu.formState;if(n!==null){a:{var r=Bo;if(na){if(ta){b:{for(var i=ta,a=ia;i.nodeType!==8;)if(!a||(i=mm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ta=mm(i.nextSibling),r=i.data===`F!`;break a}}oa(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ic.bind(null,Bo,r),r.dispatch=n,r=vs(!1),a=oc.bind(null,Bo,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,Bo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(is(),Vo,e)}function ks(e,t,n){if(t=ds(e,t,Es)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Bo.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=is(),n=Vo;if(n!==null)return ks(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Bo.updateQueue,t===null&&(t=as(),Bo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ns(){return is().memoizedState}function Ps(e,t,n,r){var i=rs();Bo.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Xo(r,Vo.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(Bo.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function Is(e,t){Ps(8390656,8,e,t)}function Ls(e,t){Fs(2048,8,e,t)}function Rs(e){Bo.flags|=4;var t=Bo.updateQueue;if(t===null)t=as(),Bo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=is().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if(Zu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Fs(4,2,e,t)}function Vs(e,t){return Fs(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Hs.bind(null,t,e),n)}function q(){}function Ws(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Wo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||zo&1073741824&&!(ed&261930)?e.memoizedState=t:(e.memoizedState=n,e=Pd(),Bo.lanes|=e,cd|=e,n)}function qs(e,t,n,r){return Rr(n,t)?n:Co.current===null?!(zo&106)||zo&1073741824&&!(ed&261930)?(Oc=!0,e.memoizedState=n):(e=Pd(),Bo.lanes|=e,cd|=e,t):(e=Ks(e,n,r),Rr(e,t)||(Oc=!0),e)}function Js(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,oc(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,Ba(c,r),Nd(e)):ac(e,t,r,Nd(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},Nd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Zs(e).queue;Js(e,a,t,fe,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:fe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},Nd())}function $s(){return Sa(fh)}function ec(){return is().memoizedState}function tc(){return is().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Nd();e=mo(n);var r=ho(t,e,n);r!==null&&(Id(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=Nd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=Ci(e,t,n,r),n!==null&&(Id(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,Nd())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Rr(s,o))return Si(e,t,i,0),Qu===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Id(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Lf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(i(479))}else t=Ci(e,n,r,2),t!==null&&Id(t,e,2)}function sc(e){var t=e.alternate;return e===Bo||t!==null&&t===Bo}function cc(e,t){W=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}var uc={readContext:Sa,use:ss,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},dc={readContext:Sa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:Is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Wo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Wo){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=rc.bind(null,Bo,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ic.bind(null,Bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:q,useDeferredValue:function(e,t){return Ks(rs(),e,t)},useTransition:function(){var e=vs(!1);return e=Js.bind(null,Bo,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Bo,a=rs();if(na){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qu===null)throw Error(i(349));ed&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Is(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=Qu.identifierPrefix;if(na){var n=Ji,r=qi;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,Bo,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=nc.bind(null,Bo)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(Zu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:Sa,use:ss,useCallback:Ws,useContext:Sa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Gs,useReducer:us,useRef:Ns,useState:function(){return us(ls)},useDebugValue:q,useDeferredValue:function(e,t){return qs(is(),Vo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:ec,useHostTransitionStatus:$s,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(is(),Vo,e,t)},useMemoCache:cs,useCacheRefresh:tc,useEffectEvent:zs},pc={readContext:Sa,use:ss,useCallback:Ws,useContext:Sa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Gs,useReducer:fs,useRef:Ns,useState:function(){return fs(ls)},useDebugValue:q,useDeferredValue:function(e,t){var n=is();return Vo===null?Ks(n,e,t):qs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:ec,useHostTransitionStatus:$s,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=is();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Vo,e,t)},useMemoCache:cs,useCacheRefresh:tc,useEffectEvent:zs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Id(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Id(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nd(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Id(t,e,n),go(t,e,n))}};function gc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!zr(n,r)||!zr(i,a):!0}function _c(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hc.enqueueReplaceState(t,t.state,null)}function J(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function vc(e){_i(e)}function yc(e){console.error(e)}function bc(e){_i(e)}function xc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Sc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){xc(e,t)},n}function wc(e){return e=mo(e),e.tag=3,e}function Tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Sc(t,n,r),typeof i!=`function`&&(bd===null?bd=new Set([this]):bd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ba(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?Jd():n.alternate===null&&sd===0&&(sd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),_f(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),_f(e,r,a)),!1}throw Error(i(435,n.tag))}return _f(e,r,a),Jd(),!1}if(na)return t=Oo.current,t===null?(r!==aa&&(t=Error(i(423),{cause:r}),fa(zi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=zi(r,n),a=Cc(e.stateNode,r,a),_o(e,a),sd!==4&&(sd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==aa&&(e=Error(i(422),{cause:r}),fa(zi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=zi(o,n),pd===null?pd=[o]:pd.push(o),sd!==4&&(sd=2),t===null)return!0;r=zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Cc(n.stateNode,r,e),_o(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(bd===null||!bd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=wc(a),Tc(a,e,n,r),_o(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Dc=Error(i(461)),Oc=!1;function kc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return U(t),r=Zo(e,t,n,o,a,i),s=es(),e!==null&&!Oc?(ts(e,t,i),il(e,t,i)):(na&&s&&Zi(t),t.flags|=1,kc(e,t,r,i),t.child)}function jc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=Ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?zr:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(zr(a,r)&&e.ref===t.ref){if(Oc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(Oc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return kc(e,t,i,n),t.child}function Pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ba(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return co(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(na){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(jo(t),(e=ta)?(e=um(e,ia),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(jo(t),a){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Oc||ba(e,t,n,!1),a=(n&e.childLanes)!==0,Oc||a){if(Co.current===null){if(r=Qu,r!==null&&(s=ht(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,wi(e,s),Id(r,e,s),Dc;Jd()}t=Lc(e,t,n)}else e=o.treeContext,ta=mm(s.nextSibling),ea=t,na=!0,ra=null,ia=!1,e!==null&&$i(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=ji(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,r,i){return U(t),n=Zo(e,t,n,r,void 0,i),r=es(),e!==null&&!Oc?(ts(e,t,i),il(e,t,i)):(na&&r&&Zi(t),t.flags|=1,kc(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return U(t),t.updateQueue=null,n=Qo(t,r,n,i),G(e),r=es(),e!==null&&!Oc?(ts(e,t,a),il(e,t,a)):(na&&r&&Zi(t),t.flags|=1,kc(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(U(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&hc.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=J(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=Sa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&_c(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=uo||gc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,po(e,t),o=t.memoizedProps,u=J(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=Sa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&_c(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&xa(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=uo||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&xa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,zc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=co(t,e.child,null,i),t.child=co(t,null,n,i)):kc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return ua(),t.flags|=256,kc(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Ga()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=dd),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(na){if(i?Ao(t):No(),(e=ta)?(e=um(e,ia),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw oa(t);return t.lanes=fm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=Pi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Ao(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ji(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Pi(i,a,n,null),i.flags|=2):i=ji(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=ji(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return co(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(No(),o=a.fallback,s=t.mode,a=Yc({mode:`visible`,children:a.children},s),o=Pi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,co(t,e.child,null,c),a=t.child,a.memoizedState=Gc(c),a.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,a)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),fm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,fa({value:a,source:null,stack:null})),Xc(e,t,c)}if(Oc||ba(e,t,c,!1),r=(c&e.childLanes)!==0,Oc||r){if(Co.current!==null)return Xc(e,t,c);if(r=Qu,r!==null&&(a=ht(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,wi(e,a),Id(r,e,a),Dc;return dm(o)||Jd(),Xc(e,t,c)}return dm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ta=mm(o.nextSibling),ea=t,na=!0,ra=null,ia=!1,e!==null&&$i(t,e),t=Jc(t,a.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),va(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function el(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function tl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(tl(e),kc(e,t,r,n),tl(e)):kc(e,t,r,n),r=na?Ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return ga(t,t.type,r.value),kc(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ba(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&xa(e)))}function ol(e,t,n){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),ga(t,Oa,e.memoizedState.cache),ua();break;case 27:case 5:Ce(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ba(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Ao(t),e=il(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ba(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:ga(t,Oa,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Oc=!0;else{if(!al(e,n)&&!(t.flags&128))return Oc=!1,ol(e,t,n);Oc=!!(e.flags&131072)}}else Oc=!1,na&&t.flags&1048576&&Xi(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=J(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ee){t.tag=11,t=Ac(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=jc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=ue(e)||e,Error(i(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=J(r,t.pendingProps),Hc(e,t,r,a,n);case 3:a:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ga(t,Oa,r),r!==o.cache&&ya(t,[Oa],n,!0),yo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Uc(e,t,r,n);break a}if(r!==a){a=zi(Error(i(424)),t),fa(a),t=Uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ta=mm(e.firstChild),ea=t,na=!0,ra=null,ia=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ua(),r===a){t=il(e,t,n);break a}kc(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Rm(t.type,null,t.pendingProps,null))?t.memoizedState=n:na||(t.stateNode=_p(t.type,t.pendingProps,ye.current,t)):t.memoizedState=Rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&na&&(r=t.stateNode=bm(t.type,t.pendingProps,ye.current),ea=t,ia=!0,a=ta,Dp(t.type)?(hm=a,ta=mm(r.firstChild)):ta=a),kc(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&na&&((a=r=ta)&&(r=cm(r,t.type,t.pendingProps,ia),r===null?a=!1:(t.stateNode=r,ea=t,ta=mm(r.firstChild),ia=!1,a=!0)),a||oa(t)),Ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,vp(a,o)?r=null:s!==null&&vp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,$o,null,null,n),fh._currentValue=a),zc(e,t),kc(e,t,r,n),t.child;case 6:return e===null&&na&&((e=n=ta)&&(n=lm(n,t.pendingProps,ia),n===null?e=!1:(t.stateNode=n,ea=t,ta=null,e=!0)),e||oa(t)),null;case 13:return qc(e,t,n);case 4:return xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):kc(e,t,r,n),t.child;case 11:return Ac(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),kc(e,t,r,n),t.child;case 8:return kc(e,t,t.pendingProps.children,n),t.child;case 12:return kc(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,U(t),a=Sa(a),r=r(a),t.flags|=1,kc(e,t,r,n),t.child;case 14:return jc(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return U(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=Qu,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},fo(t),ga(t,Oa,a)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ga(t,Oa,r),r!==a.cache&&ya(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ga(t,Oa,r))),kc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:na&&Zi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),kc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function cl(e){e.flags|=4}function ll(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?$m(t,r):$m(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Gd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t)){if(Gd())e.flags|=8192;else throw $a=Ya,qa}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,fd|=t)}function fl(e,t){if(!na)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function pl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ml(e,t,n){var r=t.pendingProps;switch(Qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_a(Oa),Se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(la(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,da())),pl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(cl(t),o===null?(pl(t),ll(t,a,null,r,n)):(pl(t),ul(t,o))):o?o===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,o)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(t,a,e,r,n)),null;case 27:if(we(t),n=ye.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}e=_e.current,la(t)?sa(t,e):(e=bm(a,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}if(o=_e.current,la(t))sa(t,o);else{var s=mp(ye.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[yt]=t,o[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(sp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ye.current,la(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ea,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ip(e.nodeValue,n)),e||oa(t,!0)}else e=mp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=la(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[yt]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(i(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=la(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[yt]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),a=!1}else a=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),dl(t,t.updateQueue),pl(t),null);case 4:return Se(),e===null&&Jf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return _a(t.type),pl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return pl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)fl(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ro(e),o!==null){for(t.flags|=128,fl(r,!1),e=o.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mi(n,e),n=n.sibling;return Io(t,Fo.current&1|2),na&&Yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>vd&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!na)return pl(t),null}else 2*Le()-r.renderingStartTime>vd&&n!==536870912&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,o=Fo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||na?Io(t,o):(n=o,ge(Oo,t),ge(Fo,n),ko===null&&(ko=t)),na&&Yi(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_a(Oa),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(i(156,t.tag))}function hl(e,t){switch(Qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(Oa),Se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(Po(t),t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Se(),null;case 10:return _a(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&z(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(Oa),null;case 25:return null;default:return null}}function gl(e,t){switch(Qi(t),t.tag){case 3:_a(Oa),Se();break;case 26:case 27:case 5:we(t);break;case 4:Se();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:_a(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&z(Ha);break;case 24:_a(Oa)}}function _l(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){gf(t,t.return,e)}}function vl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){gf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){gf(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){gf(e,e.return,t)}}}function bl(e,t,n){n.props=J(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){gf(e,t,n)}}function xl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=mi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=zp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Bp(e);p(e.child,!1,rm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){gf(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){gf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){gf(e,t,n)}else n.current=null}}function Cl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)am(e.stateNode,t[n])}function wl(e){for(var t=e.return;t!==null&&(Dl(t)&&am(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&om(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){gf(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;lp(r,e.type,n,t),r[bt]=t}catch(t){gf(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dp(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Dp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hn)),Cl(e,r),Ut=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Dp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),Ut=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Dp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);sp(t,r,n),t[yt]=e,t[bt]=n}catch(t){gf(e,e.return,t)}}var Fl=!1,Il=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Fl=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Np(o);r.push(s),s.view&&(a=!0)}else a||Np(o).view&&(a=!0);Fl=!0,Ap(o,Bl===0?t:t+`_`+Bl,n),Bl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?jp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Ul(e.child,t),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=gi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||Fd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(Il!==null&&Il.size!==0){var t=Il;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=gi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Fd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=Il===null?void 0:Il.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?Fd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Il.delete(n),Fd(e,t.onShare)):Ul(e.child,!1)),Il!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Il!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=Np(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ap(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Pp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Fd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,su=!1,cu=!1,lu=!1;function uu(e,t,n){if(e=e.containerInfo,fp=xh,e=Wr(e),Gr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(pp={focusedElem:e,selectionRange:r},xh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),du(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),du(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),du(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),du(n))}}Il=null}function du(e){for(;au!==null;){var t=au,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=J(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){gf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)sm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:sm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=mi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=gi(a.default,a.update),a!==`none`&&Vl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function fu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Mu(e,n),r&4&&_l(5,n);break;case 1:if(Mu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){gf(n,n.return,e)}else{var i=J(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){gf(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(Mu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{So(e,t)}catch(e){gf(n,n.return,e)}}break;case 27:t===null&&r&4&&Pl(n);case 26:case 5:Mu(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:Mu(e,n);break;case 31:Mu(e,n),r&4&&xu(e,n);break;case 13:Mu(e,n),r&4&&Su(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=bf.bind(null,n),pm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Pu(e,n,r)):Mu(e,n),eu=t,tu=i}break;case 30:Mu(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:Mu(e,n)}}function pu(e,t){for(e=e.child;e!==null;)mu(e,t),e=e.sibling}function mu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){gf(e,e.return,t)}hu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ut=!0}catch(t){gf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?kp(s,!0):kp(e.stateNode,!1)}catch(t){gf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&pu(e,t);break;default:pu(e,t)}}function hu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:mu(n,r);break a;case 22:n.memoizedState===null&&hu(n,r);break a;default:hu(n,r)}}e=e.sibling}}function gu(e){var t=e.alternate;t!==null&&(e.alternate=null,gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _u=null,vu=!1;function yu(e,t,n){for(n=n.child;n!==null;)bu(e,t,n),n=n.sibling}function bu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:tu||Sl(n,t),yu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Sl(n,t),Tl(n);var r=_u,i=vu;Dp(n.type)&&(_u=n.stateNode,vu=!1),yu(e,t,n),xm(n.stateNode,n.type,n.memoizedProps),_u=r,vu=i;break;case 5:tu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=_u,i=vu,_u=null,yu(e,t,n),_u=r,vu=i,_u!==null){if(vu)try{(_u.nodeType===9?_u.body:_u.nodeName===`HTML`?_u.ownerDocument.body:_u).removeChild(n.stateNode),Ut=!0}catch(e){gf(n,t,e)}else try{_u.removeChild(n.stateNode),Ut=!0}catch(e){gf(n,t,e)}}break;case 18:_u!==null&&(vu?(e=_u,Op(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qh(e)):Op(_u,n.stateNode));break;case 4:r=_u,i=vu,_u=n.stateNode.containerInfo,vu=!0,yu(e,t,n),_u=r,vu=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),tu||vl(4,n,t),yu(e,t,n);break;case 1:tu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),yu(e,t,n);break;case 21:yu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,yu(e,t,n),tu=r;break;case 30:Sl(n,t),yu(e,t,n);break;case 7:tu||Sl(n,t),yu(e,t,n);break;default:yu(e,t,n)}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qh(e)}catch(e){gf(t,t.return,e)}}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qh(e)}catch(e){gf(t,t.return,e)}}function Cu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(i(435,e.tag))}}function wu(e,t){var n=Cu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=xf.bind(null,e,t);t.then(r,r)}})}function Tu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Dp(l.type)){_u=l.stateNode,vu=!1;break a}break;case 5:_u=l.stateNode,vu=!1;break a;case 3:case 4:_u=l.stateNode.containerInfo,vu=!0;break a}l=l.return}if(_u===null)throw Error(i(160));bu(s,c,o),_u=null,vu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Du(t,e,n),t=t.sibling}var Eu=null;function Du(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Tu(t,e,n),Ou(e),a&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Eu,Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=_p(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),sp(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(o=Xm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),sp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Xm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),sp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else eu||Zm(o,e.type,e.stateNode)}else e.stateNode=Gm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):a.count--,n===null?eu||Zm(o,e.type,e.stateNode):Gm(o,n,e.memoizedProps))}break;case 27:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),r!==null&&a&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=nu,nu=!1,Tu(t,e,n),nu=o,Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{cn(t,``),Ut=!0}catch(t){gf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ru=!0);break;case 6:if(Tu(t,e,n),Ou(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ut=!0}catch(t){gf(e,e.return,t)}}break;case 3:if(Ut=!1,Ym=null,o=Eu,Eu=Tm(t.containerInfo),Tu(t,e,n),Eu=o,Ou(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{qh(t.containerInfo)}catch(t){gf(e,e.return,t)}ru&&(ru=!1,ku(e)),Ut=!1;break;case 4:a=nu,nu=eu,r=Wt(),o=Eu,Eu=Tm(e.stateNode.containerInfo),Tu(t,e,n),Ou(e),Eu=o,Ut&&su&&(cu=!0),Ut=r,nu=a;break;case 12:Tu(t,e,n),Ou(e);break;case 31:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 13:Tu(t,e,n),Ou(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(gd=Le()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||o,nu=u||o,tu=l||s,Tu(t,e,n),tu=l,nu=u,eu=c,Ou(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=o||eu,tu=t,Nu(e,2),eu=n,tu=r),!o&&nu||pu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,wu(e,n))));break;case 19:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 30:a&512&&(tu||r===null||Sl(r,r.return)),a=Wt(),o=su,s=(n&335544064)===n,c=e.memoizedProps,su=s&&gi(c.default,c.update)!==`none`,Tu(t,e,n),Ou(e),s&&r!==null&&Ut&&(e.flags|=4),su=o,Ut=a;break;case 21:break;case 7:a&512&&(tu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Tu(t,e,n),Ou(e)}}function Ou(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Dl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(El(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Nl(e,jl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(cn(l,``),n.flags&=-33),Nl(e,jl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ml(e,jl(e),u,s);break;default:throw Error(i(161))}}catch(t){gf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ku(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ku(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xh=!0,t.reset(),xh=!1),e=e.sibling}}function Au(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ju(t,e),t=t.sibling;else $l(t,!1)}function ju(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(lu=ou=!1,zl(),Au(t,e),!ou&&!cu){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];jp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),lu=!0}Rl=null;break;case 5:Au(t,e);break;case 4:r=ou,ou=!1,Au(t,e),ou&&(cu=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Au(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,Au(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Fd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:Au(t,e)}}function Mu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fu(e,t.alternate,t),t=t.sibling}function Nu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Nu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Nu(n,r);break;case 27:r&2&&xm(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Nu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Nu(n,r);break;case 22:n.memoizedState===null&&Nu(n,r);break;case 30:Sl(n,n.return),Nu(n,r);break;case 7:Sl(n,n.return);default:Nu(n,r)}e=e.sibling}}function Pu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Pu(i,a,n),_l(4,a);break;case 1:if(Pu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){gf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)xo(l[i],c)}catch(e){gf(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Pl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||Zm(Tm(c.ownerDocument),a.type,c),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Pu(i,a,n);break;case 31:Pu(i,a,n),s&&o&4&&xu(i,a);break;case 13:Pu(i,a,n),s&&o&4&&Su(i,a);break;case 22:a.memoizedState===null&&Pu(i,a,n),xl(a,a.return);break;case 30:Pu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Pu(i,a,n)}t=t.sibling}}function Fu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function Iu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Lu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ru(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Ru(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Lu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Lu(e,t,n,r);break;case 3:Lu(e,t,n,r),i&&lu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){Lu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){gf(t,t.return,e)}}else Lu(e,t,n,r);break;case 31:Lu(e,t,n,r);break;case 13:Lu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Lu(e,t,n,r):(o._visibility|=2,zu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Lu(e,t,n,r):Bu(e,t)),a&2048&&Fu(s,t);break;case 24:Lu(e,t,n,r),a&2048&&Iu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Lu(e,t,n,r);break;default:Lu(e,t,n,r)}}function zu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:zu(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,zu(a,o,s,c,i)):u._visibility&2?zu(a,o,s,c,i):Bu(a,o),i&&l&2048&&Fu(o.alternate,o);break;case 24:zu(a,o,s,c,i),i&&l&2048&&Iu(o.alternate,o);break;default:zu(a,o,s,c,i)}t=t.sibling}}function Bu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Bu(n,r),i&2048&&Fu(r.alternate,r);break;case 24:Bu(n,r),i&2048&&Iu(r.alternate,r);break;default:Bu(n,r)}t=t.sibling}}var Vu=8192;function Hu(e,t,n){if(e.subtreeFlags&Vu)for(e=e.child;e!==null;)Uu(e,t,n),e=e.sibling}function Uu(e,t,n){switch(e.tag){case 26:Hu(e,t,n),e.flags&Vu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&nh(n,e)):rh(n,Eu,e.memoizedState,e.memoizedProps));break;case 5:Hu(e,t,n),e.flags&Vu&&(e=e.stateNode,(t&335544128)===t&&nh(n,e));break;case 3:case 4:var r=Eu;Eu=Tm(e.stateNode.containerInfo),Hu(e,t,n),Eu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vu,Vu=16777216,Hu(e,t,n),Vu=r):Hu(e,t,n));break;case 30:if((e.flags&Vu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Il===null&&(Il=new Map),Il.set(r,i)}Hu(e,t,n);break;default:Hu(e,t,n)}}function Wu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ku(e),e=e.sibling}function Ku(e){switch(e.tag){case 0:case 11:case 15:Gu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Gu(e);break;case 12:Gu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qu(e)):Gu(e);break;default:Gu(e)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qu(t));break;default:qu(t)}e=e.sibling}}function Ju(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:vl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(gu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Yu={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},Xu=typeof WeakMap==`function`?WeakMap:Map,Zu=0,Qu=null,$u=null,ed=0,td=0,nd=null,rd=!1,id=!1,ad=!1,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=null,md=null,hd=!1,gd=0,_d=0,vd=1/0,yd=null,bd=null,xd=0,Sd=null,Cd=null,wd=0,Td=0,Ed=null,Dd=null,Od=null,kd=null,Ad=null,jd=0,Md=null;function Nd(){return Zu&2&&ed!==0?ed&-ed:L.T===null?vt():Lf()}function Pd(){if(dd===0){if(!(ed&536870912)||na){var e=et;et<<=1,!(et&3932160)&&(et=262144),dd=e}else dd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),dd}function Fd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=zp(mi(e.memoizedProps,n))),kd===null&&(kd=[]),kd.push(t.bind(null,r))}}function Id(e,t,n){(e===Qu&&(td===2||td===9)||e.cancelPendingCommit!==null)&&(Ud(e,0),Bd(e,ed,dd,!1)),dt(e,n),Zu&2&&e===Qu||(e===Qu&&(!(Zu&2)&&(ld|=n),sd===4&&Bd(e,ed,dd,!1)),kf(e))}function Ld(e,t,n){if(Zu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),a=r?Zd(e,t):Yd(e,t,!0),o=r;do{if(a===0){id&&!r&&Bd(e,t,0,!1);break}if(n=e.current.alternate,o&&!zd(n))a=Yd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=pd;var l=c.current.memoizedState.isDehydrated;if(l&&(Ud(c,s).flags|=256),s=Yd(c,s,!1),s!==2&&s!==6){if(ad&&!l){c.errorRecoveryDisabledLanes|=o,ld|=o,a=4;break a}o=md,md=a,o!==null&&(md===null?md=o:md.push.apply(md,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ud(e,0),Bd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Bd(r,t,dd,!rd);break a;case 2:md=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=gd+300-Le(),10<a)){if(Bd(r,t,dd,!rd),rt(r,0,!0)!==0)break a;wd=t,r.timeoutHandle=xp(Rd.bind(null,r,n,md,yd,hd,t,dd,ld,fd,rd,o,`Throttled`,-0,0),a);break a}Rd(r,n,md,yd,hd,t,dd,ld,fd,rd,o,null,-0,0)}break}}while(1);kf(e)}function Rd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},Il=null,Uu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=sh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?gd-Le():(a&4194048)===a?_d-Le():0,m=ah(d,m),m!==null)?(wd=a,e.cancelPendingCommit=m(af.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Bd(e,a,o,!l)):af(e,t,a,n,r,i,o,s,c,l,u,d)}function zd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Rr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Bd(e,t,n,r){t=ot(e,t),t&=~ud,t&=~ld,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&pt(e,n,t)}function Vd(){return Zu&6?!0:(Af(0,!1),!1)}function Hd(){if($u!==null){if(td===0)var e=$u.return;else e=$u,ha=ma=null,ns(e),no=null,ro=0,e=$u;for(;e!==null;)gl(e.alternate,e),e=e.return;$u=null}}function Ud(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Sp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wd=0,Hd(),Qu=e,$u=n=ji(e.current,null),ed=t,td=0,nd=null,rd=!1,id=it(e,t),ad=!1,fd=dd=ud=ld=cd=sd=0,md=pd=null,hd=!1,od=ot(e,t),xi(),n}function Wd(e,t){Bo=null,L.H=uc,t===Ka||t===Ja?(t=eo(),td=3):t===qa?(t=eo(),td=4):td=t===Dc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nd=t,$u===null&&(sd=1,xc(e,zi(t,e.current)))}function Gd(){var e=Oo.current;return e===null?!0:(ed&4194048)===ed?ko===null:(ed&62914560)===ed||ed&536870912?e===ko:!1}function Kd(){var e=L.H;return L.H=uc,e===null?uc:e}function qd(){var e=L.A;return L.A=Yu,e}function Jd(){sd=4,rd||(ed&4194048)!==ed&&Oo.current!==null||(id=!0),!(cd&134217727)&&!(ld&134217727)||Qu===null||Bd(Qu,ed,dd,!1)}function Yd(e,t,n){var r=Zu;Zu|=2;var i=Kd(),a=qd();(Qu!==e||ed!==t)&&(yd=null,Ud(e,t)),t=!1;var o=sd;a:do try{if(td!==0&&$u!==null){var s=$u,c=nd;switch(td){case 8:Hd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=td;if(td=0,nd=null,tf(e,s,c,l),n&&id){o=0;break a}break;default:l=td,td=0,nd=null,tf(e,s,c,l)}}Xd(),o=sd;break}catch(t){Wd(e,t)}while(1);return t&&e.shellSuspendCounter++,ha=ma=null,Zu=r,L.H=i,L.A=a,$u===null&&(Qu=null,ed=0,xi()),o}function Xd(){for(;$u!==null;)$d($u)}function Zd(e,t){var n=Zu;Zu|=2;var r=Kd(),a=qd();Qu!==e||ed!==t?(yd=null,vd=Le()+500,Ud(e,t)):id=it(e,t);a:do try{if(td!==0&&$u!==null){t=$u;var o=nd;b:switch(td){case 1:td=0,nd=null,tf(e,t,o,1);break;case 2:case 9:if(Xa(o)){td=0,nd=null,ef(t);break}t=function(){td!==2&&td!==9||Qu!==e||(td=7),kf(e)},o.then(t,t);break a;case 3:td=7;break a;case 4:td=5;break a;case 7:Xa(o)?(td=0,nd=null,ef(t)):(td=0,nd=null,tf(e,t,o,7));break;case 5:var s=null;switch($u.tag){case 26:s=$u.memoizedState;case 5:case 27:var c=$u;if(s?eh(s):c.stateNode.complete){td=0,nd=null;var l=c.sibling;if(l!==null)$u=l;else{var u=c.return;u===null?$u=null:($u=u,nf(u))}break b}}td=0,nd=null,tf(e,t,o,5);break;case 6:td=0,nd=null,tf(e,t,o,6);break;case 8:Hd(),sd=6;break a;default:throw Error(i(462))}}Qd();break}catch(t){Wd(e,t)}while(1);return ha=ma=null,L.H=r,L.A=a,Zu=n,$u===null?(Qu=null,ed=0,xi(),sd):0}function Qd(){for(;$u!==null&&!Fe();)$d($u)}function $d(e){var t=sl(e.alternate,e,od);e.memoizedProps=e.pendingProps,t===null?nf(e):$u=t}function ef(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,ed);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,ed);break;case 5:ns(t);var r=t;r===ea&&(na?(ca(r),r.tag===5&&r.stateNode!=null&&(ta=r.stateNode)):(ca(r),na=!0));default:gl(n,t),t=$u=Mi(t,od),t=sl(n,t,od)}e.memoizedProps=e.pendingProps,t===null?nf(e):$u=t}function tf(e,t,n,r){ha=ma=null,ns(t),no=null,ro=0;var i=t.return;try{if(Ec(e,i,t,n,ed)){sd=1,xc(e,zi(n,e.current)),$u=null;return}}catch(t){if(i!==null)throw $u=i,t;sd=1,xc(e,zi(n,e.current)),$u=null;return}t.flags&32768?(na||r===1?e=!0:id||ed&536870912?e=!1:(rd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),rf(t,e)):nf(t)}function nf(e){var t=e;do{if(t.flags&32768){rf(t,rd);return}e=t.return;var n=ml(t.alternate,t,od);if(n!==null){$u=n;return}if(t=t.sibling,t!==null){$u=t;return}$u=t=e}while(t!==null);sd===0&&(sd=5)}function rf(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,$u=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){$u=e;return}$u=e=n}while(e!==null);sd=6,$u=null}function af(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do pf();while(xd!==0);if(Zu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Qu&&($u=Qu=null,ed=0),Cd=t,Sd=e,wd=n,Ed=a,Dd=r,of(e,t,n,s,c,l,f)}}function of(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Td=s,s|=bi,ft(e,n,s,r,i,a),kd=null,(n&335544064)===n?(Ad=Na(e),r=10262):(Ad=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Sf(Ve,function(){return mf(),null})):(e.callbackNode=null,e.callbackPriority=0),Fl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=Zu,Zu|=4;try{uu(e,t,n)}finally{Zu=a,R.p=i,L.T=r}}xd=1,Fl?Od=Lp(o,e.containerInfo,Ad,lf,uf,cf,df,mf,sf,null,null):(lf(),uf(),df())}function sf(e){if(xd!==0){var t=Sd.onRecoverableError;t(e,{componentStack:null})}}function cf(){xd===3&&(xd=0,ju(Cd,Sd),xd=4)}function lf(){if(xd===1){xd=0;var e=Sd,t=Cd,n=wd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=Zu;Zu|=4;try{su=cu=!1,Du(t,e,n),n=pp;var o=Wr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ur(s.ownerDocument.documentElement,s)){if(c!==null&&Gr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Hr(s,h),v=Hr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}xh=!!fp,pp=fp=null}finally{Zu=a,R.p=i,L.T=r}}e.current=t,xd=2}}function uf(){if(xd===2){xd=0;var e=Sd,t=Cd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=Zu;Zu|=4;try{fu(e,t.alternate,t)}finally{Zu=i,R.p=r,L.T=n}}xd=3}}function df(){if(xd===4||xd===3){xd=0;var e=Od;Od=null,Ie();var t=Sd,n=Cd,r=wd,i=Dd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?xd=5:(xd=0,Cd=Sd=null,ff(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(bd=null),_t(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=kd,o=Ad,Ad=null,i!==null&&(kd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);wd&3&&pf(),kf(t),a=t.pendingLanes,r&261930&&a&42?t===Md?jd++:(jd=0,Md=t):(jd=0,Md=null),Af(0,!1)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function pf(){return Od!==null&&(Od.skipTransition(),Od=null),lf(),uf(),df(),mf()}function mf(){if(xd!==5)return!1;var e=Sd,t=Td;Td=0;var n=_t(wd),r=L.T,a=R.p;try{R.p=32>n?32:n,L.T=null,n=Ed,Ed=null;var o=Sd,s=wd;if(xd=0,Cd=Sd=null,wd=0,Zu&6)throw Error(i(331));var c=Zu;if(Zu|=4,Ku(o.current),Ru(o,o.current,s,n),Zu=c,Af(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,o)}catch{}return!0}finally{R.p=a,L.T=r,ff(e,t)}}function hf(e,t,n){t=zi(n,t),t=Cc(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(dt(e,2),kf(e))}function gf(e,t,n){if(e.tag===3)hf(e,e,n);else for(;t!==null;){if(t.tag===3){hf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bd===null||!bd.has(r))){e=zi(n,e),n=wc(2),r=ho(t,n,2),r!==null&&(Tc(n,r,t,e),dt(r,2),kf(r));break}}t=t.return}}function _f(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=vf.bind(null,e,t,n),t.then(e,e))}function vf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qu===e&&(ed&n)===n&&(sd===4||sd===3&&(ed&62914560)===ed&&300>Le()-gd?Zu&2?ud|=n:Ud(e,0):ud|=n,fd===ed&&(fd=0)),kf(e)}function yf(e,t){t===0&&(t=lt()),e=wi(e,t),e!==null&&(dt(e,t),kf(e))}function bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yf(e,n)}function xf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),yf(e,n)}function Sf(e,t){return Ne(e,t)}var Cf=null,wf=null,Tf=!1,Ef=!1,Df=!1,Of=0;function kf(e){e!==wf&&e.next===null&&(wf===null?Cf=wf=e:wf=wf.next=e),Ef=!0,Tf||(Tf=!0,If())}function Af(e,t){if(!Df&&Ef){Df=!0;do for(var n=!1,r=Cf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Ff(r,a))}else a=ed,a=rt(r,r===Qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Ff(r,a))}r=r.next}while(n);Df=!1}}function jf(){Mf()}function Mf(){Ef=Tf=!1;var e=0;Of!==0&&bp()&&(e=Of);for(var t=Le(),n=null,r=Cf;r!==null;){var i=r.next,a=Nf(r,t);a===0?(r.next=null,n===null?Cf=i:n.next=i,i===null&&(wf=n)):(n=r,(e!==0||a&3)&&(Ef=!0)),r=i}xd!==0&&xd!==5||Af(e,!1),Of!==0&&(Of=0)}function Nf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ct(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Qu,n=ed,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(td===2||td===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),_t(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Pf.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Pf(e,t){if(xd!==0&&xd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(pf()&&e.callbackNode!==n)return null;var r=ed;return r=rt(e,e===Qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ld(e,r,t),Nf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Pf.bind(null,e):null)}function Ff(e,t){if(pf())return null;Ld(e,t,!0)}function If(){Tp(function(){Zu&6?Ne(ze,jf):Mf()})}function Lf(){if(Of===0){var e=Ia;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Of=e}return Of}function Rf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function zf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Rf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Rf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Of!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Bf=0;Bf<di.length;Bf++){var Vf=di[Bf];fi(Vf.toLowerCase(),`on`+(Vf[0].toUpperCase()+Vf.slice(1)))}fi(ri,`onAnimationEnd`),fi(ii,`onAnimationIteration`),fi(ai,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(oi,`onTransitionRun`),fi(si,`onTransitionStart`),fi(ci,`onTransitionCancel`),fi(li,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Hf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Uf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Hf));function Wf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){_i(e)}i.currentTarget=null,a=c}}}}function Gf(e,t){var n=t[St];n===void 0&&(n=t[St]=new Set);var r=e+`__bubble`;n.has(r)||(Yf(t,e,2,!1),n.add(r))}function Kf(e,t,n){var r=0;t&&(r|=4),Yf(n,e,r,t)}var qf=`_reactListening`+Math.random().toString(36).slice(2);function Jf(e){if(!e[qf]){e[qf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(Uf.has(t)||Kf(t,!1,e),Kf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qf]||(t[qf]=!0,Kf(`selectionchange`,!1,t))}}function Yf(e,t,n,r){switch(Oh(t)){case 2:var i=Sh;break;case 8:i=Ch;break;default:i=wh}n=i.bind(null,t,n,e),i=void 0,!Tn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Xf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=kt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Sn(function(){var r=a,i=_n(n),s=[];a:{var c=ui.get(e);if(c!==void 0){var l=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=Gn;break;case`focusout`:u=`blur`,l=Gn;break;case`beforeblur`:case`afterblur`:l=Gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=rr;break;case ri:case ii:case ai:l=Kn;break;case li:l=ir;break;case`scroll`:case`scrollend`:l=Rn;break;case`wheel`:l=ar;break;case`copy`:case`cut`:case`paste`:l=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=tr;break;case`submit`:l=nr;break;case`toggle`:case`beforetoggle`:l=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Cn(m,p),g!=null&&d.push(Zf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==gn&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?kt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:jt(c),h=l==null?u:jt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,$f):null,c!==null&&ep(s,u,c,d,!1),l!==null&&f!==null&&ep(s,f,l,d,!0)))}a:{if(c=r?jt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Er;else if(br(c)){if(Dr)_=Ir;else{_=Pr;var v=Nr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&fn(r.elementType)&&(_=Er):_=Fr;if(_&&=_(e,r)){xr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?jt(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(qr=v,Jr=r,Yr=null);break;case`focusout`:Yr=Jr=qr=null;break;case`mousedown`:Xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Xr=!1,Zr(s,n,i);break;case`selectionchange`:if(Kr)break;case`keydown`:case`keyup`:Zr(s,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=Qf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=Qf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),zf(s,e,r,n,i)}Wf(s,t)})}function Zf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(Zf(e,i,a)),i=Cn(e,t),i!=null&&r.push(Zf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function $f(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ep(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(Zf(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(Zf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var tp=/\r\n?/g,np=/\u0000|\uFFFD/g;function rp(e){return(typeof e==`string`?e:``+e).replace(tp,`
|
|
9
|
+
`).replace(np,``)}function ip(e,t){return t=rp(t),rp(e)===t}function ap(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&cn(e,``+r);else return;break;case`className`:Kt(e,`class`,r);break;case`tabIndex`:Kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Kt(e,n,r);break;case`style`:dn(e,r,o);return;case`data`:if(t!==`object`){Kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ap(e,t,`name`,a.name,a,null),ap(e,t,`formEncType`,a.formEncType,a,null),ap(e,t,`formMethod`,a.formMethod,a,null),ap(e,t,`formTarget`,a.formTarget,a,null)):(ap(e,t,`encType`,a.encType,a,null),ap(e,t,`method`,a.method,a,null),ap(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&Gf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Gf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=mn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Gf(`beforetoggle`,e),Gf(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Gt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=H.get(n)||n,Gt(e,n,r);else return}Ut=!0}function op(e,t,n,r,a,o){switch(n){case`style`:dn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)cn(e,``+r);else return;break;case`onScroll`:r!=null&&Gf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Gf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Ut=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Gt(e,n,r)}return}Ut=!0}function sp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Gf(`error`,e),Gf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ap(e,t,o,s,n,null)}}a&&ap(e,t,`srcSet`,n.srcSet,n,null),r&&ap(e,t,`src`,n.src,n,null);return;case`input`:Gf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ap(e,t,r,d,n,null)}}nn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Gf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ap(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&an(e,!!r,n,!0):an(e,!!r,t,!1);return;case`textarea`:for(s in Gf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ap(e,t,s,c,n,null)}sn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ap(e,t,l,r,n,null)}return;case`dialog`:Gf(`beforetoggle`,e),Gf(`toggle`,e),Gf(`cancel`,e),Gf(`close`,e);break;case`iframe`:case`object`:Gf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Hf.length;r++)Gf(Hf[r],e);break;case`image`:Gf(`error`,e),Gf(`load`,e);break;case`details`:Gf(`toggle`,e);break;case`embed`:case`source`:case`link`:Gf(`error`,e),Gf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ap(e,t,u,r,n,null)}return;default:if(fn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&op(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ap(e,t,c,r,n,null))}var cp={};function lp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ap(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Ut=!0),o=m;break;case`name`:m!==f&&(Ut=!0),a=m;break;case`checked`:m!==f&&(Ut=!0),u=m;break;case`defaultChecked`:m!==f&&(Ut=!0),d=m;break;case`value`:m!==f&&(Ut=!0),s=m;break;case`defaultValue`:m!==f&&(Ut=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ap(e,t,p,m,r,f)}}tn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ap(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Ut=!0),p=o;break;case`defaultValue`:o!==l&&(Ut=!0),c=o;break;case`multiple`:o!==l&&(Ut=!0),s=o;default:o!==l&&ap(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?an(e,!!n,n?[]:``,!1):an(e,!!n,t,!0)):an(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ap(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Ut=!0),p=a;break;case`defaultValue`:a!==o&&(Ut=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ap(e,t,s,a,r,o)}on(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ap(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Ut=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ap(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ap(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ap(e,t,u,p,r,m)}return;default:if(fn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&op(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||op(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ap(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ap(e,t,f,p,r,m)}function up(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function dp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&up(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&up(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var fp=null,pp=null;function mp(e){return e.nodeType===9?e:e.ownerDocument}function hp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function gp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function _p(e,t,n,r){return n=mp(n).createElement(e),n[yt]=r,n[bt]=t,sp(n,e,t),Nt(n),n}function vp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var yp=null;function bp(){var e=window.event;return e&&e.type===`popstate`?e!==yp&&(yp=e,!0):(yp=null,!1)}var xp=typeof setTimeout==`function`?setTimeout:void 0,Sp=typeof clearTimeout==`function`?clearTimeout:void 0,Cp=typeof Promise==`function`?Promise:void 0,wp=typeof requestAnimationFrame==`function`?requestAnimationFrame:xp,Tp=typeof queueMicrotask==`function`?queueMicrotask:Cp===void 0?xp:function(e){return Cp.resolve(null).then(e).catch(Ep)};function Ep(e){setTimeout(function(){throw e})}function Dp(e){return e===`head`}function Op(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sm(e.ownerDocument.body)}n=i}while(n);qh(t)}function kp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Ap(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function jp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Mp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Np(e){return Mp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Pp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Mp(t,n,e)}function Fp(e){return e.documentElement.clientHeight}function Ip(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Lp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Fp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=th(f),u>ih){s.length=o;break}f=new Promise(Ip.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Rp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Rp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Rp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Rp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function zp(e){return{name:e,group:new Rp(`group`,e),imagePair:new Rp(`image-pair`,e),old:new Rp(`old`,e),new:new Rp(`new`,e)}}function Bp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Gp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Up(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Vp,e,s,r)}this._eventListeners=a}};function Vp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Bp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Gp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Up(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Hp,e,n,i),r.splice(t,1),a!==null&&a()}};function Hp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Up(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Wp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Gp(e,t,n,r){if(e.length===0)return-1;r=Wp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Wp(a.optionsOrUseCapture)===r)return i}return-1}Bp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Up(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Up(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Bp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag!==6&&(e=v(e),vm(e,t))}Bp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Kp(t[n],e);n--);};function qp(e,t){return t.push(e),!1}Bp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=mp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Jp,e,void 0,void 0))};function Jp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Bp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0);for(var n=t=0;n<Zp.length;n++){var r=Zp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Zp[t++]=r}Zp.length=t}};function Xp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Zp=[],Qp=!1;function $p(e,t,n){Zp.push({fragmentInstance:e,observer:t,instance:n}),Qp||(Qp=!0,ym(function(){Qp=!1;var e=Zp;Zp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Bp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,em,e,void 0,void 0),e};function em(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Bp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Bp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,qp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||tm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function tm(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function nm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Bp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,qp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),nm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),nm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function rm(e,t){return e=v(e),im(e,t),!1}function im(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Up(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Zp.length;i++){var a=Zp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Zp[r++]=a)}Zp.length=r,n.observe(e)}),im(e,t))}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Up(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?$p(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function sm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mm(e.nextSibling),e===null)break}return null}function lm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mm(e.nextSibling),e===null))return null;return e}function um(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mm(e.nextSibling),e===null))return null;return e}function dm(e){return e.data===`$?`||e.data===`$~`}function fm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var hm=null;function gm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _m(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function vm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function ym(e){wp(function(){wp(function(t){return e(t)})})}function bm(e,t,n){switch(t=mp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function xm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ap(e,t,r,null,cp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),Ot(e)}function Sm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var Cm=new Map,wm=new Set;function Tm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Em=R.d;R.d={f:Dm,r:Om,D:jm,C:Mm,L:Nm,m:Pm,X:Im,S:Fm,M:Lm};function Dm(){var e=Em.f(),t=Vd();return e||t}function Om(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):Em.r(e)}var km=typeof document>`u`?null:document;function Am(e,t,n){var r=km;if(r&&typeof t==`string`&&t){var i=en(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wm.has(i)||(wm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),sp(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function jm(e){Em.D(e),Am(`dns-prefetch`,e,null)}function Mm(e,t){Em.C(e,t),Am(`preconnect`,e,t)}function Nm(e,t,n){Em.L(e,t,n);var r=km;if(r&&e&&t){var i=`link[rel="preload"][as="`+en(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+en(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+en(n.imageSizes)+`"]`)):i+=`[href="`+en(e)+`"]`;var a=i;switch(t){case`style`:a=zm(e);break;case`script`:a=Um(e)}if(!(Cm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bm(a))||t===`script`&&r.querySelector(Wm(a))))){var o=r.createElement(`link`);sp(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function Pm(e,t){Em.m(e,t);var n=km;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+en(r)+`"][href="`+en(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Um(e)}if(!Cm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Cm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wm(a)))return}r=n.createElement(`link`),sp(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Fm(e,t,n){Em.S(e,t,n);var r=km;if(r&&e){var i=Mt(r).hoistableStyles,a=zm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cm.get(a))&&qm(e,n);var c=o=r.createElement(`link`);Nt(c),sp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Km(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Im(e,t){Em.X(e,t);var n=km;if(n&&e){var r=Mt(n).hoistableScripts,i=Um(e),a=r.get(i);a||(a=n.querySelector(Wm(i)),a||(e=T({src:e,async:!0},t),(t=Cm.get(i))&&Jm(e,t),a=n.createElement(`script`),Nt(a),sp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t){Em.M(e,t);var n=km;if(n&&e){var r=Mt(n).hoistableScripts,i=Um(e),a=r.get(i);a||(a=n.querySelector(Wm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Cm.get(i))&&Jm(e,t),a=n.createElement(`script`),Nt(a),sp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t,n,r){var a=(a=ye.current)?Tm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=zm(n.href),t=Mt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zm(n.href);var o=Mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Cm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cm.set(e,o)),Hm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Um(n),t=Mt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zm(e){return`href="`+en(e)+`"`}function Bm(e){return`link[rel="stylesheet"][`+e+`]`}function Vm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Hm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),sp(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Um(e){return`[src="`+en(e)+`"]`}function Wm(e){return`script[async]`+e}function Gm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+en(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),sp(r,`style`,a),Km(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zm(n.href);var o=e.querySelector(Bm(a));if(o)return t.state.loading|=4,t.instance=o,Nt(o),o;r=Vm(n),(a=Cm.get(a))&&qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Nt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),sp(o,`link`,r),t.state.loading|=4,Km(o,n.precedence,e),t.instance=o;case`script`:return o=Um(n.src),(a=e.querySelector(Wm(o)))?(t.instance=a,Nt(a),a):(r=n,(a=Cm.get(o))&&(r=T({},n),Jm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Nt(a),sp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Km(r,n.precedence,e));return t.instance}function Km(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Ym=null;function Xm(e,t,n){if(Ym===null){var r=new Map,i=Ym=new Map;i.set(n,r)}else i=Ym,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Zm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function $m(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function eh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function th(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function nh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=th(t),e.suspenseyImages.push(t)),e=ch.bind(e),t.decode().then(e,e))}function rh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zm(r.href),a=t.querySelector(Bm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=sh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Vm(r),(i=Cm.get(i))&&qm(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),sp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=sh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ih=0;function ah(e,t){return e.stylesheets&&e.count===0&&uh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ih===0&&(ih=62500*dp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ih?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function oh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)uh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function sh(){this.count--,oh(this)}function ch(){this.imgCount--,oh(this)}var lh=null;function uh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lh=new Map,t.forEach(dh,e),lh=null,sh.call(e))}function dh(e,t){if(!(t.state.loading&4)){var n=lh.get(e);if(n)var r=n.get(null);else{n=new Map,lh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=sh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fh={$$typeof:N,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function ph(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function mh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ph(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function hh(e){return e?(e=Di,e):Di}function gh(e,t,n,r,i,a){i=hh(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Id(n,e,t),go(n,e,t))}function _h(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vh(e,t){_h(e,t),(e=e.alternate)&&_h(e,t)}function yh(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Id(t,e,67108864),vh(e,67108864)}}function bh(e){if(e.tag===13||e.tag===31){var t=Nd();t=gt(t);var n=wi(e,t);n!==null&&Id(n,e,t),vh(e,t)}}var xh=!0;function Sh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,wh(e,t,n,r)}finally{R.p=a,L.T=i}}function Ch(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,wh(e,t,n,r)}finally{R.p=a,L.T=i}}function wh(e,t,n,r){if(xh){var i=Th(r);if(i===null)Xf(e,t,r,Eh,n),Lh(e,r);else if(zh(i,e,t,n,r))r.stopPropagation();else if(Lh(e,r),t&4&&-1<Ih.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}kf(a),!(Zu&6)&&(vd=Le()+500,Af(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Id(s,a,2),Vd(),vh(a,2)}if(a=Th(r),a===null&&Xf(e,t,r,Eh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Xf(e,t,r,null,n)}}function Th(e){return e=_n(e),Dh(e)}var Eh=null;function Dh(e){if(Eh=null,e=kt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Eh=e,null}function Oh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var kh=!1,Ah=null,jh=null,Mh=null,Nh=new Map,Ph=new Map,Fh=[],Ih=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Lh(e,t){switch(e){case`focusin`:case`focusout`:Ah=null;break;case`dragenter`:case`dragleave`:jh=null;break;case`mouseover`:case`mouseout`:Mh=null;break;case`pointerover`:case`pointerout`:Nh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ph.delete(t.pointerId)}}function Rh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zh(e,t,n,r,i){switch(t){case`focusin`:return Ah=Rh(Ah,e,t,n,r,i),!0;case`dragenter`:return jh=Rh(jh,e,t,n,r,i),!0;case`mouseover`:return Mh=Rh(Mh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Nh.set(a,Rh(Nh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ph.set(a,Rh(Ph.get(a)||null,e,t,n,r,i)),!0}return!1}function Bh(e){var t=kt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,B(e.priority,function(){bh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,B(e.priority,function(){bh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Th(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gn=r,n.target.dispatchEvent(r),gn=null}else return t=At(n),t!==null&&yh(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Vh(e)&&n.delete(t)}function Uh(){kh=!1,Ah!==null&&Vh(Ah)&&(Ah=null),jh!==null&&Vh(jh)&&(jh=null),Mh!==null&&Vh(Mh)&&(Mh=null),Nh.forEach(Hh),Ph.forEach(Hh)}function Wh(e,n){e.blockedOn===n&&(e.blockedOn=null,kh||(kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Uh)))}var Gh=null;function Kh(e){Gh!==e&&(Gh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===e&&(Gh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Dh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qh(e){function t(t){return Wh(t,e)}Ah!==null&&Wh(Ah,e),jh!==null&&Wh(jh,e),Mh!==null&&Wh(Mh,e),Nh.forEach(t),Ph.forEach(t);for(var n=0;n<Fh.length;n++){var r=Fh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fh.length&&(n=Fh[0],n.blockedOn===null);)Bh(n),n.blockedOn===null&&Fh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Kh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(Dh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kh(n)}}}function Jh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Yh(e){this._internalRoot=e}Xh.prototype.render=Yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;gh(n,Nd(),e,t,null,null)},Xh.prototype.unmount=Yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gh(e.current,2,null,e,null,null),Vd(),t[xt]=null}};function Xh(e){this._internalRoot=e}Xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fh.length&&t!==0&&t<Fh[n].priority;n++);Fh.splice(n,0,e),n===0&&Bh(e)}};var Zh=n.version;if(Zh!==`19.3.1`)throw Error(i(527,Zh,`19.3.1`));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Ke=$h.inject(Qh),qe=$h}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=vc,s=yc,c=bc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mh(e,1,!1,null,null,n,r,null,o,s,c,Jh),e[xt]=t.current,Jf(e),new Yh(t)}})),lt=o(((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=ct()}))(),ut=`x-s3deck-csrf`,dt=604800,ft=524288,pt=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t}};function mt(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t??{}))r!=null&&r!==``&&n.set(e,String(r));let r=n.toString();return`api/${e.replace(/^\//,``)}${r?`?${r}`:``}`}function ht(e,t=``){return`buckets/${encodeURIComponent(e)}${t}`}var gt=null;function _t(e){gt=e}async function vt(e){let t=`HTTP_ERROR`,n=`${e.status} ${e.statusText}`;try{let r=await e.json();t=r.error.code,n=r.error.message}catch{}return new pt(e.status,t,n)}async function B(e,t={}){let n=t.method??`GET`,r=await fetch(mt(e,t.query),{method:n,signal:t.signal,credentials:`same-origin`,headers:{Accept:`application/json`,[ut]:`1`,...t.body===void 0?{}:{"Content-Type":`application/json`},...t.headers},body:t.body===void 0?void 0:JSON.stringify(t.body)});if(!r.ok){let e=await vt(r);throw e.status===401&&e.code===`UNAUTHENTICATED`&>?.(),e}if(r.status!==204)return await r.json()}function V(e){return e instanceof Error?e.message:String(e)}function yt(e,t,n={}){return mt(ht(e,`/download`),{key:t,versionId:n.versionId??void 0,inline:n.inline?`1`:void 0})}function bt(e){let t=document.createElement(`a`);t.href=e,t.rel=`noopener`,t.download=``,document.body.appendChild(t),t.click(),t.remove()}var xt={me:[`me`],connections:[`connections`],s3:[`s3`],buckets:()=>[`s3`,`buckets`],bucket:e=>[`s3`,`bucket`,e],objects:(e,t,n)=>[`s3`,`bucket`,e,`objects`,t,n],details:(e,t,n)=>[`s3`,`bucket`,e,`details`,t,n??null],versions:(e,t)=>[`s3`,`bucket`,e,`versions`,t],tags:(e,t)=>[`s3`,`bucket`,e,`tags`,t],settings:e=>[`s3`,`bucket`,e,`settings`],usage:(e,t)=>[`s3`,`bucket`,e,`usage`,t],deleted:(e,t)=>[`s3`,`bucket`,e,`deleted`,t],incomplete:e=>[`s3`,`bucket`,e,`incomplete`],folderSize:(e,t)=>[`s3`,`bucket`,e,`folder-size`,t],users:[`admin`,`users`],activity:e=>[`admin`,`activity`,e],jobs:[`jobs`]};function St(e,t){return e.invalidateQueries({queryKey:xt.bucket(t)})}function Ct(){return tt({queryKey:xt.me,queryFn:()=>B(`auth/me`),staleTime:6e4})}function wt(){let e=_();return nt({mutationFn:e=>B(`auth/login`,{method:`POST`,body:e}),onSuccess:()=>e.invalidateQueries()})}function Tt(){let e=_();return nt({mutationFn:()=>B(`auth/logout`,{method:`POST`}),onSuccess:()=>{e.clear(),e.invalidateQueries({queryKey:xt.me})}})}function Et(e=!0){return tt({queryKey:xt.connections,queryFn:()=>B(`connections`),enabled:e})}function Dt(e,t){e.setQueryData(xt.connections,t),e.removeQueries({queryKey:xt.s3})}function Ot(){let e=_();return nt({mutationFn:e=>B(`connections`,{method:`POST`,body:e}),onSuccess:t=>Dt(e,t)})}function kt(){let e=_();return nt({mutationFn:e=>B(`connections/${encodeURIComponent(e)}/activate`,{method:`POST`}),onSuccess:t=>Dt(e,t)})}function At(){let e=_();return nt({mutationFn:e=>B(`connections/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:t=>Dt(e,t)})}function jt(e=!0){return tt({queryKey:xt.buckets(),queryFn:()=>B(`buckets`),enabled:e,retry:!1})}function Mt(){let e=_();return nt({mutationFn:e=>B(`buckets`,{method:`POST`,body:e}),onSuccess:()=>e.invalidateQueries({queryKey:xt.buckets()})})}function Nt(){let e=_();return nt({mutationFn:({bucket:e,force:t})=>B(ht(e),{method:`DELETE`,query:{force:t?`1`:`0`}}),onSuccess:()=>e.invalidateQueries({queryKey:xt.buckets()})})}function Pt(e){return tt({queryKey:xt.settings(e),queryFn:()=>B(ht(e,`/settings`))})}function Ft(e){let t=_();return nt({mutationFn:({setting:t,body:n})=>B(ht(e,`/settings/${t}`),{method:`PUT`,body:n}),onSuccess:()=>t.invalidateQueries({queryKey:xt.settings(e)})})}function It(e,t,n){return tt({queryKey:xt.usage(e,t),queryFn:({signal:n})=>B(ht(e,`/usage`),{query:{prefix:t},signal:n}),enabled:n,staleTime:1/0,retry:!1})}function Lt(e,t,n){return rt({queryKey:xt.objects(e,t,n),queryFn:({pageParam:r,signal:i})=>B(ht(e,`/objects`),{query:{prefix:t,cursor:r,flat:n?`1`:`0`,limit:500},signal:i}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,placeholderData:le,staleTime:15e3})}function Rt(e,t,n){return tt({queryKey:xt.details(e,t??``,n),queryFn:()=>B(ht(e,`/details`),{query:{key:t??``,versionId:n??void 0}}),enabled:!!t})}function zt(e,t,n){return tt({queryKey:xt.versions(e,t),queryFn:()=>B(ht(e,`/versions`),{query:{key:t}}),enabled:n})}function Bt(e,t,n){return tt({queryKey:xt.tags(e,t),queryFn:()=>B(ht(e,`/tags`),{query:{key:t}}),enabled:n,retry:!1})}function Vt(e,t,n){let r=_();return nt({mutationFn:t,onSettled:(t,i,a)=>{St(r,e);for(let e of n?.(a)??[])St(r,e)}})}var Ht={delete:(e,t)=>B(ht(e,`/delete`),{method:`POST`,body:t}),summary:(e,t,n)=>B(ht(e,`/summary`),{method:`POST`,body:t,signal:n}),copy:(e,t)=>B(ht(e,`/copy`),{method:`POST`,body:t}),createFolder:(e,t)=>B(ht(e,`/folder`),{method:`POST`,body:{prefix:t}}),presign:(e,t)=>B(ht(e,`/presign`),{method:`POST`,body:t}),metadata:(e,t)=>B(ht(e,`/metadata`),{method:`POST`,body:t}),tags:(e,t)=>B(ht(e,`/tags`),{method:`PUT`,body:t}),restoreVersion:(e,t,n)=>B(ht(e,`/versions/restore`),{method:`POST`,body:{key:t,versionId:n}}),deleteVersion:(e,t,n)=>B(ht(e,`/versions/delete`),{method:`POST`,body:{key:t,versionId:n}}),zip:(e,t)=>B(ht(e,`/zip`),{method:`POST`,body:t})};function Ut(e,t,n){return rt({queryKey:xt.deleted(e,t),queryFn:({pageParam:n,signal:r})=>B(ht(e,`/deleted`),{query:{prefix:t,cursor:n},signal:r}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:n})}function Wt(e,t=!0){return tt({queryKey:xt.incomplete(e),queryFn:()=>B(ht(e,`/multipart`)),enabled:t,retry:!1})}function Gt(e,t,n){return tt({queryKey:xt.folderSize(e,t),queryFn:({signal:n})=>Ht.summary(e,{prefixes:[t]},n),enabled:n,staleTime:3e5,retry:!1})}var Kt={abortUpload:(e,t,n)=>B(ht(e,`/multipart/abort`),{method:`POST`,body:{key:t,uploadId:n}}),storageClass:(e,t,n)=>B(ht(e,`/storage-class`),{method:`POST`,body:{keys:t,storageClass:n}}),restoreArchive:(e,t,n,r)=>B(ht(e,`/restore-archive`),{method:`POST`,body:{keys:t,days:n,tier:r}})};function qt(e=!0){return tt({queryKey:xt.users,queryFn:()=>B(`admin/users`),enabled:e})}function Jt(){let e=_(),t=()=>e.invalidateQueries({queryKey:xt.users});return{create:nt({mutationFn:e=>B(`admin/users`,{method:`POST`,body:e}),onSuccess:t}),update:nt({mutationFn:({username:e,patch:t})=>B(`admin/users/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),onSuccess:t}),remove:nt({mutationFn:e=>B(`admin/users/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:t})}}function Yt(e){return tt({queryKey:xt.activity(e),queryFn:()=>B(`admin/activity`,{query:e}),refetchInterval:15e3})}function Xt(){return tt({queryKey:xt.jobs,queryFn:()=>B(`jobs`),refetchInterval:e=>e.state.data?.jobs.some(e=>e.status===`running`)?1e3:1e4})}var Zt={compare:(e,t)=>B(`sync/compare`,{method:`POST`,body:e,signal:t}),start:e=>B(`sync`,{method:`POST`,body:e}),cancel:e=>B(`jobs/${encodeURIComponent(e)}`,{method:`DELETE`})};function Qt(e){return tt({queryKey:[`s3`,`buckets-for`,e],queryFn:()=>B(`buckets`,{headers:{"x-s3deck-connection":e}}),enabled:!!e,retry:!1})}var $t=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function en(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:$t(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var tn=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},nn=e=>{let t=tn(e);return t.charAt(0).toUpperCase()+t.slice(1)},rn=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},an={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function on(e){return e!=null}function sn(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??an.width,a=e.size??e.height??an.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?rn(...c):rn(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??an[`stroke-width`])*Number(e.size??e.width??an.width)/Number(t.size??t.width??an.width):t.strokeWidth??an[`stroke-width`];return[`svg`,{...Object.entries(an).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&on(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&on(t.width)&&{[r(`width`)]:t.width},...`height`in t&&on(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function cn(e,t={}){return sn(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ln=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},un=(0,d.createContext)({}),dn=()=>(0,d.useContext)(un),fn=(0,d.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=dn()??{},b=!!c||ln(f),[x,S,C=[]]=cn(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:rn(y,s),hasA11yProp:b,attributes:f});return(0,d.createElement)(x,{ref:p,...S},[...C.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function H(e,t=[],n=[]){let r=typeof e==`string`?en(e,t,n):e,i=(0,d.forwardRef)(({className:e,...t},n)=>(0,d.createElement)(fn,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=nn(r.name)),i}var pn={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};pn.node;var mn=H(pn),hn={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};hn.node;var gn=H(hn),_n={name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]};_n.node;var vn=H(_n),yn={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};yn.node;var bn=H(yn),xn={name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]};xn.node;var Sn=H(xn),Cn={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Cn.node;var wn=H(Cn),Tn={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};Tn.node;var En=H(Tn),Dn={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Dn.node;var On=H(Dn),kn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};kn.node;var An=H(kn),jn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};jn.node;var Mn=H(jn),Nn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Nn.node;var Pn=H(Nn),Fn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Fn.node;var In=H(Fn),Ln={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Ln.node;var Rn=H(Ln),zn={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};zn.node;var Bn=H(zn),Vn={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Vn.node;var Hn=H(Vn),Un={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Un.node;var Wn=H(Un),Gn={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Gn.node;var Kn=H(Gn),qn={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};qn.node;var Jn=H(qn),Yn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Yn.node;var Xn=H(Yn),Zn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Zn.node;var Qn=H(Zn),$n={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};$n.node;var er=H($n),tr={name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]};tr.node;var nr=H(tr),rr={name:`file-braces`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]],aliases:[`file-json`]};rr.node;var ir=H(rr),ar={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};ar.node;var or=H(ar),sr={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]};sr.node;var cr=H(sr),lr={name:`file-music`,size:24,node:[[`path`,{d:`M11.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.35`,key:`5ad7z2`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 20v-7l3 1.474`,key:`1ggyb9`}],[`circle`,{cx:`6`,cy:`20`,r:`2`,key:`j7wjp0`}]]};lr.node;var ur=H(lr),dr={name:`file-play`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]],aliases:[`file-video`]};dr.node;var fr=H(dr),pr={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};pr.node;var mr=H(pr),hr={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};hr.node;var gr=H(hr),_r={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};_r.node;var vr=H(_r),yr={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};yr.node;var br=H(yr),xr={name:`folder-sync`,size:24,node:[[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v.5`,key:`1dkoa9`}],[`path`,{d:`M12 10v4h4`,key:`1czhmt`}],[`path`,{d:`m12 14 1.535-1.605a5 5 0 0 1 8 1.5`,key:`lvuxfi`}],[`path`,{d:`M22 22v-4h-4`,key:`1ewp4q`}],[`path`,{d:`m22 18-1.535 1.605a5 5 0 0 1-8-1.5`,key:`14ync0`}]]};xr.node;var Sr=H(xr),Cr={name:`folder-up`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]};Cr.node;var wr=H(Cr),Tr={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Tr.node;var Er=H(Tr),Dr={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Dr.node;var Or=H(Dr),kr={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};kr.node;var Ar=H(kr),jr={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};jr.node;var Mr=H(jr),Nr={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Nr.node;var Pr=H(Nr),Fr={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Fr.node;var Ir=H(Fr),Lr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Lr.node;var Rr=H(Lr),zr={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};zr.node;var Br=H(zr),Vr={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Vr.node;var Hr=H(Vr),Ur={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Ur.node;var Wr=H(Ur),Gr={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Gr.node;var Kr=H(Gr),qr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};qr.node;var Jr=H(qr),Yr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Yr.node;var Xr=H(Yr),Zr={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};Zr.node;var Qr=H(Zr),$r={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};$r.node;var ei=H($r),ti={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};ti.node;var ni=H(ti),ri={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ri.node;var ii=H(ri),ai={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};ai.node;var oi=H(ai),si={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};si.node;var ci=H(si),li={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};li.node;var ui=H(li),di={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};di.node;var fi=H(di),pi={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};pi.node;var mi=H(pi),hi={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};hi.node;var gi=H(hi),_i={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};_i.node;var vi=H(_i),yi={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};yi.node;var bi=H(yi),xi={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};xi.node;var Si=H(xi),Ci={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};Ci.node;var wi=H(Ci),Ti={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ti.node;var Ei=H(Ti),Di={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Di.node;var Oi=H(Di),ki={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};ki.node;var Ai=H(ki),ji={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};ji.node;var Mi=H(ji),Ni={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ni.node;var Pi=H(Ni),Fi={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};Fi.node;var Ii=H(Fi),Li={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Li.node;var Ri=H(Li),zi={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};zi.node;var Bi=H(zi),Vi={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Vi.node;var Hi=H(Vi),Ui={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Ui.node;var Wi=H(Ui),Gi={name:`user-x`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]};Gi.node;var Ki=H(Gi),qi={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};qi.node;var Ji=H(qi),Yi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Yi.node;var Xi=H(Yi),Zi=`s3deck-theme`,Qi=new Set,$i=matchMedia(`(prefers-color-scheme: dark)`);function ea(){try{let e=localStorage.getItem(Zi);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}var ta=ea();function na(){let e=ta===`dark`||ta===`system`&&$i.matches;document.documentElement.classList.toggle(`dark`,e)}$i.addEventListener(`change`,()=>{na();for(let e of Qi)e()}),na();function ra(e){ta=e;try{localStorage.setItem(Zi,e)}catch{}na();for(let e of Qi)e()}function ia(){return{theme:(0,d.useSyncExternalStore)(e=>(Qi.add(e),()=>void Qi.delete(e)),()=>ta),setTheme:ra}}var aa=c(st(),1);function oa(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 sa=e=>{switch(e){case`success`:return ua;case`info`:return fa;case`warning`:return da;case`error`:return pa;default:return null}},ca=Array(12).fill(0),la=({visible:e,className:t})=>d.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},d.createElement(`div`,{className:`sonner-spinner`},ca.map((e,t)=>d.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),ua=d.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},d.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`})),da=d.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},d.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`})),fa=d.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},d.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`})),pa=d.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},d.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=d.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`},d.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),d.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ha=()=>{let[e,t]=d.useState(document.hidden);return d.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},ga=1,_a=100,va=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:ga++,ya=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-_a;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=va(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,o=r.then(async e=>{if(a=[`resolve`,e],d.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(xa(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,o=typeof r==`object`&&!d.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}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,o=typeof r==`object`&&!d.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}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,o=typeof r==`object`&&!d.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).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,o=typeof r==`object`&&!d.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=va(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}},ba=(e,t)=>ya.message(e,t),xa=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,U=Object.assign(ba,{success:ya.success,info:ya.info,warning:ya.warning,error:ya.error,custom:ya.custom,message:ya.message,promise:ya.promise,dismiss:ya.dismiss,loading:ya.loading},{getHistory:()=>ya.toasts,getToasts:()=>ya.getActiveToasts()});oa(`[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 Sa(e){return e.label!==void 0}var Ca=3,wa=`24px`,Ta=`16px`,Ea=4e3,Da=356,Oa=14,ka=45,Aa=200;function ja(...e){return e.filter(Boolean).join(` `)}function Ma(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Na=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,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]=d.useState(null),[k,A]=d.useState(null),[j,M]=d.useState(!1),[N,ee]=d.useState(!1),[te,P]=d.useState(!1),[ne,re]=d.useState(!1),[ie,ae]=d.useState(!1),[F,oe]=d.useState(0),[I,se]=d.useState(0),ce=d.useRef(n.duration||b||Ea),le=d.useRef(null),ue=d.useRef(null),de=c===0,L=c+1<=o,R=n.type,fe=R??`default`,pe=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,z=d.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=d.useMemo(()=>n.closeButton??m,[n.closeButton,m]),_e=d.useMemo(()=>n.duration||b||Ea,[n.duration,b]),ve=d.useRef(0),ye=d.useRef(0),be=d.useRef(0),xe=d.useRef(null),[Se,Ce]=x.split(`-`),we=d.useMemo(()=>s.reduce((e,t,n)=>n>=z?e:e+t.height,0),[s,z]),Te=ha(),Ee=d.useMemo(()=>e.swipeDirections??Ma(x),[e.swipeDirections,x]),De=n.invert||t,Oe=R===`loading`;ye.current=d.useMemo(()=>z*S+we,[z,we]),d.useEffect(()=>{ce.current=_e},[_e]),d.useEffect(()=>{M(!0)},[]),d.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),d.useLayoutEffect(()=>{if(!j)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(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 ke=d.useCallback(()=>{ee(!0),oe(ye.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},Aa)},[n,f,a,ye]);d.useEffect(()=>{if(n.promise&&R===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Te?(()=>{if(be.current<ve.current){let e=new Date().getTime()-ve.current;ce.current-=e}be.current=new Date().getTime()})():ce.current!==1/0&&(ve.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},ce.current)),()=>clearTimeout(e)},[u,i,n,R,Te,ke]),d.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return T?.loading?d.createElement(`div`,{className:ja(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":R===`loading`},T.loading):d.createElement(la,{className:ja(w?.loader,n?.classNames?.loader),visible:R===`loading`})}let je=n.icon||T?.[R]||sa(R);return d.createElement(`li`,{tabIndex:0,ref:ue,className:ja(v,me,w?.toast,n?.classNames?.toast,w?.[fe],n?.classNames?.[fe]),"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":ie,"data-removed":N,"data-visible":L,"data-y-position":Se,"data-x-position":Ce,"data-index":c,"data-front":de,"data-swiping":te,"data-dismissible":pe,"data-type":R,"data-invert":De,"data-swipe-out":ne,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?F:ye.current}px`,"--initial-height":C?`auto`:`${I}px`,...h,...n.style},onDragEnd:()=>{P(!1),O(null),xe.current=null},onPointerDown:e=>{e.button!==2&&!Oe&&pe&&(le.current=new Date,oe(ye.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(P(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(ne||!pe)return;xe.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-le.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Ee.includes(e>0?`right`:`left`):Ee.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=ka||a>.11))oe(ye.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ke(),re(!0);else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ae(!1),P(!1),O(null)}},onPointerMove:e=>{var t,n;if(!xe.current||!pe||window.getSelection()?.toString().length>0)return;let r=e.clientY-xe.current.y,i=e.clientX-xe.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(Ee.includes(`top`)||Ee.includes(`bottom`)){if(Ee.includes(`top`)&&r<0||Ee.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`&&(Ee.includes(`left`)||Ee.includes(`right`))){if(Ee.includes(`left`)&&i<0||Ee.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)&&ae(!0),(t=ue.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&R!==`loading`?d.createElement(`button`,{"aria-label":E,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!pe?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ja(w?.closeButton,n?.classNames?.closeButton)},T?.close??ma):null,(R||n.icon||n.promise)&&n.icon!==null&&(T?.[R]!==null||n.icon)?d.createElement(`div`,{"data-icon":``,className:ja(w?.icon,n?.classNames?.icon)},R===`loading`?n.icon||Ae():n.promise?Ae():null,R===`loading`?null:je):null,d.createElement(`div`,{"data-content":``,className:ja(w?.content,n?.classNames?.content)},d.createElement(`div`,{"data-title":``,className:ja(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?d.createElement(`div`,{"data-description":``,className:ja(y,he,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),d.isValidElement(n.cancel)?n.cancel:n.cancel&&Sa(n.cancel)?d.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{Sa(n.cancel)&&pe&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:ja(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,d.isValidElement(n.action)?n.action:n.action&&Sa(n.action)?d.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{Sa(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),e.defaultPrevented||ke())},className:ja(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Pa(){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 Fa(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ta:wa;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 Ia=d.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:f=`light`,richColors:p,duration:m,style:h,visibleToasts:g=Ca,toastOptions:_,dir:v=Pa(),gap:y=Oa,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=d.useState([]),T=d.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=d.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=d.useState([]),[k,A]=d.useState(!1),[j,M]=d.useState(!1),[N,ee]=d.useState(f===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:f),te=d.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ne=d.useRef(null),re=d.useRef(!1),ie=d.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||ya.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return d.useEffect(()=>ya.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{aa.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)]})})})}),[]),d.useEffect(()=>{if(f!==`system`){ee(f);return}if(f===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ee(`dark`):ee(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ee(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ee(e?`dark`:`light`)}catch(e){console.error(e)}})}},[f]),d.useEffect(()=>{C.length<=1&&A(!1)},[C]),d.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=te.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===te.current||te.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),d.useEffect(()=>{if(te.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,re.current=!1)}},[te.current]),d.createElement(`section`,{ref:t,"aria-label":x??`${S} ${P}`,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?d.createElement(`ol`,{key:t,dir:v===`auto`?Pa():v,tabIndex:-1,ref:te,className:c,"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":`${Da}px`,"--gap":`${y}px`,...h,...Fa(l,u)},onBlur:e=>{re.current&&!e.currentTarget.contains(e.relatedTarget)&&(re.current=!1,ne.current&&=(ne.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||re.current||(re.current=!0,ne.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)=>d.createElement(Na,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:p,duration:_?.duration??m,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:g,closeButton:_?.closeButton??s,interacting:j,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:ie,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:y,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),La=({...e})=>{let{theme:t}=ia();return(0,h.jsx)(Ia,{theme:t,className:`toaster group`,icons:{success:(0,h.jsx)(Rn,{className:`size-4`}),info:(0,h.jsx)(Mr,{className:`size-4`}),warning:(0,h.jsx)(Ii,{className:`size-4`}),error:(0,h.jsx)(Qr,{className:`size-4`}),loading:(0,h.jsx)(Rr,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e})};function Ra(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=Ra(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function za(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ra(e))&&(r&&(r+=` `),r+=t);return r}var Ba=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Va=(e,t)=>({classGroupId:e,validator:t}),Ha=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ua=`-`,Wa=[],Ga=`arbitrary..`,Ka=e=>{let t=Ya(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ja(e);let n=e.split(Ua);return qa(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ba(i,t):t:i||Wa}return n[e]||Wa}}},qa=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qa(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ua):e.slice(t).join(Ua),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ja=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ga+r:void 0})(),Ya=e=>{let{theme:t,classGroups:n}=e;return Xa(n,t)},Xa=(e,t)=>{let n=Ha();for(let r in e){let i=e[r];Za(i,n,r,t)}return n},Za=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qa(i,t,n,r)}},Qa=(e,t,n,r)=>{typeof e==`string`?$a(e,t,n):typeof e==`function`?eo(e,t,n,r):to(e,t,n,r)},$a=(e,t,n)=>{let r=e===``?t:no(t,e);r.classGroupId=n},eo=(e,t,n,r)=>{ro(e)?Za(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Va(n,e)))},to=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Za(o,no(t,a),n,r)}},no=(e,t)=>{let n=e,r=t.split(Ua),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ha(),n.nextPart.set(t,i)),n=i}return n},ro=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,io=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ao=`!`,oo=`:`,so=[],co=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),lo=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let c=e[s];if(n===0&&r===0){if(c===oo){t.push(e.slice(i,s)),i=s+1;continue}if(c===`/`){a=s;continue}}if(c===`[`)n++;else if(c===`]`)n--;else if(c===`(`)r++;else if(c===`)`)r--;else if(c===`\\`)s++;else if(c===`"`||c===`'`)for(;++s<o;){let t=e[s];if(t===`\\`)s++;else if(t===c)break}}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ao)?(c=s.slice(0,-1),l=!0):s.startsWith(ao)&&(c=s.slice(1),l=!0);let u=l&&s.startsWith(ao)?1:0,d=a&&a>i?a-i-u:void 0;return co(t,l,c,d)};if(t){let e=t+oo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):co(so,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},uo=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},fo=e=>({cache:io(e.cacheSize),parseClassName:lo(e),sortModifiers:uo(e),postfixLookupClassGroupIds:po(e),...Ka(e)}),po=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},mo=/\s+/,ho=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(mo),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ao:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},go=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=_o(n))&&(i&&(i+=` `),i+=r);return i},_o=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=_o(e[r]))&&(n&&(n+=` `),n+=t);return n},vo=(e,...t)=>{let n,r,i,a,o=o=>(n=fo(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ho(e,n);return i(e,a),a};return a=o,(...e)=>a(go(...e))},yo=[],bo=e=>{let t=t=>t[e]||yo;return t.isThemeGetter=!0,t.themeKey=e,t},xo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,So=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Co=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,To=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|Q|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^--spacing\(.+\)|^0$/,Eo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark|contrast-color|device-cmyk|--alpha)\(.+\)$/i,Do=/^(?:_*[+-]?(?:\d|\.\d)|[\w-]+\(|_*(?:inherit|initial|revert(?:-layer)?|unset)_*$)/i,Oo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ko=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ao=e=>Co.test(e),jo=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),No=e=>e.endsWith(`%`)&&jo(e.slice(0,-1)),Po=e=>wo.test(e),Fo=()=>!0,Io=e=>To.test(e)&&!Eo.test(e),Lo=e=>Do.test(e)&&!Eo.test(e),Ro=()=>!1,zo=e=>Oo.test(e),Bo=e=>ko.test(e),Vo=e=>!W(e)&&!G(e),Ho=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Uo=e=>os(e,us,Ro),W=e=>xo.test(e),Wo=e=>os(e,ds,Io),Go=e=>os(e,fs,Lo),Ko=e=>os(e,ps,jo),qo=e=>os(e,hs,Fo),Jo=e=>os(e,ms,Ro),Yo=e=>os(e,cs,Ro),Xo=e=>os(e,ls,Bo),Zo=e=>os(e,gs,zo),G=e=>So.test(e),Qo=e=>ss(e,ds),$o=e=>ss(e,fs,!0),es=e=>ss(e,ms),ts=e=>ss(e,cs),ns=e=>ss(e,us),rs=e=>ss(e,ls),is=e=>ss(e,gs,!0),as=e=>ss(e,hs,!0),os=(e,t,n)=>{let r=xo.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ss=(e,t,n=!1)=>{let r=So.exec(e);return r?r[1]?t(r[1]):n:!1},cs=e=>e===`position`||e===`percentage`,ls=e=>e===`image`||e===`url`,us=e=>e===`length`||e===`size`||e===`bg-size`,ds=e=>e===`length`,fs=e=>e!==`color`,ps=e=>e===`number`,ms=e=>e===`family-name`,hs=e=>e===`number`||e===`weight`,gs=e=>e===`shadow`,_s=vo(()=>{let e=bo(`color`),t=bo(`font`),n=bo(`text`),r=bo(`font-weight`),i=bo(`tracking`),a=bo(`leading`),o=bo(`breakpoint`),s=bo(`container`),c=bo(`spacing`),l=bo(`radius`),u=bo(`shadow`),d=bo(`inset-shadow`),f=bo(`text-shadow`),p=bo(`drop-shadow`),m=bo(`blur`),h=bo(`perspective`),g=bo(`aspect`),_=bo(`ease`),v=bo(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),G,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[G,W,c],T=()=>[Ao,`full`,`auto`,...w()],E=()=>[Mo,`none`,`subgrid`,G,W],D=()=>[`auto`,{span:[`full`,Mo,G,W]},Mo,G,W],O=()=>[Mo,`auto`,G,W],k=()=>[`auto`,`min`,`max`,`fr`,G,W],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Ao,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[s,Ao,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[Ao,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,G,W],ne=()=>[...b(),ts,Yo,{position:[G,W]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,ns,Uo,{size:[G,W]}],ae=()=>[No,Qo,Wo],F=()=>[``,`none`,`full`,l,G,W],oe=()=>[``,jo,Qo,Wo],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[jo,No,$o,Go],le=()=>[``,`none`,m,G,W],ue=()=>[`none`,jo,G,W],de=()=>[`none`,jo,G,W],L=()=>[jo,G,W],R=()=>[Ao,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Po],breakpoint:[Po],color:[Fo],container:[Po],"drop-shadow":[Po],ease:[`in`,`out`,`in-out`],font:[Vo],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Po],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Po],shadow:[Po],spacing:[`px`,jo],text:[Po],"text-shadow":[Po],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ao,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[Ho],columns:[{columns:[jo,`auto`,W,G,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`],"not-sr":[`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Mo,`auto`,G,W]}],basis:[{basis:[Ao,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[jo,Ao,`auto`,`initial`,`none`,G,W]}],grow:[{grow:[``,jo,G,W]}],shrink:[{shrink:[``,jo,G,W]}],order:[{order:[Mo,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Qo,Wo]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,as,qo]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,No,W]}],"font-family":[{font:[es,Jo,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,G,W]}],"line-clamp":[{"line-clamp":[jo,`none`,G,W]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[jo,`from-font`,`auto`,Qo,ts,Wo]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[jo,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Mo,G,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Mo,G,W],radial:[``,G,W],conic:[``,Mo,G,W]},rs,Xo]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[jo,G,W]}],"outline-w":[{outline:[``,jo,Qo,Wo]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,is,Zo]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,is,Zo]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[jo,Wo]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,is,Zo]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[jo,G,W]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[jo]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{mask:[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[jo]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:le()}],brightness:[{brightness:[jo,G,W]}],contrast:[{contrast:[jo,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,is,Zo]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,jo,G,W]}],"hue-rotate":[{"hue-rotate":[jo,G,W]}],invert:[{invert:[``,jo,G,W]}],saturate:[{saturate:[jo,G,W]}],sepia:[{sepia:[``,jo,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[jo,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[jo,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,jo,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jo,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,jo,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[jo,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[jo,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,jo,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[jo,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[jo,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":[`translate-none`],zoom:[{zoom:[Mo,G,W]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,G,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,G,W]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[jo,Qo,Wo,Ko]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],"place-content":[`align-content`,`justify-content`],"place-items":[`align-items`,`justify-items`],"place-self":[`align-self`,`justify-self`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],sr:`not-sr.position.size.w.h.p.px.py.ps.pe.pbs.pbe.pt.pr.pb.pl.m.mx.my.ms.me.mbs.mbe.mt.mr.mb.ml.overflow.overflow-x.overflow-y.whitespace`.split(`.`),"not-sr":[`sr`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],"mask-image-x-from-pos":[`mask-image-r-from-pos`,`mask-image-l-from-pos`],"mask-image-x-to-pos":[`mask-image-r-to-pos`,`mask-image-l-to-pos`],"mask-image-x-from-color":[`mask-image-r-from-color`,`mask-image-l-from-color`],"mask-image-x-to-color":[`mask-image-r-to-color`,`mask-image-l-to-color`],"mask-image-y-from-pos":[`mask-image-t-from-pos`,`mask-image-b-from-pos`],"mask-image-y-to-pos":[`mask-image-t-to-pos`,`mask-image-b-to-pos`],"mask-image-y-from-color":[`mask-image-t-from-color`,`mask-image-b-from-color`],"mask-image-y-to-color":[`mask-image-t-to-color`,`mask-image-b-to-color`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function K(...e){return _s(za(e))}var vs=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform)?`⌘`:`Ctrl`,ys=Object.defineProperty,bs=(e,t)=>ys(e,`name`,{value:t,configurable:!0});function xs(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}bs(xs,`setRef`);function Ss(...e){return t=>{let n=!1,r=e.map(e=>{let r=xs(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():xs(e[t],null)}}}}bs(Ss,`composeRefs`);function Cs(...e){return d.useCallback(Ss(...e),e)}bs(Cs,`useComposedRefs`);var ws=Object.defineProperty,Ts=(e,t)=>ws(e,`name`,{value:t,configurable:!0});function Es(e){let t=d.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Ls(r),d.Children.forEach(r,e=>{if(Ns(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Fs(n)&&typeof Vs==`function`;)n=Vs(n._payload);a=As(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=d.cloneElement(a,void 0,s):!o&&d.Children.count(r)===1&&d.isValidElement(r)&&(a=r);let c=a?Ms(a):void 0,l=Cs(n,c);if(!a){if(r||r===0)throw Error(o?Bs(e):zs(e));return r}let u=js(i,a.props??{});return a.type!==d.Fragment&&(u.ref=n?l:c),d.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Ts(Es,`createSlot`);var Ds=Es(`Slot`),Os=Symbol.for(`radix.slottable`);function ks(e){let t=Ts(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Os,t}Ts(ks,`createSlottable`);var As=Ts((e,t)=>`child`in e.props?d.isValidElement(t)?d.cloneElement(t,void 0,e.props.children(t.props.children)):null:d.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function js(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Rs(a,i))}return{...e,...n}}Ts(js,`mergeProps`);function Ms(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ts(Ms,`getElementRef`);function Ns(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Os}Ts(Ns,`isSlottable`);var Ps=Symbol.for(`react.lazy`);function Fs(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ps&&`_payload`in e&&Is(e._payload)}Ts(Fs,`isLazyComponent`);function Is(e){return typeof e==`object`&&!!e&&`then`in e}Ts(Is,`isPromiseLike`);function Ls(e){let t=e;for(;Fs(t)&&typeof Vs==`function`;)t=Vs(t._payload);return t}Ts(Ls,`useUnwrappedLazy`);function Rs(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ts(Rs,`concatAriaDescribedby`);var zs=Ts(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Bs=Ts(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Vs=d.use,Hs=Object.defineProperty,Us=(e,t)=>Hs(e,`name`,{value:t,configurable:!0}),q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Es(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,h.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ws(e,t){e&&aa.flushSync(()=>e.dispatchEvent(t))}Us(Ws,`dispatchDiscreteCustomEvent`);var Gs=Object.defineProperty,Ks=(e,t)=>Gs(e,`name`,{value:t,configurable:!0}),qs=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Js=d.forwardRef(Ks(function(e,t){return(0,h.jsx)(q.span,{...e,ref:t,style:{...qs,...e.style}})},`VisuallyHidden`)),Ys=Object.defineProperty,Xs=(e,t)=>Ys(e,`name`,{value:t,configurable:!0});function Zs(e,t){let n=d.createContext(t);n.displayName=e+`Context`;let r=Xs(e=>{let{children:t,...r}=e,i=d.useMemo(()=>r,Object.values(r));return(0,h.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=d.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Xs(i,`useContext`),[r,i]}Xs(Zs,`createContext`);function Qs(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Xs(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,h.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=d.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Xs(s,`useContext`),[o,s]}Xs(r,`createContext`);let i=Xs(()=>{let t=n.map(e=>d.createContext(e));return Xs(function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,$s(i,...t)]}Xs(Qs,`createContextScope`);function $s(...e){let t=e[0];if(e.length===1)return t;let n=Xs(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Xs(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Xs($s,`composeContextScopes`);var ec=globalThis?.document?d.useLayoutEffect:()=>{},tc=Object.defineProperty,nc=(e,t)=>tc(e,`name`,{value:t,configurable:!0});function rc(e){let t=e+`CollectionProvider`,[n,r]=Qs(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=nc(e=>{let{scope:t,children:n}=e,r=d.useRef(null),a=d.useRef(new Map).current;return(0,h.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Es(s),l=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Cs(t,a(s,n).collectionRef);return(0,h.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Es(u),m=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),s=Cs(t,o),c=a(u,n);return d.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,h.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=u;function g(t){let n=a(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return nc(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},g,r]}nc(rc,`createCollection`);var ic=new WeakMap,ac=class e extends Map{static{nc(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ic.set(this,!0)}set(e,t){return ic.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=cc(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=oc(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=oc(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return oc(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function oc(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=sc(e,t);return n===-1?void 0:e[n]}nc(oc,`at`);function sc(e,t){let n=e.length,r=cc(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}nc(sc,`toSafeIndex`);function cc(e){return e!==e||e===0?0:Math.trunc(e)}nc(cc,`toSafeInteger`);function lc(e){let t=e+`CollectionProvider`,[n,r]=Qs(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=nc(({state:e,...t})=>e?(0,h.jsx)(u,{...t,state:e}):(0,h.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=nc(e=>{let t=y();return(0,h.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=nc(e=>{let{scope:t,children:n,state:r}=e,a=d.useRef(null),[s,c]=d.useState(null),l=Cs(a,c),[u,f]=r,p=d.useRef(new ac),m=d.useCallback(()=>{let e=p.current;return fc(e)||e.sort(pc),e},[]);return d.useEffect(()=>{if(!s)return;let e=mc(()=>{f(e=>{let t=e.toSorted(pc);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,f]),(0,h.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,h.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Es(f),m=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Cs(t,a(f,n).collectionElementRef);return(0,h.jsx)(p,{ref:i,children:r})});m.displayName=f;let g=e+`CollectionItemSlot`,_=Es(g),v=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),{setCollection:s,registryRef:c}=a(g,n),l=d.useRef(i);uc(l.current,i)||(l.current=i);let u=l.current,f=Cs(t,d.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);ec(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let p=d.useRef(null);return d.useEffect(()=>{let e=o.current,t=p.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(p.current=e?{element:e,itemData:u}:null,s(n=>{let r=new ac(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(pc)}))}),d.useEffect(()=>()=>{let e=p.current;p.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new ac(t);return n.delete(e.element),n})},[s]),(0,h.jsx)(_,{"data-radix-collection-item":``,ref:f,children:r})});v.displayName=g;function y(){return d.useState(new ac)}nc(y,`useInitCollection`);function b(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}nc(b,`useCollection`);function x(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return nc(x,`useGetCollection`),[{Provider:c,Slot:m,ItemSlot:v},{createCollectionScope:r,useCollection:b,useGetCollection:x,useInitCollection:y}]}nc(lc,`createCollection`);function uc(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}nc(uc,`shallowEqual`);function dc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}nc(dc,`isElementPreceding`);function fc(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}nc(fc,`isInDocumentOrder`);function pc(e,t){return!e[1].element||!t[1].element?0:dc(e[1].element,t[1].element)?-1:1}nc(pc,`sortByDocumentPosition`);function mc(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}nc(mc,`getChildListObserver`);var hc=Object.defineProperty,gc=(e,t)=>hc(e,`name`,{value:t,configurable:!0}),_c=!!(typeof window<`u`&&window.document&&window.document.createElement);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return gc(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}gc(J,`composeEventHandlers`);function vc(e){if(!_c)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}gc(vc,`getOwnerWindow`);function yc(e){if(!_c)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}gc(yc,`getOwnerDocument`);function bc(e,t=!1){let{activeElement:n}=yc(e);if(!n?.nodeName)return null;if(xc(n)&&n.contentDocument)return bc(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=yc(n).getElementById(e);if(t)return t}}return n}gc(bc,`getActiveElement`);function xc(e){return e.tagName===`IFRAME`}gc(xc,`isFrame`);var Sc=Object.defineProperty,Cc=(e,t)=>Sc(e,`name`,{value:t,configurable:!0}),wc=d.useEffectEvent,Tc=d.useInsertionEffect;function Ec(e){if(typeof wc==`function`)return wc(e);let t=d.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Tc==`function`?Tc(()=>{t.current=e}):ec(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}Cc(Ec,`useEffectEvent`);var Dc=Object.defineProperty,Oc=(e,t)=>Dc(e,`name`,{value:t,configurable:!0}),kc=d.useInsertionEffect||ec;function Ac({prop:e,defaultProp:t,onChange:n=Oc(()=>{},`onChange`),caller:r}){let[i,a,o]=jc({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,d.useCallback(t=>{if(s){let n=Mc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Oc(Ac,`useControllableState`);function jc({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return kc(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Oc(jc,`useUncontrolledState`);function Mc(e){return typeof e==`function`}Oc(Mc,`isFunction`);var Nc=Symbol(`RADIX:SYNC_STATE`);function Pc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ec(o),u=[{...n,state:a}];r&&u.push(r);let[f,p]=d.useReducer((t,n)=>{if(n.type===Nc)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=f.state,h=d.useRef(m);d.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=d.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return d.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Nc,state:i})},[i,f.state,c]),[g,p]}Oc(Pc,`useControllableStateReducer`);var Fc=Object.defineProperty,Ic=(e,t)=>Fc(e,`name`,{value:t,configurable:!0});function Lc(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}Ic(Lc,`useStateMachine`);var Rc=Ic(e=>{let{present:t,children:n}=e,r=zc(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=Vc(r.ref,Uc(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null},`Presence`);function zc(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),o=d.useRef(void 0),[s,c]=Lc(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{s===`mounted`?(a.current=o.current??Hc(r.current),o.current=void 0):a.current=`none`},[s]),ec(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Hc(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),ec(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ic(a=>{let o=Hc(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ic(e=>{e.target===t&&(a.current=Hc(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:d.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Hc(t)}else r.current=null;n(e)},[])}}Ic(zc,`usePresence`);function Bc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ic(Bc,`setRef`);function Vc(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Bc(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Bc(n[e],null)}}},[])}Ic(Vc,`useStableComposedRefs`);function Hc(e){return e?.animationName||`none`}Ic(Hc,`getAnimationName`);function Uc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ic(Uc,`getElementRef`);var Wc=Object.defineProperty,Gc=(e,t)=>Wc(e,`name`,{value:t,configurable:!0}),Kc=d.useId||(()=>void 0),qc=0;function Jc(e){let[t,n]=d.useState(Kc());return ec(()=>{e||n(e=>e??String(qc++))},[e]),e||(t?`radix-${t}`:``)}Gc(Jc,`useId`);var Yc=Object.defineProperty,Xc=(e,t)=>Yc(e,`name`,{value:t,configurable:!0}),Zc=`Collapsible`,[Qc,$c]=Qs(Zc),[el,tl]=Qc(Zc),nl=d.forwardRef(Xc(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Ac({prop:r,defaultProp:i??!1,onChange:o,caller:Zc});return(0,h.jsx)(el,{scope:n,disabled:a,contentId:Jc(),open:c,onOpenToggle:d.useCallback(()=>l(e=>!e),[l]),children:(0,h.jsx)(q.div,{"data-state":cl(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),rl=`CollapsibleTrigger`,il=d.forwardRef(Xc(function(e,t){let{__scopeCollapsible:n,...r}=e,i=tl(rl,n);return(0,h.jsx)(q.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":cl(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:J(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),al=`CollapsibleContent`,ol=d.forwardRef(Xc(function(e,t){let{forceMount:n,...r}=e,i=tl(al,e.__scopeCollapsible);return(0,h.jsx)(Rc,{present:n||i.open,children:({present:e})=>(0,h.jsx)(sl,{...r,ref:t,present:e})})},`CollapsibleContent`)),sl=d.forwardRef(Xc(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=tl(al,n),[s,c]=d.useState(r),l=d.useRef(null),u=Cs(t,l),f=d.useRef(0),p=f.current,m=d.useRef(0),g=m.current,_=o.open||s,v=d.useRef(_),y=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),ec(()=>{let e=l.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),c(r)}},[o.open,r]),(0,h.jsx)(q.div,{"data-state":cl(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!_,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&i})},`CollapsibleContentImpl`));function cl(e){return e?`open`:`closed`}Xc(cl,`getState`);var ll=Object.defineProperty,ul=(e,t)=>ll(e,`name`,{value:t,configurable:!0}),dl={LTR:`ltr`,RTL:`rtl`},fl=d.createContext(void 0);function pl(e){let t=d.useContext(fl);return e||t||dl.LTR}ul(pl,`useDirection`);var ml=Object.defineProperty,hl=(e,t)=>ml(e,`name`,{value:t,configurable:!0}),gl=d.useInsertionEffect;function _l(e){let t=d.useRef(e);return typeof gl==`function`?gl(()=>{t.current=e}):ec(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}hl(_l,`useCallbackRef`);var vl=Object.defineProperty,yl=(e,t)=>vl(e,`name`,{value:t,configurable:!0}),bl=`dismissableLayer.update`,xl=`dismissableLayer.pointerDownOutside`,Sl=`dismissableLayer.focusOutside`,Cl,wl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tl=d.forwardRef(yl(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=d.useContext(wl),[f,p]=d.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=d.useState({}),_=Cs(t,p),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=f?v.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=d.useRef(!1),T=Ol(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:d.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=kl(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),D=f?x===v.length-1:!1,O=_l(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return d.useEffect(()=>{if(D)return m.addEventListener(`keydown`,O,{capture:!0}),()=>m.removeEventListener(`keydown`,O,{capture:!0})},[m,D,O]),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Cl=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Al(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(f),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Cl))}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Al())},[f,u]),d.useEffect(()=>{let e=yl(()=>g({}),`handleUpdate`);return document.addEventListener(bl,e),()=>document.removeEventListener(bl,e)},[]),(0,h.jsx)(q.div,{...l,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:J(e.onFocusCapture,E.onFocusCapture),onBlurCapture:J(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function El(){let e=d.useContext(wl),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}yl(El,`useDismissableLayerSurface`);var Dl=yl(()=>!0,`IS_TRUE`);function Ol(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Dl}=t,s=_l(e),c=d.useRef(!1),l=d.useRef(!1),u=d.useRef(new Map),f=d.useRef(()=>{});return d.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}yl(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}yl(t,`isOutsideInteractionIntercepted`);function d(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}yl(d,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}yl(p,`handleInteractionBubble`);let m=yl(a=>{if(a.target&&!c.current){let d=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||jl(xl,s,p,{discrete:!0})};if(yl(d,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?d():(n.removeEventListener(`click`,f.current),f.current=d,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,d,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,d,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:yl(()=>c.current=!0,`onPointerDownCapture`)}}yl(Ol,`usePointerDownOutside`);function kl(e,t=globalThis?.document){let n=_l(e),r=d.useRef(!1);return d.useEffect(()=>{let e=yl(e=>{e.target&&!r.current&&jl(Sl,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:yl(()=>r.current=!0,`onFocusCapture`),onBlurCapture:yl(()=>r.current=!1,`onBlurCapture`)}}yl(kl,`useFocusOutside`);function Al(){let e=new CustomEvent(bl);document.dispatchEvent(e)}yl(Al,`dispatchUpdate`);function jl(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ws(i,a):i.dispatchEvent(a)}yl(jl,`handleAndDispatchCustomEvent`);var Ml=Object.defineProperty,Nl=(e,t)=>Ml(e,`name`,{value:t,configurable:!0}),Pl=`focusScope.autoFocusOnMount`,Fl=`focusScope.autoFocusOnUnmount`,Il={bubbles:!1,cancelable:!0},Ll=d.forwardRef(Nl(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=d.useState(null),u=_l(a),f=_l(o),p=d.useRef(null),m=Cs(t,l),g=d.useRef(i);d.useEffect(()=>{g.current=i});let _=d.useCallback(e=>e?c?.contains(e)?!0:!!g.current?.some(t=>t.contains(e)):!1,[c]),v=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(v.paused||!c)return;let t=e.target;_(t)?p.current=t:Jl(p.current,{select:!0})},t=function(e){if(v.paused||!c)return;let t=e.relatedTarget;t!==null&&(_(t)||Jl(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Jl(c)};Nl(e,`handleFocusIn`),Nl(t,`handleFocusOut`),Nl(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,v.paused,_]),d.useEffect(()=>{if(c){Yl.add(v);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Pl,Il);c.addEventListener(Pl,u),c.dispatchEvent(t),t.defaultPrevented||(Hl(Ql(Wl(c)),{select:!0}),document.activeElement===e&&Jl(c))}return()=>{c.removeEventListener(Pl,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Fl,Il);c.addEventListener(Fl,f),c.dispatchEvent(r),r.defaultPrevented||Jl(e??t.body,{select:!0}),c.removeEventListener(Fl,f),Yl.remove(v)},0)}}},[c,u,f,v]);let y=d.useCallback(e=>{if(!n&&!r||v.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ul(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Jl(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Jl(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,v.paused]);return(0,h.jsx)(q.div,{tabIndex:-1,...s,ref:m,onKeyDown:y})},`FocusScope`)),Rl=d.createContext(null);function zl({registry:e,children:t}){return e?(0,h.jsx)(Rl.Provider,{value:e,children:t}):t}Nl(zl,`FocusScopeBranchProvider`);function Bl(){let[e,t]=d.useState([]);return{nodes:e,registry:d.useMemo(()=>({add:Nl(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Nl(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Nl(Bl,`useFocusScopeBranchRegistry`);function Vl(e){let t=d.useContext(Rl);d.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Nl(Vl,`useFocusScopeBranch`);function Hl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Jl(r,{select:t}),document.activeElement!==n)return}Nl(Hl,`focusFirst`);function Ul(e){let t=Wl(e);return[Gl(t,e),Gl(t.reverse(),e)]}Nl(Ul,`getTabbableEdges`);function Wl(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Nl(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Nl(Wl,`getTabbableCandidates`);function Gl(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Kl(r,{upTo:t})))return r}Nl(Gl,`findVisible`);function Kl(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Nl(Kl,`isHidden`);function ql(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Nl(ql,`isSelectableInput`);function Jl(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&ql(e)&&t&&e.select()}}Nl(Jl,`focus`);var Yl=Xl();function Xl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Zl(e,t),e.unshift(t)},remove(t){e=Zl(e,t),e[0]?.resume()}}}Nl(Xl,`createFocusScopesStack`);function Zl(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Nl(Zl,`arrayRemove`);function Ql(e){return e.filter(e=>e.tagName!==`A`)}Nl(Ql,`removeLinks`);var $l=Object.defineProperty,eu=d.forwardRef(((e,t)=>$l(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=d.useState(!1);ec(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?aa.createPortal((0,h.jsx)(q.div,{...r,ref:t}),o):null},`Portal`)),tu=Object.defineProperty,nu=(e,t)=>tu(e,`name`,{value:t,configurable:!0}),ru=0,iu=null;function au(e){return ou(),e.children}nu(au,`FocusGuards`);function ou(){d.useEffect(()=>{iu||={start:su(),end:su()};let{start:e,end:t}=iu;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ru++,()=>{ru===1&&(iu?.start.remove(),iu?.end.remove(),iu=null),ru=Math.max(0,ru-1)}},[])}nu(ou,`useFocusGuards`);function su(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}nu(su,`createFocusGuard`);var cu=function(){return cu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cu.apply(this,arguments)};function lu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function uu(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var du=`right-scroll-bar-position`,fu=`width-before-scroll-bar`,pu=`with-scroll-bars-hidden`,mu=`--removed-body-scroll-bar-size`;function hu(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function gu(e,t){var n=(0,d.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var _u=typeof window<`u`?d.useLayoutEffect:d.useEffect,vu=new WeakMap;function yu(e,t){var n=gu(t||null,function(t){return e.forEach(function(e){return hu(e,t)})});return _u(function(){var t=vu.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||hu(e,null)}),i.forEach(function(e){r.has(e)||hu(e,a)})}vu.set(n,e)},[e]),n}function bu(e){return e}function xu(e,t){t===void 0&&(t=bu);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Su(e){e===void 0&&(e={});var t=xu(null);return t.options=cu({async:!0,ssr:!1},e),t}var Cu=function(e){var t=e.sideCar,n=lu(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return d.createElement(r,cu({},n))};Cu.isSideCarExport=!0;function wu(e,t){return e.useMedium(t),Cu}var Tu=Su(),Eu=function(){},Du=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Eu,onWheelCapture:Eu,onTouchMoveCapture:Eu}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=lu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=yu([n,t]),w=cu(cu({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:Tu,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),cu(cu({},w),{ref:C})):d.createElement(y,cu({},w,{className:c,ref:C}),s))});Du.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Du.classNames={fullWidth:fu,zeroRight:du};var Ou=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ku(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ou();return t&&e.setAttribute(`nonce`,t),e}function Au(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ju(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Mu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ku())&&(Au(t,n),ju(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Nu=function(){var e=Mu();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pu=function(){var e=Nu();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Fu={left:0,top:0,right:0,gap:0},Iu=function(e){return parseInt(e||``,10)||0},Lu=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Iu(n),Iu(r),Iu(i)]},Ru=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Fu;var t=Lu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},zu=Pu(),Bu=`data-scroll-locked`,Vu=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
10
|
+
.${pu} {
|
|
11
|
+
overflow: hidden ${r};
|
|
12
|
+
padding-right: ${s}px ${r};
|
|
13
|
+
}
|
|
14
|
+
body[${Bu}] {
|
|
15
|
+
overflow: hidden ${r};
|
|
16
|
+
overscroll-behavior: contain;
|
|
17
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
18
|
+
padding-left: ${i}px;
|
|
19
|
+
padding-top: ${a}px;
|
|
20
|
+
padding-right: ${o}px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: ${s}px ${r};
|
|
24
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${du} {
|
|
28
|
+
right: ${s}px ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${fu} {
|
|
32
|
+
margin-right: ${s}px ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.${du} .${du} {
|
|
36
|
+
right: 0 ${r};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.${fu} .${fu} {
|
|
40
|
+
margin-right: 0 ${r};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[${Bu}] {
|
|
44
|
+
${mu}: ${s}px;
|
|
45
|
+
}
|
|
46
|
+
`},Hu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Uu=function(){d.useEffect(function(){return document.body.setAttribute(Bu,(Hu()+1).toString()),function(){var e=Hu()-1;e<=0?document.body.removeAttribute(Bu):document.body.setAttribute(Bu,e.toString())}},[])},Wu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Uu();var a=d.useMemo(function(){return Ru(i)},[i]);return d.createElement(zu,{styles:Vu(a,!t,i,n?``:`!important`)})},Gu=!1;if(typeof window<`u`)try{var Ku=Object.defineProperty({},"passive",{get:function(){return Gu=!0,!0}});window.addEventListener(`test`,Ku,Ku),window.removeEventListener(`test`,Ku,Ku)}catch{Gu=!1}var qu=Gu?{passive:!1}:!1,Ju=function(e){return e.tagName===`TEXTAREA`},Yu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ju(e)&&n[t]===`visible`)},Xu=function(e){return Yu(e,`overflowY`)},Zu=function(e){return Yu(e,`overflowX`)},Qu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),td(e,r)){var i=nd(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$u=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ed=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},td=function(e,t){return e===`v`?Xu(t):Zu(t)},nd=function(e,t){return e===`v`?$u(t):ed(t)},rd=function(e,t){return e===`h`&&t===`rtl`?-1:1},id=function(e,t,n,r,i){var a=rd(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=nd(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&td(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ad=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},od=function(e){return[e.deltaX,e.deltaY]},sd=function(e){return e&&`current`in e?e.current:e},cd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ld=function(e){return`
|
|
47
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
|
+
`},ud=0,dd=[];function fd(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),i=d.useState(ud++)[0],a=d.useState(Pu)[0],o=d.useRef(e);d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=uu([e.lockRef.current],(e.shards||[]).map(sd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=d.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ad(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Qu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Qu(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return id(h,t,e,h===`h`?s:c,!0)},[]),c=d.useCallback(function(e){var n=e;if(dd.length&&dd[dd.length-1]===a){var r=`deltaY`in n?od(n):ad(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&cd(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(sd).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=d.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:pd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=d.useCallback(function(e){n.current=ad(e),r.current=void 0},[]),f=d.useCallback(function(t){l(t.type,od(t),t.target,s(t,e.lockRef.current))},[]),p=d.useCallback(function(t){l(t.type,ad(t),t.target,s(t,e.lockRef.current))},[]);d.useEffect(function(){return dd.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,qu),document.addEventListener(`touchmove`,c,qu),document.addEventListener(`touchstart`,u,qu),function(){dd=dd.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,qu),document.removeEventListener(`touchmove`,c,qu),document.removeEventListener(`touchstart`,u,qu)}},[]);var m=e.removeScrollBar,h=e.inert;return d.createElement(d.Fragment,null,h?d.createElement(a,{styles:ld(i)}):null,m?d.createElement(Wu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var md=wu(Tu,fd),hd=d.forwardRef(function(e,t){return d.createElement(Du,cu({},e,{ref:t,sideCar:md}))});hd.classNames=Du.classNames;var gd=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},_d=new WeakMap,vd=new WeakMap,yd={},bd=0,xd=function(e){return e&&(e.host||xd(e.parentNode))},Sd=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=xd(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Cd=function(e,t,n,r){var i=Sd(t,Array.isArray(e)?e:[e]);yd[n]||(yd[n]=new WeakMap);var a=yd[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(_d.get(e)||0)+1,l=(a.get(e)||0)+1;_d.set(e,c),a.set(e,l),o.push(e),c===1&&i&&vd.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),bd++,function(){o.forEach(function(e){var t=_d.get(e)-1,i=a.get(e)-1;_d.set(e,t),a.set(e,i),t||(vd.has(e)||e.removeAttribute(r),vd.delete(e)),i||e.removeAttribute(n)}),bd--,bd||(_d=new WeakMap,_d=new WeakMap,vd=new WeakMap,yd={})}},wd=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||gd(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Cd(r,i,n,`aria-hidden`)):function(){return null}},Td=Object.defineProperty,Ed=(e,t)=>Td(e,`name`,{value:t,configurable:!0}),Dd=`Dialog`,[Od,kd]=Qs(Dd),[Ad,jd]=Od(Dd),Md=Ed(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=d.useRef(null),c=d.useRef(null),{nodes:l,registry:u}=Bl(),[f,p]=Ac({prop:r,defaultProp:i??!1,onChange:a,caller:Dd}),[m,g]=d.useState(0),[_,v]=d.useState(0);return(0,h.jsx)(Ad,{scope:t,triggerRef:s,contentRef:c,contentId:Jc(),titleId:Jc(),descriptionId:Jc(),titlePresent:m>0,descriptionPresent:_>0,setTitleCount:g,setDescriptionCount:v,open:f,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(e=>!e),[p]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Nd=`DialogTrigger`,Pd=d.forwardRef(Ed(function(e,t){let{__scopeDialog:n,...r}=e,i=jd(Nd,n),a=Cs(t,i.triggerRef);return(0,h.jsx)(q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":$d(i.open),...r,ref:a,onClick:J(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Fd=`DialogPortal`,[Id,Ld]=Od(Fd,{forceMount:void 0}),Rd=Ed(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=jd(Fd,t);return(0,h.jsx)(Id,{scope:t,forceMount:n,children:d.Children.map(r,e=>(0,h.jsx)(Rc,{present:n||a.open,children:(0,h.jsx)(eu,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),zd=`DialogOverlay`,Bd=d.forwardRef(Ed(function(e,t){let n=Ld(zd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jd(zd,e.__scopeDialog);return a.modal?(0,h.jsx)(Rc,{present:r||a.open,children:(0,h.jsx)(Hd,{...i,ref:t})}):null},`DialogOverlay`)),Vd=Es(`DialogOverlay.RemoveScroll`),Hd=d.forwardRef(Ed(function(e,t){let{__scopeDialog:n,...r}=e,i=jd(zd,n),a=Cs(t,El());return(0,h.jsx)(hd,{as:Vd,allowPinchZoom:!0,shards:d.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,h.jsx)(q.div,{"data-state":$d(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Ud=`DialogContent`,Wd=d.forwardRef(Ed(function(e,t){let n=Ld(Ud,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jd(Ud,e.__scopeDialog);return(0,h.jsx)(Rc,{present:r||a.open,children:a.modal?(0,h.jsx)(Gd,{...i,ref:t}):(0,h.jsx)(Kd,{...i,ref:t})})},`DialogContent`)),Gd=d.forwardRef(Ed(function(e,t){let n=jd(Ud,e.__scopeDialog),r=d.useRef(null),i=Cs(t,n.contentRef,r);return d.useEffect(()=>{let e=r.current;if(e)return wd(e)},[]),(0,h.jsx)(qd,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Kd=d.forwardRef(Ed(function(e,t){let n=jd(Ud,e.__scopeDialog),r=d.useRef(!1),i=d.useRef(!1);return(0,h.jsx)(qd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),qd=d.forwardRef(Ed(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=jd(Ud,n);return ou(),(0,h.jsx)(zl,{registry:l.branchRegistry,children:(0,h.jsx)(Ll,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(Tl,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Qd(o,l.descriptionId):o,"data-state":$d(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Jd=d.forwardRef(Ed(function(e,t){let{__scopeDialog:n,...r}=e,i=jd(`DialogTitle`,n),{setTitleCount:a}=i;return ec(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,h.jsx)(q.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Yd=d.forwardRef(Ed(function(e,t){let{__scopeDialog:n,...r}=e,i=jd(`DialogDescription`,n),{setDescriptionCount:a}=i;return ec(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,h.jsx)(q.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Xd=`DialogClose`,Zd=d.forwardRef(Ed(function(e,t){let{__scopeDialog:n,...r}=e,i=jd(Xd,n);return(0,h.jsx)(q.button,{type:`button`,...r,ref:t,onClick:J(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Qd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ed(Qd,`concatAriaDescribedby`);function $d(e){return e?`open`:`closed`}Ed($d,`getState`);var ef=Object.defineProperty,tf=(e,t)=>ef(e,`name`,{value:t,configurable:!0}),[nf,rf]=Qs(`AlertDialog`,[kd]),af=kd(),of=tf(e=>{let{__scopeAlertDialog:t,...n}=e,r=af(t);return(0,h.jsx)(Md,{...r,...n,modal:!0})},`AlertDialog`);d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=af(n);return(0,h.jsx)(Pd,{...i,...r,ref:t})},`AlertDialogTrigger`));var sf=tf(e=>{let{__scopeAlertDialog:t,...n}=e,r=af(t);return(0,h.jsx)(Rd,{...r,...n})},`AlertDialogPortal`),cf=d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=af(n);return(0,h.jsx)(Bd,{...i,...r,ref:t})},`AlertDialogOverlay`)),[lf,uf]=nf(`AlertDialogContent`),df=d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=af(n),o=Cs(t,d.useRef(null)),s=d.useRef(null);return(0,h.jsx)(lf,{scope:n,cancelRef:s,children:(0,h.jsx)(Wd,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:J(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),ff=d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=af(n);return(0,h.jsx)(Jd,{...i,...r,ref:t})},`AlertDialogTitle`)),pf=d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=af(n);return(0,h.jsx)(Yd,{...i,...r,ref:t})},`AlertDialogDescription`)),mf=d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=af(n);return(0,h.jsx)(Zd,{...i,...r,ref:t})},`AlertDialogAction`)),hf=`AlertDialogCancel`,gf=d.forwardRef(tf(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=uf(hf,n),a=af(n),o=Cs(t,i);return(0,h.jsx)(Zd,{...a,...r,ref:o})},`AlertDialogCancel`)),_f=Object.defineProperty,vf=(e,t)=>_f(e,`name`,{value:t,configurable:!0});function yf(e){let[t,n]=d.useState(void 0);return ec(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}vf(yf,`useSize`);var bf=Object.defineProperty,xf=(e,t)=>bf(e,`name`,{value:t,configurable:!0}),Sf=`Checkbox`,[Cf,wf]=Qs(Sf),[Tf,Ef]=Cf(Sf);function Df(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:f}=e,[p,m]=Ac({prop:n,defaultProp:i??!1,onChange:c,caller:Sf}),[g,_]=d.useState(null),[v,y]=d.useState(null),[b,x]=d.useState(null),S=!g||!!o||!!g.closest(`form`),C={checked:p,disabled:a,setChecked:m,control:g,setControl:_,name:s,form:o,value:u,userClick:b,onUserClick:x,required:l,defaultChecked:!If(i)&&i,isFormControl:S,bubbleInput:v,setBubbleInput:y};return(0,h.jsx)(Tf,{scope:t,...C,children:Ff(f)?f(C):r})}xf(Df,`CheckboxProvider`);var Of=`CheckboxTrigger`,kf=d.forwardRef(xf(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:f,onUserClick:p,isFormControl:m,bubbleInput:g}=Ef(Of,e),_=Cs(i,u),v=d.useRef(c);return d.useEffect(()=>{let e=a?.form;if(e){let t=xf(()=>f(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,f]),(0,h.jsx)(q.button,{type:`button`,role:`checkbox`,"aria-checked":If(c)?`mixed`:c,"aria-required":l,"data-state":Lf(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:J(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:J(n,e=>{let t=e.isPropagationStopped();p({requestedChecked:If(c)?!0:!c,hasConsumerStoppedPropagation:t}),f(e=>If(e)?!0:!e),g&&m&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),Af=d.forwardRef(xf(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,h.jsx)(Df,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(kf,{...d,ref:t,__scopeCheckbox:n}),e&&(0,h.jsx)(Pf,{__scopeCheckbox:n})]})})},`Checkbox`)),jf=`CheckboxIndicator`,Mf=d.forwardRef(xf(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Ef(jf,n);return(0,h.jsx)(Rc,{present:r||If(a.checked)||a.checked===!0,children:(0,h.jsx)(q.span,{"data-state":Lf(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Nf=`CheckboxBubbleInput`,Pf=d.forwardRef(xf(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:f,form:p,bubbleInput:m,setBubbleInput:g}=Ef(Nf,e),_=Cs(r,g),v=yf(i),y=d.useRef(!1),b=d.useRef(o),x=d.useRef(a),S=d.useRef(null);d.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==o;b.current=o;let i=a!==null&&a!==x.current;if(x.current=a,i)S.current=r?null:a,r&&(e.indeterminate=If(o),n.call(e,!If(o)&&o)),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===o;y.current=!0,e.indeterminate=If(o),n.call(e,!If(o)&&o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[m,o,a]);let C=d.useRef(!If(o)&&o);return(0,h.jsx)(q.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??C.current,required:c,disabled:l,name:u,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:J(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Ff(e){return typeof e==`function`}xf(Ff,`isFunction`);function If(e){return e===`indeterminate`}xf(If,`isIndeterminate`);function Lf(e){return If(e)?`indeterminate`:e?`checked`:`unchecked`}xf(Lf,`getState`);var Rf=[`top`,`right`,`bottom`,`left`],zf=Math.min,Bf=Math.max,Vf=Math.round,Hf=Math.floor,Uf=e=>({x:e,y:e}),Wf={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Gf(e,t,n){return Bf(e,zf(t,n))}function Kf(e,t){return typeof e==`function`?e(t):e}function qf(e){return e.split(`-`)[0]}function Jf(e){return e.split(`-`)[1]}function Yf(e){return e===`x`?`y`:`x`}function Xf(e){return e===`y`?`height`:`width`}function Zf(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Qf(e){return Yf(Zf(e))}function $f(e,t,n){n===void 0&&(n=!1);let r=Jf(e),i=Qf(e),a=Xf(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=cp(o)),[o,cp(o)]}function ep(e){let t=cp(e);return[tp(e),t,tp(t)]}function tp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var np=[`left`,`right`],rp=[`right`,`left`],ip=[`top`,`bottom`],ap=[`bottom`,`top`];function op(e,t,n){switch(e){case`top`:case`bottom`:return n?t?rp:np:t?np:rp;case`left`:case`right`:return t?ip:ap;default:return[]}}function sp(e,t,n,r){let i=Jf(e),a=op(qf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(tp)))),a}function cp(e){let t=qf(e);return Wf[t]+e.slice(t.length)}function lp(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function up(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:lp(e)}function dp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fp(e,t,n){let{reference:r,floating:i}=e,a=Zf(t),o=Qf(t),s=Xf(o),c=qf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Jf(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function pp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Kf(t,e),p=up(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=dp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=dp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var mp=50,hp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:pp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fp(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<mp&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=fp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},gp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Kf(e,t)||{};if(l==null)return{};let d=up(u),f={x:n,y:r},p=Qf(i),m=Xf(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=zf(d[_],T),D=zf(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Gf(E,k,O),j=!c.arrow&&Jf(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),_p=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Kf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=qf(r),_=Zf(o),v=qf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[cp(o)]:ep(o)),x=p!==`none`;!d&&x&&b.push(...sp(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=$f(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Zf(t)||T.every(e=>Zf(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Zf(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function vp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yp(e){return Rf.some(t=>e[t]>=0)}var bp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Kf(e,t);switch(i){case`referenceHidden`:{let e=vp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yp(e)}}}case`escaped`:{let e=vp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yp(e)}}}default:return{}}}}},xp=new Set([`left`,`top`]);async function Sp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=qf(n),s=Jf(n),c=Zf(n)===`y`,l=xp.has(o)?-1:1,u=a&&c?-1:1,d=Kf(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Cp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Sp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Kf(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Zf(i),p=Yf(f),m=u[p],h=u[f],g=(e,t)=>Gf(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Tp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Kf(e,t),u={x:n,y:r},d=Zf(i),f=Yf(d),p=u[f],m=u[d],h=Kf(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=xp.has(qf(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ep=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Kf(e,t),c=await i.detectOverflow(t,s),l=qf(n),u=Jf(n),d=Zf(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=zf(p-c[m],g),y=zf(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Bf(c.left,c.right):S=p-2*Bf(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Dp(){return typeof window<`u`}function Op(e){return jp(e)?(e.nodeName||``).toLowerCase():`#document`}function kp(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ap(e){return((jp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jp(e){return Dp()?e instanceof Node||e instanceof kp(e).Node:!1}function Mp(e){return Dp()?e instanceof Element||e instanceof kp(e).Element:!1}function Np(e){return Dp()?e instanceof HTMLElement||e instanceof kp(e).HTMLElement:!1}function Pp(e){return!Dp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof kp(e).ShadowRoot}function Fp(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Kp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ip(e){return/^(table|td|th)$/.test(Op(e))}function Lp(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Rp=/transform|translate|scale|rotate|perspective|filter/,zp=/paint|layout|strict|content/,Bp=e=>!!e&&e!==`none`,Vp;function Hp(e){let t=Mp(e)?Kp(e):e;return Bp(t.transform)||Bp(t.translate)||Bp(t.scale)||Bp(t.rotate)||Bp(t.perspective)||!Wp()&&(Bp(t.backdropFilter)||Bp(t.filter))||Rp.test(t.willChange||``)||zp.test(t.contain||``)}function Up(e){let t=Jp(e);for(;Np(t)&&!Gp(t);){if(Hp(t))return t;if(Lp(t))return null;t=Jp(t)}return null}function Wp(){return Vp??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Vp}function Gp(e){return/^(html|body|#document)$/.test(Op(e))}function Kp(e){return kp(e).getComputedStyle(e)}function qp(e){return Mp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jp(e){if(Op(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Pp(e)&&e.host||Ap(e);return Pp(t)?t.host:t}function Yp(e){let t=Jp(e);return Gp(t)?(e.ownerDocument||e).body:Np(t)&&Fp(t)?t:Yp(t)}function Xp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Yp(e),i=r===e.ownerDocument?.body,a=kp(r);if(i){let e=Zp(a);return t.concat(a,a.visualViewport||[],Fp(r)?r:[],e&&n?Xp(e):[])}return t.concat(r,Xp(r,[],n))}function Zp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qp(e){let t=Kp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Np(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Vf(n)!==a||Vf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $p(e){return Mp(e)?e:e.contextElement}function em(e){let t=$p(e);if(!Np(t))return Uf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qp(t),o=(a?Vf(n.width):n.width)/r,s=(a?Vf(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var tm=Uf(0);function nm(e){let t=kp(e);return!Wp()||!t.visualViewport?tm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rm(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===kp(e)}function im(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$p(e),o=Uf(1);t&&(r?Mp(r)&&(o=em(r)):o=em(e));let s=rm(a,n,r)?nm(a):Uf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=kp(a),t=Mp(r)?kp(r):r,n=e,i=Zp(n);for(;i&&t!==n;){let e=em(i),t=i.getBoundingClientRect(),r=Kp(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=kp(i),i=Zp(n)}}return dp({width:u,height:d,x:c,y:l})}function am(e,t){let n=qp(e).scrollLeft;return t?t.left+n:im(Ap(e)).left+n}function om(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-am(e,n),y:n.top+t.scrollTop}}function sm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ap(r),s=t?Lp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Uf(1),u=Uf(0),d=Np(r);if((d||!a)&&((Op(r)!==`body`||Fp(o))&&(c=qp(r)),d)){let e=im(r);l=em(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?om(o,c):Uf(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cm(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function lm(e){let t=qp(e),n=e.ownerDocument.body,r=Bf(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Bf(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+am(e),o=-t.scrollTop;return Kp(n).direction===`rtl`&&(a+=Bf(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var um=25;function dm(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=kp(e),a=Ap(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Wp()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(am(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=um&&(s-=o)}return{width:s,height:c,x:l,y:u}}function fm(e,t){let n=im(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=em(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pm(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=dm(e,n,t);else if(t===`document`)r=lm(Ap(e));else if(Mp(t))r=fm(t,n);else{let n=nm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dp(r)}function mm(e,t){let n=t.get(e);if(n)return n;let r=Xp(e,[],!1).filter(e=>Mp(e)&&Op(e)!==`body`),i=null,a=Kp(e).position===`fixed`,o=a?Jp(e):e;for(;Mp(o)&&!Gp(o);){let e=Kp(o),t=Hp(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Jp(o)}return t.set(e,r),r}function hm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Lp(t)?[]:mm(t,this._c):[].concat(n),r],o=pm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=pm(t,a[e],i);s=Bf(n.top,s),c=zf(n.right,c),l=zf(n.bottom,l),u=Bf(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gm(e){let{width:t,height:n}=Qp(e);return{width:t,height:n}}function _m(e,t,n){let r=Np(t),i=Ap(t),a=n===`fixed`,o=im(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Uf(0);if((r||!a)&&((Op(t)!==`body`||Fp(i))&&(s=qp(t)),r)){let e=im(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=am(i));let l=i&&!r&&!a?om(i,s):Uf(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function vm(e){return Kp(e).position===`static`}function ym(e,t){if(!Np(e)||Kp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ap(e)===n&&(n=n.ownerDocument.body),n}function bm(e,t){let n=kp(e);if(Lp(e))return n;if(!Np(e)){let t=Jp(e);for(;t&&!Gp(t);){if(Mp(t)&&!vm(t))return t;t=Jp(t)}return n}let r=ym(e,t);for(;r&&Ip(r)&&vm(r);)r=ym(r,t);return r&&Gp(r)&&vm(r)&&!Hp(r)?n:r||Up(e)||n}var xm=async function(e){let t=this.getOffsetParent||bm,n=this.getDimensions,r=await n(e.floating);return{reference:_m(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sm(e){return Kp(e).direction===`rtl`}var Cm={convertOffsetParentRelativeRectToViewportRelativeRect:sm,getDocumentElement:Ap,getClippingRect:hm,getOffsetParent:bm,getElementRects:xm,getClientRects:cm,getDimensions:gm,getScale:em,isElement:Mp,isRTL:Sm};function wm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tm(e,t,n){let r=null,i,a=Ap(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Hf(d),h=Hf(a.clientWidth-(u+f)),g=Hf(a.clientHeight-(d+p)),_=Hf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Bf(0,zf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!wm(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=kp(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Em(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$p(e),u=i||a?[...l?Xp(l):[],...t?Xp(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tm(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?im(e):null;c&&g();function g(){let t=im(e);h&&!wm(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dm=Cp,Om=wp,km=_p,Am=Ep,jm=bp,Mm=gp,Nm=Tp,Pm=(e,t,n)=>{let r=new Map,i=n??{},a={...Cm,...i.platform,_c:r};return hp(e,t,{...i,platform:a})},Fm=typeof document<`u`?d.useLayoutEffect:function(){};function Im(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Im(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Im(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Lm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rm(e,t){let n=Lm(e);return Math.round(t*n)/n}function zm(e){let t=d.useRef(e);return Fm(()=>{t.current=e}),t}function Bm(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);Im(p,r)||m(r);let[h,g]=d.useState(null),[_,v]=d.useState(null),y=d.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=d.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=d.useRef(null),w=d.useRef(null),T=d.useRef(u),E=c!=null,D=zm(c),O=zm(i),k=zm(l),A=d.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Pm(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Im(T.current,t)&&(T.current=t,aa.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);Fm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=d.useRef(!1);Fm(()=>(j.current=!0,()=>{j.current=!1}),[]),Fm(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=d.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=d.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Rm(N.floating,u.x),r=Rm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Lm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var Vm=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Mm({element:r.current,padding:i}).fn(n):r?Mm({element:r,padding:i}).fn(n):{}}}},Hm=(e,t)=>{let n=Dm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Um=(e,t)=>{let n=Om(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wm=(e,t)=>({fn:Nm(e).fn,options:[e,t]}),Gm=(e,t)=>{let n=km(e);return{name:n.name,fn:n.fn,options:[e,t]}},Km=(e,t)=>{let n=Am(e);return{name:n.name,fn:n.fn,options:[e,t]}},qm=(e,t)=>{let n=jm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jm=(e,t)=>{let n=Vm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ym=Object.defineProperty,Xm=d.forwardRef(((e,t)=>Ym(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,h.jsx)(q.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,h.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Zm=Object.defineProperty,Qm=(e,t)=>Zm(e,`name`,{value:t,configurable:!0}),$m={Partial:`partial`,Always:`always`},eh={Optimized:`optimized`,Always:`always`},th=`Popper`,[nh,rh]=Qs(th),[ih,ah]=nh(th),oh=Qm(e=>{let{__scopePopper:t,children:n}=e,[r,i]=d.useState(null),[a,o]=d.useState(void 0);return(0,h.jsx)(ih,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),sh=`PopperAnchor`,ch=d.forwardRef(Qm(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=ah(sh,n),o=d.useRef(null),s=a.onAnchorChange,c=Cs(t,d.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=d.useRef(null);d.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&vh(a.placementState),f=u?.[0],p=u?.[1];return r?null:(0,h.jsx)(q.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),lh=`PopperContent`,[uh,dh]=nh(lh),fh=d.forwardRef(Qm(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f=$m.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=eh.Optimized,onPlaced:g,..._}=e,v=ah(lh,n),[y,b]=d.useState(null),x=Cs(t,b),[S,C]=d.useState(null),w=yf(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],A=k.length>0,j={padding:O,boundary:k.filter(gh),altBoundary:A},{refs:M,floatingStyles:N,placement:ee,isPositioned:te,middlewareData:P}=Bm({strategy:`fixed`,placement:D,whileElementsMounted:Qm((...e)=>Em(...e,{animationFrame:m===eh.Always}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Hm({mainAxis:i+E,alignmentAxis:o}),c&&Um({mainAxis:!0,crossAxis:!1,...f===$m.Partial?{limiter:Wm()}:{},...j}),c&&Gm({...j}),Km({...j,apply:Qm(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Jm({element:S,padding:s}),_h({arrowWidth:T,arrowHeight:E}),p&&qm(A?{strategy:`referenceHidden`,...j}:{strategy:`referenceHidden`,padding:j.padding,altBoundary:j.altBoundary})]}),ne=v.setPlacementState;ec(()=>(ne(ee),()=>{ne(void 0)}),[ee,ne]);let[re,ie]=vh(ee),ae=_l(g);ec(()=>{te&&ae?.()},[te,ae]);let F=P.arrow?.x,oe=P.arrow?.y,I=P.arrow?.centerOffset!==0,[se,ce]=d.useState();return ec(()=>{y&&ce(window.getComputedStyle(y).zIndex)},[y]),(0,h.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,h.jsx)(uh,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:F,arrowY:oe,shouldHideArrow:I,children:(0,h.jsx)(q.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`)),ph=`PopperArrow`,mh={top:`bottom`,right:`left`,bottom:`top`,left:`right`},hh=d.forwardRef(Qm(function(e,t){let{__scopePopper:n,...r}=e,i=dh(ph,n),a=mh[i.placedSide];return(0,h.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,h.jsx)(Xm,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function gh(e){return e!==null}Qm(gh,`isNotNull`);var _h=Qm(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=vh(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function vh(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Qm(vh,`getSideAndAlignFromPlacement`);var yh=Object.defineProperty,bh=(e,t)=>yh(e,`name`,{value:t,configurable:!0}),xh=!1;function Sh(){let[e,t]=d.useState(xh);return d.useEffect(()=>{xh||(xh=!0,t(!0))},[]),e}bh(Sh,`useIsHydrated`);var Ch=d.useSyncExternalStore;function wh(){return()=>{}}bh(wh,`subscribe`);function Th(){return Ch(wh,()=>!0,()=>!1)}bh(Th,`useIsHydratedModern`);var Eh=typeof Ch==`function`?Th:Sh,Dh=Object.defineProperty,Oh=(e,t)=>Dh(e,`name`,{value:t,configurable:!0}),kh=`rovingFocusGroup.onEntryFocus`,Ah={bubbles:!1,cancelable:!0},jh=`RovingFocusGroup`,[Mh,Nh,Ph]=rc(jh),[Fh,Ih]=Qs(jh,[Ph]),Lh={Vertical:`vertical`,Horizontal:`horizontal`},Rh={LTR:`ltr`,RTL:`rtl`},[zh,Bh]=Fh(jh),Vh=d.forwardRef(Oh(function(e,t){return(0,h.jsx)(Mh.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(Mh.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(Hh,{...e,ref:t})})})},`RovingFocusGroup`)),Hh=d.forwardRef(Oh(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...f}=e,p=d.useRef(null),m=Cs(t,p),g=pl(a),[_,v]=Ac({prop:o,defaultProp:s??null,onChange:c,caller:jh}),[y,b]=d.useState(!1),x=_l(l),S=Nh(n),C=d.useRef(!1),[w,T]=d.useState(0);return d.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(kh,x),()=>e.removeEventListener(kh,x)},[x]),(0,h.jsx)(zh,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:d.useCallback(e=>v(e),[v]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:d.useCallback(()=>T(e=>e-1),[]),children:(0,h.jsx)(q.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:J(e.onMouseDown,()=>{C.current=!0}),onFocus:J(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(kh,Ah);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Jh([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:J(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Uh=`RovingFocusGroupItem`,Wh=d.forwardRef(Oh(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Jc(),l=a||c,u=Bh(Uh,n),f=u.currentTabStopId===l,p=Nh(n),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:_}=u,v=Eh();return ec(()=>{if(v&&r)return m(),()=>g()},[v,r,m,g]),d.useEffect(()=>{if(!v&&r)return m(),()=>g()},[v,r,m,g]),(0,h.jsx)(Mh.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,h.jsx)(q.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:J(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:J(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:J(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=qh(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Yh(n,r+1):n.slice(r+1)}setTimeout(()=>Jh(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Gh={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Kh(e,t){return t===Rh.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Oh(Kh,`getDirectionAwareKey`);function qh(e,t,n){let r=Kh(e.key,n);if(!(t===Lh.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Lh.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Gh[r]}Oh(qh,`getFocusIntent`);function Jh(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Oh(Jh,`focusFirst`);function Yh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Oh(Yh,`wrapArray`);var Xh=Object.defineProperty,Zh=(e,t)=>Xh(e,`name`,{value:t,configurable:!0}),Qh=[`Enter`,` `],$h=[`ArrowDown`,`PageUp`,`Home`],eg=[`ArrowUp`,`PageDown`,`End`],tg=[...$h,...eg];[...Qh],[...Qh];var ng=`Menu`,[rg,ig,ag]=rc(ng),[og,sg]=Qs(ng,[ag,rh,Ih]),cg=rh(),lg=Ih(),[ug,dg]=og(ng),[fg,pg]=og(ng),mg=Zh(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=cg(t),[c,l]=d.useState(null),u=d.useRef(!1),f=_l(a),p=pl(i);return d.useEffect(()=>{let e=Zh(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Zh(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),d.useEffect(()=>{if(!n)return;let e=Zh(()=>f(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,h.jsx)(oh,{...s,children:(0,h.jsx)(ug,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:l,children:(0,h.jsx)(fg,{scope:t,onClose:d.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})},`Menu`),hg=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,...r}=e,i=cg(n);return(0,h.jsx)(ch,{...i,...r,ref:t})},`MenuAnchor`)),gg=`MenuPortal`,[_g,vg]=og(gg,{forceMount:void 0}),yg=Zh(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=dg(gg,t);return(0,h.jsx)(_g,{scope:t,forceMount:n,children:(0,h.jsx)(Rc,{present:n||a.open,children:(0,h.jsx)(eu,{asChild:!0,container:i,children:r})})})},`MenuPortal`),bg=`MenuContent`,[xg,Sg]=og(bg),Cg=d.forwardRef(Zh(function(e,t){let n=vg(bg,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=dg(bg,e.__scopeMenu),o=pg(bg,e.__scopeMenu);return(0,h.jsx)(rg.Provider,{scope:e.__scopeMenu,children:(0,h.jsx)(Rc,{present:r||a.open,children:(0,h.jsx)(rg.Slot,{scope:e.__scopeMenu,children:o.modal?(0,h.jsx)(wg,{...i,ref:t}):(0,h.jsx)(Tg,{...i,ref:t})})})})},`MenuContent`)),wg=d.forwardRef(Zh(function(e,t){let n=dg(bg,e.__scopeMenu),r=d.useRef(null),i=Cs(t,r);return d.useEffect(()=>{let e=r.current;if(e)return wd(e)},[]),(0,h.jsx)(Dg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Tg=d.forwardRef(Zh(function(e,t){let n=dg(bg,e.__scopeMenu);return(0,h.jsx)(Dg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Eg=Es(`MenuContent.ScrollLock`),Dg=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,..._}=e,v=dg(bg,n),y=pg(bg,n),b=cg(n),x=lg(n),S=ig(n),[C,w]=d.useState(null),T=d.useRef(null),[E,D]=d.useState(null);Vl(E);let{nodes:O,registry:k}=Bl(),A=!!(i||g),j=Cs(t,T,v.onContentChange,D),M=d.useRef(0),N=d.useRef(``),ee=d.useRef(0),te=d.useRef(null),P=d.useRef(`right`),ne=d.useRef(0),re=d.useMemo(()=>g?[T,...O.map(e=>({current:e}))]:[],[T,O,g]),ie=g?hd:d.Fragment,ae=g?{as:Eg,allowPinchZoom:!0,shards:re}:void 0,F=Zh(e=>{let t=N.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Qg(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){N.current=e,window.clearTimeout(M.current),e!==``&&(M.current=window.setTimeout(()=>s(``),1e3))}Zh(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);d.useEffect(()=>()=>window.clearTimeout(M.current),[]),ou();let oe=d.useCallback(e=>P.current===te.current?.side&&e_(e,te.current?.area),[]);return(0,h.jsx)(xg,{scope:n,searchRef:N,onItemEnter:d.useCallback(e=>{oe(e)&&e.preventDefault()},[oe]),onItemLeave:d.useCallback(e=>{oe(e)||(T.current?.focus(),w(null))},[oe]),onTriggerLeave:d.useCallback(e=>{oe(e)&&e.preventDefault()},[oe]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:d.useCallback(e=>{te.current=e},[]),children:(0,h.jsx)(zl,{registry:A?k:null,children:(0,h.jsx)(ie,{...ae,children:(0,h.jsx)(Ll,{asChild:!0,trapped:i,branches:O,onMountAutoFocus:J(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,h.jsx)(Tl,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:(0,h.jsx)(Vh,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:J(c,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,h.jsx)(fh,{role:`menu`,"aria-orientation":`vertical`,"data-state":qg(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:j,style:{outline:`none`,..._.style},onKeyDown:J(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&F(e.key));let i=T.current;if(e.target!==i||!tg.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);eg.includes(e.key)&&a.reverse(),Xg(a)}),onBlur:J(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),N.current=``)}),onPointerMove:J(e.onPointerMove,t_(e=>{let t=e.target,n=ne.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ne.current?`right`:`left`;P.current=t,ne.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Og=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,...r}=e;return(0,h.jsx)(q.div,{role:`group`,...r,ref:t})},`MenuGroup`)),kg=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,...r}=e;return(0,h.jsx)(q.div,{...r,ref:t})},`MenuLabel`)),Ag=`MenuItem`,jg=`menu.itemSelect`,Mg=d.forwardRef(Zh(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=d.useRef(null),o=pg(Ag,e.__scopeMenu),s=Sg(Ag,e.__scopeMenu),c=Cs(t,a),l=d.useRef(!1),u=Zh(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(jg,{bubbles:!0,cancelable:!0});e.addEventListener(jg,e=>r?.(e),{once:!0}),Ws(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,h.jsx)(Ng,{...i,ref:c,disabled:n,onClick:J(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:J(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:J(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Qh.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ng=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Sg(Ag,n),s=lg(n),c=d.useRef(null),l=Cs(t,c),[u,f]=d.useState(!1),[p,m]=d.useState(``);return d.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,h.jsx)(rg.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,h.jsx)(Wh,{asChild:!0,...s,focusable:!r,children:(0,h.jsx)(q.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:J(e.onPointerMove,t_(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(e.onPointerLeave,t_(e=>o.onItemLeave(e))),onFocus:J(e.onFocus,()=>f(!0)),onBlur:J(e.onBlur,()=>f(!1))})})})},`MenuItemImpl`)),Pg=d.forwardRef(Zh(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,h.jsx)(Vg,{scope:e.__scopeMenu,checked:n,children:(0,h.jsx)(Mg,{role:`menuitemcheckbox`,"aria-checked":Jg(n)?`mixed`:n,...i,ref:t,"data-state":Yg(n),onSelect:J(i.onSelect,()=>r?.(Jg(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Fg,Ig]=og(`MenuRadioGroup`,{value:void 0,onValueChange:Zh(()=>{},`onValueChange`)}),Lg=d.forwardRef(Zh(function(e,t){let{value:n,onValueChange:r,...i}=e,a=_l(r);return(0,h.jsx)(Fg,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,h.jsx)(Og,{...i,ref:t})})},`MenuRadioGroup`)),Rg=`MenuRadioItem`,zg=d.forwardRef(Zh(function(e,t){let{value:n,...r}=e,i=Ig(Rg,e.__scopeMenu),a=n===i.value;return(0,h.jsx)(Vg,{scope:e.__scopeMenu,checked:a,children:(0,h.jsx)(Mg,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Yg(a),onSelect:J(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Bg=`MenuItemIndicator`,[Vg,Hg]=og(Bg,{checked:!1}),Ug=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Hg(Bg,n);return(0,h.jsx)(Rc,{present:r||Jg(a.checked)||a.checked===!0,children:(0,h.jsx)(q.span,{...i,ref:t,"data-state":Yg(a.checked)})})},`MenuItemIndicator`)),Wg=d.forwardRef(Zh(function(e,t){let{__scopeMenu:n,...r}=e;return(0,h.jsx)(q.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Gg,Kg]=og(`MenuSub`);function qg(e){return e?`open`:`closed`}Zh(qg,`getOpenState`);function Jg(e){return e===`indeterminate`}Zh(Jg,`isIndeterminate`);function Yg(e){return Jg(e)?`indeterminate`:e?`checked`:`unchecked`}Zh(Yg,`getCheckedState`);function Xg(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Zh(Xg,`focusFirst`);function Zg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Zh(Zg,`wrapArray`);function Qg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Zg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Zh(Qg,`getNextMatch`);function $g(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Zh($g,`isPointInPolygon`);function e_(e,t){return t?$g({x:e.clientX,y:e.clientY},t):!1}Zh(e_,`isPointerInGraceArea`);function t_(e){return t=>t.pointerType===`mouse`?e(t):void 0}Zh(t_,`whenMouse`);var n_=Object.defineProperty,r_=(e,t)=>n_(e,`name`,{value:t,configurable:!0}),i_=`DropdownMenu`,[a_,o_]=Qs(i_,[sg]),s_=sg(),[c_,l_]=a_(i_),u_=r_(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=s_(t),l=d.useRef(null),[u,f]=Ac({prop:i,defaultProp:a??!1,onChange:o,caller:i_});return(0,h.jsx)(c_,{scope:t,triggerId:Jc(),triggerRef:l,contentId:Jc(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,h.jsx)(mg,{...c,open:u,onOpenChange:f,dir:r,modal:s,children:n})})},`DropdownMenu`),d_=`DropdownMenuTrigger`,f_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=l_(d_,n),o=s_(n),s=Cs(t,a.triggerRef);return(0,h.jsx)(hg,{asChild:!0,...o,children:(0,h.jsx)(q.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:J(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:J(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),p_=r_(e=>{let{__scopeDropdownMenu:t,...n}=e,r=s_(t);return(0,h.jsx)(yg,{...r,...n})},`DropdownMenuPortal`),m_=`DropdownMenuContent`,h_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=l_(m_,n),a=s_(n),o=d.useRef(!1);return(0,h.jsx)(Cg,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:J(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),g_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(kg,{...i,...r,ref:t})},`DropdownMenuLabel`)),__=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(Mg,{...i,...r,ref:t})},`DropdownMenuItem`)),v_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(Pg,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),y_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(Lg,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),b_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(zg,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),x_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(Ug,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),S_=d.forwardRef(r_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=s_(n);return(0,h.jsx)(Wg,{...i,...r,ref:t})},`DropdownMenuSeparator`)),C_=Object.defineProperty,w_=d.forwardRef(((e,t)=>C_(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,h.jsx)(q.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),T_=Object.defineProperty,E_=(e,t)=>T_(e,`name`,{value:t,configurable:!0});function D_(e,[t,n]){return Math.min(n,Math.max(t,e))}E_(D_,`clamp`);var O_=Object.defineProperty,k_=(e,t)=>O_(e,`name`,{value:t,configurable:!0}),A_=`Progress`,j_=100,[M_,N_]=Qs(A_),[P_,F_]=M_(A_),I_=d.forwardRef(k_(function(e,t){let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=z_,...o}=e;(i||i===0)&&!H_(i)&&console.error(W_(`${i}`,`Progress`));let s=H_(i)?i:j_;r!==null&&!U_(r,s)&&console.error(G_(`${r}`,`Progress`));let c=U_(r,s)?r:null,l=V_(c)?a(c,s):void 0;return(0,h.jsx)(P_,{scope:n,value:c,max:s,children:(0,h.jsx)(q.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":V_(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":B_(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})},`Progress`)),L_=`ProgressIndicator`,R_=d.forwardRef(k_(function(e,t){let{__scopeProgress:n,...r}=e,i=F_(L_,n);return(0,h.jsx)(q.div,{"data-state":B_(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})},`ProgressIndicator`));function z_(e,t){return`${Math.round(e/t*100)}%`}k_(z_,`defaultGetValueLabel`);function B_(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}k_(B_,`getProgressState`);function V_(e){return typeof e==`number`}k_(V_,`isNumber`);function H_(e){return V_(e)&&!isNaN(e)&&e>0}k_(H_,`isValidMaxNumber`);function U_(e,t){return V_(e)&&!isNaN(e)&&e<=t&&e>=0}k_(U_,`isValidValueNumber`);function W_(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${j_}\`.`}k_(W_,`getInvalidMaxError`);function G_(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
50
|
+
- a positive number
|
|
51
|
+
- less than the value passed to \`max\` (or ${j_} if no \`max\` prop is set)
|
|
52
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
53
|
+
|
|
54
|
+
Defaulting to \`null\`.`}k_(G_,`getInvalidValueError`);var K_=Object.defineProperty,q_=(e,t)=>K_(e,`name`,{value:t,configurable:!0}),J_={ItemAligned:`item-aligned`,Popper:`popper`},Y_={LTR:`ltr`,RTL:`rtl`},X_=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Z_=[` `,`Enter`],Q_=`Select`,[$_,ev,tv]=rc(Q_),[nv,rv]=Qs(Q_,[tv,rh]),iv=rh(),[av,ov]=nv(Q_),[sv,cv]=nv(Q_);function lv(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:p,required:m,form:g,internal_do_not_use_render:_}=e,v=iv(t),[y,b]=d.useState(null),[x,S]=d.useState(null),[C,w]=d.useState(!1),T=pl(l),[E,D]=Ac({prop:r,defaultProp:i??!1,onChange:a,caller:Q_}),[O,k]=Ac({prop:o,defaultProp:s,onChange:c,caller:Q_}),A=d.useRef(null),j=d.useRef(!1),[M,N]=d.useState(null),ee=q_(e=>{N({value:e,hasConsumerStoppedPropagation:j.current}),k(e)},`handleUserSelect`),te=d.useRef(O);d.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=q_(()=>k(te.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,k]);let P=!y||!!g||!!y.closest(`form`),[ne,re]=d.useState(new Set),ie=Jc(),ae=Array.from(ne).map(e=>e.props.value).join(`;`),F=d.useCallback(e=>{re(t=>new Set(t).add(e))},[]),oe=d.useCallback(e=>{re(t=>{let n=new Set(t);return n.delete(e),n})},[]),I={required:m,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:ie,value:O,onValueChange:k,hasConsumerStoppedPropagationRef:j,userSelection:M,onUserSelect:ee,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:p,name:u,autoComplete:f,form:g,nativeOptions:ne,nativeSelectKey:ae,isFormControl:P};return(0,h.jsx)(oh,{...v,children:(0,h.jsx)(av,{scope:t,...I,children:(0,h.jsx)($_.Provider,{scope:t,children:(0,h.jsx)(sv,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:oe,children:Xv(_)?_(I):n})})})})}q_(lv,`SelectProvider`);var uv=q_(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,h.jsx)(lv,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[n,e?(0,h.jsx)(Yv,{__scopeSelect:t}):null]})})},`Select`),dv=`SelectTrigger`,fv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=iv(n),o=ov(dv,n),s=o.disabled||r,c=Cs(t,o.onTriggerChange),l=ev(n),u=d.useRef(`touch`),[f,p,m]=Qv(e=>{let t=l().filter(e=>!e.disabled),n=$v(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),g=q_(e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,h.jsx)(ch,{asChild:!0,...a,children:(0,h.jsx)(q.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Zv(o.value)?``:void 0,...i,ref:c,onClick:J(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&g(e)}),onPointerDown:J(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:J(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),p(e.key)),t&&e.key===` `||X_.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),pv=`SelectValue`,mv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=ov(pv,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,f=Cs(t,c.onValueNodeChange);ec(()=>{l(u)},[l,u]);let p=Zv(c.value);return(0,h.jsx)(q.span,{...s,asChild:!p&&s.asChild,ref:f,style:{pointerEvents:`none`},children:(0,h.jsx)(d.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),hv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,h.jsx)(q.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[gv,_v]=nv(`SelectPortal`,{forceMount:void 0}),vv=q_(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,h.jsx)(gv,{scope:e.__scopeSelect,forceMount:n,children:(0,h.jsx)(eu,{asChild:!0,...r})})},`SelectPortal`),yv=`SelectContent`,bv=d.forwardRef(q_(function(e,t){let n=_v(yv,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=ov(yv,e.__scopeSelect),[o,s]=d.useState();return ec(()=>{s(new DocumentFragment)},[]),(0,h.jsx)(Rc,{present:r||a.open,children:({present:e})=>e?(0,h.jsx)(Ev,{...i,ref:t}):(0,h.jsx)(xv,{...i,fragment:o})})},`SelectContent`)),xv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?aa.createPortal((0,h.jsx)(Cv,{scope:n,children:(0,h.jsx)($_.Slot,{scope:n,children:(0,h.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Sv=10,[Cv,wv]=nv(yv),Tv=Es(`SelectContent.RemoveScroll`),Ev=d.forwardRef(q_(function(e,t){let{__scopeSelect:n}=e,{position:r=J_.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=ov(yv,n),[x,S]=d.useState(null),[C,w]=d.useState(null),T=Cs(t,S),[E,D]=d.useState(null),[O,k]=d.useState(null),A=ev(n),[j,M]=d.useState(!1),N=d.useRef(!1),ee=d.useRef(!1),te=d.useRef(!1);d.useEffect(()=>{if(x)return wd(x)},[x]),ou();let P=d.useCallback(e=>{let[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[A,C]),ne=d.useCallback(()=>P([E,x]),[P,E,x]);d.useEffect(()=>{j&&ne()},[j,ne]);let{onOpenChange:re,triggerPointerDownPosRef:ie}=b;d.useEffect(()=>{if(x){let e={x:0,y:0},t=q_(t=>{e={x:Math.abs(Math.round(t.pageX)-(ie.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ie.current?.y??0))}},`handlePointerMove`),n=q_(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||re(!1),document.removeEventListener(`pointermove`,t),ie.current=null},`handlePointerUp`);return ie.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,re,ie]),d.useEffect(()=>{let e=q_(()=>re(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[ae,F]=Qv(e=>{let t=A().filter(e=>!e.disabled),n=$v(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),oe=d.useCallback((e,t,n)=>{let r=!ee.current;r&&(ee.current=!0);let i=!N.current&&!n;b.value!==void 0&&b.value===t||i?(D(e),i&&(N.current=!0)):r&&D(e)},[b.value]),I=d.useCallback(()=>x?.focus(),[x]),se=d.useCallback((e,t,n)=>{if(!e)return;let r=!te.current;r&&(te.current=!0);let i=!N.current&&!n;(b.value!==void 0&&b.value===t||i||r)&&k(e)},[b.value]),ce=r===J_.Popper?Ov:Dv,le=ce===Ov?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,h.jsx)(Cv,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:oe,selectedItem:E,onItemLeave:I,itemTextRefCallback:se,focusSelectedItem:ne,selectedItemText:O,position:r,isPositioned:j,searchRef:ae,children:(0,h.jsx)(hd,{as:Tv,allowPinchZoom:!0,children:(0,h.jsx)(Ll,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:J(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,h.jsx)(Tl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,h.jsx)(ce,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...le,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:J(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&F(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Dv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ov(yv,n),o=wv(yv,n),[s,c]=d.useState(null),[l,u]=d.useState(null),f=Cs(t,u),p=ev(n),m=d.useRef(!1),g=d.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==Y_.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Sv,d=D_(a,[Sv,Math.max(Sv,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Sv,d=D_(a,[Sv,Math.max(Sv,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-Sv*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Sv,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${Sv}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);ec(()=>x(),[x]);let[S,C]=d.useState();ec(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);let w=d.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,h.jsx)(kv,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:w,children:(0,h.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,h.jsx)(q.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Ov=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Sv,...a}=e,o=iv(n);return(0,h.jsx)(fh,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[kv,Av]=nv(yv,{}),jv=`SelectViewport`,Mv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=wv(jv,n),o=Av(jv,n),s=Cs(t,a.onViewportChange),c=d.useRef(0);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,h.jsx)($_.Slot,{scope:n,children:(0,h.jsx)(q.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:J(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Sv*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Nv,Pv]=nv(`SelectGroup`),Fv=`SelectItem`,[Iv,Lv]=nv(Fv),Rv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=ov(Fv,n),c=wv(Fv,n),l=s.value===r,[u,f]=d.useState(a??``),[p,m]=d.useState(!1),g=Cs(t,_l(e=>c.itemRefCallback?.(e,r,i))),_=Jc(),v=d.useRef(`touch`);function y(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return q_(y,`handleSelect`),(0,h.jsx)(Iv,{scope:n,value:r,disabled:i,textId:_,isSelected:l,onItemTextChange:d.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,h.jsx)($_.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,h.jsx)(q.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":l&&p,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:J(o.onFocus,()=>m(!0)),onBlur:J(o.onBlur,()=>m(!1)),onClick:J(o.onClick,e=>{i||v.current!==`mouse`&&y(e)}),onPointerUp:J(o.onPointerUp,e=>{i||v.current===`mouse`&&y(e)}),onPointerDown:J(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:J(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:J(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Z_.includes(e.key)&&y(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),zv=`SelectItemText`,Bv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=ov(zv,n),s=wv(zv,n),c=Lv(zv,n),l=cv(zv,n),[u,f]=d.useState(null),p=_l(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=Cs(t,f,c.onItemTextChange,p),g=u?.textContent,_=d.useMemo(()=>(0,h.jsx)(`option`,{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=l;return ec(()=>(v(_),()=>y(_)),[v,y,_]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(q.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Zv(o.value)?aa.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Vv=`SelectItemIndicator`,Hv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,...r}=e;return Lv(Vv,n).isSelected?(0,h.jsx)(q.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Uv=`SelectScrollUpButton`,Wv=d.forwardRef(q_(function(e,t){let n=wv(Uv,e.__scopeSelect),r=Av(Uv,e.__scopeSelect),[i,a]=d.useState(!1),o=Cs(t,r.onScrollButtonChange);return ec(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};q_(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,h.jsx)(qv,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Gv=`SelectScrollDownButton`,Kv=d.forwardRef(q_(function(e,t){let n=wv(Gv,e.__scopeSelect),r=Av(Gv,e.__scopeSelect),[i,a]=d.useState(!1),o=Cs(t,r.onScrollButtonChange);return ec(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};q_(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,h.jsx)(qv,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),qv=d.forwardRef(q_(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=wv(`SelectScrollButton`,n),o=d.useRef(null),s=ev(n),c=d.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),ec(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,h.jsx)(q.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:J(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:J(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:J(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Jv=`SelectBubbleInput`,Yv=d.forwardRef(q_(function({__scopeSelect:e,...t},n){let r=ov(Jv,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,g=d.useRef(null),_=Cs(n,g),v=i??``,y=d.useRef(v),b=d.useRef(f),x=d.useRef(!1),S=Array.from(p).some(e=>(e.props.value??``)===``);return d.useEffect(()=>{let e=g.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f!==null&&f!==b.current;b.current=f;let i=y.current!==v;y.current=v;let a=r&&i;if(r&&!i&&f.value!==v&&!f.hasConsumerStoppedPropagation&&n){x.current=!0;try{n.call(e,f.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{x.current=!1,n.call(e,v)}return}let o=a&&!f.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,v),e.dispatchEvent(t)}},[v,f]),(0,h.jsxs)(q.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{x.current||a(e.target.value)},...t,style:{...qs,...t.style},ref:_,defaultValue:v,children:[Zv(i)&&!S?(0,h.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function Xv(e){return typeof e==`function`}q_(Xv,`isFunction`);function Zv(e){return e===``||e===void 0}q_(Zv,`shouldShowPlaceholder`);function Qv(e){let t=_l(e),n=d.useRef(``),r=d.useRef(0),i=d.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}q_(a,`updateSearch`),a(i)},[t]),a=d.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}q_(Qv,`useTypeaheadSearch`);function $v(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ey(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}q_($v,`findNextItem`);function ey(e,t){return e.map((n,r)=>e[(t+r)%e.length])}q_(ey,`wrapArray`);var ty=Object.defineProperty,ny=(e,t)=>ty(e,`name`,{value:t,configurable:!0}),ry={Horizontal:`horizontal`,Vertical:`vertical`},iy=ry.Horizontal,ay=Object.values(ry),oy=d.forwardRef(ny(function(e,t){let{decorative:n,orientation:r=iy,...i}=e,a=sy(r)?r:iy,o=a===ry.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,h.jsx)(q.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function sy(e){return ay.includes(e)}ny(sy,`isValidOrientation`);var cy=Object.defineProperty,ly=(e,t)=>cy(e,`name`,{value:t,configurable:!0}),uy=`Switch`,[dy,fy]=Qs(uy),[py,my]=dy(uy);function hy(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:f}=e,[p,m]=Ac({prop:n,defaultProp:i??!1,onChange:c,caller:uy}),[g,_]=d.useState(null),[v,y]=d.useState(null),[b,x]=d.useState(null),S={checked:p,setChecked:m,disabled:a,control:g,setControl:_,name:s,form:o,value:u,userClick:b,onUserClick:x,required:l,defaultChecked:i,isFormControl:!g||!!o||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return(0,h.jsx)(py,{scope:t,...S,children:Cy(f)?f(S):r})}ly(hy,`SwitchProvider`);var gy=`SwitchTrigger`,_y=d.forwardRef(ly(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:f,onUserClick:p,isFormControl:m,bubbleInput:g}=my(gy,e),_=Cs(r,u),v=d.useRef(c);return d.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=ly(()=>f(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,f]),(0,h.jsx)(q.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":wy(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:J(t,e=>{let t=e.isPropagationStopped();p({requestedChecked:!c,hasConsumerStoppedPropagation:t}),f(e=>!e),g&&m&&(t||e.stopPropagation())})})},`SwitchTrigger`)),vy=d.forwardRef(ly(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,h.jsx)(hy,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_y,{...d,ref:t,__scopeSwitch:n}),e&&(0,h.jsx)(Sy,{__scopeSwitch:n})]})})},`Switch`)),yy=`SwitchThumb`,by=d.forwardRef(ly(function(e,t){let{__scopeSwitch:n,...r}=e,i=my(yy,n);return(0,h.jsx)(q.span,{"data-state":wy(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),xy=`SwitchBubbleInput`,Sy=d.forwardRef(ly(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:f,form:p,bubbleInput:m,setBubbleInput:g}=my(xy,e),_=Cs(r,g),v=yf(i),y=d.useRef(!1),b=d.useRef(o),x=d.useRef(a),S=d.useRef(null);d.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==o;b.current=o;let i=a!==null&&a!==x.current;if(x.current=a,i)S.current=r?null:a,r&&n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===o;y.current=!0,n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[m,o,a]);let C=d.useRef(o);return(0,h.jsx)(q.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??C.current,required:c,disabled:l,name:u,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:J(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Cy(e){return typeof e==`function`}ly(Cy,`isFunction`);function wy(e){return e?`checked`:`unchecked`}ly(wy,`getState`);var Ty=Object.defineProperty,Ey=(e,t)=>Ty(e,`name`,{value:t,configurable:!0}),Dy={Automatic:`automatic`,Manual:`manual`},Oy=`Tabs`,[ky,Ay]=Qs(Oy,[Ih]),jy=Ih(),[My,Ny]=ky(Oy),Py=d.forwardRef(Ey(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=Dy.Automatic,...l}=e,u=pl(s),[d,f]=Ac({prop:r,onChange:i,defaultProp:a??``,caller:Oy});return(0,h.jsx)(My,{scope:n,baseId:Jc(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,h.jsx)(q.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Fy=`TabsList`,Iy=d.forwardRef(Ey(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Ny(Fy,n),o=jy(n);return(0,h.jsx)(Vh,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,h.jsx)(q.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Ly=`TabsTrigger`,Ry=d.forwardRef(Ey(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ny(Ly,n),s=jy(n),c=Vy(o.baseId,r),l=Hy(o.baseId,r),u=r===o.value;return(0,h.jsx)(Wh,{asChild:!0,...s,focusable:!i,active:u,children:(0,h.jsx)(q.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:J(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:J(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:J(e.onFocus,()=>{let e=o.activationMode!==Dy.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),zy=`TabsContent`,By=d.forwardRef(Ey(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Ny(zy,n),c=Vy(s.baseId,r),l=Hy(s.baseId,r),u=r===s.value,f=d.useRef(u);return d.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,h.jsx)(Rc,{present:i||u,children:({present:n})=>(0,h.jsx)(q.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Vy(e,t){return`${e}-trigger-${t}`}Ey(Vy,`makeTriggerId`);function Hy(e,t){return`${e}-content-${t}`}Ey(Hy,`makeContentId`);var Uy=Object.defineProperty,Wy=(e,t)=>Uy(e,`name`,{value:t,configurable:!0}),Gy=`Toggle`,Ky=d.forwardRef(Wy(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=Ac({prop:n,onChange:i,defaultProp:r??!1,caller:Gy});return(0,h.jsx)(q.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:J(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),qy=Object.defineProperty,Jy=(e,t)=>qy(e,`name`,{value:t,configurable:!0}),Yy=`ToggleGroup`,Xy={Single:`single`,Multiple:`multiple`},[Zy,Qy]=Qs(Yy,[Ih]),$y=Ih(),eb=d.forwardRef(Jy(function(e,t){let{type:n,...r}=e;if(n===Xy.Single)return(0,h.jsx)(rb,{role:`radiogroup`,...r,ref:t});if(n===Xy.Multiple)return(0,h.jsx)(ib,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Yy}\``)},`ToggleGroup`)),[tb,nb]=Zy(Yy),rb=d.forwardRef(Jy(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Jy(()=>{},`onValueChange`),...a}=e,[o,s]=Ac({prop:n,defaultProp:r??``,onChange:i,caller:Yy});return(0,h.jsx)(tb,{scope:e.__scopeToggleGroup,type:Xy.Single,value:d.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:d.useCallback(()=>s(``),[s]),children:(0,h.jsx)(sb,{...a,ref:t})})},`ToggleGroupImplSingle`)),ib=d.forwardRef(Jy(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Jy(()=>{},`onValueChange`),...a}=e,[o,s]=Ac({prop:n,defaultProp:r??[],onChange:i,caller:Yy}),c=d.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=d.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,h.jsx)(tb,{scope:e.__scopeToggleGroup,type:Xy.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,h.jsx)(sb,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[ab,ob]=Zy(Yy),sb=d.forwardRef(Jy(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=$y(n),u=pl(o),d={dir:u,...c};return(0,h.jsx)(ab,{scope:n,rovingFocus:i,disabled:r,children:i?(0,h.jsx)(Vh,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,h.jsx)(q.div,{...d,ref:t})}):(0,h.jsx)(q.div,{...d,ref:t})})},`ToggleGroupImpl`)),cb=`ToggleGroupItem`,lb=d.forwardRef(Jy(function(e,t){let n=nb(cb,e.__scopeToggleGroup),r=ob(cb,e.__scopeToggleGroup),i=$y(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=d.useRef(null);return r.rovingFocus?(0,h.jsx)(Wh,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,h.jsx)(ub,{...s,ref:t})}):(0,h.jsx)(ub,{...s,ref:t})},`ToggleGroupItem`)),ub=d.forwardRef(Jy(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=nb(cb,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Xy.Single?o:void 0;return(0,h.jsx)(Ky,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),db=Object.defineProperty,fb=(e,t)=>db(e,`name`,{value:t,configurable:!0}),[pb,mb]=Qs(`Tooltip`,[rh]),hb=rh(),gb=`TooltipProvider`,_b=700,vb=`tooltip.open`,[yb,bb]=pb(gb),xb=fb(e=>{let{__scopeTooltip:t,delayDuration:n=_b,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=d.useRef(!0),s=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,h.jsx)(yb,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:d.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:d.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:d.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Sb=`Tooltip`,[Cb,wb]=pb(Sb),Tb=fb(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=bb(Sb,e.__scopeTooltip),l=hb(t),[u,f]=d.useState(null),[p,m]=d.useState(void 0),g=Jc(),_=d.useRef(0),v=o??c.disableHoverableContent,y=s??c.delayDuration,b=d.useRef(!1),[x,S]=Ac({prop:r,defaultProp:i??!1,onChange:fb(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(vb))):c.onClose(),a?.(e)},`onChange`),caller:Sb}),C=d.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=d.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=d.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=d.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);d.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=p??g;return(0,h.jsx)(oh,{...l,children:(0,h.jsx)(Cb,{scope:t,contentId:D,setContentId:m,open:x,stateAttribute:C,trigger:u,onTriggerChange:f,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:d.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:n})})},`Tooltip`),Eb=`TooltipTrigger`,Db=d.forwardRef(fb(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=wb(Eb,n),o=bb(Eb,n),s=hb(n),c=Cs(t,d.useRef(null),a.onTriggerChange),l=d.useRef(!1),u=d.useRef(!1),f=d.useCallback(()=>l.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,h.jsx)(ch,{asChild:!0,...s,children:(0,h.jsx)(q.button,{"aria-describedby":a.open?Wb(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:J(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:J(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:J(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:J(e.onBlur,a.onClose),onClick:J(e.onClick,a.onClose)})})},`TooltipTrigger`)),Ob=`TooltipPortal`,[kb,Ab]=pb(Ob,{forceMount:void 0}),jb=fb(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=wb(Ob,t);return(0,h.jsx)(kb,{scope:t,forceMount:n,children:(0,h.jsx)(Rc,{present:n||a.open,children:(0,h.jsx)(eu,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Mb=`TooltipContent`,Nb=d.forwardRef(fb(function(e,t){let n=Ab(Mb,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=wb(Mb,e.__scopeTooltip);return(0,h.jsx)(Rc,{present:r||o.open,children:o.disableHoverableContent?(0,h.jsx)(Ib,{side:i,...a,ref:t}):(0,h.jsx)(Pb,{side:i,...a,ref:t})})},`TooltipContent`)),Pb=d.forwardRef(fb(function(e,t){let n=wb(Mb,e.__scopeTooltip),r=bb(Mb,e.__scopeTooltip),i=d.useRef(null),a=Cs(t,i),[o,s]=d.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:f}=r,p=d.useCallback(()=>{s(null),f(!1)},[f]),m=d.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=zb(r,Rb(r,n.getBoundingClientRect())),a=Bb(t.getBoundingClientRect()),o=Hb([...i,...a]);s(o),f(!0)},[f]);return d.useEffect(()=>()=>p(),[p]),d.useEffect(()=>{if(c&&u){let e=fb(e=>m(e,u),`handleTriggerLeave`),t=fb(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),d.useEffect(()=>{if(o){let e=fb(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Vb(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,h.jsx)(Ib,{...e,ref:a})},`TooltipContentHoverable`)),Fb=ks(`TooltipContent`),Ib=d.forwardRef(fb(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=wb(Mb,n),u=hb(n),{onClose:f}=l,[p,m]=d.useState(null),g=Cs(t,m);Vl(p),d.useEffect(()=>(document.addEventListener(vb,f),()=>document.removeEventListener(vb,f)),[f]),d.useEffect(()=>{if(l.trigger){let e=fb(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,f]);let{setContentId:_}=l;return ec(()=>(_(a),()=>{_(void 0)}),[a,_]),(0,h.jsx)(Tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,h.jsxs)(fh,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:g,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,h.jsx)(Fb,{children:r}),i?(0,h.jsx)(Js,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Lb=d.forwardRef(fb(function(e,t){let{__scopeTooltip:n,...r}=e,i=hb(n);return(0,h.jsx)(hh,{...i,...r,ref:t})},`TooltipArrow`));function Rb(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}fb(Rb,`getExitSideFromRect`);function zb(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}fb(zb,`getPaddedExitPoints`);function Bb(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}fb(Bb,`getPointsFromRect`);function Vb(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}fb(Vb,`isPointInPolygon`);function Hb(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ub(t)}fb(Hb,`getHull`);function Ub(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}fb(Ub,`getHullPresorted`);function Wb(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}fb(Wb,`concatAriaDescribedby`);function Gb({delayDuration:e=0,...t}){return(0,h.jsx)(xb,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Kb({...e}){return(0,h.jsx)(Tb,{"data-slot":`tooltip`,...e})}function qb({...e}){return(0,h.jsx)(Db,{"data-slot":`tooltip-trigger`,...e})}function Jb({className:e,sideOffset:t=0,children:n,...r}){return(0,h.jsx)(jb,{children:(0,h.jsxs)(Nb,{"data-slot":`tooltip-content`,sideOffset:t,className:K(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,h.jsx)(Lb,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Yb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Xb=za,Zb=(e,t)=>n=>{if(t?.variants==null)return Xb(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=Yb(t)||Yb(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 Xb(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)},Qb=Zb(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Y({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Ds:`button`;return(0,h.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:K(Qb({variant:t,size:n,className:e})),...i})}function $b({...e}){return(0,h.jsx)(Md,{"data-slot":`dialog`,...e})}function ex({...e}){return(0,h.jsx)(Rd,{"data-slot":`dialog-portal`,...e})}function tx({className:e,...t}){return(0,h.jsx)(Bd,{"data-slot":`dialog-overlay`,className:K(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function nx({className:e,children:t,showCloseButton:n=!0,...r}){return(0,h.jsxs)(ex,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(tx,{}),(0,h.jsxs)(Wd,{"data-slot":`dialog-content`,className:K(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,h.jsxs)(Zd,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,h.jsx)(Xi,{}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function rx({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`dialog-header`,className:K(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function ix({className:e,showCloseButton:t=!1,children:n,...r}){return(0,h.jsxs)(`div`,{"data-slot":`dialog-footer`,className:K(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,h.jsx)(Zd,{asChild:!0,children:(0,h.jsx)(Y,{variant:`outline`,children:`Close`})})]})}function ax({className:e,...t}){return(0,h.jsx)(Jd,{"data-slot":`dialog-title`,className:K(`text-lg leading-none font-semibold`,e),...t})}function ox({className:e,...t}){return(0,h.jsx)(Yd,{"data-slot":`dialog-description`,className:K(`text-sm text-muted-foreground`,e),...t})}var sx=`s3deck:navigate`,cx=new Set([`settings`,`sync`,`activity`,`users`]),lx=null,ux;function dx(e){let t=new URLSearchParams(e);return{bucket:t.get(`b`)||null,prefix:t.get(`p`)??``,search:t.get(`q`)??``,view:cx.has(t.get(`view`)??``)?t.get(`view`):`browse`,object:t.get(`o`)||null}}function fx(){return lx!==location.search&&(lx=location.search,ux=dx(location.search)),ux}function px(e){return window.addEventListener(`popstate`,e),window.addEventListener(sx,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(sx,e)}}function mx(){return(0,d.useSyncExternalStore)(px,fx)}function hx(e){let t=new URLSearchParams;e.bucket&&t.set(`b`,e.bucket),e.prefix&&t.set(`p`,e.prefix),e.search&&t.set(`q`,e.search),e.view&&e.view!==`browse`&&t.set(`view`,e.view),e.object&&t.set(`o`,e.object);let n=t.toString();return n?`?${n}`:location.pathname}function gx(e,t={}){let n=hx(e);n===location.search||n===location.pathname&&!location.search||(history[t.replace?`replaceState`:`pushState`](null,``,n),window.dispatchEvent(new Event(sx)))}function _x(e,t){gx({...fx(),...e},t)}function vx(e){let t=e.replace(/\/$/,``),n=t.lastIndexOf(`/`);return n===-1?``:t.slice(0,n+1)}function yx(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function bx(e,t=`|`){return e.map(e=>Gx(e)).join(t)}function xx(e,t){return typeof t==`bigint`?t.toString():t}var Sx=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Cx(e){return new Sx(e)}function wx(e){return e==null}function Tx(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ex(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function Dx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ox(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function kx(e){return Ox(e._zod.def)??e._zod.def.shape}function Ax(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Dx(this,t,e),e},enumerable:!0,configurable:!0})}function jx(e,t,n){t in e?Dx(e,t,n):e[t]=n}function Mx(e,t,n,r){let i=kx(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Ax(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):jx(e,a,r?r(n.value,a):n.value))}}function Nx(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ax(e,n,()=>t[n]):jx(e,n,r.value))}}function Px(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Fx(e){return JSON.stringify(e)}function Ix(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Lx=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Rx(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var zx=Cx(()=>{if(FS.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Bx(e){if(Rx(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Rx(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Vx(e){return Bx(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Hx=new Set([`string`,`number`,`symbol`]);function Ux(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Wx(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function X(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Gx(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Kx(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var qx={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jx={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Yx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Mx(i,e,Xx(e,t)),Wx(e,Px(n,{shape:i,checks:[]}))}function Xx(e,t){let n=kx(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Zx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Xx(e,t)),a={};return Mx(a,e,Reflect.ownKeys(kx(e)).filter(e=>!i.has(e))),Wx(e,Px(n,{shape:a,checks:[]}))}function Qx(e,t){if(!Bx(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=kx(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Wx(e,Px(e._zod.def,{shape:$x(e,t)}))}function $x(e,t){let n={};return Mx(n,e,Reflect.ownKeys(kx(e))),Nx(n,t),n}function eS(e,t){if(!Bx(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Wx(e,Px(e._zod.def,{shape:$x(e,t)}))}function tS(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Mx(n,e,Reflect.ownKeys(kx(e))),Mx(n,t,Reflect.ownKeys(kx(t))),Wx(e,Px(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function nS(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Xx(t,n)):void 0,o={};return Mx(o,t,Reflect.ownKeys(kx(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Wx(t,Px(t._zod.def,{shape:o,checks:[]}))}function rS(e,t,n){let r=n?new Set(Xx(t,n)):void 0,i={};return Mx(i,t,Reflect.ownKeys(kx(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Wx(t,Px(t._zod.def,{shape:i}))}function iS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function aS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function oS(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function sS(e){return typeof e==`string`?e:e?.message}function cS(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function lS(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function uS(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:sS(e.inst?._zod.def?.error?.(e))??sS(a?.(e))??sS(t?.error?.(e))??sS(n.customError?.(e))??sS(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var dS=/[\uD800-\uDBFF]/;function fS(e){let t=e.length;if(!dS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function pS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function mS(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function hS(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function gS(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):bS(e,n,r.value)}}function _S(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function vS(e,t,n){return _S(e,t,n,!1)}function yS(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return _S(this,n,r(this))},set(e){_S(this,n,e)}})}return t}function bS(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:_S(this,t,n.bind(this))},set(e){_S(this,t,e)}})}function xS(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var SS,CS=!1,wS={configurable:!0,get(){CS=!0}};function TS(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&SS!==e._zod?SS=void 0:(SS=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,wS);let e=CS;CS=!1;try{let r=n(this);return CS?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),CS||=e,r}catch(n){throw delete this[t],CS||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function ES(e,t,n,r){let i=xS(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var DS=`~constantCatch`;function OS(e){let t=()=>e;return t[DS]=!0,t}var kS,AS={value:void 0,enumerable:!1},jS=`captureStackTrace`in Error?Error:null;function MS(e){let t=jS;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return jS=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Z(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){AS.value=new a(r);try{Object.defineProperty(n,"_zod",AS)}finally{AS.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),gS(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?MS(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var NS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},PS=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(kS=globalThis).__zod_globalConfig??(kS.__zod_globalConfig={});var FS=globalThis.__zod_globalConfig;function IS(e){return e&&Object.assign(FS,e),FS}function LS(){let e=this._zod;return e.message??=JSON.stringify(e.def,xx,2),e.message}function RS(e){this._zod.message=e}var zS={get:LS,set:RS,enumerable:!0,configurable:!0},BS={value:void 0,enumerable:!1},VS=new WeakSet([Object.prototype,Error.prototype]),HS=Z(`$ZodError`,(e,t)=>{e.name=`$ZodError`,BS.value=t,Object.defineProperty(e,"issues",BS),BS.value=void 0,Object.defineProperty(e,"message",zS);let n=Object.getPrototypeOf(e);VS.has(n)||(VS.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function US(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function WS(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?US(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function GS(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function KS(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qS=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new NS;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>uS(e,o,IS())));throw Lx(n,a?.callee??t),n}return s.value};return t},JS=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>uS(e,o,IS())));throw Lx(n,a?.callee??t),n}return s.value};return t},YS=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new NS;return a.issues.length?XS(e,a.issues,i):{success:!0,data:a.value}};function XS(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>uS(e,n,IS()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var ZS=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?XS(e,a.issues,i):{success:!0,data:a.value}},QS=Symbol.for(`zod.compile.invalid`),$S=Symbol.for(`zod.compile.fallback`),eC=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==QS)return!0;if(r.definite===!0&&n===void 0)return!1}return tC(e,t,n)});function tC(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[$S]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new NS;return a.issues.length===0}var nC=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},rC=e=>{let t=qS(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,KS(n,a))};return n},iC=e=>{let t=qS(e),n=(e,r,i,a)=>t(e,r,i,KS(n,a));return n},aC=e=>{let t=JS(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,KS(n,a))};return n},oC=e=>{let t=JS(e),n=async(e,r,i,a)=>await t(e,r,i,KS(n,a));return n},sC=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return YS(e)(t,n,i)},cC=e=>(t,n,r)=>YS(e)(t,n,r),lC=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ZS(e)(t,n,i)},uC=e=>async(t,n,r)=>ZS(e)(t,n,r),dC=/^[cC][0-9a-z]{6,}$/,fC=/^[0-9a-z]+$/,pC=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,mC=/^[0-9a-vA-V]{20}$/,hC=/^[A-Za-z0-9]{27}$/,gC=/^[a-zA-Z0-9_-]{21}$/;function _C(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var vC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yC=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bC=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,xC=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,SC=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function CC(){return new RegExp(SC,`u`)}var wC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,EC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,DC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kC=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,AC=/^https?$/,jC=/^\+[1-9]\d{6,14}$/,MC=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function NC(e){return RegExp(`^${e}$`)}var PC=NC(MC);function FC(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function IC(e){return RegExp(`^${FC(e)}$`)}function LC(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${FC({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${FC({precision:e.precision})}`:n;return RegExp(`^${MC}T(?:${r})$`)}var RC=/^[\s\S]{0,}$/,zC=/^-?\d+$/,BC=/^-?\d+(?:\.\d+)?$/,VC=/^(?:true|false)$/i,HC=/^[^A-Z]*$/,UC=/^[^a-z]*$/,WC=Z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),GC=e=>{let t=e.value;return!wx(t)&&t.length!==void 0},KC={number:`number`,bigint:`bigint`,object:`date`},qC=Z(`$ZodCheckLessThan`,(e,t)=>{WC.init(e,t);let n=KC[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:KC[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),JC=Z(`$ZodCheckGreaterThan`,(e,t)=>{WC.init(e,t);let n=KC[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:KC[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),YC=Z(`$ZodCheckMultipleOf`,(e,t)=>{WC.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Ex(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),XC=Z(`$ZodCheckNumberFormat`,(e,t)=>{WC.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=qx[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ZC=Z(`$ZodCheckMaxLength`,(e,t)=>{var n;WC.init(e,t),(n=e._zod.def).when??(n.when=GC),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?fS(r):i)<=t.maximum)return;let a=pS(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),QC=Z(`$ZodCheckMinLength`,(e,t)=>{var n;WC.init(e,t),(n=e._zod.def).when??(n.when=GC),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?fS(r):i)>=t.minimum)return;let a=pS(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$C=Z(`$ZodCheckLengthEquals`,(e,t)=>{var n;WC.init(e,t),(n=e._zod.def).when??(n.when=GC),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?fS(r):i;if(a===t.length)return;let o=pS(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ew=Z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;WC.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),tw=Z(`$ZodCheckRegex`,(e,t)=>{ew.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nw=Z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=HC,ew.init(e,t)}),rw=Z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=UC,ew.init(e,t)}),iw=Z(`$ZodCheckIncludes`,(e,t)=>{WC.init(e,t);let n=Ux(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),aw=Z(`$ZodCheckStartsWith`,(e,t)=>{WC.init(e,t);let n=RegExp(`^${Ux(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ow=Z(`$ZodCheckEndsWith`,(e,t)=>{WC.init(e,t);let n=RegExp(`.*${Ux(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),sw=Z(`$ZodCheckOverwrite`,(e,t)=>{WC.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),cw=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
55
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
56
|
+
`)}\n};`)(...Object.values(this.closed))}},lw={major:4,minor:6,patch:7},uw=Z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lw;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=iS(t),a;for(let o of n){if(o._zod.def.when){if(aS(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new NS;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(lS(t.issues,n,e),i||=iS(t,n))});else{if(t.issues.length===n)continue;lS(t.issues,n,e),i||=iS(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(iS(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new NS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new NS;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return vS(this,`~standard`,pw(this))},set"~standard"(e){_S(this,`~standard`,e)}}),dw=(e,t)=>e.issues.length?{issues:e.issues.map(e=>uS(e,t,IS()))}:{value:e.value};async function fw(e,t){let n={async:!0};return dw(await e._zod.run({value:t,issues:[]},n),n)}function pw(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return dw(r,n)}catch{}return fw(e,t)},vendor:`zod`,version:1}}var mw=Z(`$ZodString`,(e,t)=>{uw.init(e,t),e._zod.pattern=t.pattern??RC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),hw=Z(`$ZodStringFormat`,(e,t)=>{ew.init(e,t),mw.init(e,t)}),gw=Z(`$ZodGUID`,(e,t)=>{t.pattern??=yC,hw.init(e,t)}),_w=Z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=bC(e)}else t.pattern??=bC();hw.init(e,t)}),vw=Z(`$ZodEmail`,(e,t)=>{t.pattern??=xC,hw.init(e,t)});function yw(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function bw(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?yw(e)||2:xw(e,t)}function xw(e,t){if(!t.normalize&&t.protocol?.source===AC.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Sw=/[\t\n\r]/g;function Cw(e){return e.replace(Sw,``)}function ww(e,t){return t.lastIndex=0,t.test(e.hostname)}function Tw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Ew=Z(`$ZodURL`,(e,t)=>{hw.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=bw(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Cw(r);return}t.hostname&&!ww(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Tw(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Cw(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Dw=Z(`$ZodEmoji`,(e,t)=>{t.pattern??=CC(),hw.init(e,t)}),Ow=Z(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?gC:_C(t.length),hw.init(e,t)}),kw=Z(`$ZodCUID`,(e,t)=>{t.pattern??=dC,hw.init(e,t)}),Aw=Z(`$ZodCUID2`,(e,t)=>{t.pattern??=fC,hw.init(e,t)}),jw=Z(`$ZodULID`,(e,t)=>{t.pattern??=pC,hw.init(e,t)}),Mw=Z(`$ZodXID`,(e,t)=>{t.pattern??=mC,hw.init(e,t)}),Nw=Z(`$ZodKSUID`,(e,t)=>{t.pattern??=hC,hw.init(e,t)}),Pw=Z(`$ZodISODateTime`,(e,t)=>{t.pattern??=LC(t),hw.init(e,t)}),Fw=Z(`$ZodISODate`,(e,t)=>{t.pattern??=PC,hw.init(e,t)}),Iw=Z(`$ZodISOTime`,(e,t)=>{t.pattern??=IC(t),hw.init(e,t)}),Lw=Z(`$ZodISODuration`,(e,t)=>{t.pattern??=vC,hw.init(e,t)}),Rw=Z(`$ZodIPv4`,(e,t)=>{t.pattern??=wC,hw.init(e,t)}),zw=/^[0-9a-fA-F:.]+$/;function Bw(e){return zw.test(e)?yw(`http://[${e}]`):!1}var Vw=Z(`$ZodIPv6`,(e,t)=>{t.pattern??=TC,hw.init(e,t),e._zod.check=n=>{Bw(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Hw=Z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=EC,hw.init(e,t)});function Uw(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Bw(n)}var Ww=Z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=DC,hw.init(e,t),e._zod.check=n=>{Uw(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Gw(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Kw=/^[0-9a-zA-Z+/]*={0,2}$/,qw=Z(`$ZodBase64`,(e,t)=>{t.pattern??=Kw,hw.init(e,t),e._zod.check=n=>{Gw(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Jw=/^[A-Za-z0-9_-]*$/;function Yw(e){if(!Jw.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Gw(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Xw=Z(`$ZodBase64URL`,(e,t)=>{t.pattern??=Jw,hw.init(e,t),e._zod.check=n=>{Yw(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Zw=Z(`$ZodE164`,(e,t)=>{t.pattern??=jC,hw.init(e,t)});function Qw(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var $w=Z(`$ZodJWT`,(e,t)=>{hw.init(e,t),e._zod.check=n=>{Qw(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),eT=Z(`$ZodNumber`,(e,t)=>{uw.init(e,t),e._zod.pattern=BC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),tT=Z(`$ZodNumberFormat`,(e,t)=>{XC.init(e,t),eT.init(e,t)}),nT=Z(`$ZodBoolean`,(e,t)=>{uw.init(e,t),e._zod.pattern=VC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),rT=Z(`$ZodUnknown`,(e,t)=>{uw.init(e,t),e._zod.parse=e=>e}),iT=Z(`$ZodNever`,(e,t)=>{uw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function aT(e,t){let n=cS(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of cS(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,lS(n.issues,t,e),n}}return i(n,a)}}var oT=e=>Array.isArray(e)?e.length:-1;function sT(e,t,n){e.issues.length&&t.issues.push(...oS(n,e.issues)),t.value[n]=e.value}var cT=Z(`$ZodArray`,(e,t)=>{uw.init(e,t);let n=FS.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>sT(t,r,e)));else if(sT(c,r,e),s&&c.issues.length!==0&&iS(c))break}return o.length?Promise.all(o).then(()=>r):r},aT(e,oT)});function lT(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...oS(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var uT=[];function dT(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:uT,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Kx(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function fT(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(iS(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>lT(e,n,i,t,d,f))):lT(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var pT=Z(`$ZodObject`,(e,t)=>{uw.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Cx(()=>dT(t));TS(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Dx(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Rx,o=t.catchall,s,c=FS.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(iS(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>lT(n,t,e,r,a,o))):lT(s,t,e,r,a,o)}return o?fT(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),mT=Z(`$ZodObjectJIT`,(e,t)=>{pT.init(e,t);let n=e._zod.parse,r=Cx(()=>dT(t)),i=FS.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new cw([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
57
|
+
let ${e}_ab = false;
|
|
58
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
59
|
+
const iss = ${e}.issues[i];
|
|
60
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
61
|
+
payload.issues.push(iss);
|
|
62
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
63
|
+
}
|
|
64
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
65
|
+
payload.value = newResult;
|
|
66
|
+
return payload;
|
|
67
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Fx(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
68
|
+
const ${n}_present = ${i};
|
|
69
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
70
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (${e}) {
|
|
74
|
+
newResult[${r}] = ${n}.value;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
`)}else f?(o.write(`
|
|
79
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
80
|
+
}
|
|
81
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
82
|
+
if (${n}.value !== undefined || ${i}) {
|
|
83
|
+
newResult[${r}] = ${n}.value;
|
|
84
|
+
}
|
|
85
|
+
`)):o.write(`
|
|
86
|
+
const ${n}_present = ${i};
|
|
87
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
88
|
+
}
|
|
89
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
90
|
+
payload.issues.push({
|
|
91
|
+
code: "invalid_type",
|
|
92
|
+
expected: "nonoptional",
|
|
93
|
+
input: undefined,
|
|
94
|
+
path: [${r}]
|
|
95
|
+
});
|
|
96
|
+
if (ctx && ctx.abortEarly) {
|
|
97
|
+
payload.value = newResult;
|
|
98
|
+
return payload;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (${n}_present) {
|
|
103
|
+
newResult[${r}] = ${n}.value;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Rx,c=!FS.jitless,l=c&&zx.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?fT([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function hT(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!iS(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>uS(e,r,IS())))}),t)}var gT=Z(`$ZodUnion`,(e,t)=>{uw.init(e,t),TS(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),TS(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),TS(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),TS(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Tx(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>hT(t,r,e,i)):hT(o,r,e,i)}}),_T=Z(`$ZodIntersection`,(e,t)=>{uw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>yT(e,t,n)):yT(e,i,a)}});function vT(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Bx(e)&&Bx(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=vT(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=vT(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yT(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=vT(t.value,n.value);if(!c.valid){if(iS(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var bT=Z(`$ZodRecord`,(e,t)=>{uw.init(e,t);let n=FS.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Bx(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>uS(e,i,IS())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...oS(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...oS(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&BC.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>uS(e,i,IS())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...oS(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...oS(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),xT=Z(`$ZodEnum`,(e,t)=>{uw.init(e,t);let n=yx(t.entries),r=new Set(n);e._zod.values=r,TS(e,`pattern`,e=>{let t=yx(e.def.entries).filter(e=>Hx.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ux(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ST=Z(`$ZodLiteral`,(e,t)=>{uw.init(e,t);let n=new Set(t.values);e._zod.values=n,TS(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ux(e):e?Ux(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),CT=Z(`$ZodTransform`,(e,t)=>{uw.init(e,t),e._zod.optin=`optional`,FS.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new PS(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new NS;return n.value=i,n}});function wT(e,t){return e.value=t.issues.length?void 0:t.value,e}var TT=Z(`$ZodOptional`,(e,t)=>{uw.init(e,t),TS(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,TS(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),TS(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Tx(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>wT(e,t)):wT(e,r)}return t.innerType._zod.run(e,n)}}),ET=Z(`$ZodExactOptional`,(e,t)=>{TT.init(e,t),TS(e,`values`,e=>e.def.innerType._zod.values),TS(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),DT=Z(`$ZodNullable`,(e,t)=>{uw.init(e,t),TS(e,`optin`,e=>e.def.innerType._zod.optin),TS(e,`optout`,e=>e.def.innerType._zod.optout),TS(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Tx(t.source)}|null)$`):void 0}),TS(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),OT=Z(`$ZodDefault`,(e,t)=>{uw.init(e,t),e._zod.optin=`defaulted`,TS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>kT(e,t)):kT(r,t)}});function kT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var AT=Z(`$ZodPrefault`,(e,t)=>{uw.init(e,t),e._zod.optin=`defaulted`,TS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),jT=Z(`$ZodNonOptional`,(e,t)=>{uw.init(e,t),TS(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>MT(t,e)):MT(i,e)}});function MT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function NT(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>uS(e,r,IS()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var PT=Z(`$ZodCatch`,(e,t)=>{uw.init(e,t),TS(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),TS(e,`optout`,e=>e.def.innerType._zod.optout),TS(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>NT(e,r,t,n)):NT(e,r,t,n)}}),FT=Z(`$ZodPipe`,(e,t)=>{uw.init(e,t),TS(e,`values`,e=>e.def.in._zod.values),TS(e,`optin`,e=>e.def.in._zod.optin),TS(e,`optout`,e=>e.def.out._zod.optout),TS(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>IT(e,t.in,n)):IT(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>IT(e,t.out,n)):IT(r,t.out,n)}});function IT(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var LT=Z(`$ZodReadonly`,(e,t)=>{uw.init(e,t),TS(e,`propValues`,e=>e.def.innerType._zod.propValues),TS(e,`values`,e=>e.def.innerType._zod.values),TS(e,`optin`,e=>e.def.innerType?._zod?.optin),TS(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(RT):RT(r)}});function RT(e){return e.memo||(e.value=Object.freeze(e.value)),e}var zT=Z(`$ZodCustom`,(e,t)=>{WC.init(e,t),uw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>BT(t,n,r,e));BT(i,n,r,e)}});function BT(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(hS(e))}}var VT=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},HT=`~memo`,UT=[];function WT(e){return typeof e==`object`&&!!e}function GT(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var KT=new WeakMap,qT=0,JT=1,YT=2;function XT(e,t,n){let r=KT.get(e);if(r!==void 0)return r?YT:qT;if(t.has(e))return YT;t.add(e);let i=qT,a=e=>{if(i!==YT&&e?._zod){let r=XT(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=qT;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?JT:o.value?._zod?XT(o.value,t,n):qT;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ox(c);s(e?o(e,!0):JT),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?XT(r,t,!1):JT);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ZT(e,i)}function ZT(e,t){return t!==JT&&KT.set(e,t===YT),t}function QT(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var $T,eE=[],tE={alloc(e,t,n){let r=$T;if(!r)return n;$T=void 0;let i={value:n,issues:null};return r.set(t.value,i),eE.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&rE(n,e.value))throw new VT;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=XT(e,new Set,!1);if(i===qT)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===YT||r?n=!0:r=!0}let l=s.value;if(!WT(l))return t(s,c);let u=c[HT];u||(u={buckets:new WeakMap,backEdges:void 0},c[HT]=u);let d;i===c?d=a:(d=QT(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...GT(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;$T=d;let p=eE.length,m=t(s,c);$T=void 0;let h=eE.length>p?eE.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?GT(e.issues):UT),e)):(h&&(h.issues=m.issues.length?GT(m.issues):UT),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function nE(){return tE}function rE(e,t){let n=e[HT]?.backEdges;return n!==void 0&&WT(t)&&n.has(t)}var iE=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(mS(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Gx(e.values[0])}`:`Invalid option: expected one of ${bx(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${bx(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function aE(){return{localeError:iE()}}var oE,sE=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function cE(){return new sE}(oE=globalThis).__zod_globalRegistry??(oE.__zod_globalRegistry=cE());var lE=globalThis.__zod_globalRegistry;function uE(e){return e.checks&&=[...e.checks],e}function dE(e,t){return new e(uE({type:`string`,...X(t)}))}function fE(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...X(t)})}function pE(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...X(t)})}function mE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...X(t)})}function hE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...X(t)})}function gE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...X(t)})}function _E(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...X(t)})}function vE(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...X(t)})}function yE(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...X(t)})}function bE(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...X(t)})}function xE(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...X(t)})}function SE(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...X(t)})}function CE(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...X(t)})}function wE(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...X(t)})}function TE(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...X(t)})}function EE(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...X(t)})}function DE(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...X(t)})}function OE(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...X(t)})}function kE(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...X(t)})}function AE(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...X(t)})}function jE(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...X(t)})}function ME(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...X(t)})}function NE(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...X(t)})}function PE(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...X(t)})}function FE(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...X(t)})}function IE(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...X(t)})}function LE(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...X(t)})}function RE(e,t){return new e(uE({type:`number`,checks:[],...X(t)}))}function zE(e,t){return new e(uE({type:`number`,coerce:!0,checks:[],...X(t)}))}function BE(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...X(t)})}function VE(e,t){return new e({type:`boolean`,...X(t)})}function HE(e){return new e({type:`unknown`})}function UE(e,t){return new e({type:`never`,...X(t)})}function WE(e,t){return new qC({check:`less_than`,...X(t),value:e,inclusive:!1})}function GE(e,t){return new qC({check:`less_than`,...X(t),value:e,inclusive:!0})}function KE(e,t){return new JC({check:`greater_than`,...X(t),value:e,inclusive:!1})}function qE(e,t){return new JC({check:`greater_than`,...X(t),value:e,inclusive:!0})}function JE(e,t){return new YC({check:`multiple_of`,...X(t),value:e})}function YE(e,t){return new ZC({check:`max_length`,...X(t),maximum:e})}function XE(e,t){return new QC({check:`min_length`,...X(t),minimum:e})}function ZE(e,t){return new $C({check:`length_equals`,...X(t),length:e})}function QE(e,t){return new tw({check:`string_format`,format:`regex`,...X(t),pattern:e})}function $E(e){return new nw({check:`string_format`,format:`lowercase`,...X(e)})}function eD(e){return new rw({check:`string_format`,format:`uppercase`,...X(e)})}function tD(e,t){return new iw({check:`string_format`,format:`includes`,...X(t),includes:e})}function nD(e,t){return new aw({check:`string_format`,format:`starts_with`,...X(t),prefix:e})}function rD(e,t){return new ow({check:`string_format`,format:`ends_with`,...X(t),suffix:e})}function iD(e){return new sw({check:`overwrite`,tx:e})}function aD(e){return iD(t=>t.normalize(e))}function oD(){return iD(e=>e.trim())}function sD(){return iD(e=>e.toLowerCase())}function cD(){return iD(e=>e.toUpperCase())}function lD(){return iD(e=>Ix(e))}function uD(e,t,n){return new e({type:`array`,element:t,...X(n)})}function dD(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...X(n)})}function fD(e,t){let n=pD(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(hS(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(hS(r))}},e(t.value,t)),t);return n}function pD(e,t){let n=new WC({check:`custom`,...X(t)});return n._zod.check=e,n}function mD(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Dx(e,t,n[t]);return e}function hD(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??lE,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function gD(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function _D(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,_D(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&mD(o.schema,c),t.io===`input`&&DD(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function vD(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function yD(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${vD(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+vD(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
107
|
+
|
|
108
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function bD(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;bD(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var xD=new Set([`type`,`properties`,`required`,`additionalProperties`]),SD=[`oneOf`,`anyOf`];function CD(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function wD(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!xD.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??CD(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Dx(n,r,e.length===1?e[0]:wD(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=CD(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function TD(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of xD)if(t in e)return;let n=t.filter(e=>SD.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=wD(t);else{let e=n[0],i=SD.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>wD([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,mD(e,r))}function ED(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):mD(i,s),mD(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())bD(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])TD(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}mD(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Dx(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:kD(t,`input`,e.processors),output:kD(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function DD(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return DD(r.element,n);if(r.type===`set`)return DD(r.valueType,n);if(r.type===`lazy`)return DD(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return DD(r.innerType,n);if(r.type===`intersection`)return DD(r.left,n)||DD(r.right,n);if(r.type===`record`||r.type===`map`)return DD(r.keyType,n)||DD(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:DD(r.in,n)||DD(r.out,n);if(r.type===`object`){for(let e in r.shape)if(DD(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(DD(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(DD(e,n))return!0;return!!(r.rest&&DD(r.rest,n))}return!1}var OD=(e,t={})=>n=>{let r=hD({...n,processors:t});return _D(e,r),yD(r,e),ED(r,e)},kD=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=hD({...i??{},target:a,io:t,processors:n});return _D(e,o),yD(o,e),ED(o,e)},AD=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},jD=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},MD=(e,t)=>{AD(e,`minimum`,t),jD(e,`maximum`,t)},ND=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},PD=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},FD=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ID=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},LD=(e,t)=>AD(e,`minimum`,t.minimum),RD=(e,t)=>jD(e,`maximum`,t.maximum),zD=e=>(t,n)=>{ID(t,n.format);let[r,i]=e[n.format];AD(t,`minimum`,r),jD(t,`maximum`,i)},BD={greater_than:(e,t)=>AD(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>jD(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ND(e,t.value),number_format:zD(qx),bigint_format:zD(Jx),min_length:LD,max_length:RD,length_equals:(e,t)=>MD(e,t.length),min_size:LD,max_size:RD,size_equals:(e,t)=>MD(e,t.size),string_format:(e,t)=>{ID(e,t.format),t.pattern&&PD(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>FD(e,t.mime)};function VD(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)BD[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&AD(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&AD(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&jD(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&jD(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ND(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&FD(t,i.mime);for(let e of i.patterns??[])PD(t,e);return t}var HD={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},UD=new Map([[Kw,OC],[Jw,kC]]),WD=e=>UD.get(e)??e,GD=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=VD(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=HD[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(WD);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},KD=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=VD(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):gD(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},qD=(e,t,n,r)=>{n.type=`boolean`},JD=(e,t,n,r)=>{n.not={}},YD=(e,t,n,r)=>{let i=e._zod.def,a=yx(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},XD=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(gD(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(gD(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},ZD=(e,t,n,r)=>{gD(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},QD=(e,t,n,r)=>{gD(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},$D=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=VD(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_D(a.element,t,{...r,path:[...r.path,`items`]})};function eO(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?eO(t.out):t.type===`catch`?eO(t.innerType):e._zod.optin}var tO=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&gD(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Dx(i.properties,e,_D(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?eO(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_D(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},nO=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_D(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},rO=(e,t,n,r)=>{let i=e._zod.def,a=_D(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_D(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function iO(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=iO(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>iO(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?BC:zC).source)),p}var aO=new WeakMap;function oO(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of aO.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=iO(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var sO=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=VD(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=_D(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Dx(i.patternProperties,WD(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=_D(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=aO.get(t);n||(n=[],aO.set(t,n),t.deferred.push(()=>oO(t))),n.push(e)}i.additionalProperties=_D(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&eO(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},cO=(e,t,n,r)=>{let i=e._zod.def,a=_D(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},lO=(e,t,n,r)=>{let i=e._zod.def;_D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},uO=Symbol();function dO(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(gD(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),uO):JSON.parse(o)}var fO=(e,t,n,r)=>{let i=e._zod.def;_D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=dO(i.defaultValue,e,t,n,r);o!==uO&&(n.default=o)},pO=(e,t,n,r)=>{let i=e._zod.def;_D(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=dO(i.defaultValue,e,t,n,r);o!==uO&&(n._prefault=o)},mO=(e,t,n,r)=>{let i=e._zod.def;_D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{gD(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},hO=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;_D(o,t,r);let s=t.seen.get(e);s.ref=o},gO=(e,t,n,r)=>{let i=e._zod.def;_D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},_O=(e,t,n,r)=>{let i=e._zod.def;_D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vO=new WeakSet([Object.prototype,Error.prototype]);function yO(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var bO=Z(`ZodError`,(e,t)=>{HS.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);vO.has(n)||(vO.add(n),yO(n,`format`,e=>t=>GS(e,t)),yO(n,`flatten`,e=>t=>WS(e,t)),yO(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,xx,2)}),yO(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xx,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),xO=qS(bO),SO=JS(bO),CO=YS(bO),wO=ZS(bO),TO=rC(bO),EO=iC(bO),DO=aC(bO),OO=oC(bO),kO=sC(bO),AO=cC(bO),jO=lC(bO),MO=uC(bO);function NO(){FS.localeError||IS(aE())}function PO(){FS.memoizer||IS({memoizer:nE()})}var FO=Z(`ZodType`,(e,t)=>(NO(),uw.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Px(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Wx(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(tA(e,t))},superRefine(e,t){return this.check(nA(e,t))},overwrite(e){return this.check(iD(e))},optional(){return Lk(this)},exactOptional(){return zk(this)},nullable(){return Vk(this)},nullish(){return Lk(Vk(this))},nonoptional(e){return qk(this,e)},array(){return yk(this)},or(e){return Tk([this,e])},and(e){return Dk(this,e)},transform(e){return Zk(this,Fk(e))},default(e){return Uk(this,e)},prefault(e){return Gk(this,e)},catch(e){return Yk(this,e)},pipe(e){return Zk(this,e)},readonly(){return $k(this)},describe(e){let t=this.clone();return lE.add(t,{description:e}),t},meta(...e){if(e.length===0)return lE.get(this);let t=this.clone();return lE.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return vS(this,`~standard`,{...pw(this),jsonSchema:{input:kD(this,`input`),output:kD(this,`output`)}})},set"~standard"(e){_S(this,`~standard`,e)},parse:function e(t,n){return xO(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await SO(this,t,n,{callee:e})},safeParse(e,t){return CO(this,e,t)},async safeParseAsync(e,t){return wO(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){_S(this,`spa`,e)},validate(e,t){return eC(this,e,t)},validateAsync(e,t){return nC(this,e,t)},encode:function e(t,n){return TO(this,t,n,{callee:e})},decode:function e(t,n){return EO(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await DO(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await OO(this,t,n,{callee:e})},safeEncode(e,t){return kO(this,e,t)},safeDecode(e,t){return AO(this,e,t)},async safeEncodeAsync(e,t){return jO(this,e,t)},async safeDecodeAsync(e,t){return MO(this,e,t)},toJSONSchema(e){return OD(this,{})(e)},get description(){return lE.get(this)?.description},get _def(){return this._zod.def}}),IO=Z(`_ZodString`,(e,t)=>{mw.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GD(e,t,n,r)},yS({format:e=>VD(e).format??null,minLength:e=>VD(e).minimum??null,maxLength:e=>VD(e).maximum??null},{regex(...e){return this.check(QE(...e))},includes(...e){return this.check(tD(...e))},startsWith(...e){return this.check(nD(...e))},endsWith(...e){return this.check(rD(...e))},min(...e){return this.check(XE(...e))},max(...e){return this.check(YE(...e))},length(...e){return this.check(ZE(...e))},nonempty(...e){return this.check(XE(1,...e))},lowercase(e){return this.check($E(e))},uppercase(e){return this.check(eD(e))},trim(){return this.check(oD())},normalize(...e){return this.check(aD(...e))},toLowerCase(){return this.check(sD())},toUpperCase(){return this.check(cD())},slugify(){return this.check(lD())}})),LO=Z(`ZodString`,(e,t)=>{mw.init(e,t),IO.init(e,t)},{email(e){return this.check(fE(UO,e))},url(e){return this.check(vE(KO,e))},jwt(e){return this.check(NE(sk,e))},emoji(e){return this.check(yE(qO,e))},guid(e){return this.check(pE(WO,e))},uuid(e){return this.check(mE(GO,e))},uuidv4(e){return this.check(hE(GO,e))},uuidv6(e){return this.check(gE(GO,e))},uuidv7(e){return this.check(_E(GO,e))},nanoid(e){return this.check(bE(JO,e))},cuid(e){return this.check(xE(YO,e))},cuid2(e){return this.check(SE(XO,e))},ulid(e){return this.check(CE(ZO,e))},base64(e){return this.check(AE(ik,e))},base64url(e){return this.check(jE(ak,e))},xid(e){return this.check(wE(QO,e))},ksuid(e){return this.check(TE($O,e))},ipv4(e){return this.check(EE(ek,e))},ipv6(e){return this.check(DE(tk,e))},cidrv4(e){return this.check(OE(nk,e))},cidrv6(e){return this.check(kE(rk,e))},e164(e){return this.check(ME(ok,e))},datetime(e){return this.check(PE(zO,e))},date(e){return this.check(FE(BO,e))},time(e){return this.check(IE(VO,e))},duration(e){return this.check(LE(HO,e))}});function Q(e){return dE(LO,e)}var RO=Z(`ZodStringFormat`,(e,t)=>{hw.init(e,t),IO.init(e,t)}),zO=Z(`ZodISODateTime`,(e,t)=>{Pw.init(e,t),RO.init(e,t)}),BO=Z(`ZodISODate`,(e,t)=>{Fw.init(e,t),RO.init(e,t)}),VO=Z(`ZodISOTime`,(e,t)=>{Iw.init(e,t),RO.init(e,t)}),HO=Z(`ZodISODuration`,(e,t)=>{Lw.init(e,t),RO.init(e,t)}),UO=Z(`ZodEmail`,(e,t)=>{vw.init(e,t),RO.init(e,t)}),WO=Z(`ZodGUID`,(e,t)=>{gw.init(e,t),RO.init(e,t)}),GO=Z(`ZodUUID`,(e,t)=>{_w.init(e,t),RO.init(e,t)}),KO=Z(`ZodURL`,(e,t)=>{Ew.init(e,t),RO.init(e,t)}),qO=Z(`ZodEmoji`,(e,t)=>{Dw.init(e,t),RO.init(e,t)}),JO=Z(`ZodNanoID`,(e,t)=>{Ow.init(e,t),RO.init(e,t)}),YO=Z(`ZodCUID`,(e,t)=>{kw.init(e,t),RO.init(e,t)}),XO=Z(`ZodCUID2`,(e,t)=>{Aw.init(e,t),RO.init(e,t)}),ZO=Z(`ZodULID`,(e,t)=>{jw.init(e,t),RO.init(e,t)}),QO=Z(`ZodXID`,(e,t)=>{Mw.init(e,t),RO.init(e,t)}),$O=Z(`ZodKSUID`,(e,t)=>{Nw.init(e,t),RO.init(e,t)}),ek=Z(`ZodIPv4`,(e,t)=>{Rw.init(e,t),RO.init(e,t)}),tk=Z(`ZodIPv6`,(e,t)=>{Vw.init(e,t),RO.init(e,t)}),nk=Z(`ZodCIDRv4`,(e,t)=>{Hw.init(e,t),RO.init(e,t)}),rk=Z(`ZodCIDRv6`,(e,t)=>{Ww.init(e,t),RO.init(e,t)}),ik=Z(`ZodBase64`,(e,t)=>{qw.init(e,t),RO.init(e,t)}),ak=Z(`ZodBase64URL`,(e,t)=>{Xw.init(e,t),RO.init(e,t)}),ok=Z(`ZodE164`,(e,t)=>{Zw.init(e,t),RO.init(e,t)}),sk=Z(`ZodJWT`,(e,t)=>{$w.init(e,t),RO.init(e,t)}),ck=Z(`ZodNumber`,(e,t)=>{eT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KD(e,t,n,r),e.isFinite=!0},yS({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=VD(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=VD(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=VD(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>VD(e).format??null},{gt(e,t){return this.check(KE(e,t))},gte(e,t){return this.check(qE(e,t))},min(e,t){return this.check(qE(e,t))},lt(e,t){return this.check(WE(e,t))},lte(e,t){return this.check(GE(e,t))},max(e,t){return this.check(GE(e,t))},int(e){return this.check(dk(e))},safe(e){return this.check(dk(e))},positive(e){return this.check(KE(0,e))},nonnegative(e){return this.check(qE(0,e))},negative(e){return this.check(WE(0,e))},nonpositive(e){return this.check(GE(0,e))},multipleOf(e,t){return this.check(JE(e,t))},step(e,t){return this.check(JE(e,t))},finite(){return this}}));function lk(e){return RE(ck,e)}var uk=Z(`ZodNumberFormat`,(e,t)=>{tT.init(e,t),ck.init(e,t)});function dk(e){return BE(uk,e)}var fk=Z(`ZodBoolean`,(e,t)=>{nT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qD(e,t,n,r)});function pk(e){return VE(fk,e)}var mk=Z(`ZodUnknown`,(e,t)=>{rT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function hk(){return HE(mk)}var gk=Z(`ZodNever`,(e,t)=>{iT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JD(e,t,n,r)});function _k(e){return UE(gk,e)}var vk=Z(`ZodArray`,(e,t)=>{PO(),cT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$D(e,t,n,r),e.element=t.element},{min(e,t){return this.check(XE(e,t))},nonempty(e){return this.check(XE(1,e))},max(e,t){return this.check(YE(e,t))},length(e,t){return this.check(ZE(e,t))},unwrap(){return this.element}});function yk(e,t){return uD(vk,e,t)}var bk=Z(`ZodObject`,(e,t)=>{PO(),mT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tO(e,t,n,r),ES(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return jk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Px(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Px(this._zod.def,{catchall:hk()}))},loose(){return this.clone(Px(this._zod.def,{catchall:hk()}))},strict(){return this.clone(Px(this._zod.def,{catchall:_k()}))},strip(){return this.clone(Px(this._zod.def,{catchall:void 0}))},extend(e){return Qx(this,e)},safeExtend(e){return eS(this,e)},merge(e){return tS(this,e)},pick(e){return Yx(this,e)},omit(e){return Zx(this,e)},partial(...e){return nS(Ik,this,e[0])},exactPartial(...e){return nS(Rk,this,e[0],`exactPartial`)},required(...e){return rS(Kk,this,e[0])}});function xk(e,t){return new bk({type:`object`,shape:e??{},...X(t)})}function Sk(e,t){return new bk({type:`object`,shape:e,catchall:_k(),...X(t)})}function Ck(e,t){return new bk({type:`object`,shape:e,catchall:hk(),...X(t)})}var wk=Z(`ZodUnion`,(e,t)=>{gT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nO(e,t,n,r),e.options=t.options});function Tk(e,t){return new wk({type:`union`,options:e,...X(t)})}var Ek=Z(`ZodIntersection`,(e,t)=>{_T.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rO(e,t,n,r)});function Dk(e,t){return new Ek({type:`intersection`,left:e,right:t})}var Ok=Z(`ZodRecord`,(e,t)=>{PO(),bT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sO(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function kk(e,t,n){return!t||!t._zod?new Ok({type:`record`,keyType:Q(),valueType:e,...X(t)}):new Ok({type:`record`,keyType:e,valueType:t,...X(n)})}var Ak=Z(`ZodEnum`,(e,t)=>{xT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YD(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ak({...t,checks:[],...X(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ak({...t,checks:[],...X(r),entries:i})}});function jk(e,t){return new Ak({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...X(t)})}var Mk=Z(`ZodLiteral`,(e,t)=>{ST.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XD(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Nk(e,t){return new Mk({type:`literal`,values:Array.isArray(e)?e:[e],...X(t)})}var Pk=Z(`ZodTransform`,(e,t)=>{PO(),CT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QD(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new PS(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(hS(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(hS(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Fk(e){return new Pk({type:`transform`,transform:e})}var Ik=Z(`ZodOptional`,(e,t)=>{TT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_O(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lk(e){return new Ik({type:`optional`,innerType:e})}var Rk=Z(`ZodExactOptional`,(e,t)=>{ET.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_O(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zk(e){return new Rk({type:`optional`,innerType:e})}var Bk=Z(`ZodNullable`,(e,t)=>{DT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cO(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vk(e){return new Bk({type:`nullable`,innerType:e})}var Hk=Z(`ZodDefault`,(e,t)=>{OT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fO(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Uk(e,t){return new Hk({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vx(t)}})}var Wk=Z(`ZodPrefault`,(e,t)=>{AT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pO(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gk(e,t){return new Wk({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vx(t)}})}var Kk=Z(`ZodNonOptional`,(e,t)=>{jT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lO(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qk(e,t){return new Kk({type:`nonoptional`,innerType:e,...X(t)})}var Jk=Z(`ZodCatch`,(e,t)=>{PT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mO(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Yk(e,t){return new Jk({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:OS(t)})}var Xk=Z(`ZodPipe`,(e,t)=>{FT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hO(e,t,n,r),e.in=t.in,e.out=t.out});function Zk(e,t){return new Xk({type:`pipe`,in:e,out:t})}var Qk=Z(`ZodReadonly`,(e,t)=>{LT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gO(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $k(e){return new Qk({type:`readonly`,innerType:e})}var eA=Z(`ZodCustom`,(e,t)=>{zT.init(e,t),FO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZD(e,t,n,r)});function tA(e,t={}){return dD(eA,e,t)}function nA(e,t){return fD(e,t)}function rA(e){return zE(ck,e)}var iA=Q().min(1).max(255),aA=Q().trim().min(3,`At least 3 characters`).max(63,`At most 63 characters`).regex(/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/,`Lowercase letters, digits, dots and hyphens; start and end with a letter or digit`).refine(e=>!/\.\.|\.-|-\./.test(e),`No adjacent dots, or dots next to hyphens`).refine(e=>!/^\d{1,3}(\.\d{1,3}){3}$/.test(e),`Must not look like an IP address`),oA=Q().min(1,`Key is required`).refine(e=>new TextEncoder().encode(e).length<=1024,`Keys are limited to 1,024 bytes`),sA=Q().refine(e=>new TextEncoder().encode(e).length<=1024,`Prefix is limited to 1,024 bytes`),cA=Q().trim().max(64).regex(/^[a-zA-Z0-9-]*$/,`Letters, digits and hyphens only`),lA=Q().trim().refine(e=>{try{let t=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&!t.username&&!t.password}catch{return!1}},`Enter an http(s) URL, e.g. http://localhost:9000`),uA=xk({username:Q().trim().min(1,`Username is required`).max(128),password:Q().min(1,`Password is required`).max(256)}),dA=jk([`auto`,`path`,`virtual`]),fA=xk({label:Q().trim().max(64).optional(),endpoint:Tk([Nk(``),lA]).optional(),region:cA.optional(),accessKeyId:Q().trim().min(1,`Access key ID is required`).max(256),secretAccessKey:Q().min(1,`Secret access key is required`).max(1024),sessionToken:Q().trim().max(8192).optional(),pathStyle:dA.optional(),buckets:yk(iA).max(50).optional(),publicUrlBase:Tk([Nk(``),lA]).optional(),remember:pk().optional()});xk({prefix:sA.default(``),cursor:Q().max(4096).optional(),flat:jk([`0`,`1`]).default(`0`),limit:rA().int().min(1).max(1e3).default(500)}),xk({key:oA,versionId:Q().max(1024).optional()}).extend({inline:jk([`0`,`1`]).default(`0`)}),xk({prefix:sA.default(``)}),xk({key:oA,contentType:Q().max(255).optional()}),xk({prefix:sA.refine(e=>e.length>0&&e.endsWith(`/`),`Folder must end with "/"`)}),xk({keys:yk(oA).max(1e5).default([]),prefixes:yk(sA.refine(e=>e.endsWith(`/`),`Folders end with "/"`)).max(1e3).default([])}).refine(e=>e.keys.length+e.prefixes.length>0,`Nothing to delete`),xk({keys:yk(oA).max(1e5).default([]),prefixes:yk(sA).max(1e3).default([])}),xk({destinationBucket:iA,move:pk().default(!1),items:yk(xk({source:oA,destination:oA})).min(1).max(1e4)}).refine(e=>e.items.every(e=>e.source.endsWith(`/`)===e.destination.endsWith(`/`)),`Folders must be copied to folders`),xk({key:oA,method:jk([`GET`,`PUT`]),expiresIn:lk().int().min(60).max(dt),versionId:Q().max(1024).optional(),contentType:Q().max(255).optional()});var pA=Q().max(2048).regex(/^[^\r\n]*$/,`No line breaks`),mA=Q().min(1).max(128).regex(/^[a-zA-Z0-9-_]+$/,`Letters, digits, "-" and "_" only`),hA=xk({keys:yk(oA).min(1).max(1e3),contentType:pA.optional(),cacheControl:pA.optional(),contentDisposition:pA.optional(),contentEncoding:pA.optional(),metadata:kk(mA,pA).optional()}),gA=xk({Key:Q().min(1).max(128),Value:Q().max(256)});xk({keys:yk(oA).min(1).max(1e3),versionId:Q().max(1024).optional(),tags:yk(gA).max(10,`At most 10 tags`).refine(e=>new Set(e.map(e=>e.Key)).size===e.length,`Tag keys must be unique`)}),xk({key:oA,versionId:Q().min(1).max(1024)}),xk({base:sA.default(``),keys:yk(oA).max(1e5).default([]),prefixes:yk(sA).max(1e3).default([]),name:Q().max(200).optional()});var _A=xk({name:aA,region:cA.optional()});xk({force:jk([`0`,`1`]).default(`0`)}),xk({enabled:pk()});var vA=jk([`GET`,`PUT`,`POST`,`DELETE`,`HEAD`]),yA=yk(Sk({ID:Q().max(255).optional(),AllowedOrigins:yk(Q().min(1)).min(1,`AllowedOrigins needs at least one origin`),AllowedMethods:yk(vA).min(1,`AllowedMethods needs at least one method`),AllowedHeaders:yk(Q()).optional(),ExposeHeaders:yk(Q()).optional(),MaxAgeSeconds:lk().int().min(0).optional()})).max(100),bA=Ck({Prefix:Q().optional(),Tag:gA.optional(),ObjectSizeGreaterThan:lk().int().min(0).optional(),ObjectSizeLessThan:lk().int().min(0).optional(),And:Ck({}).optional()}),xA=yk(Ck({ID:Q().max(255).optional(),Status:jk([`Enabled`,`Disabled`]),Filter:bA.optional(),Prefix:Q().optional(),Expiration:Ck({Days:lk().int().min(1).optional(),Date:Q().optional()}).optional(),Transitions:yk(Ck({StorageClass:Q()})).optional(),NoncurrentVersionExpiration:Ck({NoncurrentDays:lk().int().min(1).optional()}).optional(),AbortIncompleteMultipartUpload:Ck({DaysAfterInitiation:lk().int().min(1)}).optional()})).max(1e3),SA=Ck({Version:Q().optional(),Statement:yk(Ck({Effect:jk([`Allow`,`Deny`])})).min(1,`A policy needs at least one statement`)}).nullable(),CA=Sk({BlockPublicAcls:pk(),IgnorePublicAcls:pk(),BlockPublicPolicy:pk(),RestrictPublicBuckets:pk()}),wA=jk([`viewer`,`editor`,`admin`]),TA=Q().trim().min(2,`At least 2 characters`).max(128).regex(/^[A-Za-z0-9._@+-]+$/,`Letters, digits and . _ @ + - only`),EA=Q().min(10,`At least 10 characters`).max(256),DA=xk({username:TA,password:EA.optional(),role:wA});xk({role:wA.optional(),disabled:pk().optional(),password:EA.optional()}).refine(e=>Object.keys(e).length>0,`Nothing to change`),xk({user:Q().max(128).optional(),bucket:Q().max(255).optional(),limit:rA().int().min(1).max(2e3).default(200)}),xk({key:oA.refine(e=>!e.endsWith(`/`),`File keys must not end with "/"`),contentType:Q().max(255).optional()});var OA=xk({key:oA,uploadId:Q().min(1).max(1024)});OA.extend({partNumber:rA().int().min(1).max(1e4)}),OA.extend({parts:yk(xk({PartNumber:lk().int().min(1).max(1e4),ETag:Q().min(1).max(256)})).min(1).max(1e4)}),xk({keys:yk(oA).min(1).max(1e3),storageClass:Q().regex(/^[A-Z_]+$/,`Unknown storage class`).max(64)}),xk({keys:yk(oA).min(1).max(1e3),days:lk().int().min(1).max(365),tier:jk([`Expedited`,`Standard`,`Bulk`])}),xk({prefix:sA.default(``),cursor:Q().max(4096).optional()});var kA=xk({connectionId:Q().min(1).max(128),bucket:iA,prefix:sA.default(``)});xk({source:kA,target:kA}).extend({mode:jk([`copy`,`mirror`])});function AA(e){return e.issues.slice(0,5).map(e=>e.path.length?`${e.path.map(String).join(`.`)}: ${e.message}`:e.message).join(`; `)}var jA=3,MA=4,NA=16777216,PA=8388608,FA=5,IA=`x-s3deck-connection`;function LA(e){let t=1048576;return Math.max(PA,Math.ceil(e/9e3/t)*t)}var RA={key:e=>`s3deck-upload:${e.connectionId}|${e.bucket}|${e.key}|${e.file.size}|${e.file.lastModified}`,get(e){try{let t=localStorage.getItem(this.key(e));return t?JSON.parse(t):null}catch{return null}},set(e,t){try{localStorage.setItem(this.key(e),JSON.stringify(t))}catch{}},clear(e){try{localStorage.removeItem(this.key(e))}catch{}}},zA=class extends Error{},BA=e=>new Promise(t=>setTimeout(t,e));function VA(e,t,n,r,i){return new Promise((a,o)=>{let s=new XMLHttpRequest,c=i(s);s.upload.onprogress=e=>r(e.loaded),s.onload=()=>{c();let e=null;try{e=JSON.parse(s.responseText)}catch{}if(s.status>=200&&s.status<300)return a(e);let t=e?.error?.message??`HTTP ${s.status}`;s.status>=500||s.status===408||s.status===429?o(new zA(t)):o(Error(t))},s.onerror=()=>(c(),o(new zA(`Network error`))),s.onabort=()=>(c(),o(new DOMException(`Aborted`,`AbortError`))),s.open(`PUT`,e),s.setRequestHeader(ut,`1`);for(let[e,t]of Object.entries(n))s.setRequestHeader(e,t);s.send(t)})}var HA=new class{items=[];xhrs=new Map;stops=new Set;listeners=new Set;completeListeners=new Set;frame=null;seq=0;subscribe=e=>(this.listeners.add(e),()=>void this.listeners.delete(e));getSnapshot=()=>this.items;onComplete(e){return this.completeListeners.add(e),()=>void this.completeListeners.delete(e)}add(e,t,n,r){let i=[],a=[];for(let o of r){let r=n+o.path.replace(/^\/+/,``);!oA.safeParse(r).success||r.endsWith(`/`)?i.push(r):a.push({id:`u${++this.seq}`,bucket:t,key:r,file:o.file,connectionId:e,loaded:0,speed:0,status:`queued`})}return this.items=[...this.items,...a],this.emit(!0),this.pump(),i}cancel(e){let t=this.items.find(t=>t.id===e);if(this.halt(e),this.update(e,{status:`cancelled`,speed:0},!0),t){let e=RA.get(t);e&&(RA.clear(t),B(ht(t.bucket,`/multipart/abort`),{method:`POST`,body:{key:t.key,uploadId:e.uploadId},headers:{[IA]:t.connectionId}}).catch(()=>{}))}this.pump()}pause(e){this.halt(e),this.update(e,{status:`paused`,speed:0},!0),this.pump()}resume(e){this.update(e,{status:`queued`,error:void 0},!0),this.pump()}retry(e){this.resume(e)}cancelAll(){for(let e of this.items)(e.status===`queued`||e.status===`uploading`||e.status===`paused`)&&this.cancel(e.id)}clearFinished(){this.items=this.items.filter(e=>e.status===`queued`||e.status===`uploading`||e.status===`paused`),this.emit(!0)}halt(e){this.stops.add(e);for(let t of this.xhrs.get(e)??[])t.abort()}pump(){let e=this.items.filter(e=>e.status===`uploading`).length,t=this.items.filter(e=>e.status===`queued`).slice(0,Math.max(0,jA-e));for(let e of t)this.start(e)}track(e){return t=>{let n=this.xhrs.get(e)??new Set;return n.add(t),this.xhrs.set(e,n),()=>void n.delete(t)}}async start(e){this.stops.delete(e.id),this.update(e.id,{status:`uploading`,error:void 0},!0);let t=this.speedMeter(e.id);try{if(e.file.size>NA?await this.uploadMultipart(e,t):await this.uploadSingle(e,t),this.stops.has(e.id))return;this.update(e.id,{status:`done`,loaded:e.file.size,speed:0},!0);for(let t of this.completeListeners)t(e.bucket)}catch(t){if(this.stops.has(e.id)||t instanceof DOMException&&t.name===`AbortError`)return;this.update(e.id,{status:`error`,error:t instanceof Error?t.message:String(t),speed:0},!0)}finally{this.xhrs.delete(e.id),this.pump()}}speedMeter(e){let t=0,n=performance.now(),r=0;return i=>{let a=performance.now(),o=(a-n)/1e3;if(o>.3){let e=Math.max(0,(i-t)/o);r=r?r*.7+e*.3:e,t=i,n=a}this.update(e,{loaded:i,speed:r})}}async uploadSingle(e,t){let n=mt(ht(e.bucket,`/upload`),{key:e.key,contentType:e.file.type||void 0});for(let r=1;;r++)try{await VA(n,e.file,{"Content-Type":e.file.type||`application/octet-stream`,[IA]:e.connectionId},t,this.track(e.id));return}catch(t){if(!(t instanceof zA)||r>=FA||this.stops.has(e.id))throw t;await BA(1e3*2**(r-1))}}async uploadMultipart(e,t){let n={[IA]:e.connectionId},r=t=>ht(e.bucket,`/multipart${t}`),i=RA.get(e),a=[];if(i)try{a=(await B(r(`/parts`),{query:{key:e.key,uploadId:i.uploadId},headers:n})).parts,this.update(e.id,{resumed:!0})}catch(t){if(!(t instanceof pt&&t.status===404))throw t;RA.clear(e),i=null}i||(i={uploadId:(await B(r(``),{method:`POST`,body:{key:e.key,contentType:e.file.type||void 0},headers:n})).uploadId,partSize:LA(e.file.size)},RA.set(e,i));let{uploadId:o,partSize:s}=i,c=Math.ceil(e.file.size/s),l=t=>t===c?e.file.size-(c-1)*s:s,u=new Map;for(let e of a)e.size===l(e.partNumber)&&u.set(e.partNumber,e.etag);let d=new Map,f=[...u.keys()].reduce((e,t)=>e+l(t),0),p=()=>t(f+[...d.values()].reduce((e,t)=>e+t,0));p();let m=Array.from({length:c},(e,t)=>t+1).filter(e=>!u.has(e));await Promise.all(Array.from({length:Math.min(MA,m.length)},async()=>{for(let t=m.shift();t!==void 0;t=m.shift()){if(this.stops.has(e.id))return;let i=(t-1)*s,a=e.file.slice(i,i+l(t)),c=mt(r(`/part`),{key:e.key,uploadId:o,partNumber:t});for(let r=1;;r++)try{let r=await VA(c,a,{"Content-Type":`application/octet-stream`,...n},e=>(d.set(t,e),p()),this.track(e.id));u.set(t,r.etag);break}catch(n){if(d.delete(t),!(n instanceof zA)||r>=FA||this.stops.has(e.id))throw n;await BA(1e3*2**(r-1))}d.delete(t),f+=l(t),p()}})),this.stops.has(e.id)||(await B(r(`/complete`),{method:`POST`,body:{key:e.key,uploadId:o,parts:[...u].map(([e,t])=>({PartNumber:e,ETag:t}))},headers:n}),RA.clear(e))}update(e,t,n=!1){this.items=this.items.map(n=>n.id===e?{...n,...t}:n),this.emit(n)}emit(e){if(e){this.frame!==null&&cancelAnimationFrame(this.frame),this.frame=null;for(let e of this.listeners)e()}else this.frame===null&&(this.frame=requestAnimationFrame(()=>{this.frame=null;for(let e of this.listeners)e()}))}};function UA(){return(0,d.useSyncExternalStore)(HA.subscribe,HA.getSnapshot)}function WA(e){return new Promise((t,n)=>e.readEntries(t,n))}async function GA(e,t){if(e.isFile){let n=await new Promise((t,n)=>e.file(t,n));t.push({file:n,path:e.fullPath.replace(/^\//,``)})}else if(e.isDirectory){let n=e.createReader();for(;;){let e=await WA(n);if(!e.length)break;for(let n of e)await GA(n,t)}}}async function KA(e){let t=[...e.items].filter(e=>e.kind===`file`).map(e=>e.webkitGetAsEntry?.()).filter(e=>!!e);if(!t.length)return[...e.files].map(e=>({file:e,path:e.name}));let n=[];for(let e of t)await GA(e,n);return n}function qA(e){return[...e??[]].map(e=>({file:e,path:e.webkitRelativePath||e.name}))}function JA(e){let t=[...e?.files??[]],n=new Date().toISOString().replace(/[:.]/g,`-`).slice(0,19);return t.map((e,r)=>{let i=/^image\.(png|jpe?g|gif|webp)$/i.test(e.name),a=e.name.split(`.`).pop()??`bin`;return{file:e,path:i?`pasted-${n}${t.length>1?`-${r+1}`:``}.${a}`:e.name}})}var YA=(0,d.createContext)(null);function XA(){let e=(0,d.useContext)(YA);if(!e)throw Error(`useApp outside AppContext`);return e}function ZA(e){window.dispatchEvent(new CustomEvent(`s3deck:action`,{detail:e}))}function QA(e){let t=t=>e(t.detail);return window.addEventListener(`s3deck:action`,t),()=>window.removeEventListener(`s3deck:action`,t)}var $A=e=>e.type===`checkbox`,ej=e=>e.type===`file`,tj=e=>e instanceof Date,nj=e=>e==null,rj=e=>typeof e==`object`,ij=e=>!nj(e)&&!Array.isArray(e)&&rj(e)&&!tj(e),aj=e=>ij(e)&&e.target?$A(e.target)?e.target.checked:ej(e.target)?e.target.files:e.target.value:e,oj=/[.[\]'"]/,sj=e=>e.split(oj).filter(Boolean);function cj(e,t){let n=sj(t),r=e._formValues,i=e._defaultValues;for(let e=0;e<n.length-1;e++){let t=n[e];if(r=r==null?r:r[t],i=i==null?i:i[t],r===null||i===null)return null}}var lj=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),uj=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function dj(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof Blob<`u`&&e instanceof Blob,n=typeof FileList<`u`&&e instanceof FileList;if(uj&&(t||n))return e;let r=Array.isArray(e),i=Object.getPrototypeOf(e);if(!r&&i&&i.constructor!==Object)return e;let a=r?Array(e.length):Object.create(i);for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(a[t]=dj(e[t]));return a}var fj={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},pj={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},mj={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},hj=[mj.required,mj.min,mj.max,mj.minLength,mj.maxLength,mj.pattern,mj.validate],gj=`form`,_j=`root`,vj=[`__proto__`,`constructor`,`prototype`],yj=/^\w*$/,bj=e=>yj.test(e),xj=e=>e===void 0,$=(e,t,n)=>{if(!t||!ij(e))return n;let r=bj(t)?[t]:sj(t);if(r.some(e=>vj.includes(e)))return n;let i=r.reduce((e,t)=>nj(e)?void 0:e[t],e);return xj(i)||i===e?xj(e[t])?n:e[t]:i},Sj=e=>typeof e==`boolean`,Cj=e=>typeof e==`function`,wj=(e,t,n)=>{let r=-1,i=bj(t)?[t]:sj(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=ij(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(vj.includes(t))return;e[t]=a,e=e[t]}},Tj=d.createContext(null);Tj.displayName=`HookFormControlContext`;var Ej=()=>d.useContext(Tj),Dj=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==pj.all&&(t._proxyFormState[i]=!r||pj.all),n&&(n[i]=!0),e[i]}});return i},Oj=typeof window<`u`?d.useLayoutEffect:d.useEffect,kj=e=>{let t=e.constructor&&e.constructor.prototype;return ij(t)&&t.hasOwnProperty(`isPrototypeOf`)},Aj=e=>nj(e)||!rj(e),jj=(e,t)=>t.length===0&&!Array.isArray(e)&&Object.getPrototypeOf(e)!==null&&!kj(e);function Mj(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Aj(e)||Aj(t))return Object.is(e,t);if(tj(e)&&tj(t))return Object.is(e.getTime(),t.getTime());if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;if(jj(e,i)||jj(t,a))return Object.is(e,t);if(!i.length&&Array.isArray(e)!==Array.isArray(t))return!1;let o=r.get(e);if(o&&o.has(t))return!0;if(o)o.add(t);else{let n=new WeakSet;n.add(t),r.set(e,n)}for(let a of i){let i=e[a];if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!n||a!==`ref`){let e=t[a];if(tj(i)&&tj(e)||(ij(i)||Array.isArray(i))&&(ij(e)||Array.isArray(e))?!Mj(i,e,n,r):!Object.is(i,e))return!1}}return!0}var Nj=({defaultValues:e,...t})=>({...dj(t),defaultValues:e});function Pj(e,t=dj){let n=d.useRef(!1),r=d.useRef(!1),i=d.useRef(void 0),a=d.useRef(0);return a.current++,!r.current&&e&&(r.current=!0,i.current=t(e())),{resyncIfNeeded:d.useCallback((e,t,o)=>{if(e&&(n.current||r.current&&a.current>1)){let e=t();Mj(i.current,e)||o(e)}n.current=!0},[]),snapshot:d.useCallback((e,n)=>{e&&(i.current=t(n()))},[t])}}function Fj(e){let t=Ej(),{control:n=t,disabled:r,name:i,exact:a}=e||{},o=()=>({...n._formState,defaultValues:n._defaultValues}),[s,c]=d.useState(o),l=d.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:f}=Pj(o,Nj);return Oj(()=>{u(!r,o,c);let e=n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{e(),f(!r,o)}},[n,i,r,a,u,f]),d.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),d.useMemo(()=>Dj(s,n,l.current,!1),[s,n])}var Ij=e=>typeof e==`string`,Lj=(e,t,n,r,i)=>Ij(e)?(r&&t.watch.add(e),$(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),$(n,e,$(i,e)))):(r&&(t.watchAll=!0),n);function Rj(e){let t=Ej(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=d.useRef(i),l=d.useRef(s),u=d.useRef(n),f=d.useRef(r);l.current=s;let p=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[m,h]=d.useState(p),g=d.useRef(m),_=d.useCallback(e=>{let t=Lj(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),v=d.useCallback(e=>{if(!a){let t=Lj(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);Mj(e,g.current)||(h(e),g.current=e)}else h(t),g.current=t}},[n._formValues,n._names,a,r]),{resyncIfNeeded:y,snapshot:b}=Pj(p),x=d.useRef(v);x.current=v;let S=d.useRef(_);S.current=_,Oj(()=>{u.current!==n||!Mj(f.current,r)?(u.current=n,f.current=r,x.current()):y(!a,()=>S.current(),e=>{let t=dj(e);h(t),g.current=t});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{x.current(e.values)}});return()=>{e(),b(!a,()=>S.current())}},[n,o,r,a,y,b]),d.useEffect(()=>n._removeUnmounted());let C=u.current!==n,w=f.current,T=d.useMemo(()=>!C&&!Mj(w,r),[C,r,w]);return(C||T)&&(c.current=i),!a&&(C||T)?_():m}function zj(e){let t=Ej(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=lj(i._names.array,n),l=Rj({control:i,name:n,defaultValue:d.useMemo(()=>{let e=$(i._formValues,n,$(i._defaultValues,n,o));return xj(e)?cj(i,n):e},[i,n,o]),exact:s}),u=Fj({control:i,name:n,exact:s}),f=d.useRef(e),p=d.useRef(a),m=d.useRef(null),h=d.useRef(void 0),g=d.useRef(i.register(n,{...e.rules,value:h.current===n&&!$(i._fields,n)?void 0:l,...Sj(e.disabled)?{disabled:e.disabled}:{}}));h.current=n,f.current=e;let _=d.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!$(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$(u.validatingFields,n)},error:{enumerable:!0,get:()=>$(u.errors,n)}}),[u,n]),v=d.useCallback(e=>{let t=aj(e);return $(i._fields,n)||(g.current=i.register(n,{...f.current.rules,value:t})),g.current.onChange({target:{value:aj(e),name:n},type:fj.CHANGE})},[n,i]),y=d.useCallback(()=>{let e=$(i._formValues,n);return $(i._fields,n)||(g.current=i.register(n,{...f.current.rules,value:e})),g.current.onBlur({target:{value:e,name:n},type:fj.BLUR})},[n,i]),b=d.useCallback(e=>{e&&(m.current={focus:()=>Cj(e.focus)&&e.focus(),select:()=>Cj(e.select)&&e.select(),setCustomValidity:t=>Cj(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Cj(e.reportValidity)&&e.reportValidity()});let t=$(i._fields,n);t&&t._f&&e&&(t._f.ref=m.current,t._f._c=!0)},[i._fields,n]),x=d.useMemo(()=>({name:n,value:l,...Sj(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:v,onBlur:y,ref:b}),[n,r,u.disabled,v,y,b,l]);return d.useEffect(()=>{if(p.current=a,i._options.shouldUnregister||a){let e=dj($(a?i._defaultValues:i._options.values||i._defaultValues,n,$(i._options.defaultValues,n,f.current.defaultValue)));wj(i._defaultValues,n,e),xj($(i._formValues,n))&&wj(i._formValues,n,e)}else!c&&!xj(f.current.defaultValue)&&xj($(i._defaultValues,n))&&(wj(i._defaultValues,n,dj(f.current.defaultValue)),i._subjects.state.next({defaultValues:i._defaultValues}))},[i,n,c,a]),d.useEffect(()=>{g.current=i.register(n,{...f.current.rules,...Sj(f.current.disabled)?{disabled:f.current.disabled}:{}});let e=(e,t)=>{let n=$(i._fields,e);n&&n._f&&(n._f.mount=t,n._f._c=t)};if(e(n,!0),!c&&i.register(n,{...f.current.rules,...Sj(f.current.disabled)?{disabled:f.current.disabled}:{}}),m.current){let e=$(i._fields,n);e&&e._f&&(e._f.ref=m.current)}return()=>{let t=i._options.shouldUnregister||p.current;(c?t&&!i._state.action:t)?i.unregister(n):e(n,!1)}},[n,i,c]),d.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),d.useMemo(()=>({field:x,formState:u,fieldState:_}),[x,u,_])}var Bj=e=>e.render(zj(e)),Vj=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)}),Hj=(e,t,n={})=>n.shouldFocus||xj(n.shouldFocus)?n.focusName||`${e}.${xj(n.focusIndex)?t:n.focusIndex}.`:``,Uj=e=>({isOnSubmit:!e||e===pj.onSubmit,isOnBlur:e===pj.onBlur,isOnChange:e===pj.onChange,isOnAll:e===pj.all,isOnTouch:e===pj.onTouched}),Wj=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},Gj=(e,t,n)=>{for(let r of n||Object.keys(e)){if(r===`_f`)continue;let i=n?$(e,r):e[r];if(i){let{_f:e}=i;if(e){let n=e.refs?.find(e=>!e.disabled);if(n&&t(n,e.name)||e.ref&&t(e.ref,e.name)||Gj(i,t))return!0}else if((ij(i)||Array.isArray(i))&&Gj(i,t))return!0}}},Kj=(e,t,n)=>{let r=$(e,n),i=Array.isArray(r)?r:[];return wj(i,_j,$(t[n],_j,t[n])),wj(e,n,i),e},qj=e=>ij(e)&&!Object.keys(e).length,Jj=e=>{if(!uj)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Yj=e=>e.type===`radio`,Xj=e=>e instanceof RegExp,Zj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Qj={value:!1,isValid:!1},$j={value:!0,isValid:!0},eM=e=>{if(!Array.isArray(e))return Qj;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?Qj:!t.attributes||!(`value`in t.attributes)||xj(t.value)||t.value===``?$j:{value:t.value,isValid:!0}},tM={isValid:!1,value:null},nM=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,tM):tM;function rM(e,t,n=`validate`){if(Ij(e)||Array.isArray(e)&&e.length&&e.every(Ij)||Sj(e)&&!e)return{type:n,message:Ij(e)?e:``,ref:t}}var iM=e=>ij(e)&&!Xj(e)?e:{value:e,message:``},aM=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_,_c:v}=e._f,y=$(n,h);if(!_||t.has(h))return{};let b=s?s[0]:o,x=e=>{if(i&&b.reportValidity){let t=Sj(e)?``:e||``;s?s.forEach(e=>Cj(e.setCustomValidity)&&e.setCustomValidity(t)):b.setCustomValidity(t),b.reportValidity()}},S={},C=!v&&Yj(o),w=!v&&$A(o),T=C||w,E=(g||ej(o))&&xj(o.value)&&xj(y)||Jj(o)&&o.value===``&&!v||y===``||Array.isArray(y)&&!y.length,D=Zj.bind(null,h,r,S),O=(e,t,n,r=mj.maxLength,i=mj.minLength)=>{let a=e?t:n;S[h]={type:e?r:i,message:a,ref:o,...D(e?r:i,a)}};if(a?!Array.isArray(y)||!y.length:c&&(!T&&(E||nj(y))||Sj(y)&&!y||w&&!eM(s).isValid||C&&!nM(s).isValid)){let{value:e,message:t}=Ij(c)?{value:!!c,message:c}:iM(c);if(e&&(S[h]={type:mj.required,message:t,ref:b,...D(mj.required,t)},!r))return x(t),S}if(!E&&(!nj(d)||!nj(f))){let e,t,n=iM(f),i=iM(d);if(!nj(y)&&!tj(y)&&!isNaN(y)){let r=!v&&o.valueAsNumber||y&&+y;nj(n.value)||(e=r>n.value),nj(i.value)||(t=r<i.value)}else{let r=!v&&o.valueAsDate||new Date(y),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;Ij(n.value)&&y&&(e=s?a(y)>a(n.value):c?y>n.value:r>new Date(n.value)),Ij(i.value)&&y&&(t=s?a(y)<a(i.value):c?y<i.value:r<new Date(i.value))}if((e||t)&&(O(!!e,n.message,i.message,mj.max,mj.min),!r))return x(S[h].message),S}if((!nj(l)||!nj(u))&&!E&&(Ij(y)||a&&Array.isArray(y))){let e=iM(l),t=iM(u),n=!nj(e.value)&&y.length>+e.value,i=!nj(t.value)&&y.length<+t.value;if((n||i)&&(O(n,e.message,t.message),!r))return x(S[h].message),S}if(p&&!E&&Ij(y)){let{value:e,message:t}=iM(p);if(Xj(e)&&!y.match(e)&&(S[h]={type:mj.pattern,message:t,ref:o,...D(mj.pattern,t)},!r))return x(t),S}if(m){if(Cj(m)){let e=rM(await m(y,n),b);if(e&&(S[h]={...e,...D(mj.validate,e.message)},!r))return x(e.message),S}else if(ij(m)){let e={};for(let t in m){if(!qj(e)&&!r)break;let i=rM(await m[t](y,n),b,t);i&&(e={...i,...D(t,i.message)},r||x(i.message),r&&(S[h]=e))}if(!qj(e)&&(S[h]={ref:b,...e},!r))return S}}let k=S[h];return x(!k||k.message),S},oM=e=>Array.isArray(e)?e:[e],sM=(e,t)=>[...e,...oM(t)],cM=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function lM(e,t,n){return[...e.slice(0,t),...oM(n),...e.slice(t)]}var uM=(e,t,n)=>Array.isArray(e)?(xj(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],dM=(e,t)=>[...oM(t),...oM(e)],fM=e=>Array.isArray(e)?e.filter(Boolean):[];function pM(e,t){let n=0,r=[...e];for(let e of t)r.splice(e-n,1),n++;return fM(r).length?r:[]}var mM=(e,t)=>xj(t)?[]:pM(e,[...new Set(oM(t))].sort((e,t)=>e-t)),hM=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function gM(e,t){let n=t.length-1,r=0;for(;r<n;){if(nj(e)){e=void 0;break}e=e[t[r]],r++}return e}function _M(e){for(let t in e)if(e.hasOwnProperty(t)&&!xj(e[t]))return!1;return!0}function vM(e,t){if(!ij(e)&&!Array.isArray(e))return e;if(Ij(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:bj(t)?[t]:sj(t);if(n.some(e=>vj.includes(String(e))))return e;let r=n.length===1?e:gM(e,n),i=n.length-1,a=n[i];return r&&(ij(r)||Array.isArray(r))&&delete r[a],i!==0&&(ij(r)&&qj(r)||Array.isArray(r)&&_M(r))&&vM(e,n.slice(0,-1)),e}var yM=(e,t,n)=>(e[t]=n,e);function bM(e){let t=Ej(),{control:n=t,name:r,keyName:i=`id`,disabled:a,shouldUnregister:o,rules:s}=e,c=()=>n._getFieldArray(r),[l,u]=d.useState(c),f=d.useRef(n._getFieldArray(r).map(Vj)),p=d.useRef(!1),{resyncIfNeeded:m,snapshot:h}=Pj(c),g=d.useRef(n),_=d.useRef(r),v=d.useRef({control:n,name:r,rules:s});a||n._names.array.add(r),d.useMemo(()=>{!a&&l&&((s||v.current.rules&&v.current.control===n&&v.current.name===r)&&n.register(r,s),v.current={control:n,name:r,rules:s})},[n,r,l,s,a]),Oj(()=>{if(a)return;if(g.current===n&&_.current===r)m(!0,c,e=>{u(e),f.current=e.map(Vj)});else{g.current=n,_.current=r;let e=c();Mj(l,e)||(u(e),f.current=e.map(Vj)),h(!0,c)}let e=n._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===r||!t){let n=$(e,r);Array.isArray(n)?(u(n),f.current=n.map(Vj)):t||(u([]),f.current=[])}}}).unsubscribe;return()=>{e(),h(!0,c)}},[n,r,a,m,h]);let y=d.useCallback(e=>{p.current=!0,n._setFieldArray(r,e)},[n,r]);return d.useEffect(()=>{if(a){n._state.actionArrayLengths.delete(r);return}n._state.action=!1,n._state.actionArrayLengths.delete(r),Wj(r,n._names)&&n._subjects.state.next({...n._formState});let e=Uj(n._options.mode),t=Uj(n._options.reValidateMode);if(p.current&&(!e.isOnSubmit||n._formState.isSubmitted)&&!(n._formState.isSubmitted&&t.isOnSubmit)&&(!e.isOnBlur||n._formState.isSubmitted&&t.isOnChange)){let e=$(n._formValues,r);if(n._options.resolver)n._runSchema([r]).then(t=>{if(n._updateIsValidating([r]),e!==$(n._formValues,r))return;let i=$(t.errors,r);Mj($(n._formState.errors,r),i,!0)||(i?ij(i)&&!Object.keys(i).some(e=>!Number.isNaN(+e))?Kj(n._formState.errors,{[r]:i},r):wj(n._formState.errors,r,i):vM(n._formState.errors,r),n._formState.errors={...n._formState.errors},n._subjects.state.next({errors:n._formState.errors}))});else{let t=$(n._fields,r);t&&t._f&&aM(t,n._names.disabled,n._formValues,n._options.criteriaMode===pj.all,n._options.shouldUseNativeValidation,!0).then(t=>{if(e===$(n._formValues,r)){if(!qj(t))Kj(n._formState.errors,t,r),n._formState.errors={...n._formState.errors},n._subjects.state.next({errors:n._formState.errors});else{let e=$(n._formState.errors,r);e&&e[_j]&&(vM(n._formState.errors,`${r}.${_j}`),n._formState.errors={...n._formState.errors},n._subjects.state.next({errors:n._formState.errors}))}}})}}p.current&&n._subjects.state.next({name:r,values:dj(n._formValues)}),n._names.focus&&Gj(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus=``,n._setValid(),p.current=!1},[l,r,n,a]),d.useEffect(()=>(a||xj($(n._formValues,r))&&n._setFieldArray(r),()=>{if(n._state.actionArrayLengths.delete(r),n._state.actionArrayLengths.size||(n._state.action=!1),a)return;let e=!(n._options.shouldUnregister||o),t=(e,t)=>{let r=$(n._fields,e);r&&r._f&&(r._f.mount=t)};p.current&&e&&n._subjects.state.next({name:r,values:dj(n._formValues)}),!e&&n._state.action&&[...n._state.actionArrayLengths.keys()].some(e=>r.startsWith(e+`.`))||(e?t(r,!1):n.unregister(r))}),[r,n,i,o,a]),{swap:d.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);hM(i,e,t),hM(f.current,e,t),y(i),u(i),n._setFieldArray(r,i,hM,{argA:e,argB:t},!1)},[y,r,n,a]),move:d.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);uM(i,e,t),uM(f.current,e,t),y(i),u(i),n._setFieldArray(r,i,uM,{argA:e,argB:t},!1)},[y,r,n,a]),prepend:d.useCallback((e,t)=>{if(a)return;let i=oM(dj(e)),o=dM(n._getFieldArray(r),i);n._names.focus=Hj(r,0,t),f.current=dM(f.current,i.map(Vj)),y(o),u(o),n._setFieldArray(r,o,dM,{argA:cM(e)})},[y,r,n,a]),append:d.useCallback((e,t)=>{if(a)return;let i=oM(dj(e)),o=sM(n._getFieldArray(r),i);n._names.focus=Hj(r,o.length-1,t),f.current=sM(f.current,i.map(Vj)),y(o),u(o),n._setFieldArray(r,o,sM,{argA:cM(e)})},[y,r,n,a]),remove:d.useCallback(e=>{if(a)return;let t=mM(n._getFieldArray(r),e);f.current=mM(f.current,e),y(t),u(t),!Array.isArray($(n._fields,r))&&wj(n._fields,r,void 0),n._setFieldArray(r,t,mM,{argA:e})},[y,r,n,a]),insert:d.useCallback((e,t,i)=>{if(a)return;let o=oM(dj(t)),s=lM(n._getFieldArray(r),e,o);n._names.focus=Hj(r,e,i),f.current=lM(f.current,e,o.map(Vj)),y(s),u(s),n._setFieldArray(r,s,lM,{argA:e,argB:cM(t)})},[y,r,n,a]),update:d.useCallback((e,t)=>{if(a)return;let i=dj(t),o=yM(n._getFieldArray(r),e,i);f.current=[...o].map((t,n)=>!t||n===e?Vj():f.current[n]),y(o),u([...o]),n._setFieldArray(r,o,yM,{argA:e,argB:cM(t)})},[y,r,n,a]),replace:d.useCallback(e=>{if(a)return;let t=oM(dj(e));f.current=t.map(Vj),y([...t]),u([...t]),n._setFieldArray(r,[...t],e=>Array.isArray(e)?e.slice(0,t.length):e,{})},[y,r,n,a]),fields:d.useMemo(()=>l.map((e,t)=>({...e,...Sj(a)?{disabled:a}:{},[i]:f.current[t]||Vj()})),[l,i,a])}}var xM=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:n=>{let r=e;t++;for(let e of r)e.next&&e.next(n);r===e&&t--},subscribe:n=>(e.add(n),{unsubscribe:()=>{t&&=(e=new Set(e),0),e.delete(n)}}),unsubscribe:()=>{e=new Set,t=0}}};function SM(e,t){let n=Array.isArray(e)?[]:{};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let i=e[r],a=t[r];i&&(ij(i)||Array.isArray(i))&&a?n[r]=SM(i,a):e[r]&&(n[r]=a)}return n}var CM=(e,t)=>e!==null&&rj(e)&&Object.prototype.hasOwnProperty.call(e,t),wM=(e,t)=>{if(!t)return!1;let n=e;for(let r of bj(t)?[t]:sj(t)){if(!CM(n,r))return CM(e,t);n=n[r]}return!0},TM=e=>e.type===`select-multiple`,EM=e=>{let t=[...e.options];return!e.multiple&&e.size<2&&!t.some(e=>e.defaultSelected)?e.selectedIndex!==t.findIndex(e=>!e.disabled&&!e.parentElement?.matches(`optgroup[disabled]`)):t.some(e=>e.selected!==e.defaultSelected)},DM=e=>$A(e)?e.checked!==e.defaultChecked:e.type===`select-one`||TM(e)?EM(e):!Yj(e)&&e.type!==`range`&&e.type!==`color`&&`defaultValue`in e&&e.value!==e.defaultValue,OM=e=>Yj(e)||$A(e),kM=e=>Jj(e)&&e.isConnected;function AM(e){return Array.isArray(e)||ij(e)}function jM(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];AM(o)&&AM($(t,a))?jM(o,t,a,r):o&&r.push(a)}return r}var MM=e=>{for(let t in e)if(Cj(e[t]))return!0;return!1};function NM(e){return Array.isArray(e)||ij(e)&&!MM(e)}function PM(e){return!!(e&&`_f`in e)}function FM(e){return Array.isArray(e)?!e.some(e=>!xj(e)):!Object.keys(e).length}function IM(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function LM(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];NM(i)&&(!Array.isArray(i)||!PM(a))?(t[r]=Array.isArray(i)?[]:{},LM(i,t[r],a),FM(t[r])&&IM(t,r)):xj(i)||(t[r]=!0)}return t}function RM(e,t,n,r){n||=LM(t,Array.isArray(nj(t)?e:t)?[]:{},r);for(let i in e){let a=e[i],o=r&&r[i];NM(a)&&(!Array.isArray(a)||!PM(o))?(xj(t)||Aj(n[i])?n[i]=LM(a,Array.isArray(a)?[]:{},o):RM(a,nj(t)?{}:t[i],n[i],o),FM(n[i])&&IM(n,i)):Mj(a,nj(t)?void 0:t[i])?IM(n,i):n[i]=!0}return n}var zM=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},BM=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>xj(e)?e:t?e===``?NaN:e&&+e:n&&Ij(e)?new Date(e):r?r(e):e;function VM(e){let t=e.ref;return ej(t)?t.files:Yj(t)?nM(e.refs).value:TM(t)?[...t.selectedOptions].filter(e=>!e.disabled&&!e.closest?.call(e,`optgroup[disabled]`)).map(({value:e})=>e):$A(t)?eM(e.refs).value:BM(t.value,e)}var HM=(e,t,n,r)=>{let i={};for(let n of e){let e=$(t,n);e&&wj(i,n,dj(e._f))}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},UM=e=>xj(e)?e:Xj(e)?e.source:ij(e)?Xj(e.value)?e.value.source:e.value:e,WM=`AsyncFunction`,GM=e=>{if(!e||!e.validate)return!1;if(Cj(e.validate))return e.validate.constructor.name===WM;if(ij(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===WM)return!0}return!1},KM=e=>e.mount&&(e.required||!xj(e.required)&&e.required!==!1||!xj(e.min)||!xj(e.max)||!xj(e.maxLength)||!xj(e.minLength)||e.pattern||e.validate);function qM(e,t,n){let r=$(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=$(t,r),o=$(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var JM=(e,t,n)=>{let r=Object.keys(e).filter(e=>e!==`name`);return!r.length||n&&r.length>=Object.keys(t).length||r.find(e=>t[e]===(!n||pj.all))},YM=(e,t,n)=>n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e),XM=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return YM(e,t,n);for(let r of e)if(r&&YM(r,t,n))return!0;return!1},ZM=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,QM=(e,t)=>{let n=$(e,t);!fM(n).length&&!(n&&n.root)&&vM(e,t)},$M={mode:pj.onSubmit,reValidateMode:pj.onChange,shouldFocusError:!0},eN=(e,t)=>{for(let t in e)delete e[t];Object.assign(e,t)},tN={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function nN(e={}){let t={...$M,...e},n={...dj(tN),isLoading:Cj(t.defaultValues),errors:dj(t.errors)||{},disabled:t.disabled||!1},r={},i=(ij(t.defaultValues)||ij(t.values))&&dj(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:dj(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l={},u={},d=new Set,f=Uj(t.mode),p=Uj(t.reValidateMode),m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...m},g={},_=(...e)=>e.some(e=>h[e]||g[e]),v=e=>{for(let t of d)if(XM(t.name,e,t.exact))return!0;return!1},y={array:xM(),state:xM()},b=0,x=0,S=0,C=0,w={},T=t.criteriaMode===pj.all,E=(e,t)=>n=>{clearTimeout(u[e]),u[e]=setTimeout(t,n)},D=e=>{clearTimeout(u[e]),delete u[e],delete l[e]},O=e=>{D(e);let t=`${e}.`;for(let e of Object.keys(l))e.startsWith(t)&&D(e)},k=async e=>{if(!o.keepIsValid&&!t.disabled&&(_(`isValid`)||e)){let i=++b,a=S,o;if(t.resolver?(o=qj((await I()).errors),i===b&&j()):o=await le({fields:r,onlyCheckValid:!0,eventType:fj.VALID}),i!==b)return;if(a!==S)return k(e);o!==n.isValid&&y.state.next({isValid:o})}},A=(e,t)=>{let r=[...e];if(!r.some(e=>e&&(t?$(n.validatingFields,e)!==!0:wM(n.validatingFields,e))))return;let i=dj(n.validatingFields);for(let e of r)e&&(t?wj(i,e,!0):vM(i,e));Mj(n.validatingFields,i)||(n.validatingFields=i)},j=(e,r)=>{!t.disabled&&_(`isValidating`,`validatingFields`)&&(A(e||c.mount,r),y.state.next({validatingFields:n.validatingFields,isValidating:!qj(n.validatingFields)}))},M=()=>{n.dirtyFields=RM(i,a,void 0,r)},N=(e,i=[],c,l,u=!0,d=!0)=>{if(l&&c&&!t.disabled){o.action=!0,o.keepIsValid=!1;let t=$(r,e),a=t&&t._f,f=a?Object.assign([],t):t;if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(f)?f.length:0),d&&Array.isArray(f)){let t=c(f,l.argA,l.argB)||f;a?wj(r,e,{...t,_f:a}):u&&wj(r,e,t)}let p=$(n.errors,e);if(d&&Array.isArray(p)){let t=p.root,r=c(p,l.argA,l.argB)||p;t&&(r.root=t),u&&wj(n.errors,e,r),QM(n.errors,e),n.errors={...n.errors}}let m=$(n.touchedFields,e),h=d&&Array.isArray(m);if(h){let t=c(m,l.argA,l.argB);u&&wj(n.touchedFields,e,t)}let g=$(n.dirtyFields,e);if(d&&Array.isArray(g)){let t=c(g,l.argA,l.argB)||g;u&&wj(n.dirtyFields,e,t)}_(`dirtyFields`)?M():s=!0,y.state.next({name:e,isDirty:de(e,i),dirtyFields:n.dirtyFields,...h&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else wj(a,e,i)},ee=(e,t)=>{wj(n.errors,e,t),n.errors={...n.errors},y.state.next({errors:n.errors})},te=e=>{Object.keys(l).forEach(D);let t=!qj(e);n.errors=dj(e),y.state.next({errors:n.errors,...t?{isValid:!1}:{}}),!t&&o.mount&&k()},P=e=>bj(e)?[e]:sj(e),ne=e=>{let t=P(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=nj(n)?n:n[i],r=nj(r)?r:r[i],n===null&&r!==null)return!0}return!1},re=e=>{if(!o.actionArrayLengths.size)return!1;let t=P(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(nj(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;if(o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a],xj(n)&&i!==-1&&e>i&&+t[i]<s)return!0}return!1},ie=e=>{let t=a;for(let n of P(e)){if(Array.isArray(t)&&+n>=t.length)return!0;t&&=t[n]}return!1},ae=(e,l,u,d)=>{let f=$(r,e);if(f){if(ne(e)||re(e))return;let r=xj($(a,e)),p=$(a,e,xj(u)?$(i,e):u),m=!!d&&!n.isReady&&DM(d);if(xj(p)||d&&d.defaultChecked||m||l){let t=l?p:VM(f._f);xj(t)&&ie(e)||(_(`dirtyFields`)&&!Mj($(a,e),t)&&(s=!0),wj(a,e,t),m&&F(e,t))}else fe(e,p);o.mount&&!o.action&&(t.resolver&&_(`isValidating`,`validatingFields`)?Promise.resolve().then(()=>k()):k(),r&&n.isDirty&&_(`isDirty`)&&(de()||(n.isDirty=!1,y.state.next({...n}))),t.shouldUnregister&&r&&!xj($(a,e))&&Wj(e,c)&&(o.watch=!0))}},F=(e,o,c,l,u)=>{let d=!1,f=!1,p={name:e};if(!t.disabled||l===!0){if(!c||l){let t=Mj($(i,e),o);if(_(`isDirty`)&&(f=n.isDirty,n.isDirty=p.isDirty=!t||de(),d=f!==p.isDirty),f=!!$(n.dirtyFields,e),t)vM(n.dirtyFields,e);else{let t=$(i,e),a=$(r,e),s=!(a&&a._f)&&(ij(t)||Array.isArray(t))?RM(t,o,void 0,a):!0;wj(n.dirtyFields,e,s)}let c=!1;if(s||t&&(_(`isDirty`)?n.isDirty:de())){s=!1;let e=RM(i,a,void 0,r);Mj(n.dirtyFields,e)||(c=!0,eN(n.dirtyFields,e))}p.dirtyFields=n.dirtyFields,d||=_(`dirtyFields`)&&(c||f!==!t)}if(c){let t=wM(n.touchedFields,e)?$(n.touchedFields,e):void 0;t||(wj(n.touchedFields,e,c),p.touchedFields=n.touchedFields,d||=_(`touchedFields`)&&t!==c)}d&&u&&y.state.next(p)}return d?p:{}},oe=(e,r,i,a)=>{let o=$(n.errors,e),s=_(`isValid`)&&Sj(r)&&n.isValid!==r;if(t.delayError&&i?(l[e]=E(e,()=>ee(e,i)),l[e](t.delayError)):(D(e),i?wj(n.errors,e,i):vM(n.errors,e),n.errors={...n.errors}),(i?!Mj(o,i,!0):o)||!qj(a)||s){let t={...a,...s&&Sj(r)?{isValid:r}:{},errors:n.errors,name:e};y.state.next(t)}},I=async e=>(j(e,!0),await t.resolver(a,t.context,HM(e||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),se=async e=>{let t=S,i=C,a=e?e.filter(e=>$(r,e)):[],{errors:o}=await I(e);if(t!==S)return o;if(j(e),e){for(let t of e){if(a.includes(t)&&(!$(r,t)||w[t]>i)){vM(o,t);continue}let e=$(o,t);O(t);let s=c.array.has(t)&&ij(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e))),l=$(r,t),u=ij(l)&&Object.keys(l).some(e=>e!==`_f`);s?Kj(n.errors,{[t]:e},t):e&&(e.type||e.message)||Array.isArray(e)||ij(e)&&u?wj(n.errors,t,e):vM(n.errors,t)}n.errors={...n.errors}}else Object.keys(l).forEach(D),n.errors=o;return o},ce=async({name:e,eventType:r,onlyCheckValid:i})=>{if(t.validate){let o=S,s=++x,c=await t.validate({formValues:a,formState:n,name:e,eventType:r});if(o!==S||r!==fj.SUBMIT&&s!==x)return!0;if(i&&(ij(c)?Object.values(c).some(Boolean):Ij(c)||!c))return!1;if(ij(c)){let e=!0;Se(gj);for(let t in c){let n=c[t];n&&(e=!1,Ce(`${gj}.${t}`,{message:Ij(n.message)?n.message:``,type:n.type||mj.validate}))}return e}return Ij(c)||!c?(Se(gj),Ce(gj,{message:c||``,type:mj.validate}),!1):(Se(gj),!0)}return!0},le=async({fields:e,onlyCheckValid:i,name:o,eventType:s,context:l={valid:!0,runRootValidation:!1}})=>{let u=S;if(t.validate&&!l.runRootValidation&&(l.runRootValidation=!0,!await ce({name:o,eventType:s,onlyCheckValid:i})&&(l.valid=!1,i)))return l.valid;for(let o in e){let d=e[o];if(d){let{_f:e,...f}=d;if(e){let o=c.array.has(e.name),s=d._f&&GM(d._f),f=_(`isValidating`,`validatingFields`);s&&f&&j([e.name],!0);let p=C,m=await aM(d,c.disabled,a,T,t.shouldUseNativeValidation&&!i,o);if(u!==S)return l.valid;if(s&&f&&j([e.name]),!$(r,e.name)||w[e.name]>p)continue;if(m[e.name]&&(l.valid=!1,i)||(i||(D(e.name),$(m,e.name)?o?Kj(n.errors,m,e.name):wj(n.errors,e.name,m[e.name]):vM(n.errors,e.name)),t.shouldUseNativeValidation&&m[e.name]))break}!qj(f)&&await le({context:l,onlyCheckValid:i,fields:f,name:o,eventType:s})}}return l.valid},ue=()=>{for(let e of c.unMount){let t=$(r,e);t&&(t._f.refs?t._f.refs.every(e=>!kM(e)):!kM(t._f.ref))&&De(e)}c.unMount=new Set},de=(e,t)=>(e&&!xj(t)&&wj(a,e,t),!Mj(o.mount?a:i,i)),L=(e,t,n)=>{let r=o.mount?a:xj(t)||!xj(e)?i:t;return Lj(e,c,xj(e)?{...r}:r,n,t)},R=e=>fM($(o.mount?a:i,e,t.shouldUnregister?$(i,e,[]):[])),fe=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=$(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&wj(a,e,BM(t,n)),l=Jj(n.ref)&&nj(t)?``:t,TM(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?$A(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(e.checked=Array.isArray(l)?!xj(e.value)&&l.includes(e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):ej(n.ref)?n.ref.value=``:(n.ref.value=l,n.ref.type||o||s||y.state.next({name:e,values:i?a:v(e)?dj(a):void 0})))}(n.shouldDirty||n.shouldTouch)&&F(e,c&&c._f&&!c._f.disabled&&(c._f.valueAsNumber||c._f.valueAsDate||c._f.setValueAs)?BM(t,c._f):l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&ve(e,{delayError:n.delayError}),n.shouldValidate&&c&&c._f&&c._f.deps&&(!Array.isArray(c._f.deps)||c._f.deps.length>0)&&ve(c._f.deps)},pe=(e,t,n,i=!1,o=!1,s=!1)=>{for(let l in t){if(!Object.prototype.hasOwnProperty.call(t,l))continue;let u=t[l],d=e+`.`+l,f=$(r,d);c.array.has(d)&&y.array.next({name:d,values:i?a:dj(a)}),(c.array.has(e)||ij(u)||f&&!f._f)&&!tj(u)?pe(d,u,n,i,o,s):fe(d,u,n,i,o,s)}},me=(e,t,i,s,l=!1)=>{let u=$(r,e),d=c.array.has(e),f=s?t:dj(t),p=Mj($(a,e),f);if(p||wj(a,e,f),d)y.array.next({name:e,values:s?a:dj(a)}),_(`isDirty`,`dirtyFields`)&&i.shouldDirty&&(M(),n.isDirty=de(e,f),l||y.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:n.isDirty})),i.shouldValidate&&ve(e,{delayError:i.delayError});else{let t=Array.isArray(f)&&!f.length||qj(f),n=!p&&!l;!u||u._f||nj(f)||t?fe(e,f,i,s,l,n):pe(e,f,i,s,l,n)}if(!p&&!l){let t=Wj(e,c),r=o.mount||t?e:void 0,i=d?[]:zM(c.array,e),l=s?a:v(r)||i.some(v)?dj(a):void 0;y.state.next({...t&&n,name:r,values:l});for(let e of i)y.state.next({name:e,values:l&&dj(a)})}},he=(e,t,n={})=>me(e,t,n,!1),z=(e,t={})=>{let r=Cj(e)?e(a):e;if(!Mj(a,r)||t.shouldValidate||t.shouldDirty||t.shouldTouch){a={...a,...r};for(let e of new Set([...c.mount,...c.array]))wM(r,e)&&me(e,$(r,e),t,!0,!0);if(t.shouldDirty&&_(`isDirty`,`dirtyFields`))for(let e of Object.keys(r))F(e,a[e],!1,!0);y.state.next({...n,name:void 0,type:void 0,...d.size?{values:a}:{}}),t.shouldValidate&&k()}},ge=async e=>{o.mount=!0;let i=e.target,s=i.name,u=!0,d=$(r,s),m=C,h=e=>{u=!!$(r,s)&&!(w[s]>m)&&Mj(e,$(a,s,e))};if(d){o.keepIsValid=!1;let m,g,x=!1,C=i.type?VM(d._f):aj(e),w=e.type===fj.BLUR||e.type===fj.FOCUS_OUT,E=!KM(d._f)&&!t.validate&&!t.resolver&&!$(n.errors,s)&&!d._f.deps,D=E||ZM(w,$(n.touchedFields,s),n.isSubmitted,p,f),O=Wj(s,c,w);wj(a,s,dj(C)),w?i&&i.readOnly||(d._f.onBlur&&d._f.onBlur(e),Object.prototype.hasOwnProperty.call(l,s)&&(x=!0,l[s](0))):d._f.onChange&&d._f.onChange(e);let A=F(s,C,w),M=!qj(A)||O;if(!w&&y.state.next({name:s,type:e.type,...v(s)?{values:dj(a)}:{}}),D)return E&&n.isValid||!_(`isValid`)||(t.mode===`onBlur`?w&&k():w||k()),M&&y.state.next({name:s,...O?{}:A});if(!t.resolver&&t.validate&&await ce({name:s,eventType:e.type}),!w&&O&&y.state.next({...n}),t.resolver){let e=S,{errors:t}=await I([s]);if(e!==S)return;if(j([s]),h(C),!u){!qj(A)&&y.state.next(A);return}let i=qM(n.errors,r,s),a=qM(t,r,i.name||s);m=a.error,s=a.name,g=qj(t)}else{let n=S,i=++b;if(j([s],!0),m=(await aM(d,c.disabled,a,T,t.shouldUseNativeValidation))[s],n!==S)return;if(j([s]),h(C),u){if(m)g=!1;else if(_(`isValid`)){if(g=await le({fields:r,onlyCheckValid:!0,name:s,eventType:e.type}),n!==S)return;h(C),i!==b&&(g=void 0)}}}u&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&ve(d._f.deps),oe(s,g,m,A),x&&Object.prototype.hasOwnProperty.call(l,s)&&l[s](0))}},_e=(e,t)=>{if($(n.errors,t)&&e.focus)return e.focus(),1},ve=async(e,i={})=>{o.keepIsValid=!1;let a,s,u=oM(e),d=S;if(t.resolver){let t=await se(xj(e)?e:u);a=qj(t),s=e?!u.some(e=>$(t,e)):a}else e?(s=(await Promise.all(u.map(async e=>{let t=$(r,e);return await le({fields:t&&t._f?{[e]:t}:t,eventType:fj.TRIGGER})}))).every(Boolean),(s||n.isValid)&&k()):s=a=await le({fields:r,name:e,eventType:fj.TRIGGER});if(d!==S)return s;if(i.delayError&&t.delayError&&Ij(e)){let r=$(n.errors,e);r?(vM(n.errors,e),l[e]=E(e,()=>ee(e,r)),l[e](t.delayError)):D(e)}if(i.shouldTouch){let t=e=>{!c.array.has(e)&&wj(n.touchedFields,e,!0)};for(let n of e?u:c.mount){let e=$(r,n);ij(e)||Array.isArray(e)?Gj(r,(e,n)=>t(n),[n]):t(n)}}return n.errors={...n.errors},y.state.next({...!Ij(e)||_(`isValid`)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&_(`touchedFields`)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!s&&Gj(r,_e,e?u:c.mount),s},ye=((e,t)=>{let r=xj(e)&&!t?{...o.mount?a:i}:o.mount?a:i;return t&&(r=SM(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),xj(e)?r:Ij(e)?$(r,e):e.map(e=>$(r,e))}),be=(e=>xj(e)?{...n.errors}:Ij(e)?$(n.errors,e):e.map(e=>$(n.errors,e))),xe=(e,t)=>{let r=t||n,i=$(r.errors,e);return{invalid:!!i,isDirty:!!$(r.dirtyFields,e),error:i,isValidating:!!$(r.validatingFields,e),isTouched:!!$(r.touchedFields,e)}},Se=e=>{let t=e?oM(e):void 0;t?t.forEach(e=>{O(e),vM(n.errors,e),n.errors={...n.errors},y.state.next({name:e,errors:n.errors})}):(Object.keys(l).forEach(D),n.errors={},y.state.next({errors:n.errors}))},Ce=(e,t,i)=>{O(e);let a=$(r,e,{_f:{}}),o=a._f&&a._f.ref,{ref:s,message:c,type:l,types:u,...d}=$(n.errors,e)||{};if(wj(n.errors,e,{...d,...t,ref:o}),n.errors={...n.errors},y.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus){let e=a._f?.refs?a._f.refs.find(e=>!e.disabled)||a._f.refs[0]:o;e&&e.focus&&e.focus()}},we=(e,t)=>{if(Cj(e)){let n={};d.add(n);let{unsubscribe:r}=y.state.subscribe({next:n=>`values`in n&&e(n.values||L(void 0,t),n)});return{unsubscribe:()=>{d.delete(n),r()}}}return L(e,t,!0)},Te=e=>{let t={name:e.name,exact:e.exact};e.formState&&e.formState.values&&d.add(t);let{unsubscribe:r}=y.state.subscribe({next:t=>{if(XM(e.name,t.name,e.exact)&&JM(t,e.formState||h,e.reRenderRoot)){let r=t.values||{...a};e.callback({...n,...t,validatingFields:n.validatingFields,isValidating:n.isValidating,values:r,defaultValues:i})}}});return()=>{d.delete(t),r()}},Ee=e=>{o.mount=!0;let t=Object.keys(e.formState||{}).filter(t=>e.formState&&e.formState[t]);for(let e of t)g[e]=(g[e]||0)+1;let n=Te({...e,formState:{...m,...e.formState}});return()=>{for(let e of t.splice(0))g[e]--;n()}},De=(e,o={})=>{let s=e?oM(e):[...c.mount],l=new Set(s);if(e)for(let e of c.mount)s.some(t=>e.startsWith(`${t}.`))&&l.add(e);o.keepIsValidating||A(l);for(let e of l)c.mount.delete(e),c.array.delete(e),c.disabled.delete(e),vM(r,e),!o.keepValue&&vM(a,e),o.keepError||(O(e),vM(n.errors,e)),!o.keepDirty&&vM(n.dirtyFields,e),!o.keepTouched&&vM(n.touchedFields,e),!t.shouldUnregister&&!o.keepDefaultValue&&vM(i,e);o.keepError||(n.errors={...n.errors}),d.size&&y.state.next({values:dj(a)}),y.state.next({...n,...o.keepDirty?{}:{isDirty:de()},...o.keepIsValidating?{}:{isValidating:!qj(n.validatingFields)}}),!o.keepIsValid&&k()},Oe=({disabled:e,name:t})=>{if(Sj(e)&&o.mount||e||c.disabled.has(t)){let n=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),n&&o.mount&&!o.action&&k()}},ke=(e,n={})=>{let a=$(r,e),s=Sj(n.disabled)||Sj(t.disabled),l=!c.registerName.has(e)&&a&&a._f&&!a._f.mount;if(a&&a._f||(w[e]=++C),wj(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),c.mount.add(e),a&&a._f){let t=$(r,e);for(let e of hj)e in n||delete t._f[e]}return a&&!l?Oe({disabled:Sj(n.disabled)?n.disabled:t.disabled,name:e}):ae(e,!0,n.value),{...s?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!UM(n.required),min:UM(n.min),max:UM(n.max),minLength:UM(n.minLength),maxLength:UM(n.maxLength),pattern:UM(n.pattern)}:{},name:e,onChange:ge,onBlur:ge,ref:s=>{if(s){c.registerName.add(e),ke(e,n),c.registerName.delete(e),a=$(r,e);let t=xj(s.value)&&s.querySelectorAll&&s.querySelectorAll(`input,select,textarea`)[0]||s,o=OM(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(kM),t,...Array.isArray($(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),wj(r,e,{_f:u}),ae(e,!1,void 0,t)}else a=$(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(lj(c.array,e)&&o.action)&&c.unMount.add(e)}}},Ae=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Gj(r,_e,c.mount),je=e=>{Sj(e)&&(y.state.next({disabled:e}),Gj(r,(t,n)=>{let i=$(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0))},Me=(e,i)=>async o=>{let s,u,d=!1;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let f=dj(a);y.state.next({isSubmitting:!0});let p=S,m=e=>{throw p===S&&y.state.next({isSubmitting:!1}),e};if(t.resolver){let e;try{e=await I()}catch(e){m(e)}let{errors:t,values:r}=e;if(p!==S)return;j(),Object.keys(l).forEach(D),n.errors=t,f=dj(r)}else{try{await le({fields:r,eventType:fj.SUBMIT})}catch(e){m(e)}if(p!==S)return;vM(n.errors,_j),n.errors={...n.errors}}if(c.disabled.size&&(ij(f)||Array.isArray(f)))for(let e of c.disabled)vM(f,e);if(qj(n.errors)){y.state.next({errors:{}});try{s=await e(f,o)}catch(e){d=!0,u=e}}else{if(i)try{await i({...n.errors},o)}catch(e){m(e)}p===S&&(Ae(),setTimeout(Ae))}if(p===S&&y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:qj(n.errors)&&!d,submitCount:n.submitCount+1,errors:n.errors}),d)throw u;return s},Ne=(e,t={})=>{$(r,e)&&(A([e]),xj(t.defaultValue)?he(e,dj($(i,e))):(he(e,t.defaultValue),i=dj(i),wj(i,e,dj(t.defaultValue))),t.keepTouched||vM(n.touchedFields,e),t.keepDirty||(vM(n.dirtyFields,e),n.isDirty=xj(t.defaultValue)?de():de(e,dj($(i,e)))),t.keepError||(O(e),vM(n.errors,e),n.errors={...n.errors},k()),y.state.next({...n,isValidating:!qj(n.validatingFields)}))},Pe=(e,u={})=>{S++;let d=e?dj(e):i,f=dj(d),p=qj(e),m=f,g=r;if(Object.keys(l).forEach(D),u.keepDefaultValues||(i=d),!u.keepValues){if(u.keepDirtyValues){let e=new Set([...c.mount,...jM(RM(i,a,void 0,g),n.dirtyFields)]);for(let t of e){let e=$(n.dirtyFields,t),r=$(a,t),i=$(m,t);e&&!xj(r)?wj(m,t,r):!e&&!xj(i)&&he(t,i)}}else{if(uj&&xj(e))for(let e of c.mount){let t=$(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Jj(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(u.keepFieldsRef)for(let e of c.mount)he(e,$(m,e));else r={}}if(t.shouldUnregister){if(a=u.keepDefaultValues?dj(i):{},u.keepFieldsRef)for(let e of c.mount)wj(a,e,$(m,e))}else a=dj(m);y.array.next({values:{...m}}),y.state.next({name:void 0,type:void 0,values:{...m}})}c={mount:u.keepDirtyValues||u.keepFieldsRef?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:u.keepValues||u.keepDirtyValues||u.keepFieldsRef?new Set([...c.disabled].filter(e=>$(r,e))):new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!h.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!t.shouldUnregister&&!qj(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!u.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),s=!1,u.keepErrors||(n.errors={}),y.state.next({submitCount:u.keepSubmitCount?n.submitCount:0,isDirty:p?!1:u.keepDirty?n.isDirty:u.keepValues?de():!!(u.keepDefaultValues&&e&&!Mj(e,i)),isSubmitted:u.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:p?{}:u.keepDirtyValues?u.keepDefaultValues&&a?RM(i,a,void 0,g):n.dirtyFields:u.keepDefaultValues&&e?RM(i,e,void 0,g):u.keepDirty?n.dirtyFields:u.keepValues?RM(i,a,void 0,g):{},touchedFields:u.keepTouched?n.touchedFields:{},...!u.keepIsValidating&&(n.isValidating||!qj(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:u.keepErrors?n.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Fe=(e,n)=>Pe(Cj(e)?e(a):e,{...t.resetOptions,...n}),Ie=(e,t={})=>{let n=$(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs.find(e=>!e.disabled)||i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Cj(e.select)&&e.select()})}};y.state.subscribe({next:e=>{let{name:t,type:r,values:i,...a}=e;Object.keys(a).length&&(n={...n,...a})}});let Le={control:{register:ke,unregister:De,getFieldState:xe,handleSubmit:Me,setError:Ce,_subscribe:Te,_runSchema:I,_updateIsValidating:j,_focusError:Ae,_getWatch:L,_getDirty:de,_setValid:k,_setFieldArray:N,_setDisabledField:Oe,_setErrors:te,_getFieldArray:R,_reset:Pe,_resetDefaultValues:()=>Cj(t.defaultValues)&&t.defaultValues().then(e=>{Fe(e,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:ue,_disableForm:je,_subjects:y,_proxyFormState:h,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},f=Uj(t.mode),p=Uj(t.reValidateMode),T=t.criteriaMode===pj.all}},subscribe:Ee,trigger:ve,register:ke,handleSubmit:Me,watch:we,setValue:he,setValues:z,getValues:ye,getErrors:be,reset:Fe,resetField:Ne,resetDefaultValues:(e,t={})=>{if(i=dj(e),!t.keepDirty){let e=RM(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!qj(e)}t.keepIsValid||k(),y.state.next({...n,defaultValues:i})},clearErrors:Se,unregister:De,setError:Ce,setFocus:Ie,getFieldState:xe};return{...Le,formControl:Le}}var rN={mode:$M.mode,reValidateMode:$M.reValidateMode,shouldFocusError:$M.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0,progressive:void 0,resetOptions:void 0};function iN(e={}){let t=d.useRef(void 0),n=d.useRef(void 0),r=d.useRef(e.formControl),i=d.useRef(!1),a=d.useRef(!!e.validate),o=d.useRef(!!e.errors),s=d.useRef(!1),[c,l]=d.useState(()=>({...dj(tN),isLoading:Cj(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Cj(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,i.current=!1,e.formControl)t.current={...e.formControl,formState:c},e.defaultValues&&!Cj(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=nN(e);t.current={...r,formState:c}}}let u=t.current.control,f=u._options,p={};for(let t in rN)t in f&&!(t in e)&&(p[t]=rN[t]);i.current&&!e.disabled&&(p.disabled=!1),u._options={...p,...e,validate:e.validate};let m=()=>({...u._formState,defaultValues:u._defaultValues}),{resyncIfNeeded:h,snapshot:g}=Pj(m,Nj);return Oj(()=>{h(!0,m,l);let e=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(e=>({...e,isReady:!0})),u._formState.isReady=!0,u._subjects.state.next({isReady:!0}),()=>{e(),g(!0,m)}},[u,h,g]),d.useEffect(()=>{u._disableForm(i.current&&!e.disabled?!1:e.disabled),i.current=!!e.disabled},[u,e.disabled]),d.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),d.useEffect(()=>{e.errors?(u._setErrors(e.errors),u._focusError()):o.current&&u._setErrors({}),o.current=!!e.errors},[u,e.errors]),d.useEffect(()=>{a.current&&!e.validate&&t.current&&t.current.clearErrors(gj),a.current=!!e.validate},[e.validate]),d.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),d.useEffect(()=>{if(u._proxyFormState.isDirty){let e=u._getDirty();e!==c.isDirty&&u._subjects.state.next({isDirty:e})}},[u,c.isDirty]),d.useEffect(()=>{e.values&&!Mj(e.values,n.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),u._options.resetOptions&&u._options.resetOptions.keepIsValid||u._setValid(),n.current=e.values,l(e=>({...e}))):u._resetDefaultValues()},[u,e.values]),d.useEffect(()=>{u._state.mount&&(s.current||e.values)||(u._setValid(),u._state.mount=!0),s.current=!0,u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),t.current.formState=d.useMemo(()=>Dj(c,u),[u,c]),t.current}var aN=d.createContext(null);aN.displayName=`HookFormContext`;var oN=(e,t,n)=>{if(e&&`reportValidity`in e){let r=$(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},sN=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?oN(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>oN(t,n,e))}},cN=(e,t)=>{t.shouldUseNativeValidation&&sN(e,t);let n={};for(let r in e){let i=$(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.refs?i.refs[0]:i&&i.ref});if(lN(t.names||Object.keys(e),r)){let e=Object.assign({},$(n,r));wj(e,`root`,a),wj(n,r,e)}else wj(n,r,a)}return n},lN=(e,t)=>{let n=uN(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>uN(e).match(`^${n}\\.\\d+`))};function uN(e){return e.replace(/\[(\d+)]/g,`.$1`).replace(/[[\]]/g,``)}function dN(){return dN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dN.apply(null,arguments)}function fN(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function pN(e,t){for(var n=Object.create(null);e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(`unionErrors`in r){var s=r.unionErrors.reduce(function(e,t){return t.errors.length<e.errors.length?t:e}).errors[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Zj(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function mN(e,t){for(var n=Object.create(null),r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors.reduce(function(e,t){return t.length<e.length?t:e})[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(dN({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Zj(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function hN(e,t,n){if(n===void 0&&(n={}),function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(fN(function(){function i(e){return a.shouldUseNativeValidation&&sN({},a),{errors:{},values:n.raw?Object.assign({},r):e}}var o=e;return n.mode===`sync`?i(o.parse(r,t)):Promise.resolve(o.parseAsync(r,t)).then(i)},function(e){if(function(e){var t;return!(e==null||(t=e._zod)==null||(t=t.traits)==null||!t.has(`$ZodError`))}(e))return{values:{},errors:cN(mN(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_def`in e&&typeof e._def==`object`}(e))return function(r,i,a){try{return Promise.resolve(fN(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&sN({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:cN(pN(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var gN=Zb(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function _N({className:e,variant:t,...n}){return(0,h.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:K(gN({variant:t}),e),...n})}function vN({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`alert-title`,className:K(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function yN({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`alert-description`,className:K(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function bN({className:e,...t}){return(0,h.jsx)(Af,{"data-slot":`checkbox`,className:K(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,h.jsx)(Mf,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,h.jsx)(An,{className:`size-3.5`})})})}function xN({className:e,...t}){return(0,h.jsx)(w_,{"data-slot":`label`,className:K(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function SN({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,h.jsx)(oy,{"data-slot":`separator`,decorative:n,orientation:t,className:K(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function CN({className:e,...t}){return(0,h.jsx)(`fieldset`,{"data-slot":`field-set`,className:K(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function wN({className:e,variant:t=`legend`,...n}){return(0,h.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:K(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...n})}function TN({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`field-group`,className:K(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`,e),...t})}var EN=Zb(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function DN({className:e,orientation:t=`vertical`,...n}){return(0,h.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:K(EN({orientation:t}),e),...n})}function ON({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`field-content`,className:K(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function kN({className:e,...t}){return(0,h.jsx)(xN,{"data-slot":`field-label`,className:K(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10`,e),...t})}function AN({className:e,...t}){return(0,h.jsx)(`p`,{"data-slot":`field-description`,className:K(`text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function jN({children:e,className:t,...n}){return(0,h.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:K(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[(0,h.jsx)(SN,{className:`absolute inset-0 top-1/2`}),e&&(0,h.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-muted-foreground`,"data-slot":`field-separator-content`,children:e})]})}function MN({className:e,children:t,errors:n,...r}){let i=(0,d.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,h.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,h.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,h.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:K(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function NN({className:e,type:t,...n}){return(0,h.jsx)(`input`,{type:t,"data-slot":`input`,className:K(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function PN({className:e,...t}){return(0,h.jsx)(Rr,{role:`status`,"aria-label":`Loading`,className:K(`size-4 animate-spin`,e),...t})}function FN({label:e,htmlFor:t,description:n,error:r,children:i,className:a}){return(0,h.jsxs)(DN,{"data-invalid":!!r||void 0,className:K(`gap-1.5`,a),children:[(0,h.jsx)(kN,{htmlFor:t,children:e}),i,r?(0,h.jsx)(MN,{children:r}):n?(0,h.jsx)(AN,{children:n}):null]})}function IN({error:e}){return(0,h.jsxs)(_N,{variant:`destructive`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:V(e)})]})}function LN({open:e,onOpenChange:t}){let{connection:n}=XA(),r=Mt(),i=iN({resolver:hN(_A),defaultValues:{name:``,region:n.region}}),{errors:a}=i.formState;(0,d.useEffect)(()=>{e||(i.reset({name:``,region:n.region}),r.reset())},[e]);let o=i.handleSubmit(e=>r.mutate(e,{onSuccess:()=>{U.success(`Created bucket ${e.name}`),t(!1),gx({bucket:e.name})}}));return(0,h.jsx)($b,{open:e,onOpenChange:t,children:(0,h.jsx)(nx,{children:(0,h.jsxs)(`form`,{onSubmit:o,noValidate:!0,className:`grid gap-6`,children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`New bucket`}),(0,h.jsx)(ox,{children:`Bucket names are global on most providers and can’t be changed later.`})]}),(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsx)(FN,{label:`Name`,htmlFor:`bucket-name`,error:a.name?.message,description:`3–63 characters: lowercase letters, digits, dots and hyphens`,children:(0,h.jsx)(NN,{id:`bucket-name`,autoFocus:!0,spellCheck:!1,"aria-invalid":!!a.name,...i.register(`name`)})}),(0,h.jsx)(FN,{label:`Region`,htmlFor:`bucket-region`,error:a.region?.message,children:(0,h.jsx)(NN,{id:`bucket-region`,"aria-invalid":!!a.region,...i.register(`region`)})}),r.isError&&(0,h.jsx)(IN,{error:r.error})]}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:r.isPending,children:[r.isPending&&(0,h.jsx)(PN,{}),`Create bucket`]})]})]})})})}function RN({bucket:e,open:t,onOpenChange:n}){let r=Nt(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(``);return(0,h.jsx)($b,{open:t,onOpenChange:e=>!r.isPending&&n(e),children:(0,h.jsxs)(nx,{children:[(0,h.jsxs)(rx,{children:[(0,h.jsxs)(ax,{children:[`Delete bucket “`,e,`”?`]}),(0,h.jsx)(ox,{children:`A bucket must be empty to be deleted. This can’t be undone.`})]}),(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsxs)(DN,{orientation:`horizontal`,children:[(0,h.jsx)(bN,{id:`force-delete`,checked:i,onCheckedChange:e=>a(e===!0)}),(0,h.jsxs)(ON,{children:[(0,h.jsx)(kN,{htmlFor:`force-delete`,children:`Empty it first`}),(0,h.jsx)(AN,{children:`Permanently delete every object (and every version, on versioned buckets).`})]})]}),(0,h.jsx)(FN,{label:`Type “${e}” to confirm`,htmlFor:`confirm-bucket`,children:(0,h.jsx)(NN,{id:`confirm-bucket`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,spellCheck:!1})}),r.isError&&(0,h.jsx)(IN,{error:r.error})]}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:()=>n(!1),disabled:r.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{variant:`destructive`,disabled:o!==e||r.isPending,onClick:()=>r.mutate({bucket:e,force:i},{onSuccess:()=>{U.success(`Deleted bucket ${e}`),n(!1),gx({})}}),children:[r.isPending&&(0,h.jsx)(PN,{}),`Delete bucket`]})]})]})})}function zN({label:e,children:t,size:n=`icon-sm`,variant:r=`ghost`,...i}){return(0,h.jsxs)(Kb,{children:[(0,h.jsx)(qb,{asChild:!0,children:(0,h.jsx)(Y,{size:n,variant:r,"aria-label":e,...i,children:t})}),(0,h.jsx)(Jb,{children:e})]})}var BN=Zb(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function VN({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Ds:`span`;return(0,h.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:K(BN({variant:t}),e),...r})}function HN({className:e,...t}){return(0,h.jsx)(`textarea`,{"data-slot":`textarea`,className:K(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}function UN({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:K(`group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30`,`h-9 min-w-0 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50`,`has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40`,e),...t})}var WN=Zb(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3`,"block-end":`order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3`}},defaultVariants:{align:`inline-start`}});function GN({className:e,align:t=`inline-start`,...n}){return(0,h.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:K(WN({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function KN({className:e,...t}){return(0,h.jsx)(NN,{"data-slot":`input-group-control`,className:K(`flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t})}function qN({className:e,value:t,...n}){return(0,h.jsx)(I_,{"data-slot":`progress`,className:K(`relative h-2 w-full overflow-hidden rounded-full bg-primary/20`,e),...n,children:(0,h.jsx)(R_,{"data-slot":`progress-indicator`,className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})})}function JN({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`skeleton`,className:K(`animate-pulse rounded-md bg-accent`,e),...t})}function YN({className:e,size:t=`default`,...n}){return(0,h.jsx)(vy,{"data-slot":`switch`,"data-size":t,className:K(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,h.jsx)(by,{"data-slot":`switch-thumb`,className:K(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`)})})}function XN({className:e,orientation:t=`horizontal`,...n}){return(0,h.jsx)(Py,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:K(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var ZN=Zb(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function QN({className:e,variant:t=`default`,...n}){return(0,h.jsx)(Iy,{"data-slot":`tabs-list`,"data-variant":t,className:K(ZN({variant:t}),e),...n})}function $N({className:e,...t}){return(0,h.jsx)(Ry,{"data-slot":`tabs-trigger`,className:K(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function eP({className:e,...t}){return(0,h.jsx)(By,{"data-slot":`tabs-content`,className:K(`flex-1 outline-none`,e),...t})}var tP=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function nP(e,t=1){if(!Number.isFinite(e)||e<0)return`—`;if(e<1024)return`${e} B`;let n=0,r=e;for(;r>=1024&&n<tP.length-1;)r/=1024,n++;return`${r.toFixed(r>=100?0:t)} ${tP[n]}`}function rP(e){return e.toLocaleString()}var iP=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}),aP=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function oP(e){return e?aP.format(new Date(e)):`—`}function sP(e){if(!e)return`—`;let t=(new Date(e).getTime()-Date.now())/1e3,n=Math.abs(t);return n<60?iP.format(Math.round(t),`second`):n<3600?iP.format(Math.round(t/60),`minute`):n<86400?iP.format(Math.round(t/3600),`hour`):n<2592e3?iP.format(Math.round(t/86400),`day`):oP(e)}function cP(e){return!Number.isFinite(e)||e<0?`—`:e<60?`${Math.ceil(e)}s`:e<3600?`${Math.floor(e/60)}m ${Math.round(e%60)}s`:`${Math.floor(e/3600)}h ${Math.round(e%3600/60)}m`}function lP(e){return`${nP(e)}/s`}var uP={cors:[{AllowedOrigins:[`https://example.com`],AllowedMethods:[`GET`,`HEAD`],AllowedHeaders:[`*`],MaxAgeSeconds:3600}],lifecycle:[{ID:`expire-tmp`,Status:`Enabled`,Filter:{Prefix:`tmp/`},Expiration:{Days:7},AbortIncompleteMultipartUpload:{DaysAfterInitiation:3}}],policy:e=>({Version:`2012-10-17`,Statement:[{Sid:`PublicRead`,Effect:`Allow`,Principal:`*`,Action:`s3:GetObject`,Resource:`arn:aws:s3:::${e}/*`}]})},dP={versioning:`s3:GetBucketVersioning`,cors:`s3:GetBucketCORS`,lifecycle:`s3:GetLifecycleConfiguration`,policy:`s3:GetBucketPolicy`,public:`s3:GetBucketPublicAccessBlock`,uploads:`s3:ListBucketMultipartUploads`};function fP({title:e,description:t,children:n}){return(0,h.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4 border-b pb-5`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:t})]}),n]})}function pP({what:e,section:t,error:n}){let r=/denied|forbidden|403/i.test(n);return(0,h.jsxs)(_N,{variant:`destructive`,className:`mb-6`,children:[(0,h.jsx)(Bn,{}),(0,h.jsxs)(vN,{children:[`Can’t read `,e]}),(0,h.jsxs)(yN,{children:[(0,h.jsx)(`p`,{children:r?(0,h.jsxs)(h.Fragment,{children:[`The access key isn’t allowed to read this setting`,dP[t]&&(0,h.jsxs)(h.Fragment,{children:[` `,`(needs `,(0,h.jsx)(`code`,{className:`rounded bg-destructive/10 px-1 font-mono text-xs`,children:dP[t]}),`)`]}),`.`]}):n}),(0,h.jsx)(`p`,{children:`Editing is turned off so existing configuration isn’t overwritten by mistake.`})]})]})}function mP(e,t){if(!e.trim())return{state:`empty`};let n;try{n=JSON.parse(e)}catch(e){return{state:`invalid`,message:`Invalid JSON: ${e.message}`}}let r=t.safeParse(n);return r.success?{state:`valid`,value:r.data}:{state:`invalid`,message:AA(r.error)}}function hP({fileName:e,value:t,schema:n,example:r,locked:i,emptyLabel:a,countLabel:o,saving:s,onSave:c}){let l=t===null||Array.isArray(t)&&t.length===0?``:JSON.stringify(t,null,2),[u,f]=(0,d.useState)(l);(0,d.useEffect)(()=>f(l),[l]);let p=(0,d.useMemo)(()=>mP(u,n),[u,n]),m=u!==l,g=!i&&m&&p.state!==`invalid`&&!s,_=p.state===`invalid`?(0,h.jsx)(VN,{variant:`destructive`,children:`Invalid`}):m?(0,h.jsx)(VN,{variant:`secondary`,children:`Unsaved changes`}):p.state===`empty`?(0,h.jsx)(VN,{variant:`outline`,children:a}):(0,h.jsx)(VN,{variant:`outline`,children:o?o(p.value):`Configured`});return(0,h.jsxs)(`div`,{className:K(`overflow-hidden rounded-lg border`,p.state===`invalid`&&`border-destructive/60`),children:[(0,h.jsxs)(`div`,{className:`flex h-11 items-center gap-2 border-b bg-muted/40 px-3`,children:[(0,h.jsx)(ir,{className:`size-4 text-muted-foreground`}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e}),_,!i&&(0,h.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,h.jsx)(Y,{variant:`ghost`,size:`xs`,onClick:()=>f(JSON.stringify(r,null,2)),children:`Insert example`}),p.state===`valid`&&(0,h.jsx)(Y,{variant:`ghost`,size:`xs`,onClick:()=>f(JSON.stringify(p.value,null,2)),children:`Format`})]})]}),(0,h.jsx)(HN,{value:u,onChange:e=>f(e.target.value),readOnly:i,spellCheck:!1,placeholder:i?``:`${a}. Paste JSON here or insert an example.`,"aria-invalid":p.state===`invalid`,"aria-label":e,className:`min-h-80 resize-y rounded-none border-0 bg-transparent px-4 py-3 font-mono text-xs leading-relaxed focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`}),!i&&(0,h.jsxs)(`div`,{className:`flex min-h-12 flex-wrap items-center gap-3 border-t bg-muted/40 px-3 py-2`,children:[(0,h.jsx)(`p`,{className:K(`min-w-0 flex-1 text-xs`,p.state===`invalid`?`text-destructive`:`text-muted-foreground`),role:p.state===`invalid`?`alert`:void 0,children:p.state===`invalid`?p.message:p.state===`empty`&&l?`Saving an empty document removes the current configuration.`:`Validated before saving.`}),(0,h.jsx)(Y,{variant:`outline`,size:`sm`,disabled:!m||s,onClick:()=>f(l),children:`Discard`}),(0,h.jsxs)(Y,{size:`sm`,disabled:!g,onClick:()=>p.state!==`invalid`&&c(p.state===`valid`?p.value:null),children:[s&&(0,h.jsx)(PN,{}),`Save changes`]})]})]})}function gP({id:e,title:t,description:n,children:r}){return(0,h.jsx)(kN,{htmlFor:e,className:`rounded-none border-0`,children:(0,h.jsxs)(DN,{orientation:`horizontal`,className:`px-4 py-3.5`,children:[(0,h.jsxs)(ON,{children:[(0,h.jsx)(`span`,{className:`text-sm font-medium`,children:t}),(0,h.jsx)(AN,{children:n})]}),r]})})}function _P(e,t){return e.supported?e.error?{text:`No permission to read`,tone:`error`}:{text:t(e.value),tone:`normal`}:{text:`Not supported`,tone:`muted`}}function vP({bucket:e,settings:t,onOpen:n}){let{connection:r,isAdmin:i,me:a}=XA(),o=!i||a.readonly,[s,c]=(0,d.useState)(!1),l=t.encryption,u=t.objectLock,f=t.publicAccessBlock.value,p=(e,t)=>e===0?`No ${t}s`:`${rP(e)} ${t}${e===1?``:`s`}`,m=[{id:`versioning`,label:`Versioning`,summary:_P(t.versioning,e=>e===`Off`?`Never enabled`:e)},{id:`cors`,label:`CORS`,summary:_P(t.cors,e=>p(e.length,`rule`))},{id:`lifecycle`,label:`Lifecycle`,summary:_P(t.lifecycle,e=>p(e.length,`rule`))},{id:`policy`,label:`Bucket policy`,summary:_P(t.policy,e=>e?`Configured`:`None`)},{id:`public`,label:`Public access`,summary:_P(t.publicAccessBlock,()=>f&&Object.values(f).every(Boolean)?`All public access blocked`:f&&Object.values(f).some(Boolean)?`Partially blocked`:`Not blocked`)}];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(fP,{title:`General`,description:`Where the bucket lives and how it’s configured. Select a row to change it.`}),(0,h.jsxs)(`dl`,{className:`divide-y rounded-lg border`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 text-sm`,children:[(0,h.jsx)(`dt`,{className:`w-36 shrink-0 text-muted-foreground`,children:`Name`}),(0,h.jsx)(`dd`,{className:`truncate font-mono text-xs`,children:e})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 text-sm`,children:[(0,h.jsx)(`dt`,{className:`w-36 shrink-0 text-muted-foreground`,children:`Region`}),(0,h.jsx)(`dd`,{children:t.region??r.region})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 text-sm`,children:[(0,h.jsx)(`dt`,{className:`w-36 shrink-0 text-muted-foreground`,children:`Provider`}),(0,h.jsx)(`dd`,{children:r.providerName})]}),l.supported&&(0,h.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 text-sm`,children:[(0,h.jsx)(`dt`,{className:`w-36 shrink-0 text-muted-foreground`,children:`Default encryption`}),(0,h.jsx)(`dd`,{className:K(`min-w-0`,l.error&&`text-destructive`),children:l.error?`No permission to read`:l.value?(0,h.jsxs)(h.Fragment,{children:[l.value.algorithm,l.value.kmsKeyId&&(0,h.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:l.value.kmsKeyId})]}):`None configured`})]}),u.supported&&!u.error&&(0,h.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 text-sm`,children:[(0,h.jsx)(`dt`,{className:`w-36 shrink-0 text-muted-foreground`,children:`Object lock`}),(0,h.jsx)(`dd`,{children:u.value?.enabled?u.value.mode?`Enabled · default ${u.value.mode} for ${u.value.days?`${u.value.days} days`:`${u.value.years} years`}`:`Enabled · no default retention`:`Not enabled`})]}),m.filter(e=>e.summary.tone!==`muted`).map(e=>(0,h.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`flex w-full items-center gap-4 px-4 py-3 text-left text-sm transition-colors hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:outline-none`,children:[(0,h.jsx)(`dt`,{className:`w-36 shrink-0 text-muted-foreground`,children:e.label}),(0,h.jsx)(`dd`,{className:K(`flex-1`,e.summary.tone===`error`&&`text-destructive`),children:e.summary.text}),(0,h.jsx)(Pn,{className:`size-4 text-muted-foreground`})]},e.id))]}),!o&&r.capabilities.bucketCreate&&(0,h.jsxs)(`div`,{className:`mt-10`,children:[(0,h.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-destructive`,children:`Danger zone`}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4 rounded-lg border border-destructive/40 px-4 py-3.5`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`p`,{className:`text-sm font-medium`,children:`Delete this bucket`}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Permanently delete the bucket, optionally emptying it first.`})]}),(0,h.jsxs)(Y,{variant:`destructive`,size:`sm`,onClick:()=>c(!0),children:[(0,h.jsx)(Pi,{}),` Delete bucket`]})]}),(0,h.jsx)(RN,{bucket:e,open:s,onOpenChange:c})]})]})}function yP({bucket:e}){let[t,n]=(0,d.useState)(``),[r,i]=(0,d.useState)(null),a=It(e,r?.prefix??``,!!r),o=a.data&&!a.isFetching?a.data:null;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(fP,{title:`Storage usage`,description:`Lists every object under a folder to add up sizes. Large buckets take a while and cost one LIST request per 1,000 objects.`}),(0,h.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),i({prefix:t&&!t.endsWith(`/`)?`${t}/`:t})},children:[(0,h.jsxs)(UN,{children:[(0,h.jsx)(GN,{children:(0,h.jsxs)(`span`,{className:`font-mono text-xs`,children:[e,`/`]})}),(0,h.jsx)(KN,{value:t,onChange:e=>n(e.target.value),placeholder:`folder/ (empty for the whole bucket)`,className:`font-mono text-xs`})]}),(0,h.jsxs)(Y,{type:`submit`,disabled:a.isFetching,children:[a.isFetching?(0,h.jsx)(PN,{}):(0,h.jsx)(On,{}),`Calculate`]})]}),a.isFetching&&(0,h.jsxs)(`p`,{className:`mt-4 flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,h.jsx)(PN,{}),` Counting objects… keep this tab open.`]}),a.isError&&(0,h.jsxs)(_N,{variant:`destructive`,className:`mt-4`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:V(a.error)})]}),o&&(0,h.jsxs)(`div`,{className:`mt-6 space-y-6`,children:[(0,h.jsx)(`dl`,{className:`grid divide-y rounded-lg border sm:grid-cols-3 sm:divide-x sm:divide-y-0`,children:[[`Total size`,nP(o.bytes)],[`Objects`,rP(o.objects)],[`Calculated in`,`${(o.durationMs/1e3).toFixed(1)}s`]].map(([e,t])=>(0,h.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,h.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,h.jsx)(`dd`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:t})]},e))}),[{title:`By folder`,rows:o.byFolder},{title:`By storage class`,rows:o.byStorageClass}].map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`mb-2 text-sm font-medium`,children:e.title}),(0,h.jsxs)(`div`,{className:`divide-y rounded-lg border`,children:[e.rows.slice(0,100).map(e=>(0,h.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_6rem_6rem] items-center gap-4 px-4 py-2.5 text-sm`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsx)(`p`,{className:`truncate font-mono text-xs`,children:e.name}),(0,h.jsx)(qN,{value:o.bytes?Math.max(1,e.bytes/o.bytes*100):0,className:`mt-1.5 h-1`})]}),(0,h.jsx)(`span`,{className:`text-right tabular-nums`,children:nP(e.bytes)}),(0,h.jsx)(`span`,{className:`text-right text-muted-foreground tabular-nums`,children:rP(e.objects)})]},e.name)),e.rows.length===0&&(0,h.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`No objects.`})]})]},e.title))]})]})}function bP({bucket:e}){let{readonly:t}=XA(),n=_(),r=Wt(e),[i,a]=(0,d.useState)(null),o=async t=>{a(t.length===1?t[0].uploadId:`all`);let r=0;for(let n of t)try{await Kt.abortUpload(e,n.key,n.uploadId)}catch{r++}a(null),n.invalidateQueries({queryKey:xt.incomplete(e)}),r?U.error(`${r} upload${r===1?``:`s`} couldn’t be aborted`):U.success(`Aborted ${t.length} upload${t.length===1?``:`s`}`)},s=r.data?.uploads??[];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(fP,{title:`Incomplete uploads`,description:`Multipart uploads that were started but never finished. Their parts take up storage (and cost money) until aborted.`,children:!t&&s.length>1&&(0,h.jsxs)(Y,{variant:`outline`,size:`sm`,disabled:!!i,onClick:()=>void o(s),children:[i===`all`&&(0,h.jsx)(PN,{}),` Abort all `,s.length]})}),r.isError?(0,h.jsx)(pP,{what:`incomplete uploads`,section:`uploads`,error:V(r.error)}):r.isPending?(0,h.jsx)(JN,{className:`h-32 w-full rounded-lg`}):s.length===0?(0,h.jsx)(`div`,{className:`rounded-lg border px-4 py-8 text-center text-sm text-muted-foreground`,children:`No incomplete uploads. Nothing to clean up.`}):(0,h.jsx)(`div`,{className:`divide-y rounded-lg border`,children:s.map(e=>(0,h.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-2.5 text-sm`,children:[(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`truncate font-mono text-xs`,title:e.key,children:e.key}),(0,h.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Started `,e.initiated?sP(e.initiated):`at an unknown time`]})]}),!t&&(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,disabled:!!i,onClick:()=>void o([e]),children:[i===e.uploadId&&(0,h.jsx)(PN,{}),` Abort`]})]},e.uploadId))})]})}var xP=[[`BlockPublicAcls`,`Block new public ACLs`,`Reject requests that add public ACLs to the bucket or its objects.`],[`IgnorePublicAcls`,`Ignore existing public ACLs`,`Treat any existing public ACLs as private.`],[`BlockPublicPolicy`,`Block new public bucket policies`,`Reject bucket policies that grant public access.`],[`RestrictPublicBuckets`,`Restrict public bucket policies`,`Only the bucket owner and AWS services can use a public policy.`]];function SP({value:e,locked:t,saving:n,onSave:r}){let i=e??{BlockPublicAcls:!1,IgnorePublicAcls:!1,BlockPublicPolicy:!1,RestrictPublicBuckets:!1},[a,o]=(0,d.useState)(i);(0,d.useEffect)(()=>o(i),[e]);let s=xP.some(([e])=>a[e]!==i[e]);return(0,h.jsxs)(`div`,{className:`overflow-hidden rounded-lg border`,children:[(0,h.jsx)(`div`,{className:`divide-y`,children:xP.map(([e,n,r])=>(0,h.jsx)(gP,{id:`pab-${e}`,title:n,description:r,children:(0,h.jsx)(YN,{id:`pab-${e}`,checked:a[e],disabled:t,onCheckedChange:t=>o(n=>({...n,[e]:t}))})},e))}),!t&&(0,h.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t bg-muted/40 px-3 py-2`,children:[(0,h.jsx)(Y,{variant:`outline`,size:`sm`,disabled:!s||n,onClick:()=>o(i),children:`Discard`}),(0,h.jsxs)(Y,{size:`sm`,disabled:!s||n,onClick:()=>{let e=CA.safeParse(a);e.success&&r(e.data)},children:[n&&(0,h.jsx)(PN,{}),`Save changes`]})]})]})}var CP=[{id:`general`,label:`General`,icon:Ei},{id:`versioning`,label:`Versioning`,icon:Wn},{id:`cors`,label:`CORS`,icon:Ar},{id:`lifecycle`,label:`Lifecycle`,icon:Ji},{id:`policy`,label:`Bucket policy`,icon:wi},{id:`public`,label:`Public access`,icon:Wr},{id:`uploads`,label:`Incomplete uploads`,icon:Hi},{id:`usage`,label:`Storage usage`,icon:On}];function wP({bucket:e}){let{isAdmin:t,me:n,connection:r}=XA(),i=!t||n.readonly,a=Pt(e),o=Ft(e),[s,c]=(0,d.useState)(`general`),l=(e,t,n)=>o.mutate({setting:e,body:t},{onSuccess:()=>U.success(`${n} saved`),onError:e=>U.error(`Couldn’t save ${n.toLowerCase()}`,{description:V(e)})}),u=a.data,f={general:!0,usage:!0,uploads:!0,versioning:u?.versioning.supported??r.capabilities.versioning,cors:u?.cors.supported??r.capabilities.cors,lifecycle:u?.lifecycle.supported??r.capabilities.lifecycle,policy:u?.policy.supported??r.capabilities.bucketPolicy,public:u?.publicAccessBlock.supported??r.capabilities.publicAccessBlock},p=CP.filter(e=>f[e.id]);return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 items-center gap-3 border-b bg-background px-4`,children:[(0,h.jsx)(zN,{label:`Back to files`,onClick:()=>gx({bucket:e}),children:(0,h.jsx)(gn,{})}),(0,h.jsx)(Jn,{className:`size-4 text-primary`}),(0,h.jsx)(`h1`,{className:`truncate font-semibold`,children:e}),(0,h.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`/ Settings`}),i&&(0,h.jsx)(VN,{variant:`secondary`,children:`read-only`}),(0,h.jsx)(zN,{label:`Reload settings`,className:`ml-auto`,onClick:()=>void a.refetch(),disabled:a.isFetching,children:(0,h.jsx)(ui,{className:a.isFetching?`animate-spin`:void 0})})]}),(0,h.jsxs)(XN,{orientation:`vertical`,value:s,onValueChange:e=>c(e),className:`flex-col gap-8 px-4 py-6 md:flex-row md:px-6`,children:[(0,h.jsx)(QN,{className:`h-fit w-full shrink-0 flex-col items-stretch gap-0.5 rounded-none bg-transparent p-0 md:sticky md:top-20 md:w-52`,children:p.map(({id:e,label:t,icon:n})=>(0,h.jsxs)($N,{value:e,className:`h-9 flex-none justify-start rounded-md border-0 px-3 font-normal text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-primary/10 data-[state=active]:font-medium data-[state=active]:text-primary dark:data-[state=active]:bg-primary/15 dark:data-[state=active]:text-primary`,children:[(0,h.jsx)(n,{}),t]},e))}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[a.isPending?(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(JN,{className:`h-6 w-40`}),(0,h.jsx)(JN,{className:`h-4 w-80`}),(0,h.jsx)(JN,{className:`mt-6 h-64 w-full rounded-lg`})]}):a.isError?(0,h.jsxs)(_N,{variant:`destructive`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(vN,{children:`Couldn’t load bucket settings`}),(0,h.jsx)(yN,{children:V(a.error)})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eP,{value:`general`,children:(0,h.jsx)(vP,{bucket:e,settings:a.data,onOpen:c})}),(0,h.jsxs)(eP,{value:`versioning`,children:[(0,h.jsx)(fP,{title:`Versioning`,description:`Keep every version of every object, so overwritten and deleted files can be restored.`}),a.data.versioning.error&&(0,h.jsx)(pP,{what:`versioning`,section:`versioning`,error:a.data.versioning.error}),(0,h.jsx)(`div`,{className:`overflow-hidden rounded-lg border`,children:(0,h.jsx)(gP,{id:`versioning`,title:`Object versioning`,description:a.data.versioning.value===`Suspended`?`Suspended. Existing versions are kept, new writes overwrite.`:a.data.versioning.value===`Enabled`?`Enabled. Once on, versioning can be suspended but never fully removed.`:`Off. Once enabled, versioning can be suspended but never fully removed.`,children:(0,h.jsx)(YN,{id:`versioning`,checked:a.data.versioning.value===`Enabled`,disabled:i||o.isPending||!!a.data.versioning.error,onCheckedChange:e=>l(`versioning`,{enabled:e},`Versioning`)})})})]}),(0,h.jsxs)(eP,{value:`cors`,children:[(0,h.jsx)(fP,{title:`CORS`,description:`Lets other web apps call this bucket directly from a browser. s3deck itself doesn’t need any CORS rules.`}),a.data.cors.error&&(0,h.jsx)(pP,{what:`CORS rules`,section:`cors`,error:a.data.cors.error}),(0,h.jsx)(hP,{fileName:`cors-rules.json`,value:a.data.cors.value,schema:yA,example:uP.cors,locked:i||!!a.data.cors.error,emptyLabel:`No CORS rules`,countLabel:e=>`${e.length} rule${e.length===1?``:`s`}`,saving:o.isPending,onSave:e=>l(`cors`,{rules:e??[]},`CORS rules`)})]}),(0,h.jsxs)(eP,{value:`lifecycle`,children:[(0,h.jsx)(fP,{title:`Lifecycle`,description:`Expire objects or move them to cheaper storage automatically, and clean up abandoned multipart uploads.`}),a.data.lifecycle.error&&(0,h.jsx)(pP,{what:`lifecycle rules`,section:`lifecycle`,error:a.data.lifecycle.error}),(0,h.jsx)(hP,{fileName:`lifecycle-rules.json`,value:a.data.lifecycle.value,schema:xA,example:uP.lifecycle,locked:i||!!a.data.lifecycle.error,emptyLabel:`No lifecycle rules`,countLabel:e=>`${e.length} rule${e.length===1?``:`s`}`,saving:o.isPending,onSave:e=>l(`lifecycle`,{rules:e??[]},`Lifecycle rules`)})]}),(0,h.jsxs)(eP,{value:`policy`,children:[(0,h.jsx)(fP,{title:`Bucket policy`,description:`An IAM-style JSON document that grants or denies access to the bucket and its objects.`}),a.data.policy.error&&(0,h.jsx)(pP,{what:`the bucket policy`,section:`policy`,error:a.data.policy.error}),(0,h.jsx)(hP,{fileName:`bucket-policy.json`,value:a.data.policy.value,schema:SA,example:uP.policy(e),locked:i||!!a.data.policy.error,emptyLabel:`No policy`,saving:o.isPending,onSave:e=>l(`policy`,{policy:e},`Bucket policy`)})]}),(0,h.jsxs)(eP,{value:`public`,children:[(0,h.jsx)(fP,{title:`Public access`,description:`Guard rails that override ACLs and policies, so objects can’t be made public by accident.`}),a.data.publicAccessBlock.error&&(0,h.jsx)(pP,{what:`public access settings`,section:`public`,error:a.data.publicAccessBlock.error}),(0,h.jsx)(SP,{value:a.data.publicAccessBlock.value,locked:i||!!a.data.publicAccessBlock.error,saving:o.isPending,onSave:e=>l(`public-access`,{config:e},`Public access settings`)})]}),(0,h.jsx)(eP,{value:`uploads`,children:(0,h.jsx)(bP,{bucket:e})}),(0,h.jsx)(eP,{value:`usage`,children:(0,h.jsx)(yP,{bucket:e})})]}),i&&![`general`,`usage`,`uploads`].includes(s)&&(0,h.jsxs)(`p`,{className:`mt-4 flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,h.jsx)(Mr,{className:`size-3.5`}),` `,n.readonly?`s3deck is running in read-only mode.`:`Only admins can change bucket settings.`]})]})]})]})}function TP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`empty`,className:K(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12`,e),...t})}function EP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`empty-header`,className:K(`flex max-w-sm flex-col items-center gap-2 text-center`,e),...t})}var DP=Zb(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function OP({className:e,variant:t=`default`,...n}){return(0,h.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:K(DP({variant:t,className:e})),...n})}function kP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`empty-title`,className:K(`text-lg font-medium tracking-tight`,e),...t})}function AP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`empty-description`,className:K(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function jP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`empty-content`,className:K(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function MP({icon:e,title:t,children:n,action:r}){return(0,h.jsxs)(TP,{children:[(0,h.jsxs)(EP,{children:[e&&(0,h.jsx)(OP,{variant:`icon`,children:e}),(0,h.jsx)(kP,{children:t}),n&&(0,h.jsx)(AP,{children:n})]}),r&&(0,h.jsx)(jP,{children:r})]})}function NP({icon:e,title:t,description:n,action:r}){return(0,h.jsxs)(`header`,{className:`sticky top-0 z-10 flex min-h-14 items-center gap-3 border-b bg-background px-6 py-2`,children:[(0,h.jsx)(`span`,{className:`text-primary [&_svg]:size-4`,children:e}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`h1`,{className:`truncate font-semibold leading-tight`,children:t}),(0,h.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:n})]}),r]})}function PP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,h.jsx)(`table`,{"data-slot":`table`,className:K(`w-full caption-bottom text-sm`,e),...t})})}function FP({className:e,...t}){return(0,h.jsx)(`thead`,{"data-slot":`table-header`,className:K(`[&_tr]:border-b`,e),...t})}function IP({className:e,...t}){return(0,h.jsx)(`tbody`,{"data-slot":`table-body`,className:K(`[&_tr:last-child]:border-0`,e),...t})}function LP({className:e,...t}){return(0,h.jsx)(`tr`,{"data-slot":`table-row`,className:K(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function RP({className:e,...t}){return(0,h.jsx)(`th`,{"data-slot":`table-head`,className:K(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function zP({className:e,...t}){return(0,h.jsx)(`td`,{"data-slot":`table-cell`,className:K(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function BP(e){return/delete|failed|denied|forget|abort|empty/.test(e)?`destructive`:/^(user|settings|bucket|sync)\./.test(e)?`secondary`:`outline`}function VP(){let[e,t]=(0,d.useState)(``),[n,r]=(0,d.useState)(``),i=Yt({user:e.trim()||void 0,bucket:n.trim()||void 0,limit:500});return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsx)(NP,{icon:(0,h.jsx)(fi,{}),title:`Activity`,description:i.data?.persisted===!1?`Changes made since s3deck started (not saved to disk: --no-persist).`:`Every change, who made it and from where. Kept in activity.jsonl in the data directory.`}),(0,h.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,h.jsx)(NN,{value:e,onChange:e=>t(e.target.value),placeholder:`Filter by user (exact)`,className:`h-8 w-56`,"aria-label":`Filter by user`}),(0,h.jsx)(NN,{value:n,onChange:e=>r(e.target.value),placeholder:`Filter by bucket (exact)`,className:`h-8 w-56`,"aria-label":`Filter by bucket`})]}),i.isError&&(0,h.jsx)(IN,{error:i.error}),(0,h.jsxs)(`div`,{className:`overflow-hidden rounded-lg border`,children:[(0,h.jsxs)(PP,{children:[(0,h.jsx)(FP,{children:(0,h.jsxs)(LP,{className:`hover:bg-transparent`,children:[(0,h.jsx)(RP,{className:`w-40 pl-4`,children:`When`}),(0,h.jsx)(RP,{className:`w-40`,children:`User`}),(0,h.jsx)(RP,{className:`w-44`,children:`Action`}),(0,h.jsx)(RP,{className:`w-40`,children:`Bucket`}),(0,h.jsx)(RP,{children:`Details`}),(0,h.jsx)(RP,{className:`w-32 pr-4`,children:`From`})]})}),(0,h.jsxs)(IP,{children:[i.isPending&&Array.from({length:6},(e,t)=>(0,h.jsx)(LP,{children:(0,h.jsx)(zP,{colSpan:6,className:`pl-4`,children:(0,h.jsx)(JN,{className:`h-5 w-full`})})},t)),i.data?.entries.map(e=>(0,h.jsxs)(LP,{children:[(0,h.jsx)(zP,{className:`pl-4 text-muted-foreground`,title:oP(e.at),children:sP(e.at)}),(0,h.jsx)(zP,{className:`truncate font-medium`,children:(0,h.jsx)(`button`,{type:`button`,className:`hover:underline`,onClick:()=>t(e.user),children:e.user})}),(0,h.jsx)(zP,{children:(0,h.jsx)(VN,{variant:BP(e.action),className:`font-mono text-[11px]`,children:e.action})}),(0,h.jsx)(zP,{className:`truncate`,children:e.bucket?(0,h.jsx)(`button`,{type:`button`,className:`hover:underline`,onClick:()=>r(e.bucket??``),children:e.bucket}):(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,h.jsxs)(zP,{className:K(`max-w-0 truncate font-mono text-xs`,!e.detail&&`text-muted-foreground`),title:e.detail??void 0,children:[e.detail??`—`,e.connection&&(0,h.jsxs)(`span`,{className:`ml-2 font-sans text-muted-foreground`,children:[`· `,e.connection]})]}),(0,h.jsx)(zP,{className:`pr-4 font-mono text-xs text-muted-foreground`,children:e.ip})]},e.id))]})]}),i.data?.entries.length===0&&(0,h.jsx)(MP,{icon:(0,h.jsx)(fi,{}),title:`Nothing yet`,children:e||n?`No changes match these filters.`:`Uploads, deletes, settings changes and sign-ins show up here.`})]})]})]})}function HP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card`,className:K(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function UP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card-header`,className:K(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function WP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card-title`,className:K(`leading-none font-semibold`,e),...t})}function GP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card-description`,className:K(`text-sm text-muted-foreground`,e),...t})}function KP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card-action`,className:K(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...t})}function qP({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`card-content`,className:K(`px-6`,e),...t})}function JP(){let{connection:e,isAdmin:t,me:n}=XA(),r=jt(),[i,a]=(0,d.useState)(!1),o=t&&!n.readonly&&e.capabilities.bucketCreate&&!r.data?.fallback;return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsxs)(`div`,{className:`px-6 py-6`,children:[(0,h.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-end justify-between gap-4`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Buckets`}),(0,h.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.providerName,e.endpoint?` at ${e.endpoint}`:``,` · region `,e.region,e.accessKeyHint?` · key ${e.accessKeyHint}`:``]})]}),o&&(0,h.jsxs)(Y,{onClick:()=>a(!0),children:[(0,h.jsx)(ci,{}),` New bucket`]})]}),r.data?.fallback&&(0,h.jsxs)(_N,{className:`mb-4`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:`This key can’t list buckets, so only the configured buckets are shown.`})]}),r.isPending?(0,h.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`,children:Array.from({length:6},(e,t)=>(0,h.jsx)(JN,{className:`h-20 rounded-xl`},t))}):r.isError?(0,h.jsxs)(_N,{variant:`destructive`,children:[(0,h.jsx)(Bn,{}),(0,h.jsxs)(yN,{children:[`Couldn’t list buckets: `,V(r.error)]})]}):r.data.buckets.length===0?(0,h.jsxs)(TP,{className:`border`,children:[(0,h.jsxs)(EP,{children:[(0,h.jsx)(OP,{variant:`icon`,children:(0,h.jsx)(Jn,{})}),(0,h.jsx)(kP,{children:`No buckets yet`}),(0,h.jsx)(AP,{children:o?`Create one to get started.`:`This key has no buckets.`})]}),o&&(0,h.jsxs)(Y,{onClick:()=>a(!0),children:[(0,h.jsx)(ci,{}),` New bucket`]})]}):(0,h.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`,children:r.data.buckets.map(e=>(0,h.jsx)(`a`,{href:hx({bucket:e.name}),onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),gx({bucket:e.name}))},className:`rounded-xl focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,h.jsx)(HP,{className:`gap-1 py-4 transition-colors hover:border-primary/40 hover:bg-accent/40`,children:(0,h.jsxs)(UP,{className:`px-4`,children:[(0,h.jsxs)(WP,{className:`flex items-center gap-2 truncate text-sm`,children:[(0,h.jsx)(Jn,{className:`size-4 shrink-0 text-primary`}),(0,h.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,h.jsxs)(GP,{className:`flex flex-wrap items-center gap-1.5 text-xs`,children:[e.region&&(0,h.jsx)(VN,{variant:`outline`,children:e.region}),e.createdAt?`Created ${oP(e.createdAt)}`:`Configured bucket`]})]})})},e.name))})]}),(0,h.jsx)(LN,{open:i,onOpenChange:a})]})}function YP({...e}){return(0,h.jsx)(of,{"data-slot":`alert-dialog`,...e})}function XP({...e}){return(0,h.jsx)(sf,{"data-slot":`alert-dialog-portal`,...e})}function ZP({className:e,...t}){return(0,h.jsx)(cf,{"data-slot":`alert-dialog-overlay`,className:K(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function QP({className:e,size:t=`default`,...n}){return(0,h.jsxs)(XP,{children:[(0,h.jsx)(ZP,{}),(0,h.jsx)(df,{"data-slot":`alert-dialog-content`,"data-size":t,className:K(`group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg`,e),...n})]})}function $P({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:K(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function eF({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:K(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function tF({className:e,...t}){return(0,h.jsx)(ff,{"data-slot":`alert-dialog-title`,className:K(`text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function nF({className:e,...t}){return(0,h.jsx)(pf,{"data-slot":`alert-dialog-description`,className:K(`text-sm text-muted-foreground`,e),...t})}function rF({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,h.jsx)(Y,{variant:t,size:n,asChild:!0,children:(0,h.jsx)(mf,{"data-slot":`alert-dialog-action`,className:K(e),...r})})}function iF({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,h.jsx)(Y,{variant:t,size:n,asChild:!0,children:(0,h.jsx)(gf,{"data-slot":`alert-dialog-cancel`,className:K(e),...r})})}function aF({...e}){return(0,h.jsx)(uv,{"data-slot":`select`,...e})}function oF({...e}){return(0,h.jsx)(mv,{"data-slot":`select-value`,...e})}function sF({className:e,size:t=`default`,children:n,...r}){return(0,h.jsxs)(fv,{"data-slot":`select-trigger`,"data-size":t,className:K(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,h.jsx)(hv,{asChild:!0,children:(0,h.jsx)(Mn,{className:`size-4 opacity-50`})})]})}function cF({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,h.jsx)(vv,{children:(0,h.jsxs)(bv,{"data-slot":`select-content`,className:K(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,h.jsx)(uF,{}),(0,h.jsx)(Mv,{className:K(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,h.jsx)(dF,{})]})})}function lF({className:e,children:t,...n}){return(0,h.jsxs)(Rv,{"data-slot":`select-item`,className:K(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,h.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,h.jsx)(Hv,{children:(0,h.jsx)(An,{className:`size-4`})})}),(0,h.jsx)(Bv,{children:t})]})}function uF({className:e,...t}){return(0,h.jsx)(Wv,{"data-slot":`select-scroll-up-button`,className:K(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,h.jsx)(In,{className:`size-4`})})}function dF({className:e,...t}){return(0,h.jsx)(Kv,{"data-slot":`select-scroll-down-button`,className:K(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,h.jsx)(Mn,{className:`size-4`})})}var fF=Zb(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}}),pF=d.createContext({size:`default`,variant:`default`,spacing:0});function mF({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,h.jsx)(eb,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:K(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,h.jsx)(pF.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function hF({className:e,children:t,variant:n,size:r,...i}){let a=d.useContext(pF);return(0,h.jsx)(lb,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:K(fF({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}function gF({title:e,value:t,onChange:n}){let{connections:r}=XA(),i=Qt(t.connectionId||null);return(0,h.jsxs)(HP,{className:`gap-4 py-5`,children:[(0,h.jsx)(UP,{className:`px-5`,children:(0,h.jsx)(WP,{className:`text-sm`,children:e})}),(0,h.jsx)(qP,{className:`px-5`,children:(0,h.jsxs)(TN,{className:`gap-3`,children:[(0,h.jsx)(FN,{label:`Connection`,htmlFor:`${e}-conn`,children:(0,h.jsxs)(aF,{value:t.connectionId,onValueChange:e=>n({connectionId:e,bucket:``,prefix:``}),children:[(0,h.jsx)(sF,{id:`${e}-conn`,className:`w-full`,children:(0,h.jsx)(oF,{placeholder:`Choose a connection`})}),(0,h.jsx)(cF,{children:r.map(e=>(0,h.jsx)(lF,{value:e.id,children:e.label},e.id))})]})}),(0,h.jsx)(FN,{label:`Bucket`,htmlFor:`${e}-bucket`,error:i.isError?V(i.error):void 0,children:(0,h.jsxs)(aF,{value:t.bucket,onValueChange:e=>n({...t,bucket:e}),disabled:!t.connectionId||i.isPending,children:[(0,h.jsx)(sF,{id:`${e}-bucket`,className:`w-full`,children:(0,h.jsx)(oF,{placeholder:i.isPending&&t.connectionId?`Loading…`:`Choose a bucket`})}),(0,h.jsx)(cF,{children:i.data?.buckets.map(e=>(0,h.jsx)(lF,{value:e.name,children:e.name},e.name))})]})}),(0,h.jsx)(FN,{label:`Folder`,htmlFor:`${e}-prefix`,description:`Empty for the whole bucket`,children:(0,h.jsx)(NN,{id:`${e}-prefix`,value:t.prefix,onChange:e=>n({...t,prefix:e.target.value.replace(/^\/+/,``)}),placeholder:`path/to/folder/`,className:`font-mono text-xs`})})]})})]})}var _F={missing:`Only in source`,changed:`Different`,extra:`Only in target`,same:`Same`};function vF({job:e}){let t=_(),n=e.total?e.done/e.total*100:e.status===`done`?100:0;return(0,h.jsxs)(`div`,{className:`space-y-2 px-4 py-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,title:e.title,children:e.title}),(0,h.jsxs)(VN,{variant:e.status===`failed`?`destructive`:e.status===`running`?`secondary`:`outline`,className:`capitalize`,children:[e.status===`running`&&(0,h.jsx)(PN,{className:`size-3`}),` `,e.status]}),e.status===`running`&&(0,h.jsxs)(Y,{variant:`ghost`,size:`xs`,onClick:()=>Zt.cancel(e.id).then(()=>t.invalidateQueries({queryKey:xt.jobs})).catch(e=>U.error(V(e))),children:[(0,h.jsx)(Oi,{}),` Stop`]})]}),(0,h.jsx)(qN,{value:n,className:`h-1.5`}),(0,h.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[rP(e.done),` / `,rP(e.total),` objects · `,nP(e.bytesDone),` of `,nP(e.bytesTotal),` · started`,` `,sP(e.startedAt),e.errors.length>0&&(0,h.jsxs)(`span`,{className:`text-destructive`,children:[` · `,e.errors.length,` errors`]})]}),e.errors.length>0&&(0,h.jsx)(`ul`,{className:`max-h-24 overflow-y-auto rounded-md bg-destructive/5 px-3 py-2 font-mono text-[11px] text-destructive`,children:e.errors.slice(0,20).map((e,t)=>(0,h.jsxs)(`li`,{className:`truncate`,children:[e.key?`${e.key}: `:``,e.message]},t))})]})}function yF(){let{connection:e,readonly:t}=XA(),n=_(),r=Xt(),[i,a]=(0,d.useState)({connectionId:e.id,bucket:``,prefix:``}),[o,s]=(0,d.useState)({connectionId:e.id,bucket:``,prefix:``}),[c,l]=(0,d.useState)(`copy`),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1),[g,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)(`all-changes`),C=i.connectionId&&i.bucket&&o.connectionId&&o.bucket,w=!!C&&i.connectionId===o.connectionId&&i.bucket===o.bucket&&i.prefix===o.prefix,T=async()=>{m(!0),v(null),f(null);try{f(await Zt.compare({source:i,target:o}))}catch(e){v(e)}finally{m(!1)}},E=async()=>{try{await Zt.start({source:i,target:o,mode:c}),U.success(`Sync started`,{description:`Progress is shown below. You can leave this page.`}),f(null),n.invalidateQueries({queryKey:xt.jobs})}catch(e){U.error(V(e))}},D=(0,d.useMemo)(()=>(u?.items??[]).filter(e=>x===`all-changes`?e.status!==`same`:e.status===x).slice(0,500),[u,x]);return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsx)(NP,{icon:(0,h.jsx)(Sr,{}),title:`Sync`,description:`Compare two folders on any connections, then copy or mirror one onto the other.`}),(0,h.jsxs)(`div`,{className:`space-y-6 p-6`,children:[(0,h.jsxs)(`div`,{className:`grid items-center gap-4 lg:grid-cols-[1fr_auto_1fr]`,children:[(0,h.jsx)(gF,{title:`Source`,value:i,onChange:e=>(a(e),f(null))}),(0,h.jsx)(bn,{className:`mx-auto size-5 rotate-90 text-muted-foreground lg:rotate-0`}),(0,h.jsx)(gF,{title:`Target`,value:o,onChange:e=>(s(e),f(null))})]}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,h.jsxs)(Y,{onClick:()=>void T(),disabled:!C||w||p,children:[p?(0,h.jsx)(PN,{}):(0,h.jsx)(Or,{}),`Compare`]}),w&&(0,h.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Source and target are the same folder.`}),i.connectionId!==o.connectionId&&C&&(0,h.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Different connections: data streams through s3deck.`})]}),g!=null&&(0,h.jsx)(IN,{error:g}),u&&(0,h.jsxs)(`div`,{className:`space-y-4`,children:[u.truncated&&(0,h.jsxs)(_N,{children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:`One side has more than 200,000 objects; only the first 200,000 were compared.`})]}),(0,h.jsx)(`dl`,{className:`grid divide-y rounded-lg border sm:grid-cols-4 sm:divide-x sm:divide-y-0`,children:[`missing`,`changed`,`extra`,`same`].map(e=>(0,h.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,h.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:_F[e]}),(0,h.jsx)(`dd`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:rP(u.counts[e])})]},e))}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg border px-4 py-3`,children:[(0,h.jsxs)(mF,{type:`single`,variant:`outline`,size:`sm`,value:c,onValueChange:e=>e&&l(e),children:[(0,h.jsx)(hF,{value:`copy`,children:`Copy new and changed`}),(0,h.jsx)(hF,{value:`mirror`,children:`Mirror (also delete extras)`})]}),(0,h.jsxs)(`p`,{className:`min-w-0 flex-1 text-sm text-muted-foreground`,children:[rP(u.counts.missing+u.counts.changed),` objects (`,nP(u.bytesToCopy),`) to copy`,c===`mirror`&&u.counts.extra>0&&`, ${rP(u.counts.extra)} to delete from the target`,`.`]}),(0,h.jsxs)(Y,{disabled:t||u.counts.missing+u.counts.changed+(c===`mirror`?u.counts.extra:0)===0,variant:c===`mirror`&&u.counts.extra>0?`destructive`:`default`,onClick:()=>c===`mirror`&&u.counts.extra>0?b(!0):void E(),children:[(0,h.jsx)(Sr,{}),` Start sync`]})]}),(0,h.jsxs)(`div`,{className:`overflow-hidden rounded-lg border`,children:[(0,h.jsx)(`div`,{className:`flex items-center gap-2 border-b bg-muted/40 px-3 py-2`,children:(0,h.jsxs)(mF,{type:`single`,size:`sm`,value:x,onValueChange:e=>e&&S(e),children:[(0,h.jsx)(hF,{value:`all-changes`,children:`Changes`}),(0,h.jsx)(hF,{value:`missing`,children:`Only in source`}),(0,h.jsx)(hF,{value:`changed`,children:`Different`}),(0,h.jsx)(hF,{value:`extra`,children:`Only in target`}),(0,h.jsx)(hF,{value:`same`,children:`Same`})]})}),D.length===0?(0,h.jsx)(MP,{icon:(0,h.jsx)(Or,{}),title:`Nothing here`,children:x===`all-changes`?`Source and target already match.`:`No objects in this group.`}):(0,h.jsxs)(PP,{children:[(0,h.jsx)(FP,{children:(0,h.jsxs)(LP,{className:`hover:bg-transparent`,children:[(0,h.jsx)(RP,{className:`pl-4`,children:`Key (relative)`}),(0,h.jsx)(RP,{className:`w-36`,children:`Status`}),(0,h.jsx)(RP,{className:`w-28 text-right`,children:`Source`}),(0,h.jsx)(RP,{className:`w-28 pr-4 text-right`,children:`Target`})]})}),(0,h.jsx)(IP,{children:D.map(e=>(0,h.jsxs)(LP,{children:[(0,h.jsx)(zP,{className:`max-w-0 truncate pl-4 font-mono text-xs`,title:e.key,children:e.key}),(0,h.jsx)(zP,{children:(0,h.jsx)(VN,{variant:e.status===`extra`?`destructive`:e.status===`same`?`outline`:`secondary`,children:_F[e.status]})}),(0,h.jsx)(zP,{className:`text-right tabular-nums`,children:e.sourceSize===null?`—`:nP(e.sourceSize)}),(0,h.jsx)(zP,{className:`pr-4 text-right tabular-nums`,children:e.targetSize===null?`—`:nP(e.targetSize)})]},e.key))})]})]})]}),(0,h.jsxs)(`section`,{children:[(0,h.jsx)(`h2`,{className:`mb-2 text-sm font-semibold`,children:`Jobs`}),(0,h.jsx)(`div`,{className:`divide-y rounded-lg border`,children:r.data?.jobs.length?r.data.jobs.map(e=>(0,h.jsx)(vF,{job:e},e.id)):(0,h.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`No sync jobs yet. Jobs run on the server and stop if s3deck restarts.`})})]})]}),(0,h.jsx)(YP,{open:y,onOpenChange:b,children:(0,h.jsxs)(QP,{children:[(0,h.jsxs)($P,{children:[(0,h.jsxs)(tF,{children:[`Mirror and delete `,u?rP(u.counts.extra):0,` objects?`]}),(0,h.jsxs)(nF,{children:[`Objects that exist only in the target (`,o.bucket,`/`,o.prefix,`) will be deleted so it matches the source.`]})]}),(0,h.jsxs)(eF,{children:[(0,h.jsx)(iF,{children:`Cancel`}),(0,h.jsx)(rF,{variant:`destructive`,onClick:()=>void E(),children:`Mirror`})]})]})})]})}function bF({...e}){return(0,h.jsx)(u_,{"data-slot":`dropdown-menu`,...e})}function xF({...e}){return(0,h.jsx)(f_,{"data-slot":`dropdown-menu-trigger`,...e})}function SF({className:e,sideOffset:t=4,...n}){return(0,h.jsx)(p_,{children:(0,h.jsx)(h_,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:K(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function CF({className:e,inset:t,variant:n=`default`,...r}){return(0,h.jsx)(__,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:K(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function wF({className:e,children:t,checked:n,...r}){return(0,h.jsxs)(v_,{"data-slot":`dropdown-menu-checkbox-item`,className:K(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,h.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,h.jsx)(x_,{children:(0,h.jsx)(An,{className:`size-4`})})}),t]})}function TF({...e}){return(0,h.jsx)(y_,{"data-slot":`dropdown-menu-radio-group`,...e})}function EF({className:e,children:t,...n}){return(0,h.jsxs)(b_,{"data-slot":`dropdown-menu-radio-item`,className:K(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,h.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,h.jsx)(x_,{children:(0,h.jsx)(Hn,{className:`size-2 fill-current`})})}),t]})}function DF({className:e,inset:t,...n}){return(0,h.jsx)(g_,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:K(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function OF({className:e,...t}){return(0,h.jsx)(S_,{"data-slot":`dropdown-menu-separator`,className:K(`-mx-1 my-1 h-px bg-border`,e),...t})}function kF({className:e,...t}){return(0,h.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:K(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var AF=[{value:`viewer`,label:`Viewer`,hint:`Browse, preview, download and share links`},{value:`editor`,label:`Editor`,hint:`Also upload, edit, move and delete objects`},{value:`admin`,label:`Admin`,hint:`Also buckets, bucket settings, users and the activity log`}],jF=DA.extend({sso:pk(),password:Q()}).superRefine((e,t)=>{if(e.sso)e.username.includes(`@`)||t.addIssue({code:`custom`,path:[`username`],message:`Use the email address people sign in with`});else{let n=EA.safeParse(e.password);n.success||t.addIssue({code:`custom`,path:[`password`],message:n.error.issues[0]?.message??`Invalid password`})}});function MF({open:e,onOpenChange:t,ssoEnabled:n}){let{create:r}=Jt(),i=iN({resolver:hN(jF),defaultValues:{username:``,password:``,role:`viewer`,sso:!1}}),{errors:a}=i.formState,o=i.watch(`sso`),s=i.handleSubmit(e=>r.mutate({username:e.username,role:e.role,password:e.sso?void 0:e.password},{onSuccess:e=>{U.success(`Added ${e.username}`),i.reset(),t(!1)}}));return(0,h.jsx)($b,{open:e,onOpenChange:t,children:(0,h.jsx)(nx,{children:(0,h.jsxs)(`form`,{onSubmit:s,noValidate:!0,className:`grid gap-6`,children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Add user`}),(0,h.jsx)(ox,{children:`Choose what they can do. You can change it at any time.`})]}),(0,h.jsxs)(TN,{className:`gap-4`,children:[n&&(0,h.jsx)(FN,{label:`Signs in with`,htmlFor:`sso`,children:(0,h.jsx)(Bj,{control:i.control,name:`sso`,render:({field:e})=>(0,h.jsxs)(aF,{value:e.value?`sso`:`password`,onValueChange:t=>e.onChange(t===`sso`),children:[(0,h.jsx)(sF,{id:`sso`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsxs)(cF,{children:[(0,h.jsx)(lF,{value:`password`,children:`Username and password`}),(0,h.jsx)(lF,{value:`sso`,children:`Single sign-on (email)`})]})]})})}),(0,h.jsx)(FN,{label:o?`Email`:`Username`,htmlFor:`new-username`,error:a.username?.message,children:(0,h.jsx)(NN,{id:`new-username`,autoComplete:`off`,autoFocus:!0,"aria-invalid":!!a.username,...i.register(`username`)})}),!o&&(0,h.jsx)(FN,{label:`Password`,htmlFor:`new-password`,description:`At least 10 characters`,error:a.password?.message,children:(0,h.jsx)(NN,{id:`new-password`,type:`password`,autoComplete:`new-password`,"aria-invalid":!!a.password,...i.register(`password`)})}),(0,h.jsx)(FN,{label:`Role`,htmlFor:`new-role`,description:AF.find(e=>e.value===i.watch(`role`))?.hint,children:(0,h.jsx)(Bj,{control:i.control,name:`role`,render:({field:e})=>(0,h.jsxs)(aF,{value:e.value,onValueChange:t=>e.onChange(wA.parse(t)),children:[(0,h.jsx)(sF,{id:`new-role`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsx)(cF,{children:AF.map(e=>(0,h.jsx)(lF,{value:e.value,children:e.label},e.value))})]})})}),r.isError&&(0,h.jsx)(IN,{error:r.error})]}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:r.isPending,children:[r.isPending&&(0,h.jsx)(PN,{}),`Add user`]})]})]})})})}function NF({user:e,onClose:t}){let{update:n}=Jt(),[r,i]=(0,d.useState)(``),a=EA.safeParse(r);return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&t(),children:(0,h.jsxs)(nx,{children:[(0,h.jsxs)(rx,{children:[(0,h.jsxs)(ax,{children:[`Set password for `,e.username]}),(0,h.jsx)(ox,{children:`They’ll use it the next time they sign in. Existing sessions stay signed in.`})]}),(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsx)(FN,{label:`New password`,htmlFor:`reset-pw`,error:r&&!a.success?a.error.issues[0]?.message:void 0,children:(0,h.jsx)(NN,{id:`reset-pw`,type:`password`,autoComplete:`new-password`,autoFocus:!0,value:r,onChange:e=>i(e.target.value)})}),n.isError&&(0,h.jsx)(IN,{error:n.error})]}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:t,children:`Cancel`}),(0,h.jsxs)(Y,{disabled:!a.success||n.isPending,onClick:()=>n.mutate({username:e.username,patch:{password:r}},{onSuccess:()=>(U.success(`Password updated`),t())}),children:[n.isPending&&(0,h.jsx)(PN,{}),`Save password`]})]})]})})}function PF(){let e=Ct(),t=qt(),{update:n,remove:r}=Jt(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),u=!!e.data?.persistence,f=(e,t,r)=>n.mutate({username:e.username,patch:t},{onSuccess:()=>U.success(r),onError:e=>U.error(V(e))});return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsx)(NP,{icon:(0,h.jsx)(Wi,{}),title:`Users`,description:`Who can sign in, and what they can do.`,action:u&&(0,h.jsxs)(Y,{size:`sm`,onClick:()=>a(!0),children:[(0,h.jsx)(ci,{}),` Add user`]})}),(0,h.jsxs)(`div`,{className:`space-y-4 p-6`,children:[!u&&(0,h.jsxs)(_N,{children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:`s3deck is running without a data directory (--no-persist), so extra users can’t be stored.`})]}),(0,h.jsxs)(`div`,{className:`overflow-hidden rounded-lg border`,children:[(0,h.jsxs)(PP,{children:[(0,h.jsx)(FP,{children:(0,h.jsxs)(LP,{className:`hover:bg-transparent`,children:[(0,h.jsx)(RP,{className:`pl-4`,children:`User`}),(0,h.jsx)(RP,{children:`Role`}),(0,h.jsx)(RP,{children:`Sign-in`}),(0,h.jsx)(RP,{children:`Added`}),(0,h.jsx)(RP,{className:`w-12 pr-4`})]})}),(0,h.jsxs)(IP,{children:[t.data&&(0,h.jsxs)(LP,{className:`hover:bg-transparent`,children:[(0,h.jsx)(zP,{className:`pl-4 font-medium`,children:t.data.startupAdmin}),(0,h.jsx)(zP,{children:(0,h.jsxs)(VN,{variant:`secondary`,children:[(0,h.jsx)(Si,{}),` Admin`]})}),(0,h.jsx)(zP,{className:`text-muted-foreground`,children:`Startup login (printed in the terminal)`}),(0,h.jsx)(zP,{className:`text-muted-foreground`,children:`—`}),(0,h.jsx)(zP,{})]}),t.isPending&&Array.from({length:3},(e,t)=>(0,h.jsx)(LP,{children:(0,h.jsx)(zP,{colSpan:5,className:`pl-4`,children:(0,h.jsx)(JN,{className:`h-5 w-full`})})},t)),t.data?.users.map(t=>{let n=t.username.toLowerCase()===e.data?.user?.toLowerCase();return(0,h.jsxs)(LP,{className:t.disabled?`text-muted-foreground`:void 0,children:[(0,h.jsxs)(zP,{className:`pl-4 font-medium`,children:[t.username,n&&(0,h.jsx)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:`(you)`}),t.disabled&&(0,h.jsx)(VN,{variant:`outline`,className:`ml-2`,children:`disabled`})]}),(0,h.jsx)(zP,{children:(0,h.jsx)(VN,{variant:t.role===`admin`?`secondary`:`outline`,className:`capitalize`,children:t.role})}),(0,h.jsx)(zP,{className:`text-muted-foreground`,children:t.hasPassword?`Password`:`Single sign-on`}),(0,h.jsx)(zP,{className:`text-muted-foreground`,children:oP(t.createdAt)}),(0,h.jsx)(zP,{className:`pr-4 text-right`,children:(0,h.jsxs)(bF,{children:[(0,h.jsx)(xF,{asChild:!0,children:(0,h.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Actions for ${t.username}`,children:(0,h.jsx)(Qn,{})})}),(0,h.jsxs)(SF,{align:`end`,className:`w-52`,children:[(0,h.jsx)(DF,{children:`Role`}),(0,h.jsx)(TF,{value:t.role,onValueChange:e=>f(t,{role:wA.parse(e)},`${t.username} is now ${e}`),children:AF.map(e=>(0,h.jsx)(EF,{value:e.value,disabled:n&&e.value!==`admin`,children:e.label},e.value))}),(0,h.jsx)(OF,{}),t.hasPassword&&(0,h.jsxs)(CF,{onSelect:()=>s(t),children:[(0,h.jsx)(Pr,{}),` Set password…`]}),(0,h.jsxs)(CF,{disabled:n,onSelect:()=>f(t,{disabled:!t.disabled},t.disabled?`${t.username} enabled`:`${t.username} disabled`),children:[(0,h.jsx)(Ki,{}),` `,t.disabled?`Enable`:`Disable`]}),(0,h.jsxs)(CF,{variant:`destructive`,disabled:n,onSelect:()=>l(t),children:[(0,h.jsx)(Pi,{}),` Delete…`]})]})]})})]},t.username)})]})]}),t.data&&t.data.users.length===0&&u&&(0,h.jsx)(MP,{icon:(0,h.jsx)(Wi,{}),title:`Only the startup admin so far`,children:`Add people so they get their own login and role.`}),t.isError&&(0,h.jsx)(`div`,{className:`p-4`,children:(0,h.jsx)(IN,{error:t.error})})]})]}),(0,h.jsx)(MF,{open:i,onOpenChange:a,ssoEnabled:!!e.data?.sso.enabled}),o&&(0,h.jsx)(NF,{user:o,onClose:()=>s(null)}),(0,h.jsx)(YP,{open:!!c,onOpenChange:e=>!e&&l(null),children:(0,h.jsxs)(QP,{children:[(0,h.jsxs)($P,{children:[(0,h.jsxs)(tF,{children:[`Delete `,c?.username,`?`]}),(0,h.jsx)(nF,{children:`They’re signed out right away and can’t sign in again. Their remembered connections are kept on disk.`})]}),(0,h.jsxs)(eF,{children:[(0,h.jsx)(iF,{children:`Cancel`}),(0,h.jsx)(rF,{variant:`destructive`,onClick:()=>c&&r.mutate(c.username,{onSuccess:()=>U.success(`Deleted ${c.username}`),onError:e=>U.error(V(e))}),children:`Delete user`})]})]})})]})}var FF=e=>e.toLowerCase().split(`.`).pop()??``,IF=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`bmp`,`ico`]),LF=new Set([`mp4`,`webm`,`mov`,`m4v`,`ogv`]),RF=new Set([`mp3`,`wav`,`ogg`,`oga`,`m4a`,`aac`,`flac`,`opus`]),zF=new Set([`zip`,`gz`,`tgz`,`tar`,`bz2`,`xz`,`7z`,`rar`,`zst`]),BF=new Set([`txt`,`log`,`env`,`ini`,`cfg`,`conf`,`properties`,`gitignore`,`dockerignore`,`csv`,`tsv`]),VF={js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,mts:`typescript`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,sh:`bash`,bash:`bash`,zsh:`bash`,ps1:`powershell`,html:`xml`,htm:`xml`,xml:`xml`,svg:`xml`,vue:`xml`,css:`css`,scss:`scss`,less:`less`,json:`json`,yaml:`yaml`,yml:`yaml`,toml:`ini`,ini:`ini`,sql:`sql`,graphql:`graphql`,gql:`graphql`,dockerfile:`dockerfile`,tf:`ini`,lua:`lua`,r:`r`,md:`markdown`,markdown:`markdown`};function HF(e,t){let n=FF(e),r=(t??``).toLowerCase();return n===`svg`?`code`:IF.has(n)||r.startsWith(`image/`)&&!r.includes(`svg`)?`image`:LF.has(n)||r.startsWith(`video/`)?`video`:RF.has(n)||r.startsWith(`audio/`)?`audio`:n===`pdf`||r===`application/pdf`?`pdf`:n===`md`||n===`markdown`?`markdown`:n===`json`||n===`jsonl`||n===`geojson`||r===`application/json`?`json`:n===`csv`||n===`tsv`||r===`text/csv`?`csv`:VF[n]||e.toLowerCase()===`dockerfile`?`code`:BF.has(n)||r.startsWith(`text/`)?`text`:`none`}function UF(e){return e.toLowerCase()===`dockerfile`?`dockerfile`:VF[FF(e)]}function WF(e){let t=FF(e);if(zF.has(t))return nr;if(t===`csv`||t===`tsv`||t===`xlsx`||t===`xls`)return mr;switch(HF(e)){case`image`:return cr;case`video`:return fr;case`audio`:return ur;case`code`:case`json`:return or;case`pdf`:case`markdown`:case`text`:return gr;default:return vr}}var GF=`application/x-s3deck-move`,KF=new Set([`GLACIER`,`DEEP_ARCHIVE`]),qF={STANDARD:`Standard`,INTELLIGENT_TIERING:`Intelligent-Tiering`,STANDARD_IA:`Standard-IA (infrequent access)`,ONEZONE_IA:`One Zone-IA`,GLACIER_IR:`Glacier Instant Retrieval`,GLACIER:`Glacier Flexible Retrieval (archive)`,DEEP_ARCHIVE:`Glacier Deep Archive (archive)`};function JF({value:e}){return e?KF.has(e)?(0,h.jsxs)(VN,{variant:`secondary`,className:`gap-1`,children:[(0,h.jsx)(mn,{className:`size-3`}),` Archived`]}):(0,h.jsx)(`span`,{children:e}):null}function YF({bucket:e,prefix:t}){let[n,r]=(0,d.useState)(!1),i=Gt(e,t,n);return n?i.isPending?(0,h.jsx)(PN,{className:`ml-auto size-3.5 text-muted-foreground`}):i.isError?(0,h.jsx)(`span`,{title:V(i.error),children:`—`}):(0,h.jsx)(`span`,{title:`${i.data.objects.toLocaleString()} objects`,children:nP(i.data.bytes)}):(0,h.jsx)(Y,{variant:`ghost`,size:`xs`,className:`-mr-2 text-muted-foreground opacity-0 group-hover/row:opacity-100 focus-visible:opacity-100`,onClick:e=>{e.stopPropagation(),r(!0)},children:`Calculate`})}function XF({bucket:e,entries:t,readonly:n}){let r=_(),[i,a]=(0,d.useState)(null),o=async t=>{a(t.key);try{await Ht.deleteVersion(e,t.key,t.markerVersionId),U.success(`Restored ${t.name}`),await St(r,e)}catch(e){U.error(V(e))}finally{a(null)}};return t.map(e=>{let t=WF(e.name);return(0,h.jsxs)(LP,{className:`text-muted-foreground hover:bg-transparent`,children:[(0,h.jsx)(zP,{className:`pl-4`}),(0,h.jsx)(zP,{children:(0,h.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(t,{className:`size-4 shrink-0 opacity-60`}),(0,h.jsx)(`span`,{className:`truncate line-through decoration-muted-foreground/50`,title:e.key,children:e.name}),(0,h.jsx)(VN,{variant:`outline`,children:`deleted`})]})}),(0,h.jsx)(zP,{}),(0,h.jsx)(zP,{className:`truncate`,title:oP(e.deletedAt),children:sP(e.deletedAt)}),(0,h.jsx)(zP,{className:`hidden md:table-cell`}),(0,h.jsx)(zP,{className:`pr-4 text-right`,children:!n&&(0,h.jsx)(zN,{label:`Restore`,disabled:i===e.key,onClick:()=>void o(e),children:i===e.key?(0,h.jsx)(PN,{}):(0,h.jsx)(Ri,{})})})]},`deleted:${e.key}`)})}var ZF=20971520;function QF({bucket:e,rows:t,selected:n,openKey:r,focus:i,onOpen:a,onToggle:o,menu:s,dragProps:c,dropProps:l,dropTarget:u}){return(0,h.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-3 p-4`,children:t.map((t,d)=>{let f=n.has(t.key),p=t.type===`folder`?Er:WF(t.name),m=t.type===`object`&&HF(t.name)===`image`&&t.size<=ZF;return(0,h.jsxs)(`div`,{"data-index":d,onClick:e=>a(t,d,e),...c(t),...t.type===`folder`?l(t.key):{},className:K(`group/row relative flex cursor-default flex-col overflow-hidden rounded-lg border bg-card transition-colors hover:border-primary/40`,(f||r===t.key)&&`border-primary/60 bg-primary/5`,i===d&&`outline-2 -outline-offset-2 outline-ring/60`,u===t.key&&`border-primary bg-primary/10`),children:[(0,h.jsx)(`div`,{className:`grid aspect-[4/3] place-items-center overflow-hidden bg-muted/50`,children:m?(0,h.jsx)(`img`,{src:yt(e,t.key,{inline:!0}),alt:``,loading:`lazy`,draggable:!1,className:`size-full object-cover`}):(0,h.jsx)(p,{className:K(`size-10`,t.type===`folder`?`fill-primary/15 text-primary`:`text-muted-foreground`)})}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1 px-2.5 py-2`,children:[(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`truncate text-sm`,title:t.key,children:t.name}),(0,h.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:t.type===`object`?`${nP(t.size)} · ${sP(t.lastModified)}`:`Folder`})]}),(0,h.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:s(t)})]}),(0,h.jsx)(bN,{checked:f,onClick:e=>(e.stopPropagation(),o(d,e)),"aria-label":`Select ${t.name}`,className:K(`absolute top-2 left-2 bg-background`,f?`opacity-100`:`opacity-0 group-hover/row:opacity-100 focus-visible:opacity-100`)})]},t.key)})})}function $F({bucket:e,keys:t,classes:n,onClose:r}){let[i,a]=(0,d.useState)(n[1]??n[0]??`STANDARD`),o=Vt(e,()=>Kt.storageClass(e,t,i));return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&!o.isPending&&r(),children:(0,h.jsxs)(nx,{children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Change storage class`}),(0,h.jsxs)(ox,{children:[t.length===1?(0,h.jsx)(`span`,{className:`font-mono text-xs break-all`,children:t[0]}):`${t.length} objects`,` are rewritten in place with the new class. Headers and metadata are kept.`]})]}),(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsx)(FN,{label:`Storage class`,htmlFor:`storage-class`,description:KF.has(i)?`Archived objects must be restored before they can be downloaded.`:void 0,children:(0,h.jsxs)(aF,{value:i,onValueChange:a,children:[(0,h.jsx)(sF,{id:`storage-class`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsx)(cF,{children:n.map(e=>(0,h.jsx)(lF,{value:e,children:qF[e]??e},e))})]})}),o.isError&&(0,h.jsx)(IN,{error:o.error})]}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:r,disabled:o.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{disabled:o.isPending,onClick:()=>o.mutate(void 0,{onSuccess:()=>{U.success(`Moved ${t.length} object${t.length===1?``:`s`} to ${qF[i]??i}`),r()}}),children:[o.isPending&&(0,h.jsx)(PN,{}),`Change class`]})]})]})})}var eI=[{value:`Expedited`,label:`Expedited`,hint:`1–5 minutes (Glacier Flexible only), highest cost`},{value:`Standard`,label:`Standard`,hint:`3–5 hours (12 hours for Deep Archive)`},{value:`Bulk`,label:`Bulk`,hint:`5–12 hours (48 hours for Deep Archive), lowest cost`}];function tI({bucket:e,keys:t,onClose:n}){let[r,i]=(0,d.useState)(`Standard`),[a,o]=(0,d.useState)(`7`),s=Number(a),c=Number.isInteger(s)&&s>=1&&s<=365,l=Vt(e,()=>Kt.restoreArchive(e,t,s,r));return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&!l.isPending&&n(),children:(0,h.jsxs)(nx,{children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Restore from archive`}),(0,h.jsxs)(ox,{children:[`Makes a temporary, downloadable copy of `,t.length===1?`this object`:`${t.length} objects`,`. The archived original stays where it is.`]})]}),(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsx)(FN,{label:`Retrieval speed`,htmlFor:`tier`,description:eI.find(e=>e.value===r)?.hint,children:(0,h.jsxs)(aF,{value:r,onValueChange:e=>i(e),children:[(0,h.jsx)(sF,{id:`tier`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsx)(cF,{children:eI.map(e=>(0,h.jsx)(lF,{value:e.value,children:e.label},e.value))})]})}),(0,h.jsx)(FN,{label:`Keep the copy for (days)`,htmlFor:`days`,error:c?void 0:`Between 1 and 365 days`,children:(0,h.jsx)(NN,{id:`days`,type:`number`,min:1,max:365,value:a,onChange:e=>o(e.target.value),"aria-invalid":!c})}),l.isError&&(0,h.jsx)(IN,{error:l.error})]}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:n,disabled:l.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{disabled:l.isPending||!c,onClick:()=>l.mutate(void 0,{onSuccess:()=>{U.success(`Restore requested`,{description:`The object can be downloaded once the restore finishes.`}),n()}}),children:[l.isPending&&(0,h.jsx)(PN,{}),`Request restore`]})]})]})})}function nI({text:e,label:t=`Copy`}){let[n,r]=(0,d.useState)(!1);return(0,h.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{U.error(`Copy failed. Select the text and copy it manually.`)}},children:[n?(0,h.jsx)(An,{}):(0,h.jsx)(Kn,{}),n?`Copied`:t]})}var rI=xk({name:Q().trim().min(1,`Name is required`).refine(e=>!e.startsWith(`/`)&&!e.includes(`//`),`No leading or double slashes`)});function iI({bucket:e,prefix:t,onClose:n,onCreated:r}){let i=iN({resolver:hN(rI),defaultValues:{name:``}}),a=Vt(e,t=>Ht.createFolder(e,t)),{errors:o}=i.formState,s=i.handleSubmit(({name:e})=>{let o=`${t}${e.replace(/\/+$/,``)}/`,s=sA.safeParse(o);if(!s.success)return i.setError(`name`,{message:s.error.issues[0]?.message});a.mutate(o,{onSuccess:()=>(r(o),n())})});return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&n(),children:(0,h.jsx)(nx,{children:(0,h.jsxs)(`form`,{onSubmit:s,className:`grid gap-4`,noValidate:!0,children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`New folder`}),(0,h.jsxs)(ox,{children:[`In `,(0,h.jsxs)(`span`,{className:`font-mono`,children:[e,`/`,t]})]})]}),(0,h.jsx)(FN,{label:`Folder name`,htmlFor:`folder-name`,error:o.name?.message,description:`Use "/" to create nested folders`,children:(0,h.jsx)(NN,{id:`folder-name`,autoFocus:!0,...i.register(`name`),"aria-invalid":!!o.name})}),a.isError&&(0,h.jsx)(IN,{error:a.error}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:n,children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:a.isPending,children:[a.isPending&&(0,h.jsx)(PN,{}),`Create`]})]})]})})})}function aI({bucket:e,entries:t,onClose:n,onDeleted:r}){let i=t.filter(e=>e.type===`object`),a=t.filter(e=>e.type===`folder`).map(e=>e.key),o=i.reduce((e,t)=>e+t.size,0),s=tt({queryKey:[`summary`,e,a],queryFn:({signal:t})=>Ht.summary(e,{prefixes:a},t),enabled:a.length>0,staleTime:0,gcTime:0}),c=a.length===0?{objects:i.length,bytes:o}:s.data?{objects:s.data.objects+i.length,bytes:s.data.bytes+o}:null,l=Vt(e,()=>Ht.delete(e,{keys:i.map(e=>e.key),prefixes:a})),u=t.length===1?`Delete “${t[0].name}”?`:`Delete ${t.length} items?`;return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&!l.isPending&&n(),children:(0,h.jsxs)(nx,{children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{className:`break-all`,children:u}),(0,h.jsxs)(ox,{children:[a.length>0?`Everything inside the selected folders is deleted too. `:``,`On versioned buckets, older versions are kept.`]})]}),(0,h.jsx)(`div`,{className:`rounded-md border bg-muted/40 px-3 py-2 text-sm`,children:c?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`font-medium`,children:rP(c.objects)}),` object`,c.objects===1?``:`s`,` ·`,` `,(0,h.jsx)(`span`,{className:`font-medium`,children:nP(c.bytes)})]}):s.isError?(0,h.jsxs)(`span`,{className:`text-destructive`,children:[`Couldn’t count objects: `,V(s.error)]}):(0,h.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,h.jsx)(PN,{}),` Counting objects…`]})}),l.isError&&(0,h.jsx)(IN,{error:l.error}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:n,disabled:l.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{variant:`destructive`,disabled:l.isPending||a.length>0&&!s.data,onClick:()=>l.mutate(void 0,{onSuccess:e=>{e.errors.length?U.error(`${e.errors.length} objects could not be deleted`,{description:e.errors[0]?.message}):U.success(`Deleted ${rP(e.deleted)} object${e.deleted===1?``:`s`}`),r(),n()}}),children:[l.isPending&&(0,h.jsx)(PN,{}),`Delete`]})]})]})})}function oI({bucket:e,entry:t,onClose:n}){let r=t.key.slice(0,t.key.length-t.name.length-+(t.type===`folder`)),[i,a]=(0,d.useState)(t.name),[o,s]=(0,d.useState)(null),c=Vt(e,n=>Ht.copy(e,{destinationBucket:e,move:!0,items:[{source:t.key,destination:n}]}));return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&!c.isPending&&n(),children:(0,h.jsx)(nx,{children:(0,h.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let a=i.trim().replace(/\/+$/,``);if(!a)return s(`Name is required`);if(a.includes(`/`))return s(`Use Move to change folders`);let o=`${r}${a}${t.type===`folder`?`/`:``}`,l=oA.safeParse(o);if(!l.success)return s(l.error.issues[0]?.message??`Invalid name`);if(o===t.key)return n();c.mutate(o,{onSuccess:()=>{U.success(`Renamed`),n()}})},className:`grid gap-4`,noValidate:!0,children:[(0,h.jsxs)(rx,{children:[(0,h.jsxs)(ax,{children:[`Rename `,t.type]}),(0,h.jsx)(ox,{children:t.type===`folder`?`Every object in the folder is copied to the new name, then the originals are deleted.`:`The object is copied to the new name server-side, then the original is deleted.`})]}),(0,h.jsx)(FN,{label:`Name`,htmlFor:`rename`,error:o??void 0,children:(0,h.jsx)(NN,{id:`rename`,value:i,autoFocus:!0,onFocus:e=>{let n=t.type===`object`?e.target.value.lastIndexOf(`.`):-1;e.target.setSelectionRange(0,n>0?n:e.target.value.length)},onChange:e=>(a(e.target.value),s(null))})}),c.isError&&(0,h.jsx)(IN,{error:c.error}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:n,disabled:c.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:c.isPending,children:[c.isPending&&(0,h.jsx)(PN,{}),`Rename`]})]})]})})})}function sI({bucket:e,prefix:t,entries:n,onClose:r}){let i=jt(),{readonly:a}=XA(),[o,s]=(0,d.useState)(e),[c,l]=(0,d.useState)(t),[u,f]=(0,d.useState)(`copy`),[p,m]=(0,d.useState)(null),g=Vt(e,t=>Ht.copy(e,t),e=>[e.destinationBucket]);return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&!g.isPending&&r(),children:(0,h.jsx)(nx,{children:(0,h.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let i=c.trim().replace(/^\/+/,``),a=i&&!i.endsWith(`/`)?`${i}/`:i,s=n.map(e=>({source:e.key,destination:`${a}${e.name}${e.type===`folder`?`/`:``}`}));for(let t of s){let n=oA.safeParse(t.destination);if(!n.success)return m(n.error.issues[0]?.message??`Invalid destination`);if(t.source.endsWith(`/`)&&o===e&&t.destination.startsWith(t.source))return m(`A folder can’t be copied into itself`)}if(o===e&&s.every(e=>e.source===e.destination))return m(`Pick a different destination`);g.mutate({destinationBucket:o,move:u===`move`,items:s},{onSuccess:e=>{U.success(`${u===`move`?`Moved`:`Copied`} ${rP(e.copied)} object${e.copied===1?``:`s`}`),r()}})},className:`grid gap-4`,noValidate:!0,children:[(0,h.jsxs)(rx,{children:[(0,h.jsxs)(ax,{children:[`Copy or move `,n.length===1?`“${n[0].name}”`:`${n.length} items`]}),(0,h.jsx)(ox,{children:`Server-side copy: nothing passes through your machine.`})]}),(0,h.jsxs)(mF,{type:`single`,variant:`outline`,value:u,onValueChange:e=>e&&f(e),disabled:a,className:`w-full`,children:[(0,h.jsx)(hF,{value:`copy`,className:`flex-1`,children:`Copy`}),(0,h.jsx)(hF,{value:`move`,className:`flex-1`,children:`Move`})]}),(0,h.jsx)(FN,{label:`Destination bucket`,htmlFor:`dest-bucket`,children:(0,h.jsxs)(aF,{value:o,onValueChange:s,children:[(0,h.jsx)(sF,{id:`dest-bucket`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsx)(cF,{children:(i.data?.buckets??[{name:e}]).map(e=>(0,h.jsx)(lF,{value:e.name,children:e.name},e.name))})]})}),(0,h.jsx)(FN,{label:`Destination folder`,htmlFor:`dest-prefix`,description:`Empty for the bucket root`,error:p??void 0,children:(0,h.jsx)(NN,{id:`dest-prefix`,value:c,placeholder:`path/to/folder/`,onChange:e=>(l(e.target.value),m(null)),className:`font-mono`})}),g.isError&&(0,h.jsx)(IN,{error:g.error}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:r,disabled:g.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:g.isPending,children:[g.isPending&&(0,h.jsx)(PN,{}),u===`move`?`Move`:`Copy`]})]})]})})})}var cI=[{label:`15 minutes`,s:900},{label:`1 hour`,s:3600},{label:`6 hours`,s:21600},{label:`1 day`,s:86400},{label:`3 days`,s:259200},{label:`7 days`,s:dt}];function lI({bucket:e,objectKey:t,versionId:n,onClose:r}){let{readonly:i}=XA(),a=Rt(e,t,n),[o,s]=(0,d.useState)(3600),[c,l]=(0,d.useState)(`download`),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1),[g,_]=(0,d.useState)(null);(0,d.useEffect)(()=>f(null),[c,o]);let v=async()=>{m(!0),_(null);try{f(await Ht.presign(e,{key:t,method:c===`upload`?`PUT`:`GET`,expiresIn:o,versionId:c===`download`?n??void 0:void 0}))}catch(e){_(V(e))}finally{m(!1)}};return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&r(),children:(0,h.jsxs)(nx,{className:`max-w-xl`,children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Share`}),(0,h.jsx)(ox,{className:`break-all font-mono text-xs`,children:t})]}),(0,h.jsxs)(XN,{value:c,onValueChange:e=>l(e),children:[(0,h.jsxs)(QN,{children:[(0,h.jsx)($N,{value:`download`,children:`Download link`}),!i&&(0,h.jsx)($N,{value:`upload`,children:`Upload link`}),(0,h.jsx)($N,{value:`public`,children:`Public URL`})]}),[`download`,`upload`].map(e=>(0,h.jsxs)(eP,{value:e,className:`grid gap-4 pt-4`,children:[(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e===`download`?`Anyone with this link can download the object until it expires.`:`Anyone with this link can upload one file to this exact key (HTTP PUT) until it expires, replacing the current object.`}),(0,h.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,h.jsx)(FN,{label:`Expires after`,htmlFor:`expiry-${e}`,className:`flex-1`,children:(0,h.jsxs)(aF,{value:String(o),onValueChange:e=>s(Number(e)),children:[(0,h.jsx)(sF,{id:`expiry-${e}`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsx)(cF,{children:cI.map(e=>(0,h.jsx)(lF,{value:String(e.s),children:e.label},e.s))})]})}),(0,h.jsxs)(Y,{onClick:v,disabled:p,children:[p&&(0,h.jsx)(PN,{}),`Create link`]})]}),g&&(0,h.jsx)(IN,{error:Error(g)}),u&&(0,h.jsxs)(`div`,{className:`grid gap-2`,children:[(0,h.jsx)(NN,{readOnly:!0,value:u.url,className:`font-mono text-xs`,onFocus:e=>e.target.select()}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Expires `,oP(u.expiresAt)]}),(0,h.jsx)(nI,{text:u.url,label:`Copy link`})]}),e===`upload`&&(0,h.jsx)(`pre`,{className:`overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:`curl -X PUT -T ./file '${u.url}'`})]})]},e)),(0,h.jsxs)(eP,{value:`public`,className:`grid gap-3 pt-4`,children:[(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Works only if the bucket or object is public. Set a public URL base on the connection to use your own domain.`}),a.data?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(NN,{readOnly:!0,value:a.data.publicUrl,className:`font-mono text-xs`,onFocus:e=>e.target.select()}),(0,h.jsx)(`div`,{className:`flex justify-end`,children:(0,h.jsx)(nI,{text:a.data.publicUrl,label:`Copy URL`})})]}):(0,h.jsx)(PN,{})]})]})]})})}var uI=xk({contentType:hA.shape.contentType.unwrap(),cacheControl:hA.shape.cacheControl.unwrap(),contentDisposition:hA.shape.contentDisposition.unwrap(),contentEncoding:hA.shape.contentEncoding.unwrap(),replaceMetadata:pk(),meta:yk(xk({key:Q().regex(/^[a-zA-Z0-9-_]*$/,`Letters, digits, - and _`),value:Q().max(2048)})).refine(e=>{let t=e.map(e=>e.key.toLowerCase()).filter(Boolean);return new Set(t).size===t.length},`Keys must be unique`)});function dI({bucket:e,keys:t,onClose:n}){let r=t.length===1,i=Rt(e,r?t[0]:null),a=Vt(e,t=>Ht.metadata(e,t)),o=iN({resolver:hN(uI),defaultValues:{contentType:``,cacheControl:``,contentDisposition:``,contentEncoding:``,replaceMetadata:r,meta:[]}}),s=bM({control:o.control,name:`meta`}),{errors:c}=o.formState;(0,d.useEffect)(()=>{let e=i.data;e&&o.reset({contentType:e.contentType??``,cacheControl:e.cacheControl??``,contentDisposition:e.contentDisposition??``,contentEncoding:e.contentEncoding??``,replaceMetadata:!0,meta:Object.entries(e.metadata).map(([e,t])=>({key:e,value:t}))})},[i.data,o]);let l=o.handleSubmit(e=>{let i=(e,t)=>r||t?e:void 0,s=o.formState.dirtyFields,c={keys:t,contentType:i(e.contentType,s.contentType),cacheControl:i(e.cacheControl,s.cacheControl),contentDisposition:i(e.contentDisposition,s.contentDisposition),contentEncoding:i(e.contentEncoding,s.contentEncoding),metadata:e.replaceMetadata?Object.fromEntries(e.meta.filter(e=>e.key).map(e=>[e.key,e.value])):void 0},l=hA.safeParse(c);if(!l.success)return o.setError(`root`,{message:l.error.issues[0]?.message});a.mutate(l.data,{onSuccess:()=>{U.success(`Updated ${t.length} object${r?``:`s`}`),n()}})});return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&!a.isPending&&n(),children:(0,h.jsx)(nx,{className:`max-w-xl`,children:(0,h.jsxs)(`form`,{onSubmit:l,className:`grid gap-4`,noValidate:!0,children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Edit metadata`}),(0,h.jsx)(ox,{children:r?(0,h.jsx)(`span`,{className:`break-all font-mono text-xs`,children:t[0]}):`${t.length} objects. Only fields you change are applied.`})]}),r&&i.isPending?(0,h.jsx)(PN,{}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,h.jsx)(FN,{label:`Content-Type`,htmlFor:`m-ct`,error:c.contentType?.message,children:(0,h.jsx)(NN,{id:`m-ct`,placeholder:`image/png`,...o.register(`contentType`)})}),(0,h.jsx)(FN,{label:`Cache-Control`,htmlFor:`m-cc`,error:c.cacheControl?.message,children:(0,h.jsx)(NN,{id:`m-cc`,placeholder:`public, max-age=3600`,...o.register(`cacheControl`)})}),(0,h.jsx)(FN,{label:`Content-Disposition`,htmlFor:`m-cd`,error:c.contentDisposition?.message,children:(0,h.jsx)(NN,{id:`m-cd`,placeholder:`attachment`,...o.register(`contentDisposition`)})}),(0,h.jsx)(FN,{label:`Content-Encoding`,htmlFor:`m-ce`,error:c.contentEncoding?.message,children:(0,h.jsx)(NN,{id:`m-ce`,placeholder:`gzip`,...o.register(`contentEncoding`)})})]}),(0,h.jsxs)(CN,{className:`gap-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,h.jsx)(wN,{variant:`label`,className:`mb-0`,children:`Custom metadata (x-amz-meta-*)`}),!r&&(0,h.jsxs)(DN,{orientation:`horizontal`,className:`w-auto`,children:[(0,h.jsx)(Bj,{control:o.control,name:`replaceMetadata`,render:({field:e})=>(0,h.jsx)(bN,{id:`replace-meta`,checked:e.value,onCheckedChange:t=>e.onChange(t===!0)})}),(0,h.jsx)(kN,{htmlFor:`replace-meta`,className:`text-xs font-normal`,children:`Replace on all objects`})]})]}),s.fields.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(NN,{placeholder:`key`,className:`font-mono text-xs`,...o.register(`meta.${t}.key`),"aria-invalid":!!c.meta?.[t]?.key}),(0,h.jsx)(NN,{placeholder:`value`,className:`font-mono text-xs`,...o.register(`meta.${t}.value`)}),(0,h.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:()=>s.remove(t),"aria-label":`Remove field`,children:(0,h.jsx)(Pi,{})})]},e.id)),(0,h.jsxs)(Y,{variant:`outline`,size:`sm`,className:`justify-self-start`,onClick:()=>s.append({key:``,value:``}),children:[(0,h.jsx)(ci,{}),` Add field`]}),(0,h.jsx)(MN,{children:c.meta?.root?.message??c.meta?.message})]})]}),c.root?.message&&(0,h.jsx)(IN,{error:Error(c.root.message)}),a.isError&&(0,h.jsx)(IN,{error:a.error}),(0,h.jsxs)(ix,{children:[(0,h.jsx)(Y,{variant:`outline`,onClick:n,disabled:a.isPending,children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:a.isPending,children:[a.isPending&&(0,h.jsx)(PN,{}),`Save`]})]})]})})})}var fI=xk({tags:yk(gA).max(10,`At most 10 tags`).refine(e=>new Set(e.map(e=>e.Key)).size===e.length,`Tag keys must be unique`)});function pI({bucket:e,keys:t,onDone:n}){let r=t.length===1,i=Bt(e,t[0],r),a=Vt(e,n=>Ht.tags(e,{keys:t,tags:n})),o=iN({resolver:hN(fI),defaultValues:{tags:[]}}),s=bM({control:o.control,name:`tags`}),{errors:c}=o.formState;return(0,d.useEffect)(()=>{i.data&&o.reset({tags:i.data.tags})},[i.data,o]),r&&i.isPending?(0,h.jsx)(PN,{}):r&&i.isError?(0,h.jsx)(IN,{error:i.error}):(0,h.jsxs)(`form`,{noValidate:!0,className:`grid gap-2`,onSubmit:o.handleSubmit(e=>a.mutate(e.tags,{onSuccess:()=>{U.success(`Tags saved`),n?.()}})),children:[!r&&(0,h.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`These tags replace the tags on all `,t.length,` objects.`]}),s.fields.length===0&&(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tags.`}),s.fields.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(NN,{placeholder:`Key`,className:`text-xs`,...o.register(`tags.${t}.Key`),"aria-invalid":!!c.tags?.[t]?.Key}),(0,h.jsx)(NN,{placeholder:`Value`,className:`text-xs`,...o.register(`tags.${t}.Value`),"aria-invalid":!!c.tags?.[t]?.Value}),(0,h.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:()=>s.remove(t),"aria-label":`Remove tag`,children:(0,h.jsx)(Pi,{})})]},e.id)),(0,h.jsx)(MN,{children:c.tags?.root?.message??c.tags?.message}),a.isError&&(0,h.jsx)(IN,{error:a.error}),(0,h.jsxs)(`div`,{className:`flex justify-between gap-2 pt-1`,children:[(0,h.jsxs)(Y,{variant:`outline`,size:`sm`,disabled:s.fields.length>=10,onClick:()=>s.append({Key:``,Value:``}),children:[(0,h.jsx)(ci,{}),` Add tag`]}),(0,h.jsxs)(Y,{type:`submit`,size:`sm`,disabled:a.isPending,children:[a.isPending&&(0,h.jsx)(PN,{}),`Save tags`]})]})]})}function mI({bucket:e,keys:t,onClose:n}){return(0,h.jsx)($b,{open:!0,onOpenChange:e=>!e&&n(),children:(0,h.jsxs)(nx,{children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Edit tags`}),(0,h.jsx)(ox,{children:t.length===1?(0,h.jsx)(`span`,{className:`break-all font-mono text-xs`,children:t[0]}):`${t.length} objects`})]}),(0,h.jsx)(pI,{bucket:e,keys:t,onDone:n})]})})}function hI({...e}){return(0,h.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,...e})}function gI({className:e,...t}){return(0,h.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:K(`flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5`,e),...t})}function _I({className:e,...t}){return(0,h.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:K(`inline-flex items-center gap-1.5`,e),...t})}function vI({asChild:e,className:t,...n}){let r=e?Ds:`a`;return(0,h.jsx)(r,{"data-slot":`breadcrumb-link`,className:K(`transition-colors hover:text-foreground`,t),...n})}function yI({className:e,...t}){return(0,h.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:K(`font-normal text-foreground`,e),...t})}function bI({children:e,className:t,...n}){return(0,h.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:K(`[&>svg]:size-3.5`,t),...n,children:e??(0,h.jsx)(Pn,{})})}function xI({className:e,...t}){return(0,h.jsx)(`kbd`,{"data-slot":`kbd`,className:K(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,e),...t})}function SI({className:e,...t}){return(0,h.jsx)(`kbd`,{"data-slot":`kbd-group`,className:K(`inline-flex items-center gap-1`,e),...t})}function CI(e,t){this.v=e,this.k=t}function wI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TI(e){if(Array.isArray(e))return e}function EI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function DI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
109
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OI(e,t){return TI(e)||EI(e,t)||kI(e,t)||DI()}function kI(e,t){if(e){if(typeof e==`string`)return wI(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wI(e,t):void 0}}function AI(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof CI;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}AI.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},AI.prototype.next=function(e){return this._invoke(`next`,e)},AI.prototype.throw=function(e){return this._invoke(`throw`,e)},AI.prototype.return=function(e){return this._invoke(`return`,e)};var jI=Object.entries,MI=Object.keys,NI=Object.setPrototypeOf,PI=Object.isFrozen,FI=Object.getPrototypeOf,II=Object.getOwnPropertyDescriptor,LI=Object.freeze,RI=Object.seal,zI=Object.create,BI=typeof Reflect<`u`&&Reflect,VI=BI.apply,HI=BI.construct;LI||=function(e){return e},RI||=function(e){return e},VI||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},HI||=function(e){return new e(...[...arguments].slice(1))};var UI=mL(Array.prototype.forEach),WI=mL(Array.prototype.lastIndexOf),GI=mL(Array.prototype.pop),KI=mL(Array.prototype.push),qI=mL(Array.prototype.slice),JI=mL(Array.prototype.splice),YI=Array.isArray,XI=hL(Set),ZI=mL(Set.prototype.add),QI=mL(Set.prototype.has),$I=mL(String.prototype.toLowerCase),eL=mL(String.prototype.toString),tL=mL(String.prototype.match),nL=mL(String.prototype.replace),rL=mL(String.prototype.indexOf),iL=mL(String.prototype.trim),aL=mL(Number.prototype.toString),oL=mL(Boolean.prototype.toString),sL=typeof BigInt>`u`?null:mL(BigInt.prototype.toString),cL=typeof Symbol>`u`?null:mL(Symbol.prototype.toString),lL=mL(Object.prototype.hasOwnProperty),uL=mL(Object.prototype.toString),dL=RegExp.prototype.test,fL=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),VI(dL,e,[t])},pL=hL(TypeError);function mL(e){return function(t){var n=[...arguments].slice(1);return VI(e,t,n)}}function hL(e){return function(){return HI(e,[...arguments])}}function gL(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$I;if(NI&&NI(e,null),!YI(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(PI(t)||(t[r]=e),i=e)}e[i]=!0}return e}function _L(e){for(let t=0;t<e.length;t++)lL(e,t)||(e[t]=null);return e}function vL(e){let t=zI(null);for(let r of jI(e)){var n=OI(r,2);let i=n[0],a=n[1];lL(e,i)&&(t[i]=YI(a)?_L(a):a&&typeof a==`object`&&a.constructor===Object?vL(a):a)}return t}function yL(e){let t=zI(null),n=MI(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function bL(e){switch(typeof e){case`string`:return e;case`number`:return aL(e);case`boolean`:return oL(e);case`bigint`:return sL?sL(e):`0`;case`symbol`:return cL?cL(e):`Symbol()`;case`undefined`:return uL(e);case`function`:case`object`:{if(e===null)return uL(e);let t=e,n=xL(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:uL(e)}return uL(e)}default:return uL(e)}}function xL(e,t){for(;e!==null;){let n=II(e,t);if(n){if(n.get)return mL(n.get);if(typeof n.value==`function`)return mL(n.value)}e=FI(e)}function n(){return null}return n}function SL(e,t){for(;e!==null;){let n=II(e,t);if(n)return n.get?mL(n.get):null;e=FI(e)}return null}function CL(e){if(!e)return!1;try{return fL(e,``),!0}catch{return!1}}var wL=LI(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),TL=LI(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.filter.font.g.glyph.glyphref.hkern.image.line.lineargradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),EL=LI([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),DL=LI([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),OL=LI(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),kL=LI([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),AL=LI([`#text`]),jL=LI(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ML=LI(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),NL=LI(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),PL=LI([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),FL=RI(/{{[\w\W]*|^[\w\W]*}}/g),IL=RI(/<%[\w\W]*|^[\w\W]*%>/g),LL=RI(/\${[\w\W]*/g),RL=RI(/{{|}}|\${|<%|%>|<%|%>/),zL=RI(/^data-[\-\w.\u00B7-\uFFFF]+$/),BL=RI(/^aria-[\-\w]+$/),VL=RI(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),HL=RI(/^(?:\w+script|data):/i),UL=RI(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),WL=RI(/^html$/i),GL=RI(/^[a-z][.\w]*(-[.\w]+)+$/i),KL=RI(/<[/\w!]/g),qL=RI(/<[/\w]/g),JL=RI(/<\/no(script|embed|frames)/i),YL=RI(/\/>/i),XL=RI(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),ZL=RI(/^[\r\n\t ]+/),QL={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},$L=LI(gL({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),eR=function(){return typeof window>`u`?null:window},tR=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},nR=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rR=function(e,t,n,r){return lL(e,t)&&YI(e[t])?gL(r.base?yL(r.base):{},e[t],r.transform):n},iR=function(e,t,n){let r=lL(e,t)?e[t]:void 0;return r&&typeof r==`object`?vL(r):n};function aR(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eR(),t=e=>aR(e);if(t.version=`3.4.18`,t.removed=[],!e||!e.document||e.document.nodeType!==QL.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter,l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=xL(d,`cloneNode`),p=xL(d,`remove`),m=xL(d,`removeAttributeNode`),h=xL(d,`nextSibling`),g=xL(d,`childNodes`),_=xL(d,`parentNode`),v=xL(d,`shadowRoot`),y=xL(d,`attributes`),b=o&&o.prototype?xL(o.prototype,`nodeType`):null,x=o&&o.prototype?xL(o.prototype,`nodeName`):null,S=o&&o.prototype?xL(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName},T=SL(d,`namespaceURI`),E=function(e){return T?T(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let D,O=``,k,A=!1,j=0,M=function(){if(j>0)throw pL(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},N=function(e){M(),j++;try{return D.createHTML(e)}finally{j--}},ee=function(e){return D&&Pe?N(e):e},te=function(e){M(),j++;try{return D.createScriptURL(e)}finally{j--}},P=function(){return A||=(k=tR(u,i),!0),k},ne=n,re=ne.implementation,ie=ne.createNodeIterator,ae=ne.createDocumentFragment,F=ne.getElementsByTagName,oe=r.importNode,I=nR();t.isSupported=typeof jI==`function`&&typeof _==`function`&&re&&re.createHTMLDocument!==void 0;let se=FL,ce=IL,le=LL,ue=zL,de=BL,L=HL,R=UL,fe=GL,pe=VL,me=null,he=gL({},[...wL,...TL,...EL,...OL,...AL]),z=null,ge=gL({},[...jL,...ML,...NL,...PL]),_e=null,ve=null,ye=null,be=Object.seal(zI(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),xe=!0,Se=!0,Ce=!1,we=!0,Te=!1,Ee=!0,De=!1,Oe=!1,ke=null,Ae=null,je=!1,Me=!1,Ne=!1,Pe=!1,Fe=!0,Ie=!1,Le=`user-content-`,Re=!0,ze=!1,Be=null,Ve=!1,He=null,Ue=gL({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),We=null,Ge=gL({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ke=null,qe=gL({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Je=`http://www.w3.org/1998/Math/MathML`,Ye=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,Ze=Xe,Qe=!1,$e=null,et=gL({},[Je,Ye,Xe],eL),tt=LI(gL({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),nt=null,rt=LI(gL({},[`annotation-xml`])),it=null,at=LI(zI(null)),ot=gL({},[`title`,`style`,`font`,`a`,`script`]),st=null,ct=[`application/xhtml+xml`,`text/html`],lt=null,ut=null,dt=n.createElement(`form`),ft=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=vL(e),st=ct.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,lt=st===`application/xhtml+xml`?eL:$I,me=rR(e,`ALLOWED_TAGS`,he,{transform:lt}),z=rR(e,`ALLOWED_ATTR`,ge,{transform:lt}),$e=rR(e,`ALLOWED_NAMESPACES`,et,{transform:eL}),Ke=rR(e,`ADD_URI_SAFE_ATTR`,qe,{transform:lt,base:qe}),We=rR(e,`ADD_DATA_URI_TAGS`,Ge,{transform:lt,base:Ge}),He=rR(e,`FORBID_CONTENTS`,Ue,{transform:lt}),ve=rR(e,`FORBID_TAGS`,zI(null),{transform:lt}),ye=rR(e,`FORBID_ATTR`,zI(null),{transform:lt}),Ve=lL(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?vL(e.USE_PROFILES):e.USE_PROFILES:!1,xe=e.ALLOW_ARIA_ATTR!==!1,Se=e.ALLOW_DATA_ATTR!==!1,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,De=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,je=e.FORCE_BODY||!1,Fe=e.SANITIZE_DOM!==!1,Ie=e.SANITIZE_NAMED_PROPS||!1,Re=e.KEEP_CONTENT!==!1,ze=e.IN_PLACE||!1,pe=CL(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:VL,Ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,nt=iR(e,`MATHML_TEXT_INTEGRATION_POINTS`,tt),it=iR(e,`HTML_INTEGRATION_POINTS`,rt);let t=iR(e,`CUSTOM_ELEMENT_HANDLING`,at);if(_e=zI(null),lL(t,`tagNameCheck`)&&ft(t.tagNameCheck)&&(_e.tagNameCheck=t.tagNameCheck),lL(t,`attributeNameCheck`)&&ft(t.attributeNameCheck)&&(_e.attributeNameCheck=t.attributeNameCheck),lL(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(_e.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),RI(_e),Te&&(Se=!1),Ne&&(Me=!0),Ve&&((lL(e,`ALLOWED_TAGS`)||lL(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),me=gL({},AL),z=zI(null),Ve.html===!0&&(gL(me,wL),gL(z,jL)),Ve.svg===!0&&(gL(me,TL),gL(z,ML),gL(z,PL)),Ve.svgFilters===!0&&(gL(me,EL),gL(z,ML),gL(z,PL)),Ve.mathMl===!0&&(gL(me,OL),gL(z,NL),gL(z,PL))),be.tagCheck=null,be.attributeCheck=null,lL(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?be.tagCheck=e.ADD_TAGS:YI(e.ADD_TAGS)&&(me===he&&(me=yL(me)),gL(me,e.ADD_TAGS,lt))),lL(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?be.attributeCheck=e.ADD_ATTR:YI(e.ADD_ATTR)&&(z===ge&&(z=yL(z)),gL(z,e.ADD_ATTR,lt))),lL(e,`ADD_FORBID_CONTENTS`)&&YI(e.ADD_FORBID_CONTENTS)&&(He===Ue&&(He=yL(He)),gL(He,e.ADD_FORBID_CONTENTS,lt)),Re&&(me[`#text`]=!0),De&&gL(me,[`html`,`head`,`body`]),me.table&&(me.tbody=!0,delete ve.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw pL(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw pL(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=D;D=e.TRUSTED_TYPES_POLICY;try{O=N(``)}catch(e){throw D=t,e}}else e.TRUSTED_TYPES_POLICY===null?(D=void 0,O=``):(D===void 0&&(D=P()),D&&typeof O==`string`&&(O=N(``)));ut=LI(e)},mt=gL({},[...TL,...EL,...DL]),ht=gL({},[...OL,...kL]),gt=function(e,t,n){return t===Xe?e===`svg`:t===Je?e===`svg`&&(n===`annotation-xml`||nt[n]):!!mt[e]},_t=function(e,t,n){return t===Xe?e===`math`:t===Ye?e===`math`&&it[n]:!!ht[e]},vt=function(e,t,n){return t===Ye&&!it[n]||t===Je&&!nt[n]?!1:!ht[e]&&(ot[e]||!mt[e])},B=function(e){let t=E(e),n=$I(w(e)),r=_(e),i=Ze,a=`template`;return r&&C(r)===QL.element&&(i=E(r),a=$I(w(r))),$e[t]?t===Ye?gt(n,i,a):t===Je?_t(n,i,a):t===Xe?vt(n,i,a):st===`application/xhtml+xml`:!1},V=function(e){KI(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw pL(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},bt=function(e){wt(e);let t=g(e);t&&UI(qI(t),e=>{try{p(e)}catch{}}),C(e)===QL.element&&St(e,!1)},xt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}if(KI(t.removed,{attribute:r||null,from:n}),r)yt(n,r,e);else try{n.removeAttribute(e)}catch{}if(e===`is`){if(Me||Ne)try{V(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},St=function(e,t){let n=y(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&z[lt(a)])&&yt(e,i,a)}},Ct=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===QL.element){let t=v(e);Bt(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},wt=function(e){Ct(e,e=>{C(e)===QL.element&&St(e,!0)})},Tt=function(e){let t=[];return Ct(e,e=>{t.push(e)},!0),t},Et=function(e,t){let n=XI();UI(Tt(e),e=>{C(e)===QL.element&&ZI(n,e)}),UI(t,e=>{C(e)===QL.element&&!QI(n,e)&&St(e,!0)})},Dt=function(e,n){let r=!1;return UI(t.removed,t=>{t.element&&(r||=t.element===e,wt(t.element))}),Et(e,n),r},Ot=function(e,t){let n=Be,r=null,i=()=>(r||(r=XI(),UI(t,e=>{ZI(r,e)})),r);for(let t=0;;t++){let r=Tt(e),a=[e],o=!1;if(UI(r,e=>{C(e)===QL.documentFragment?KI(a,e):!o&&!QI(n,e)&&(o=QI(i(),e))}),!o)return;if(t>=8)throw pL(`the tree kept changing during in-place sanitization; refusing to return it`);UI(a,(t,n)=>{kt(t,n>0,e,i())})}},kt=function(e,t,n,r){let i=Pt(e),a;for(;a=i.nextNode();)QI(r,a)&&!QI(Be,a)&&(t&&Ht(I.uponSanitizeShadowNode,a,null),nn(a,n))},At=function(e){Be&&ZI(Be,e)},jt=function(e,t){return Ee?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Mt=function(e){Ee&&Ct(e,e=>{let t=C(e);if(t===QL.processingInstruction||t===QL.comment&&fL(qL,e.data)){try{p(e)}catch{}return!1}if(t===QL.element){let t=e,n=lt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&jt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Nt=function(e){let t=null,r=null;if(je)e=`<remove></remove>`+e;else{let t=tL(e,ZL);r=t&&t[0]}st===`application/xhtml+xml`&&Ze===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=D?N(e):e;if(Ze===Xe)try{t=new l().parseFromString(i,st)}catch{}if(!t||!t.documentElement){t=re.createDocument(Ze,`template`,null);try{t.documentElement.innerHTML=Qe?O:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ze===Xe?F.call(t,De?`html`:`body`)[0]:De?t.documentElement:a},Pt=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=S?S(e):e.ownerDocument;return ie.call(n||e,e,(t?0:c.SHOW_ELEMENT)|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ft=function(e){return e=nL(e,se,` `),e=nL(e,ce,` `),e=nL(e,le,` `),e},It=function(e){Lt(e);let t=e.querySelectorAll?.call(e,`template`);t&&UI(t,e=>{Bt(e.content)&&It(e.content)})},Lt=function(e){e.normalize();let t=Pt(e,!0),n=t.nextNode();for(;n;)n.data=Ft(n.data),n=t.nextNode()},Rt=function(e){let t=x?x(e):null;return typeof t!=`string`||lt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},zt=function(e){if(!b||typeof e!=`object`||!e)return null;try{let t=b(e);return typeof t==`number`?t:null}catch{return null}},Bt=function(e){return zt(e)===QL.documentFragment},Vt=function(e){return zt(e)!==null};function Ht(e,n,r){e.length!==0&&UI(e,e=>{e.call(t,n,r,ut)})}let Ut=function(e,t,n){return!!(Ee&&n===QL.element&&e.hasChildNodes()&&!Vt(e.firstElementChild)&&fL(KL,e.textContent)&&fL(KL,e.innerHTML)||Ee&&$L[t]&&n===QL.element&&E(e)===Xe&&(Vt(e.firstElementChild)||typeof e.textContent==`string`&&fL(KL,e.textContent))||n===QL.processingInstruction||Ee&&n===QL.comment&&fL(qL,e.data))},Wt=function(e,t){return e instanceof RegExp?fL(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Gt=function(e,t,n){if(!ve[t]&&Zt(t)&&Wt(_e.tagNameCheck,t))return!1;if(Re&&!He[t]&&!He[$I(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return V(e),!0},Kt=function(e,t,n,r){return e.length===0?t:t===n||t===r?yL(t):t},qt=function(e,t){return e===t||_(e)!==null?!1:(ze&&wt(e),!0)},Jt=function(e,n){if(At(e),Ht(I.beforeSanitizeElements,e,null),qt(e,n))return!0;if(Rt(e))return V(e),!0;let r=lt(w(e)),i=C(e);if(me=Kt(I.uponSanitizeElement,me,he,ke),Ht(I.uponSanitizeElement,e,{tagName:r,allowedTags:me}),qt(e,n))return!0;if(Ut(e,r,i))return V(e),!0;if(ve[r]||!(be.tagCheck instanceof Function&&be.tagCheck(r))&&!me[r]){let t=Gt(e,r,n);return t===!1&&(Ht(I.afterSanitizeElements,e,null),qt(e,n))?!0:t}if(i===QL.element&&!B(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&fL(JL,e.innerHTML))return V(e),!0;if(Te&&i===QL.text){let n=e.textContent,r=Ft(n);n!==r&&(KI(t.removed,{element:e.cloneNode()}),e.textContent=r)}return Ht(I.afterSanitizeElements,e,null),qt(e,n)},Yt=function(e,t,r){if(ye[t]||jt(t,e)||Fe&&(t===`id`||t===`name`)&&(r in n||r in dt))return!1;let i=z[t]||be.attributeCheck instanceof Function&&be.attributeCheck(t,e);if(Se&&fL(ue,t)||xe&&fL(de,t))return!0;if(!i)return Zt(e)&&Wt(_e.tagNameCheck,e)&&Wt(_e.attributeNameCheck,t,e)||t===`is`&&_e.allowCustomizedBuiltInElements&&Wt(_e.tagNameCheck,r);if(Ke[t])return!0;let a=nL(r,R,``);return fL(pe,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&rL(r,`data:`)===0&&We[e]||Ce&&!fL(L,a)?!0:!r},Xt=gL({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Zt=function(e){return!Xt[$I(e)]&&fL(fe,e)},Qt=function(e,t,n,r){if(D&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return N(r);case`TrustedScriptURL`:return te(r)}return r},$t=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Rt(e)||(V(e),!1)}catch{return xt(t,e),!1}},en=function(e,t){return Ee&&fL(XL,t)?!0:$I(e)===`attributename`&&rL(t,`href`)!==-1},tn=function(e,n){if(Ht(I.beforeSanitizeAttributes,e,null),qt(e,n))return;let r=e.attributes;if(!r||Rt(e))return;z=Kt(I.uponSanitizeAttribute,z,ge,Ae);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},a=r.length,o=lt(w(e));for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=lt(s),d=l,f=s===`value`?d:iL(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Ht(I.uponSanitizeAttribute,e,i),f=i.attrValue,Ie&&(u===`id`||u===`name`)&&rL(f,Le)!==0&&(xt(s,e,n),f=Le+f,p=!0),en(s,f)?xt(s,e,n):i.forceKeepAttr||(i.keepAttr?!we&&fL(YL,f)?xt(s,e,n):(Te&&(f=Ft(f)),Yt(o,u,f)?(f=Qt(o,u,c,f),f!==d&&$t(e,s,c,f)&&p&&GI(t.removed)):xt(s,e,n)):xt(s,e,n))}Ht(I.afterSanitizeAttributes,e,null),qt(e,n)},nn=function(e,t){Jt(e,t),tn(e,t),Bt(e.content)&&rn(e.content)},rn=function(e){let t=null,n=Pt(e);for(Ht(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ht(I.uponSanitizeShadowNode,t,null),nn(t,e),C(t)===QL.element){let e=v(t);Bt(e)&&(an(e),rn(e))}Te&&Lt(e),Ht(I.afterSanitizeShadowDOM,e,null)},an=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){rn(e.shadow);continue}let n=e.node,r=C(n)===QL.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&<(e)===`template`){let e=n.content;Bt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Bt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!Vt(e)&&(e=bL(e),typeof e!=`string`))throw pL(`dirty is not a string, aborting`);if(!t.isSupported)return e;Oe?(me=ke,z=Ae):pt(n),t.removed=[];let c=ze&&typeof e!=`string`&&Vt(e),l=[],u=Be;if(c){Mt(e);let t=w(e);if(typeof t==`string`){let n=lt(t);if(!me[n]||ve[n])throw bt(e),pL(`root node is forbidden and cannot be sanitized in-place`)}if(Rt(e))throw bt(e),pL(`root node is clobbered and cannot be sanitized in-place`);l=Tt(e),Be=XI()}else if(Vt(e))i=Nt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===QL.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),an(i);else{if(!Me&&!Te&&!De&&e.indexOf(`<`)===-1)return ee(e);if(i=Nt(e),!i)return Me?null:Pe?O:``}i&&je&&V(i.firstChild);let d=c?e:i;try{c&&an(e);let t=Pt(d);for(;o=t.nextNode();)nn(o,d);c&&Ot(e,l)}catch(t){throw c&&(bt(e),Dt(e,l)),t}finally{Be=u}if(c){if(Dt(e,l))throw pL(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Te&&It(e),e}if(Me){if(Te&&It(i),Ne)for(s=ae.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(z.shadowroot||z.shadowrootmode)&&(s=oe.call(r,s,!0)),s}let f=()=>De?i.outerHTML:i.innerHTML,p=f();return Te&&fL(RL,p)&&(Lt(i),p=f()),De&&me[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&fL(WL,i.ownerDocument.doctype.name)&&(p=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
110
|
+
`+p),ee(p)},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(e),Oe=!0,ke=me,Ae=z},t.clearConfig=function(){ut=null,Oe=!1,ke=null,Ae=null,D=k,O=``},t.isValidAttribute=function(e,t,n){ut||pt({});let r=lt(e),i=lt(t);return typeof n==`string`&&(en(t,n)||!we&&fL(YL,n))?!1:Yt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&lL(I,e)&&KI(I[e],t)},t.removeHook=function(e,t){if(lL(I,e)){if(t!==void 0){let n=WI(I[e],t);return n===-1?void 0:JI(I[e],n,1)[0]}return GI(I[e])}},t.removeHooks=function(e){lL(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=nR()},t}var oR=aR();function sR(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var cR=sR();function lR(e){cR=e}var uR={exec:()=>null};function dR(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function fR(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(mR.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var pR=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),mR={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:dR(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:dR(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:dR(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:dR(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:dR(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:dR(e=>RegExp(`^ {0,${e}}(?:</?(?:${xR})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:dR(e=>RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},hR=/^(?:[ \t]*(?:\n|$))+/,gR=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_R=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,vR=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yR=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bR=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xR=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,SR=fR(` {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,xR).getRegex(),CR=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,wR=fR(CR).replace(/bull/g,bR).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,``).replace(/html/g,SR).getRegex(),TR=fR(CR).replace(/bull/g,bR).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,SR).getRegex(),ER=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,DR=/^[^\n]+/,OR=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,kR=fR(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,OR).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),AR=fR(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,bR).getRegex(),jR=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,MR=fR(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,jR).replace(`tag`,xR).replace(`attribute`,/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),NR=e=>fR(ER).replace(`hr`,vR).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,SR).getRegex(),PR=NR(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),FR=NR(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),IR={blockquote:fR(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,FR).getRegex(),code:gR,def:kR,fences:_R,heading:yR,hr:vR,html:MR,lheading:wR,list:AR,newline:hR,paragraph:PR,table:uR,text:DR},LR=fR(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,vR).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,SR).getRegex(),RR={...IR,lheading:TR,table:LR,paragraph:fR(ER).replace(`hr`,vR).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,LR).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,SR).getRegex()},zR={...IR,html:fR(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,jR).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uR,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:fR(ER).replace(`hr`,vR).replace(`heading`,` *#{1,6} *[^
|
|
111
|
+
]`).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).replace(`lheading`,wR).getRegex()},BR=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,VR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,HR=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,UR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,WR=/[\p{P}\p{S}]/u,GR=/[\s\p{P}\p{S}]/u,KR=/[^\s\p{P}\p{S}]/u,qR=fR(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,GR).getRegex(),JR=/[\p{Pi}\p{Ps}"']/u,YR=/(?!~)[\p{P}\p{S}]/u,XR=/(?!~)[\s\p{P}\p{S}]/u,ZR=/(?:[^\s\p{P}\p{S}]|~)/u,QR=fR(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,pR?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),$R=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ez=fR($R,`u`).replace(/punct/g,WR).getRegex(),tz=fR($R,`u`).replace(/punct/g,YR).getRegex(),nz=fR(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,JR).replace(/punct/g,WR).getRegex(),rz=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,iz=fR(rz,`gu`).replace(/notPunctSpace/g,KR).replace(/punctSpace/g,GR).replace(/punct/g,WR).getRegex(),az=fR(rz,`gu`).replace(/notPunctSpace/g,ZR).replace(/punctSpace/g,XR).replace(/punct/g,YR).getRegex(),oz=fR(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,KR).replace(/punctSpace/g,GR).replace(/punct/g,WR).getRegex(),sz=fR(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,KR).replace(/punctSpace/g,GR).replace(/punct/g,WR).getRegex(),cz=fR(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,KR).replace(/punctSpace/g,GR).replace(/punct/g,WR).getRegex(),lz=fR(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,WR).getRegex(),uz=fR(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,KR).replace(/punctSpace/g,GR).replace(/punct/g,WR).getRegex(),dz=fR(/\\(punct)/,`gu`).replace(/punct/g,WR).getRegex(),fz=fR(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,WR).getRegex(),pz=fR(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),mz=fR(jR).replace(`(?:-->|$)`,`-->`).getRegex(),hz=fR(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,mz).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gz=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,_z=fR(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,gz).getRegex(),vz=fR(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,_z).replace(`href`,/<(?:\\.|[^\n<>\\])*>|(?!<)[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),yz=fR(/^!?\[(label)\]\[(ref)\]/).replace(`label`,_z).replace(`ref`,OR).getRegex(),bz=fR(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,OR).getRegex(),xz=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Sz=fR(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,gz).getRegex(),Cz=fR(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,fR(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Sz).replace(`ref`,xz).getRegex()).replace(`nolink`,fR(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,xz).getRegex()).getRegex(),wz=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Tz=fR(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ez={_backpedal:uR,anyPunctuation:dz,anyPunctuationOutsideCode:fz,autolink:pz,blockSkip:QR,br:HR,code:VR,del:uR,delLDelim:uR,delRDelim:uR,emStrongLDelim:ez,emStrongRDelimAst:iz,emStrongRDelimUnd:sz,escape:BR,link:vz,nolink:bz,punctuation:qR,reflink:yz,reflinkSearch:Cz,tag:hz,text:UR,url:uR},Dz={...Ez,emStrongLDelim:nz,emStrongRDelimAst:oz,emStrongRDelimUnd:cz,link:fR(/^!?\[(label)\]\((.*?)\)/).replace(`label`,_z).getRegex(),reflink:fR(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,_z).getRegex()},Oz={...Ez,emStrongRDelimAst:az,emStrongLDelim:tz,delLDelim:lz,delRDelim:uz,url:fR(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Tz).replace(`protocol`,wz).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:fR(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,wz).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,pR?`(?<![^\\s*_~(])www\\.`:`www\\.`).getRegex()},kz={...Oz,br:fR(HR).replace(`{2,}`,`*`).getRegex(),text:fR(Oz.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Az={normal:IR,gfm:RR,pedantic:zR},jz={normal:Ez,gfm:Oz,breaks:kz,pedantic:Dz},Mz={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Nz=e=>Mz[e];function Pz(e,t){if(t){if(mR.escapeTest.test(e))return e.replace(mR.escapeReplace,Nz)}else if(mR.escapeTestNoEncode.test(e))return e.replace(mR.escapeReplaceNoEncode,Nz);return e}function Fz(e){return mR.numericCharacterReference.test(e)?e.replace(mR.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function Iz(e){try{e=encodeURI(e).replace(mR.percentDecode,`%`)}catch{return null}return e}function Lz(e,t){let n=e.replace(mR.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(mR.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(mR.slashPipe,`|`);return n}function Rz(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function zz(e){let t=e.split(`
|
|
112
|
+
`),n=t.length-1;for(;n>=0&&mR.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
113
|
+
`)}function Bz(e){return e.trim().replace(mR.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function Vz(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var Hz=new WeakMap;function Uz(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`
|
|
114
|
+
`:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`
|
|
115
|
+
`&&o!==`\r`&&o!==`\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function Wz(e,t){let n=Uz(t),r=Hz.get(e);r?r.push(n):Hz.set(e,[n])}function Gz(e){let t=Hz.get(e);t&&(t.pop(),t.length===0&&Hz.delete(e))}function Kz(e,t,n){let r=Hz.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:Uz(t).lastPossibleEmStrongCloserIndex[n]}function qz(e,t){let n=Hz.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:Uz(t).lastPossibleDelCloserIndex}function Jz(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Yz(e,t){let n=``;for(let r=0;r<e.length;r++){if(e[r]==="`"){let i=t.inline.code.exec(e.slice(r));if(i){n+=i[0],r+=i[0].length-1;continue}}e[r]===`\\`&&(e[r+1]===`[`||e[r+1]===`]`)?(n+=e[r+1],r++):n+=e[r]}return n}function Xz(e,t,n,r,i){let a=t.href,o=t.title||null,s=Yz(e[1],i),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Zz(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
116
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
117
|
+
`)}function Qz(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var $z=class{options;rules;lexer;constructor(e){this.options=e||cR}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:zz(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Zz(e,t[3]||``,this.rules);return t[3]!==void 0&&(n===``||n.endsWith(`
|
|
118
|
+
`))&&(n+=`
|
|
119
|
+
`),{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Rz(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Rz(t[0],`
|
|
120
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Rz(t[0],`
|
|
121
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Rz(t[0],`
|
|
122
|
+
`).split(`
|
|
123
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
124
|
+
`),c=s.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>n.startsWith(` `)?t+` `+n.slice(1):t+Jz(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
125
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
126
|
+
${s}`:s,r=r?`${r}
|
|
127
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
128
|
+
`),o=t.raw+`
|
|
129
|
+
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
|
130
|
+
`).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n}
|
|
131
|
+
${d.join(`
|
|
132
|
+
`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
133
|
+
`+e.join(`
|
|
134
|
+
`),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`
|
|
135
|
+
`).length:0;if(s>0){let t=e.slice(0,s).join(`
|
|
136
|
+
`);n=`${n}
|
|
137
|
+
${t}`,r=`${r}
|
|
138
|
+
${t}`}if(e=e.slice(s),e.length>0&&!this.rules.other.blockquoteStart.test(e[0]))break}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===`text`&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
|
|
139
|
+
`,1)[0],d=t[1].length,f=this.options.pedantic?Jz(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Jz(e,d)),p=e.split(`
|
|
140
|
+
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h),c=!1;for(;e;){let l=e.split(`
|
|
141
|
+
`,1)[0],u;if(p=l,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),u=p):u=p.replace(this.rules.other.leadingSpaceTab,e=>Jz(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(u.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
|
|
142
|
+
`+u.slice(h),c=!1;else{if(m)break;let e=f;if(!this.options.pedantic&&!a.includes(`
|
|
143
|
+
`)&&!f.includes(` `)){let t;for(;!n.test(e)&&(t=this.rules.other.nestedBlockMarker.exec(e));)e=e.slice(t[0].length);if(!e.trim())break}if(e.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(e)||i.test(e)||o.test(e)||n.test(e))break;if(!this.options.pedantic&&!c){let e=f.replace(this.rules.other.nestedContainerMarkers,``);if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}let t=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}
|
|
144
|
+
${p}`)?` ${u.replace(/^ {0,3}/,``)}`:p;a+=`
|
|
145
|
+
`+t,c=!0}m=!p.trim(),e=e.substring(l.length+1),f=u.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();let u=[];for(let e of o.items)if(this.lexer.state.top=!1,u.push(this.lexer.inlineQueue.length),e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e=0;e<o.items.length;e++){let t=o.items[e],n=t.tokens[0];if(t.task&&(n?.type===`text`||n?.type===`paragraph`)){t.text=t.text.replace(this.rules.other.listReplaceTask,``),n.raw=n.raw.replace(this.rules.other.listReplaceTask,``),n.text=n.text.replace(this.rules.other.listReplaceTask,``);let r=this.lexer.inlineQueue;for(let t=u[e];t<r.length;t++)if(r[t].tokens===n.tokens){r[t].src=r[t].src.replace(this.rules.other.listReplaceTask,``);break}let i=this.rules.other.listTaskCheckbox.exec(t.raw);if(i){let e={type:`checkbox`,raw:i[0]+` `,checked:i[0]!==`[ ]`};t.checked=e.checked,o.loose?t.tokens[0]&&[`paragraph`,`text`].includes(t.tokens[0].type)&&`tokens`in t.tokens[0]&&t.tokens[0].tokens?(t.tokens[0].raw=e.raw+t.tokens[0].raw,t.tokens[0].text=e.raw+t.tokens[0].text,t.tokens[0].tokens.unshift(e)):t.tokens.unshift({type:`paragraph`,raw:e.raw,text:e.raw,tokens:[e]}):t.tokens.unshift(e)}}else t.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){if(this.lexer.state.lastToken?.type===`paragraph`&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=zz(t[0]);return{type:`html`,block:!0,raw:n,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Vz(t[2],`()`)!==-1)return;let e=Bz(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Rz(t[0],`
|
|
146
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Lz(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
147
|
+
`):[],a={type:`table`,raw:Rz(t[0],`
|
|
148
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Lz(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Rz(t[0],`
|
|
149
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
150
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){if(e.charCodeAt(0)!==92)return;let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=e.charCodeAt(0);if(t!==91&&t!==33)return;let n=this.rules.inline.link.exec(e);if(n){let t=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Qz(e,n[1],t,this.rules))return;let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Rz(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Vz(n[2],`()`);if(e===-2)return;if(e>-1){let t=(n[0].indexOf(`!`)===0?5:4)+n[1].length+e;n[2]=n[2].substring(0,e),n[0]=n[0].substring(0,t).trim(),n[3]=``}}let i=Rz(n[0].slice(0,-1),`\\`);if((n[0].length-i.length)%2==0)return;let a=n[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=n[3]?n[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),Xz(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},n[0],this.lexer,this.rules)}}reflink(e,t){let n=e.charCodeAt(0);if(n!==91&&n!==33)return;let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=r[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Qz(e,r[1],n,this.rules))return;let i=t[Bz(r[2]||r[1])];if(!i){let e=r[0].charAt(0);return{type:`text`,raw:e,text:e}}return Xz(r,i,r[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:n===`*`||n===`_`||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,g=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let _=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=Kz(this,t,i),y=t.length-e.length+n;if(v<y)return;t=t.slice(-1*e.length+n);let b=v-y;for(_.lastIndex=0;(r=_.exec(t))!==null&&!(r.index>b);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if((r[5]||r[6]||g)&&h%3&&!((h+f)%3)){if(a&&(r[5]||r[6]))break;m+=f;continue}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){if(e.charCodeAt(0)!==96)return;let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=e.charCodeAt(0);if(t!==32&&t!==92&&t!==10)return;let n=this.rules.inline.br.exec(e);if(n)return{type:`br`,raw:n[0]}}del(e,t,n=``){if(e.charCodeAt(0)!==126)return;let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=qz(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Fz(t[0]),escaped:e}}}},eB=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||cR,this.options.tokenizer=this.options.tokenizer||new $z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:mR,block:Az.normal,inline:jz.normal};this.options.pedantic?(t.block=Az.pedantic,t.inline=jz.pedantic):this.options.gfm&&(t.block=Az.gfm,t.inline=this.options.breaks?jz.breaks:jz.gfm),this.tokenizer.rules=t}static get rules(){return{block:Az,inline:jz}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(mR.carriageReturn,`
|
|
151
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(mR.tabCharGlobal,` `).replace(mR.spaceLine,``));let i=1/0,a,o=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===$z.prototype.paragraph;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
152
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
153
|
+
`)?``:`
|
|
154
|
+
`)+r.raw,n.text+=`
|
|
155
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
156
|
+
`)?``:`
|
|
157
|
+
`)+r.raw,n.text+=`
|
|
158
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let i=t.at(-1);(n||i===a&&o)&&i?.type===`paragraph`?(i.raw+=(i.raw.endsWith(`
|
|
159
|
+
`)?``:`
|
|
160
|
+
`)+r.raw,i.text+=`
|
|
161
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text,a=i):(t.push(r),a=r),n=s.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
162
|
+
`)?``:`
|
|
163
|
+
`)+r.raw,n.text+=`
|
|
164
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Bz(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==$z.prototype.emStrong||this.tokenizer.del!==$z.prototype.del?this.#r(e):e;if(!n)return this.#t(e,r,t);Wz(this.tokenizer,r);try{return this.#t(e,r,t)}finally{Gz(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}let s=e[0];if(s===`*`||s===`_`){let a=t.length-e.length;if(Kz(this.tokenizer,t,s)<=a){let t=1;for(;t<e.length&&e.charCodeAt(t)===s.charCodeAt(0);)t++;let a=e.substring(0,t),o=n.at(-1);o?.type===`text`&&!o.escaped?(o.raw+=a,o.text+=a):n.push({type:`text`,raw:a,text:a,escaped:!1}),e=e.substring(t),i=s,r=!0;continue}}else if(s===`~`){let a=t.length-e.length;if(qz(this.tokenizer,t)<=a){let t=1;for(;t<e.length&&e.charCodeAt(t)===126;)t++;let a=e.substring(0,t),o=n.at(-1);o?.type===`text`&&!o.escaped?(o.raw+=a,o.text+=a):n.push({type:`text`,raw:a,text:a,escaped:!1}),e=e.substring(t),i=s,r=!0;continue}}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(c=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,i=``,a=0,o;for(t.lastIndex=0;o=t.exec(e);){let s=o.index+(o[2]?o[2].length:0),c=o.index+o[0].length;if(e.charAt(s)===`<`){let i=e.slice(s),a=n.exec(i)||r.exec(i);if(!a){t.lastIndex=s+1;continue}c=s+a[0].length,t.lastIndex=c}i+=e.slice(a,s)+`[`+`a`.repeat(c-s-2)+`]`,a=c}return i+e.slice(a)}#r(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Bz(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},tB=class{options;parser;constructor(e){this.options=e||cR}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(mR.notSpaceStart)?.[0],i=e?e.replace(mR.endingNewline,``)+`
|
|
165
|
+
`:``;return r?`<pre><code class="language-`+Pz(r)+`">`+(n?i:Pz(i,!0))+`</code></pre>
|
|
166
|
+
`:`<pre><code>`+(n?i:Pz(i,!0))+`</code></pre>
|
|
167
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
168
|
+
${this.parser.parse(e)}</blockquote>
|
|
169
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
170
|
+
`}hr(e){return`<hr>
|
|
171
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
172
|
+
`+r+`</`+i+`>
|
|
173
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
174
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
175
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
176
|
+
<thead>
|
|
177
|
+
`+t+`</thead>
|
|
178
|
+
`+r+`</table>
|
|
179
|
+
`}tablerow({text:e}){return`<tr>
|
|
180
|
+
${e}</tr>
|
|
181
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
182
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Pz(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Pz(n,!0):this.parser.parseInline(r),o=Iz(e);if(o===null)return a;e=Pz(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Pz(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Iz(e);if(i===null)return Pz(n);e=i;let a=`<img src="${Pz(e)}" alt="${Pz(n)}"`;return t&&(a+=` title="${Pz(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Pz(e.text)}},nB=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
|
|
183
|
+
`}checkbox({raw:e}){return e}},rB=class e{options;renderer;textRenderer;constructor(e){this.options=e||cR,this.options.renderer=this.options.renderer||new tB,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nB,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n===!1?``:n??``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e===!1?``:e??``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},iB=class{options;block;constructor(e){this.options=e||cR}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?eB.lex:eB.lexInline}provideParser(e=this.block){return e?rB.parse:rB.parseInline}};function aB(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var oB=new class{defaults=sR();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=rB;Renderer=tB;TextRenderer=nB;Lexer=eB;Tokenizer=$z;Hooks=iB;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(aB(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)aB(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)aB(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;aB(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);aB(n,this.walkTokens(i,t))}):e.tokens&&aB(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new tB(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $z(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new iB;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=iB.passThroughHooks.has(n)?e=>{if(t.options.async&&iB.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return aB(n,r.call(this,e)),t&&aB(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return eB.lex(e,t??this.defaults)}parser(e,t){return rB.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?eB.lex:eB.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?rB.parse:rB.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?eB.lex:eB.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?rB.parse:rB.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
184
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Pz(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function sB(e,t){return oB.parse(e,t)}sB.options=sB.setOptions=function(e){return oB.setOptions(e),sB.defaults=oB.defaults,lR(sB.defaults),sB},sB.getDefaults=sR,sB.defaults=cR;function cB(...e){return oB.use(...e),sB.defaults=oB.defaults,lR(sB.defaults),sB}sB.use=cB,sB.walkTokens=function(e,t){return oB.walkTokens(e,t)},sB.parseInline=oB.parseInline,sB.Parser=rB,sB.parser=rB.parse,sB.Renderer=tB,sB.TextRenderer=nB,sB.Lexer=eB,sB.lexer=eB.lex,sB.Tokenizer=$z,sB.Hooks=iB,sB.parse=sB,sB.options,sB.setOptions,sB.walkTokens,sB.parseInline,rB.parse,eB.lex;var lB=c(o(((e,t,n)=>{((n,r)=>{typeof define==`function`&&define.amd?define([],r):typeof t==`object`&&e!==void 0?t.exports=r():n.Papa=r()})(n,function e(){var t=typeof self<`u`?self:typeof window<`u`?window:t===void 0?{}:t,n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,i={},a=0,o={};function s(e){return e.charCodeAt(0)===65279?e.slice(1):e}function c(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine=``,this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=y(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){var i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<i){let t=this._config.newline;t||=(a=this._config.quoteChar||`"`,this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(i)].join(t)}this.isFirstChunk&&x(this._config.beforeFirstChunk)&&(a=this._config.beforeFirstChunk(e))!==void 0&&(e=a),this.isFirstChunk=!1,this._halted=!1;var i=this._partialLine+e,a=(this._partialLine=``,this._handle.parse(i,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,i=(this._finished||(this._partialLine=i.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)t.postMessage({results:a,workerId:o.WORKER_ID,finished:i});else if(x(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!i||!x(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),i||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){x(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function l(e){var t;(e||={}).chunkSize||(e.chunkSize=o.RemoteChunkSize),c.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)),t.ontimeout=b(this._chunkTimeout,this),t.open(this._config.downloadRequestBody?`POST`:`GET`,this._input,!n),this._config.downloadTimeout&&!n&&(t.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var e,r=this._config.downloadRequestHeaders;for(e in r)t.setRequestHeader(e,r[e])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,t.setRequestHeader(`Range`,`bytes=`+this._start+`-`+i));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(e=>(e=e.getResponseHeader(`Content-Range`))===null?-1:parseInt(e.substring(e.lastIndexOf(`/`)+1)))(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))},this._chunkTimeout=function(){this._chunkError(`Request timed out after `+this._config.downloadTimeout+`ms`)}}function u(e){(e||={}).chunkSize||(e.chunkSize=o.LocalChunkSize),c.call(this,e);var t,n,r=typeof FileReader<`u`;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,i=(this._config.chunkSize&&(i=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,i)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;c.call(this,e||={}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return e=this._config.chunkSize,t=e?(n=t.substring(0,e),t.substring(e)):(n=t,``),this._finished=!t,this.parseChunk(n)}}function f(e){c.call(this,e||={});var t=[],n=!0,r=!1;this.pause=function(){c.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(`data`,this._streamData),this._input.on(`end`,this._streamEnd),this._input.on(`error`,this._streamError)},this._checkIsFinished=function(){r&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=b(function(e){try{t.push(typeof e==`string`?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=b(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=b(function(){this._streamCleanUp(),r=!0,this._streamData(``)},this),this._streamCleanUp=b(function(){this._input.removeListener(`data`,this._streamData),this._input.removeListener(`end`,this._streamEnd),this._input.removeListener(`error`,this._streamError)},this)}function p(e){var t,n,r,i,a=2**53,s=-a,c=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,u=this,d=0,f=0,p=!1,g=!1,_=[],v={data:[],errors:[],meta:{}};function b(t){return e.skipEmptyLines===`greedy`?t.join(``).trim()===``:t.length===1&&t[0].length===0}function S(){if(v&&r&&(w(`Delimiter`,`UndetectableDelimiter`,`Unable to auto-detect delimiting character; defaulted to '`+o.DefaultDelimiter+`'`),r=!1),e.skipEmptyLines&&(v.data=v.data.filter(function(e){return!b(e)})),C()){if(v){if(Array.isArray(v.data[0])){for(var t=0;C()&&t<v.data.length;t++)v.data[t].forEach(e);v.data.splice(0,1)}else v.data.forEach(e)}function e(e){_.push(e)}}function n(t,n){for(var r=e.header?{}:[],i=0;i<t.length;i++){var o=i,u=t[i],u=((t,n)=>(t=>(e.dynamicTypingFunction&&e.dynamicTyping[t]===void 0&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping)))(t)?n===`true`||n===`TRUE`||n!==`false`&&n!==`FALSE`&&((e=>{if(c.test(e)&&(e=parseFloat(e),s<e&&e<a))return 1})(n)?parseFloat(n):l.test(n)?new Date(n):n===``?null:n):n)(o=e.header?i>=_.length?`__parsed_extra`:_[i]:o,u=e.transform?e.transform(u,o):u);o===`__parsed_extra`?(r[o]=r[o]||[],r[o].push(u)):r[o]=u}return e.header&&(i>_.length?w(`FieldMismatch`,`TooManyFields`,`Too many fields: expected `+_.length+` fields but parsed `+i,f+n):i<_.length&&w(`FieldMismatch`,`TooFewFields`,`Too few fields: expected `+_.length+` fields but parsed `+i,f+n)),r}var i;v&&(e.header||e.dynamicTyping||e.transform)&&(i=1,!v.data.length||Array.isArray(v.data[0])?(v.data=v.data.map(n),i=v.data.length):v.data=n(v.data,0),e.header&&v.meta&&(v.meta.fields=_),f+=i)}function C(){return e.header&&_.length===0}function w(e,t,n,r){e={type:e,code:t,message:n},r!==void 0&&(e.row=r),v.errors.push(e)}x(e.step)&&(i=e.step,e.step=function(t){v=t,C()?S():(S(),v.data.length!==0&&(d+=t.data.length,e.preview&&d>e.preview?n.abort():(v.data=v.data[0],i(v,u))))}),this.parse=function(i,a,s){var c=e.quoteChar||`"`,c=(e.newline||=this.guessLineEndings(i,c),r=!1,e.delimiter?x(e.delimiter)&&(e.delimiter=e.delimiter(i),v.meta.delimiter=e.delimiter):((c=((t,n,r,i,a)=>{var s,c,l,u;a||=[`,`,` `,`|`,`;`,o.RECORD_SEP,o.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],m=0,g=0,_=0,v=(l=void 0,new h({comments:i,delimiter:p,newline:n,preview:10}).parse(t)),y=0;y<v.data.length;y++)r&&b(v.data[y])?_++:(f=v.data[y].length,g+=f,l===void 0?l=f:0<f&&(m+=Math.abs(f-l),l=f));0<v.data.length&&(g/=v.data.length-_),1.99<g&&(c===void 0||m<c||m===c&&u<g)&&(c=m,s=p,u=g)}return{successful:!!(e.delimiter=s),bestDelimiter:s}})(i,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=o.DefaultDelimiter),v.meta.delimiter=e.delimiter),y(e));return c.header=C(),e.preview&&e.header&&c.preview++,t=i,n=new h(c),v=n.parse(t,a,s),S(),p?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return p},this.pause=function(){p=!0,n.abort(),t=x(e.chunk)?``:t.substring(n.getCharIndex())},this.resume=function(){u.streamer._halted?(p=!1,u.streamer.parseChunk(t,!0)):setTimeout(u.resume,3)},this.aborted=function(){return g},this.abort=function(){g=!0,n.abort(),v.meta.aborted=!0,x(e.complete)&&e.complete(v),t=``},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(m(t)+`([^]*?)`+m(t),`gm`),n=(e=e.replace(t,``)).split(`\r`),t=e.split(`
|
|
185
|
+
`),e=1<t.length&&t[0].length<n[0].length;if(n.length===1||e)return`
|
|
186
|
+
`;for(var r=0,i=0;i<n.length;i++)n[i][0]===`
|
|
187
|
+
`&&r++;return r>=n.length/2?`\r
|
|
188
|
+
`:`\r`}}function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function h(e){var t=(e||={}).delimiter,n=e.newline,r=e.comments,i=e.step,a=e.preview,c=e.fastMode,l=null,u=!1,d=e.quoteChar==null?`"`:e.quoteChar,f=d;if(e.escapeChar!==void 0&&(f=e.escapeChar),(typeof t!=`string`||-1<o.BAD_DELIMITERS.indexOf(t))&&(t=`,`),r===t)throw Error(`Comment character same as delimiter`);!0===r?r=`#`:(typeof r!=`string`||-1<o.BAD_DELIMITERS.indexOf(r))&&(r=!1),n!==`
|
|
189
|
+
`&&n!==`\r`&&n!==`\r
|
|
190
|
+
`&&(n=`
|
|
191
|
+
`);var p=0,h=!1;this.parse=function(o,g,_){if(typeof o!=`string`)throw Error(`Input must be a string`);var v=o.length,y=t.length,b=n.length,S=r.length,C=x(i),w=[],T=[],E=[],D=p=0;if(!o)return ie();if(c||!1!==c&&o.indexOf(d)===-1){for(var O=o.split(n),k=0;k<O.length;k++){if(E=O[k],p+=E.length,k!==O.length-1)p+=n.length;else if(_)return ie();if(!r||E.substring(0,S)!==r){if(C){if(w=[],te(E.split(t)),ae(),h)return ie()}else te(E.split(t));if(a&&a<=k)return w=w.slice(0,a),ie(!0)}}return ie()}for(var A=o.indexOf(t,p),j=o.indexOf(n,p),M=new RegExp(m(f)+m(d),`g`),N=o.indexOf(d,p);;)if(o[p]===d)for(N=p,p++;;){if((N=o.indexOf(d,N+1))===-1)return _||T.push({type:`Quotes`,code:`MissingQuotes`,message:`Quoted field unterminated`,row:w.length,index:p}),ne();if(N===v-1)return ne(o.substring(p,N).replace(M,d));if(d===f&&o[N+1]===f)N++;else if(d===f||N===0||o[N-1]!==f){A!==-1&&A<N+1&&(A=o.indexOf(t,N+1));var ee=P((j=j!==-1&&j<N+1?o.indexOf(n,N+1):j)===-1?A:Math.min(A,j));if(o.substr(N+1+ee,y)===t){E.push(o.substring(p,N).replace(M,d)),o[p=N+1+ee+y]!==d&&(N=o.indexOf(d,p)),A!==-1&&A<p&&(A=o.indexOf(t,p)),j!==-1&&j<p&&(j=o.indexOf(n,p));break}if(ee=P(j),o.substring(N+1+ee,N+1+ee+b)===n){if(E.push(o.substring(p,N).replace(M,d)),re(N+1+ee+b),A!==-1&&A<p&&(A=o.indexOf(t,p)),N=o.indexOf(d,p),C&&(ae(),h))return ie();if(a&&w.length>=a)return ie(!0);break}T.push({type:`Quotes`,code:`InvalidQuotes`,message:`Trailing quote on quoted field is malformed`,row:w.length,index:p}),N++}}else if(r&&E.length===0&&o.substring(p,p+S)===r){if(j===-1)return ie();p=j+b,j=o.indexOf(n,p),A!==-1&&A<p&&(A=o.indexOf(t,p))}else if(A!==-1&&(A<j||j===-1))E.push(o.substring(p,A)),p=A+y,A=o.indexOf(t,p);else{if(j===-1)break;if(E.push(o.substring(p,j)),re(j+b),C&&(ae(),h))return ie();if(a&&w.length>=a)return ie(!0)}return ne();function te(e){w.push(e),D=p}function P(e){var t=0;return t=e!==-1&&(e=o.substring(N+1,e))&&e.trim()===``?e.length:t}function ne(e){return _||(e===void 0&&(e=o.substring(p)),E.push(e),p=v,te(E),C&&ae()),ie()}function re(e){p=e,te(E),E=[],j=o.indexOf(n,p)}function ie(r){if(e.header&&!g&&w.length&&!u){var i=w[0],a=Object.create(null),o=new Set(i);let t=!1;for(let n=0;n<i.length;n++){let r=s(i[n]);if(a[r=x(e.transformHeader)?e.transformHeader(r,n):r]){let e,s=a[r];for(;e=r+`_`+s,s++,o.has(e););o.add(e),i[n]=e,a[r]++,t=!0,(l=l===null?{}:l)[e]=r}else a[r]=1,i[n]=r;o.add(r)}t&&console.warn(`Duplicate headers found and renamed.`),u=!0}return{data:w,errors:T,meta:{delimiter:t,linebreak:n,aborted:h,truncated:!!r,cursor:D+(g||0),renamedHeaders:l}}}function ae(){i(ie()),w=[],T=[]}},this.abort=function(){h=!0},this.getCharIndex=function(){return p}}function g(e){var t=e.data,n=i[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var a={abort:function(){r=!0,_(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(x(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},a),!r);o++);delete t.results}else x(n.userChunk)&&(n.userChunk(t.results,a,t.file),delete t.results)}t.finished&&!r&&_(t.workerId,t.results)}function _(e,t){var n=i[e];x(n.userComplete)&&n.userComplete(t),n.terminate(),delete i[e]}function v(){throw Error(`Not implemented.`)}function y(e){if(typeof e!=`object`||!e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=y(e[t]);return n}function b(e,t){return function(){e.apply(t,arguments)}}function x(e){return typeof e==`function`}return o.parse=function(n,r){var c=(r||={}).dynamicTyping||!1;if(x(c)&&(r.dynamicTypingFunction=c,c={}),r.dynamicTyping=c,r.transform=!!x(r.transform)&&r.transform,r.downloadTimeout!==void 0){var c=parseInt(r.downloadTimeout);if(isNaN(c))throw Error(`Config downloadTimeout value (`+r.downloadTimeout+`) not parsable by parseInt(val).`);r.downloadTimeout=c}if(!r.worker||!o.WORKERS_SUPPORTED)return c=null,o.NODE_STREAM_INPUT,typeof n==`string`?(n=s(n),c=new(r.download?l:d)(r)):!0===n.readable&&x(n.read)&&x(n.on)?c=new f(r):(t.File&&n instanceof File||n instanceof Object)&&(c=new u(r)),c.stream(n);(c=(()=>{var n;return!!o.WORKERS_SUPPORTED&&(n=(()=>{var n=t.URL||t.webkitURL||null,r=e.toString();return o.BLOB_URL||=n.createObjectURL(new Blob([`var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; `,`(`,r,`)();`],{type:`text/javascript`}))})(),(n=new t.Worker(n)).onmessage=g,n.id=a++,i[n.id]=n)})()).userStep=r.step,c.userChunk=r.chunk,c.userComplete=r.complete,c.userError=r.error,r.step=x(r.step),r.chunk=x(r.chunk),r.complete=x(r.complete),r.error=x(r.error),delete r.worker,c.postMessage({input:n,config:r,workerId:c.id})},o.unparse=function(e,t){var n=!1,r=!0,i=`,`,a=`\r
|
|
192
|
+
`,s=`"`,c=s+s,l=!1,u=null,d=!1,f=((()=>{if(typeof t==`object`){if(typeof t.delimiter!=`string`||o.BAD_DELIMITERS.filter(function(e){return t.delimiter.indexOf(e)!==-1}).length||(i=t.delimiter),typeof t.quotes!=`boolean`&&typeof t.quotes!=`function`&&!Array.isArray(t.quotes)||(n=t.quotes),typeof t.skipEmptyLines!=`boolean`&&typeof t.skipEmptyLines!=`string`||(l=t.skipEmptyLines),typeof t.newline==`string`&&(a=t.newline),typeof t.quoteChar==`string`&&(s=t.quoteChar,c=s+s),typeof t.header==`boolean`&&(r=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw Error(`Option columns is empty`);u=t.columns}t.escapeChar!==void 0&&(c=t.escapeChar+s),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:typeof t.escapeFormulae==`boolean`&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),new RegExp(m(s),`g`));if(typeof e==`string`&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length)return p(u,e,l);if(Array.isArray(e[0]))return p(null,e,l);if(typeof e[0]==`object`)return p(u||Object.keys(e[0]),e,l)}else if(typeof e==`object`)return typeof e.data==`string`&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]==`object`?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]==`object`||(e.data=[e.data])),p(e.fields||[],e.data||[],l);throw Error(`Unable to serialize unrecognized input`);function p(e,t,n){var o=``,s=(typeof e==`string`&&(e=JSON.parse(e)),typeof t==`string`&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),c=!Array.isArray(t[0]);if(s&&r){for(var l=0;l<e.length;l++)0<l&&(o+=i),o+=h(e[l],l);0<t.length&&(o+=a)}for(var u=0;u<t.length;u++){var d=(s?e:t[u]).length,f=!1,p=s?Object.keys(t[u]).length===0:t[u].length===0;if(n&&!s&&(f=n===`greedy`?t[u].join(``).trim()===``:t[u].length===1&&(t[u][0]==null||t[u][0].length===0)),n===`greedy`&&s){for(var m=[],g=0;g<d;g++){var _=c?e[g]:g;m.push(t[u][_])}f=m.join(``).trim()===``}if(!f){for(var v=0;v<d;v++){0<v&&!p&&(o+=i);var y=s&&c?e[v]:v;o+=h(t[u][y],v)}u<t.length-1&&(!n||0<d&&!p)&&(o+=a)}}return o}function h(e,t){var r,a,l;return e==null?``:e.constructor===Date?isNaN(e.getTime())?``:e.toISOString():(l=!1,r=e.toString(),d&&typeof e!=`number`&&typeof e!=`bigint`&&typeof e!=`boolean`&&d.test(r)&&(e=r=`'`+r,l=!0),a=r.replace(f,c),(l=l||!0===n||typeof n==`function`&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(a,o.BAD_DELIMITERS)||-1<a.indexOf(i)||-1<r.indexOf(s)||a.charAt(0)===` `||a.charAt(a.length-1)===` `)?s+a+s:a)}},o.RECORD_SEP=``,o.UNIT_SEP=``,o.BYTE_ORDER_MARK=``,o.BAD_DELIMITERS=[`\r`,`
|
|
193
|
+
`,`"`,o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!n&&!!t.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=`,`,o.Parser=h,o.ParserHandle=p,o.NetworkStreamer=l,o.FileStreamer=u,o.StringStreamer=d,o.ReadableStreamStreamer=f,r&&(t.onmessage=function(e){e=e.data,o.WORKER_ID===void 0&&e&&(o.WORKER_ID=e.workerId),typeof e.input==`string`?t.postMessage({workerId:o.WORKER_ID,results:o.parse(e.input,e.config),finished:!0}):(t.File&&e.input instanceof File||e.input instanceof Object)&&(e=o.parse(e.input,e.config))&&t.postMessage({workerId:o.WORKER_ID,results:e,finished:!0})}),(l.prototype=Object.create(c.prototype)).constructor=l,(u.prototype=Object.create(c.prototype)).constructor=u,(d.prototype=Object.create(d.prototype)).constructor=d,(f.prototype=Object.create(c.prototype)).constructor=f,o})}))(),1),uB=`modulepreload`,dB=function(e,t){return new URL(e,t).href},fB={},pB=function(e){return e.pathname.endsWith(`.css`)},mB=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},hB=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=dB(t,n);let r=s(t),i=pB(r);return mB(fB,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:uB,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function gB(e,t){let n=await fetch(e,{headers:{Range:`bytes=0-${ft-1}`},signal:t,credentials:`same-origin`});if(!n.ok)throw await vt(n);let r=await n.arrayBuffer(),i=Number(n.headers.get(`Content-Range`)?.split(`/`)[1]??r.byteLength);return{text:new TextDecoder(`utf-8`,{fatal:!1}).decode(r),truncated:i>r.byteLength}}function _B({text:e,language:t}){let[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{let n=!1;return!t||e.length>3e5?r(null):(hB(async()=>{let{default:e}=await import(`./common-Dl4G8lb6.js`);return{default:e}},[],import.meta.url).then(({default:i})=>{if(!n)try{let n=i.getLanguage(t)?t:void 0;r(n?i.highlight(e,{language:n}).value:null)}catch{r(null)}}),()=>{n=!0})},[e,t]),(0,h.jsx)(`pre`,{className:`min-h-full overflow-auto p-4 font-mono text-xs leading-relaxed`,children:n===null?(0,h.jsx)(`code`,{children:e}):(0,h.jsx)(`code`,{dangerouslySetInnerHTML:{__html:n}})})}function vB({text:e,tsv:t}){let n=(0,d.useMemo)(()=>lB.default.parse(e,{delimiter:t?` `:``,preview:500,skipEmptyLines:!0}).data,[e,t]),[r,...i]=n;return r?(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(PP,{className:`text-xs`,children:[(0,h.jsx)(FP,{className:`sticky top-0 bg-muted`,children:(0,h.jsx)(LP,{children:r.map((e,t)=>(0,h.jsx)(RP,{children:e},t))})}),(0,h.jsx)(IP,{children:i.map((e,t)=>(0,h.jsx)(LP,{children:e.map((e,t)=>(0,h.jsx)(zP,{className:`max-w-xs truncate`,title:e,children:e},t))},t))})]}),n.length>=500&&(0,h.jsx)(`p`,{className:`p-2 text-xs text-muted-foreground`,children:`Showing the first 500 rows.`})]}):(0,h.jsx)(MP,{title:`Empty file`})}function yB({text:e}){let t=(0,d.useMemo)(()=>oR.sanitize(sB.parse(e,{async:!1,gfm:!0}),{USE_PROFILES:{html:!0}}),[e]);return(0,h.jsx)(`div`,{className:`prose-md p-5 text-sm`,dangerouslySetInnerHTML:{__html:t}})}function bB({url:e,kind:t,name:n}){let r=tt({queryKey:[`preview-text`,e],queryFn:({signal:t})=>gB(e,t),staleTime:3e4});if(r.isPending)return(0,h.jsx)(xB,{children:(0,h.jsx)(PN,{})});if(r.isError)return(0,h.jsx)(MP,{title:`Couldn’t load preview`,children:V(r.error)});let{text:i,truncated:a}=r.data,o;if(t===`json`){let e=null;if(!a)try{e=JSON.stringify(JSON.parse(i),null,2)}catch{e=null}o=(0,h.jsx)(_B,{text:e??i,language:`json`})}else o=t===`csv`?(0,h.jsx)(vB,{text:i,tsv:n.toLowerCase().endsWith(`.tsv`)}):t===`markdown`?(0,h.jsx)(yB,{text:i}):(0,h.jsx)(_B,{text:i,language:t===`code`?UF(n):void 0});return(0,h.jsxs)(`div`,{className:`flex h-full flex-col`,children:[a&&(0,h.jsx)(_N,{className:`rounded-none border-x-0 border-t-0 py-2`,children:(0,h.jsxs)(yN,{className:`text-xs`,children:[`Large file: showing the first `,nP(524288),`.`]})}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:o})]})}function xB({children:e}){return(0,h.jsx)(`div`,{className:`grid h-full place-items-center p-6`,children:e})}function SB({bucket:e,details:t,versionId:n}){let r=t.key.split(`/`).pop()??t.key,i=HF(r,t.contentType),{readonly:a,connection:o}=XA(),[s,c]=(0,d.useState)(!1);if(t.archive.archived&&t.archive.restore!==`restored`)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(MP,{icon:(0,h.jsx)(mn,{}),title:t.archive.restore===`in-progress`?`Restore in progress`:`This object is archived`,action:t.archive.restore===`none`&&!a&&o.capabilities.archiveRestore?(0,h.jsxs)(Y,{size:`sm`,onClick:()=>c(!0),children:[(0,h.jsx)(mn,{}),` Restore from archive…`]}):void 0,children:t.archive.restore===`in-progress`?`A temporary copy is being prepared. Check back later; Deep Archive restores can take up to 48 hours.`:`It’s in ${t.storageClass}. Restore it to preview or download.`}),s&&(0,h.jsx)(tI,{bucket:e,keys:[t.key],onClose:()=>c(!1)})]});let l=yt(e,t.key,{inline:!0,versionId:n});switch(i){case`image`:return(0,h.jsx)(xB,{children:(0,h.jsx)(`img`,{src:l,alt:r,className:`max-h-full max-w-full rounded border bg-[conic-gradient(#8881_25%,transparent_0_50%,#8881_0_75%,transparent_0)] bg-[length:16px_16px] object-contain`})});case`video`:return(0,h.jsx)(xB,{children:(0,h.jsx)(`video`,{src:l,controls:!0,className:`max-h-full max-w-full rounded`,preload:`metadata`})});case`audio`:return(0,h.jsx)(xB,{children:(0,h.jsx)(`audio`,{src:l,controls:!0,className:`w-full`,preload:`metadata`})});case`pdf`:return(0,h.jsx)(`iframe`,{src:l,title:r,className:`h-full w-full border-0`});case`none`:return(0,h.jsx)(MP,{icon:(0,h.jsx)(er,{}),title:`No preview for this file type`,action:(0,h.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:()=>bt(yt(e,t.key,{versionId:n})),children:[(0,h.jsx)(Xn,{}),` Download`]})});default:return(0,h.jsx)(bB,{url:l,kind:i,name:r})}}function CB({label:e,children:t}){return(0,h.jsxs)(`div`,{className:`grid grid-cols-[8.5rem_1fr] gap-2 border-b py-2 text-sm last:border-0`,children:[(0,h.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,h.jsx)(`dd`,{className:`min-w-0 break-all`,children:t})]})}function wB({details:e}){return(0,h.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,h.jsxs)(`dl`,{children:[(0,h.jsx)(CB,{label:`Key`,children:(0,h.jsx)(`span`,{className:`font-mono text-xs`,children:e.key})}),(0,h.jsxs)(CB,{label:`Size`,children:[nP(e.size),` `,(0,h.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.size.toLocaleString(),` bytes)`]})]}),(0,h.jsx)(CB,{label:`Last modified`,children:oP(e.lastModified)}),(0,h.jsx)(CB,{label:`Content type`,children:e.contentType??`—`}),(0,h.jsx)(CB,{label:`Storage class`,children:e.storageClass??`—`}),(0,h.jsx)(CB,{label:`ETag`,children:(0,h.jsx)(`span`,{className:`font-mono text-xs`,children:e.etag??`—`})}),e.versionId&&e.versionId!==`null`&&(0,h.jsx)(CB,{label:`Version ID`,children:(0,h.jsx)(`span`,{className:`font-mono text-xs`,children:e.versionId})}),e.archive.archived&&(0,h.jsx)(CB,{label:`Archive`,children:e.archive.restore===`restored`?`Restored copy available until ${oP(e.archive.restoreExpiry)}`:e.archive.restore===`in-progress`?`Restore in progress`:`Archived, not restored`}),(0,h.jsx)(CB,{label:`Encryption`,children:e.encryption?(0,h.jsxs)(`span`,{children:[e.encryption.algorithm,e.encryption.kmsKeyId&&(0,h.jsx)(`span`,{className:`block font-mono text-xs text-muted-foreground`,children:e.encryption.kmsKeyId}),e.encryption.bucketKeyEnabled&&(0,h.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`S3 Bucket Key enabled`})]}):(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`Not reported`})}),e.lock&&(0,h.jsx)(CB,{label:`Object lock`,children:(0,h.jsxs)(`span`,{children:[e.lock.mode?`${e.lock.mode} until ${oP(e.lock.retainUntil)}`:`No retention`,e.lock.legalHold!==null&&(0,h.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`Legal hold `,e.lock.legalHold?`on`:`off`]})]})}),(0,h.jsx)(CB,{label:`Public URL`,children:(0,h.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-xs`,children:e.publicUrl}),(0,h.jsx)(nI,{text:e.publicUrl})]})})]}),(0,h.jsxs)(`section`,{children:[(0,h.jsx)(`h3`,{className:`mb-1 text-sm font-medium`,children:`Custom metadata`}),Object.keys(e.metadata).length?(0,h.jsx)(`dl`,{children:Object.entries(e.metadata).map(([e,t])=>(0,h.jsx)(CB,{label:`x-amz-meta-${e}`,children:t},e))}):(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`None`})]}),(0,h.jsxs)(`section`,{children:[(0,h.jsx)(`h3`,{className:`mb-1 text-sm font-medium`,children:`Headers`}),(0,h.jsx)(`dl`,{children:Object.entries(e.headers).map(([e,t])=>(0,h.jsx)(CB,{label:e,children:(0,h.jsx)(`span`,{className:`font-mono text-xs`,children:t})},e))})]})]})}function TB({bucket:e,objectKey:t,onPreview:n}){let{readonly:r}=XA(),i=_(),a=zt(e,t,!0),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),u=async(t,n,r)=>{s(t);try{await n(),U.success(r),await St(i,e)}catch(e){U.error(V(e))}finally{s(null)}};if(a.isPending)return(0,h.jsx)(xB,{children:(0,h.jsx)(PN,{})});if(a.isError)return(0,h.jsx)(MP,{title:`Couldn’t list versions`,children:V(a.error)});let f=a.data.versions;return f.length<=1&&f[0]?.versionId===`null`?(0,h.jsx)(MP,{icon:(0,h.jsx)(Wn,{}),title:`No versions`,children:`Turn on versioning in the bucket settings to keep older versions.`}):(0,h.jsxs)(`ul`,{className:`divide-y`,children:[f.map(i=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2 px-4 py-2.5 text-sm`,children:[(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[oP(i.lastModified),i.isLatest&&(0,h.jsx)(VN,{variant:`secondary`,children:`current`}),i.isDeleteMarker&&(0,h.jsx)(VN,{variant:`destructive`,children:`delete marker`})]}),(0,h.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground`,title:i.versionId,children:[i.versionId,` `,!i.isDeleteMarker&&`· ${nP(i.size)}`]})]}),o===i.versionId&&(0,h.jsx)(PN,{}),!i.isDeleteMarker&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(zN,{label:`Preview this version`,onClick:()=>n(i.versionId),children:(0,h.jsx)(er,{})}),(0,h.jsx)(zN,{label:`Download this version`,onClick:()=>bt(yt(e,t,{versionId:i.versionId})),children:(0,h.jsx)(Xn,{})})]}),!r&&!i.isLatest&&!i.isDeleteMarker&&(0,h.jsx)(zN,{label:`Restore this version`,disabled:!!o,onClick:()=>u(i.versionId,()=>Ht.restoreVersion(e,t,i.versionId),`Version restored`),children:(0,h.jsx)(Ri,{})}),!r&&(0,h.jsx)(zN,{label:`Permanently delete this version`,disabled:!!o,onClick:()=>l(i.versionId),children:(0,h.jsx)(Pi,{className:`text-destructive`})})]},i.versionId)),(0,h.jsx)(YP,{open:!!c,onOpenChange:e=>!e&&l(null),children:(0,h.jsxs)(QP,{children:[(0,h.jsxs)($P,{children:[(0,h.jsx)(tF,{children:`Permanently delete this version?`}),(0,h.jsxs)(nF,{className:`break-all`,children:[`Version `,c,` of `,t,` will be removed for good. This can’t be undone.`]})]}),(0,h.jsxs)(eF,{children:[(0,h.jsx)(iF,{children:`Cancel`}),(0,h.jsx)(rF,{variant:`destructive`,onClick:()=>{let n=c;u(n,()=>Ht.deleteVersion(e,t,n),`Version deleted`)},children:`Delete version`})]})]})})]})}function EB({bucket:e,objectKey:t,onClose:n}){let{connection:r,readonly:i}=XA(),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(`preview`),[l,u]=(0,d.useState)(!1),f=Rt(e,t,a),p=t.split(`/`).pop()||t;return(0,d.useEffect)(()=>{o(null),c(`preview`)},[t]),(0,h.jsxs)(`aside`,{className:`flex h-full min-h-0 w-full flex-col border-l bg-background`,"aria-label":`Preview`,children:[(0,h.jsxs)(`header`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`truncate text-sm font-medium`,title:t,children:p}),(0,h.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[f.data?`${nP(f.data.size)} · ${oP(f.data.lastModified)}`:`\xA0`,a&&(0,h.jsxs)(VN,{variant:`secondary`,className:`ml-1.5`,children:[`version `,a.slice(0,8),`…`]})]})]}),(0,h.jsx)(zN,{label:`Download`,onClick:()=>bt(yt(e,t,{versionId:a})),children:(0,h.jsx)(Xn,{})}),(0,h.jsx)(zN,{label:`Share`,onClick:()=>u(!0),children:(0,h.jsx)(bi,{})}),(0,h.jsx)(zN,{label:`Close (Esc)`,onClick:n,children:(0,h.jsx)(Xi,{})})]}),(0,h.jsxs)(XN,{value:s,onValueChange:c,className:`flex min-h-0 flex-1 flex-col`,children:[(0,h.jsxs)(QN,{variant:`line`,className:`w-full justify-start border-b px-2`,children:[(0,h.jsxs)($N,{value:`preview`,children:[(0,h.jsx)(er,{}),` Preview`]}),(0,h.jsxs)($N,{value:`details`,children:[(0,h.jsx)(Mr,{}),` Details`]}),r.capabilities.versioning&&(0,h.jsxs)($N,{value:`versions`,children:[(0,h.jsx)(Wn,{}),` Versions`]}),r.capabilities.tagging&&(0,h.jsxs)($N,{value:`tags`,children:[(0,h.jsx)(Mi,{}),` Tags`]})]}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:f.isPending?(0,h.jsx)(xB,{children:(0,h.jsx)(PN,{})}):f.isError?(0,h.jsx)(MP,{title:`Couldn’t load this object`,children:V(f.error)}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eP,{value:`preview`,className:`h-full`,children:(0,h.jsx)(SB,{bucket:e,details:f.data,versionId:a})}),(0,h.jsx)(eP,{value:`details`,children:(0,h.jsx)(wB,{details:f.data})}),(0,h.jsx)(eP,{value:`versions`,children:(0,h.jsx)(TB,{bucket:e,objectKey:t,onPreview:e=>{o(e),c(`preview`)}})}),(0,h.jsx)(eP,{value:`tags`,className:`p-4`,children:i?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Read-only mode.`}):(0,h.jsx)(pI,{bucket:e,keys:[t]})})]})})]}),l&&(0,h.jsx)(lI,{bucket:e,objectKey:t,versionId:a,onClose:()=>u(!1)})]})}var DB=`s3deck-view`;function OB(){try{return localStorage.getItem(DB)===`grid`?`grid`:`list`}catch{return`list`}}function kB(e,t,n){return e.type===t.type?n===`name`||e.type===`folder`||t.type===`folder`?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}):n===`size`?e.size-t.size:n===`lastModified`?(e.lastModified??``).localeCompare(t.lastModified??``):(e.storageClass??``).localeCompare(t.storageClass??``):e.type===`folder`?-1:1}function AB({bucket:e,prefix:t,dropProps:n,dropTarget:r}){let i=t.split(`/`).filter(Boolean),a=[{label:e,prefix:``},...i.map((e,t)=>({label:e,prefix:`${i.slice(0,t+1).join(`/`)}/`}))];return(0,h.jsx)(hI,{children:(0,h.jsx)(gI,{className:`flex-nowrap sm:gap-1.5`,children:a.map((t,i)=>{let o=i===a.length-1;return(0,h.jsxs)(`span`,{className:`contents`,children:[i>0&&(0,h.jsx)(bI,{}),(0,h.jsx)(_I,{className:`min-w-0`,children:o?(0,h.jsx)(yI,{className:`truncate`,children:t.label}):(0,h.jsx)(vI,{asChild:!0,children:(0,h.jsx)(`a`,{href:hx({bucket:e,prefix:t.prefix}),...n(t.prefix),className:K(`block max-w-40 truncate rounded px-1`,r===t.prefix&&`bg-primary/15 text-primary`),onClick:n=>{n.metaKey||n.ctrlKey||(n.preventDefault(),gx({bucket:e,prefix:t.prefix}))},children:t.label})})})]},t.prefix)})})})}function jB({bucket:e}){let{readonly:t,connection:n}=XA(),r=n.capabilities.storageClasses,i=mx(),a=_(),o=i.search.length>0,s=o?i.search:i.prefix,c=Lt(e,s,o),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)({field:`name`,dir:1}),[m,g]=(0,d.useState)(new Set),[v,y]=(0,d.useState)(-1),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(OB),[E,D]=(0,d.useState)(!1),[O,k]=(0,d.useState)(null),A=n.capabilities.versioning&&!o,j=Ut(e,i.prefix,E&&A),M=(0,d.useMemo)(()=>{let e=l.trim().toLowerCase(),t=j.data?.pages.flatMap(e=>e.objects)??[];return e?t.filter(t=>t.name.toLowerCase().includes(e)):t},[j.data,l]),N=e=>{T(e);try{localStorage.setItem(DB,e)}catch{}},ee=E?`list`:w,te=(0,d.useRef)(null),P=(0,d.useRef)(null),ne=(0,d.useRef)(null),re=(0,d.useRef)(null),ie=(0,d.useRef)(null),ae=(0,d.useRef)(-1);(0,d.useEffect)(()=>{g(new Set),u(``),y(-1)},[s,e]);let F=(0,d.useMemo)(()=>{let e=c.data?.pages??[],t=[...e.flatMap(e=>e.folders),...e.flatMap(e=>e.objects)],n=l.trim().toLowerCase();return(n?t.filter(e=>(o?e.key:e.name).toLowerCase().includes(n)):t).sort((e,t)=>kB(e,t,f.field)*(e.type===t.type?f.dir:1))},[c.data,l,f,o]),oe=(0,d.useMemo)(()=>F.filter(e=>m.has(e.key)),[F,m]),I=oe.filter(e=>e.type===`object`);(0,d.useEffect)(()=>{let e=re.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},{rootMargin:`400px`});return t.observe(e),()=>t.disconnect()},[c]);let se=(0,d.useCallback)(()=>void St(a,e),[a,e]),ce=(0,d.useCallback)(r=>{if(t)return U.error(`s3deck is in read-only mode`);if(!r.length)return;let a=HA.add(n.id,e,i.prefix,r);a.length&&U.error(`${a.length} file${a.length===1?``:`s`} skipped: key too long or invalid`)},[e,i.prefix,t,n.id]);(0,d.useEffect)(()=>{let e=e=>{if(e.target?.closest(`input, textarea, [contenteditable="true"]`)||document.querySelector(`[role="dialog"]`))return;let n=JA(e.clipboardData);!n.length||t||o||(e.preventDefault(),ce(n),U.success(`Uploading ${n.length} pasted file${n.length===1?``:`s`}`))};return window.addEventListener(`paste`,e),()=>window.removeEventListener(`paste`,e)},[ce,t,o]);let le=async(t,n)=>{let r=F.filter(e=>n.includes(e.key)).filter(e=>!(e.type===`folder`&&t.startsWith(e.key))).map(e=>({source:e.key,destination:`${t}${e.name}${e.type===`folder`?`/`:``}`})).filter(e=>e.source!==e.destination);if(!r.length)return;let i=t||e,a=U.loading(`Moving ${r.length} item${r.length===1?``:`s`} to ${i}…`);try{let t=await Ht.copy(e,{destinationBucket:e,move:!0,items:r});U.success(`Moved ${t.copied} object${t.copied===1?``:`s`} to ${i}`,{id:a}),g(new Set)}catch(e){U.error(V(e),{id:a})}finally{se()}},ue=!t&&!o,de=e=>ue?{draggable:!0,onDragStart:t=>{let n=m.has(e.key)?[...m]:[e.key];t.dataTransfer.setData(GF,JSON.stringify(n)),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>k(null)}:{},L=e=>ue?{onDragOver:t=>{t.dataTransfer.types.includes(`application/x-s3deck-move`)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`move`,k(e))},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||k(t=>t===e?null:t)},onDrop:t=>{if(t.dataTransfer.types.includes(`application/x-s3deck-move`)){t.preventDefault(),t.stopPropagation(),k(null);try{le(e,JSON.parse(t.dataTransfer.getData(GF)))}catch{}}}}:{},R=t=>{t.type===`folder`?gx({bucket:e,prefix:t.key}):_x({object:t.key},{replace:!!i.object})},fe=async t=>{if(t.length===1&&t[0].type===`object`)bt(yt(e,t[0].key));else try{let{token:n}=await Ht.zip(e,{base:o?``:i.prefix,keys:t.filter(e=>e.type===`object`).map(e=>e.key),prefixes:t.filter(e=>e.type===`folder`).map(e=>e.key)});bt(mt(`zip/${n}`)),U.info(`Preparing ZIP download…`,{description:`The file is built on the fly and streams as it’s created.`})}catch(e){U.error(V(e))}},pe=(e,t)=>{let n=F[e];n&&(g(r=>{let i=new Set(r);if(t?.shiftKey&&ae.current>=0){let[t,n]=[Math.min(ae.current,e),Math.max(ae.current,e)];for(let e=t;e<=n;e++)i.add(F[e].key)}else i.has(n.key)?i.delete(n.key):i.add(n.key);return i}),ae.current=e)};(0,d.useEffect)(()=>QA(e=>{e===`upload`&&te.current?.click(),e===`upload-folder`&&P.current?.click(),e===`new-folder`&&!t&&x({type:`new-folder`}),e===`refresh`&&se()}),[t,se]),(0,d.useEffect)(()=>{let n=n=>{if(b||document.querySelector(`[role="dialog"]`))return;let r=n.target,a=r.closest(`input, textarea, select, [contenteditable="true"]`),s=n.metaKey||n.ctrlKey;if(s&&n.key.toLowerCase()===`u`)n.preventDefault(),t||te.current?.click();else if(a)n.key===`Escape`&&r.blur();else if(s&&n.key.toLowerCase()===`a`)n.preventDefault(),g(new Set(F.map(e=>e.key)));else if(n.key===`ArrowDown`||n.key===`ArrowUp`)n.preventDefault(),y(e=>Math.max(0,Math.min(F.length-1,e+(n.key===`ArrowDown`?1:-1))));else if(n.key===`Enter`&&F[v])n.preventDefault(),R(F[v]);else if(n.key===` `&&F[v]){n.preventDefault();let e=F[v];e.type===`object`&&_x({object:i.object===e.key?null:e.key},{replace:!0})}else n.key===`Backspace`?(n.preventDefault(),o?_x({search:``}):i.prefix&&gx({bucket:e,prefix:vx(i.prefix)})):n.key===`Escape`?i.object?_x({object:null},{replace:!0}):g(new Set):n.key===`/`&&(n.preventDefault(),ne.current?.focus())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)}),(0,d.useEffect)(()=>{ie.current?.querySelector(`[data-index="${v}"]`)?.scrollIntoView({block:`nearest`})},[v]);let me=(e,t,n)=>(0,h.jsxs)(Y,{variant:`ghost`,size:`xs`,className:K(`-ml-2 text-muted-foreground`,n),onClick:()=>p(t=>({field:e,dir:t.field===e&&t.dir===1?-1:1})),children:[t,f.field===e?(0,h.jsx)(wn,{className:K(`transition-transform`,f.dir===-1&&`rotate-180`)}):(0,h.jsx)(Sn,{className:`opacity-40`})]}),he=e=>(0,h.jsxs)(bF,{children:[(0,h.jsx)(xF,{asChild:!0,children:(0,h.jsx)(Y,{variant:`ghost`,size:`icon-sm`,className:`opacity-60 group-hover/row:opacity-100 data-[state=open]:opacity-100`,"aria-label":`Actions`,onClick:e=>e.stopPropagation(),children:(0,h.jsx)(Qn,{})})}),(0,h.jsxs)(SF,{align:`end`,onClick:e=>e.stopPropagation(),children:[e.type===`object`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(CF,{onSelect:()=>R(e),children:[(0,h.jsx)(er,{}),` Preview `,(0,h.jsx)(kF,{children:`Space`})]}),(0,h.jsxs)(CF,{onSelect:()=>void fe([e]),children:[(0,h.jsx)(Xn,{}),` Download`]}),(0,h.jsxs)(CF,{onSelect:()=>x({type:`share`,key:e.key}),children:[(0,h.jsx)(bi,{}),` Share link…`]})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(CF,{onSelect:()=>R(e),children:[(0,h.jsx)(Er,{}),` Open `,(0,h.jsx)(kF,{children:`↵`})]}),(0,h.jsxs)(CF,{onSelect:()=>void fe([e]),children:[(0,h.jsx)(Xn,{}),` Download as ZIP`]})]}),!t&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(OF,{}),(0,h.jsxs)(CF,{onSelect:()=>x({type:`rename`,entry:e}),children:[(0,h.jsx)(ni,{}),` Rename…`]}),(0,h.jsxs)(CF,{onSelect:()=>x({type:`copy`,entries:[e]}),children:[(0,h.jsx)(vn,{}),` Copy or move…`]}),e.type===`object`&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(CF,{onSelect:()=>x({type:`metadata`,keys:[e.key]}),children:[(0,h.jsx)(gr,{}),` Edit metadata…`]}),r.length>1&&(0,h.jsxs)(CF,{onSelect:()=>x({type:`storage-class`,keys:[e.key]}),children:[(0,h.jsx)(Ir,{}),` Change storage class…`]}),n.capabilities.archiveRestore&&KF.has(e.storageClass??``)&&(0,h.jsxs)(CF,{onSelect:()=>x({type:`restore-archive`,keys:[e.key]}),children:[(0,h.jsx)(mn,{}),` Restore from archive…`]}),n.capabilities.tagging&&(0,h.jsxs)(CF,{onSelect:()=>x({type:`tags`,keys:[e.key]}),children:[(0,h.jsx)(Mi,{}),` Edit tags…`]})]}),(0,h.jsx)(OF,{}),(0,h.jsxs)(CF,{variant:`destructive`,onSelect:()=>x({type:`delete`,entries:[e]}),children:[(0,h.jsx)(Pi,{}),` Delete…`]})]})]})]}),z=F.length>0&&m.size===F.length,ge=m.size>0&&!z;return(0,h.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 flex-col`,onDragOver:e=>{t||!e.dataTransfer.types.includes(`Files`)||e.dataTransfer.types.includes(`application/x-s3deck-move`)||(e.preventDefault(),C(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||C(!1)},onDrop:async e=>{if(!t&&e.dataTransfer.types.includes(`Files`)){e.preventDefault(),C(!1);try{ce(await KA(e.dataTransfer))}catch(e){U.error(`Couldn’t read dropped files: ${V(e)}`)}}},children:[(0,h.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-2 border-b px-3`,children:[(0,h.jsx)(zN,{label:o?`Back to folder`:`Up one folder (⌫)`,disabled:!o&&!i.prefix,onClick:()=>o?_x({search:``}):gx({bucket:e,prefix:vx(i.prefix)}),...i.prefix&&!o?L(vx(i.prefix)):{},className:K(i.prefix&&O===vx(i.prefix)&&`bg-primary/15 text-primary`),children:(0,h.jsx)(wn,{})}),(0,h.jsx)(`div`,{className:`min-w-0 flex-1`,children:o?(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,h.jsx)(gi,{className:`size-4 shrink-0 text-muted-foreground`}),(0,h.jsxs)(`span`,{className:`truncate`,children:[`Keys starting with `,(0,h.jsx)(`span`,{className:`rounded bg-muted px-1 font-mono`,children:i.search}),` in `,e]}),(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>_x({search:``}),children:[(0,h.jsx)(Xi,{}),` Clear`]})]}):(0,h.jsx)(AB,{bucket:e,prefix:i.prefix,dropProps:L,dropTarget:O})}),(0,h.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,h.jsxs)(UN,{className:`h-8 w-40 lg:w-56`,children:[(0,h.jsx)(GN,{children:(0,h.jsx)(gi,{})}),(0,h.jsx)(KN,{ref:ne,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l.trim()&&(_x({search:(o?``:i.prefix)+l.trim(),object:null}),u(``))},placeholder:`Filter · Enter searches bucket`,className:`text-xs`,"aria-label":`Filter this folder; press Enter to search the whole bucket by prefix`}),l&&(0,h.jsx)(GN,{align:`inline-end`,children:(0,h.jsx)(xI,{children:`↵`})})]}),(0,h.jsxs)(bF,{children:[(0,h.jsx)(xF,{asChild:!0,children:(0,h.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`View options`,children:(0,h.jsx)(Ei,{})})}),(0,h.jsxs)(SF,{align:`end`,className:`w-52`,children:[(0,h.jsx)(DF,{children:`View`}),(0,h.jsxs)(TF,{value:ee,onValueChange:e=>N(e),children:[(0,h.jsx)(EF,{value:`list`,disabled:E,children:`List`}),(0,h.jsx)(EF,{value:`grid`,disabled:E,children:`Grid with thumbnails`})]}),A&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(OF,{}),(0,h.jsx)(wF,{checked:E,onCheckedChange:e=>D(e===!0),children:`Show deleted files`})]})]})]}),(0,h.jsx)(zN,{label:`Refresh`,onClick:se,disabled:c.isFetching,children:(0,h.jsx)(ui,{className:K(c.isFetching&&!c.isFetchingNextPage&&`animate-spin`)})}),(0,h.jsx)(zN,{label:`Bucket settings`,onClick:()=>gx({bucket:e,view:`settings`}),children:(0,h.jsx)(vi,{})}),!t&&!o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(zN,{label:`New folder`,variant:`outline`,onClick:()=>x({type:`new-folder`}),children:(0,h.jsx)(br,{})}),(0,h.jsxs)(bF,{children:[(0,h.jsx)(xF,{asChild:!0,children:(0,h.jsxs)(Y,{size:`sm`,children:[(0,h.jsx)(Hi,{}),` Upload `,(0,h.jsx)(Mn,{className:`-mr-1 opacity-70`})]})}),(0,h.jsxs)(SF,{align:`end`,children:[(0,h.jsxs)(CF,{onSelect:()=>te.current?.click(),children:[(0,h.jsx)(Hi,{}),` Files `,(0,h.jsxs)(kF,{children:[vs,`U`]})]}),(0,h.jsxs)(CF,{onSelect:()=>P.current?.click(),children:[(0,h.jsx)(wr,{}),` Folder`]})]})]})]})]})]}),(0,h.jsxs)(`div`,{ref:ie,className:`min-h-0 flex-1 overflow-auto [&>[data-slot=table-container]]:overflow-visible`,children:[ee===`grid`&&!c.isPending?(0,h.jsx)(QF,{bucket:e,rows:F,selected:m,openKey:i.object,focus:v,onOpen:(e,t,n)=>{y(t),n.metaKey||n.ctrlKey||n.shiftKey?pe(t,n):R(e)},onToggle:pe,menu:he,dragProps:de,dropProps:L,dropTarget:O}):(0,h.jsxs)(PP,{className:`table-fixed border-separate border-spacing-0 [&_td]:border-b [&_th]:border-b [&_tr]:border-0`,children:[(0,h.jsx)(FP,{className:`sticky top-0 z-10 bg-background`,children:(0,h.jsxs)(LP,{className:`hover:bg-transparent`,children:[(0,h.jsx)(RP,{className:`w-10 pl-4`,children:(0,h.jsx)(bN,{checked:z?!0:ge?`indeterminate`:!1,onCheckedChange:e=>g(e===!0?new Set(F.map(e=>e.key)):new Set),"aria-label":`Select all`})}),(0,h.jsx)(RP,{children:me(`name`,`Name`)}),(0,h.jsx)(RP,{className:`w-24 text-right`,children:me(`size`,`Size`,`ml-0 -mr-2`)}),(0,h.jsx)(RP,{className:`w-40`,children:me(`lastModified`,`Last modified`)}),(0,h.jsx)(RP,{className:`hidden w-32 md:table-cell`,children:me(`storageClass`,`Storage class`)}),(0,h.jsx)(RP,{className:`w-12 pr-4`})]})}),(0,h.jsxs)(IP,{children:[c.isPending&&Array.from({length:8},(e,t)=>(0,h.jsxs)(LP,{children:[(0,h.jsx)(zP,{className:`pl-4`,children:(0,h.jsx)(JN,{className:`size-4`})}),(0,h.jsx)(zP,{children:(0,h.jsx)(JN,{className:`h-4 w-48`})}),(0,h.jsx)(zP,{children:(0,h.jsx)(JN,{className:`ml-auto h-4 w-12`})}),(0,h.jsx)(zP,{children:(0,h.jsx)(JN,{className:`h-4 w-24`})}),(0,h.jsx)(zP,{className:`hidden md:table-cell`,children:(0,h.jsx)(JN,{className:`h-4 w-16`})}),(0,h.jsx)(zP,{})]},t)),F.map((t,n)=>{let r=t.type===`folder`?Er:WF(t.name),a=m.has(t.key),s=i.object===t.key;return(0,h.jsxs)(LP,{"data-index":n,"data-state":a||s?`selected`:void 0,...de(t),...t.type===`folder`?L(t.key):{},onClick:e=>{y(n),e.metaKey||e.ctrlKey||e.shiftKey?pe(n,e):R(t)},className:K(`group/row cursor-default data-[state=selected]:bg-primary/8 dark:data-[state=selected]:bg-primary/15`,v===n&&`outline-2 -outline-offset-2 outline-ring/60`,O===t.key&&`bg-primary/15 outline-2 -outline-offset-2 outline-primary`),children:[(0,h.jsx)(zP,{className:`pl-4`,children:(0,h.jsx)(bN,{checked:a,onClick:e=>(e.stopPropagation(),pe(n,e)),"aria-label":`Select ${t.name}`})}),(0,h.jsx)(zP,{children:(0,h.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(r,{className:K(`size-4 shrink-0`,t.type===`folder`?`fill-primary/15 text-primary`:`text-muted-foreground`)}),(0,h.jsxs)(`span`,{className:`truncate`,title:t.key,children:[o?t.key:t.name,t.type===`folder`&&(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`/`})]})]})}),(0,h.jsx)(zP,{className:`text-right text-muted-foreground tabular-nums`,children:t.type===`object`?nP(t.size):(0,h.jsx)(YF,{bucket:e,prefix:t.key})}),(0,h.jsx)(zP,{className:`truncate text-muted-foreground`,title:t.type===`object`?oP(t.lastModified):void 0,children:t.type===`object`?sP(t.lastModified):``}),(0,h.jsx)(zP,{className:`hidden truncate text-xs text-muted-foreground md:table-cell`,children:t.type===`object`?(0,h.jsx)(JF,{value:t.storageClass}):``}),(0,h.jsx)(zP,{className:`pr-4 text-right`,children:he(t)})]},t.key)}),E&&(0,h.jsx)(XF,{bucket:e,entries:M,readonly:t})]})]}),E&&j.hasNextPage&&(0,h.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>void j.fetchNextPage(),disabled:j.isFetchingNextPage,children:[j.isFetchingNextPage&&(0,h.jsx)(PN,{}),` More deleted files`]})}),c.isError?(0,h.jsx)(MP,{title:`Couldn’t list this folder`,children:V(c.error)}):!c.isPending&&F.length===0&&!(E&&M.length)?l?(0,h.jsxs)(MP,{icon:(0,h.jsx)(gi,{}),title:`Nothing matches “${l}”`,children:[`Press `,(0,h.jsx)(xI,{children:`Enter`}),` to search the whole bucket for keys starting with it.`]}):(0,h.jsx)(MP,{icon:(0,h.jsx)(Er,{}),title:o?`No keys with this prefix`:`This folder is empty`,action:!t&&!o?(0,h.jsxs)(Y,{size:`sm`,onClick:()=>te.current?.click(),children:[(0,h.jsx)(Hi,{}),` Upload files`]}):void 0,children:!t&&!o&&`Drop files or folders here, or upload from your computer.`}):!c.isPending&&(0,h.jsx)(`div`,{ref:re,className:`flex justify-center py-3 text-xs text-muted-foreground`,children:c.isFetchingNextPage?(0,h.jsx)(PN,{}):c.hasNextPage?(0,h.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>void c.fetchNextPage(),children:`Load more`}):(0,h.jsxs)(`span`,{children:[F.length.toLocaleString(),` item`,F.length===1?``:`s`]})})]}),m.size>0&&(0,h.jsxs)(`div`,{role:`toolbar`,"aria-label":`Selection actions`,className:`absolute bottom-4 left-1/2 z-20 flex max-w-[calc(100%-2rem)] -translate-x-1/2 animate-in items-center gap-1 overflow-x-auto rounded-lg border bg-popover p-1.5 text-sm fade-in slide-in-from-bottom-2`,children:[(0,h.jsxs)(`span`,{className:`px-2 font-medium whitespace-nowrap`,children:[m.size,` selected`]}),(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>void fe(oe),children:[(0,h.jsx)(Xn,{}),` `,oe.length===1&&oe[0].type===`object`?`Download`:`Download ZIP`]}),!t&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>x({type:`copy`,entries:oe}),children:[(0,h.jsx)(vn,{}),` Copy / move`]}),I.length>0&&I.length===oe.length&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>x({type:`metadata`,keys:I.map(e=>e.key)}),children:[(0,h.jsx)(gr,{}),` Metadata`]}),n.capabilities.tagging&&(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>x({type:`tags`,keys:I.map(e=>e.key)}),children:[(0,h.jsx)(Mi,{}),` Tags`]}),r.length>1&&(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>x({type:`storage-class`,keys:I.map(e=>e.key)}),children:[(0,h.jsx)(Ir,{}),` Class`]}),n.capabilities.archiveRestore&&I.some(e=>KF.has(e.storageClass??``))&&(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>x({type:`restore-archive`,keys:I.filter(e=>KF.has(e.storageClass??``)).map(e=>e.key)}),children:[(0,h.jsx)(mn,{}),` Restore`]})]}),(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`text-destructive hover:text-destructive`,onClick:()=>x({type:`delete`,entries:oe}),children:[(0,h.jsx)(Pi,{}),` Delete`]})]}),(0,h.jsx)(zN,{label:`Clear selection (Esc)`,onClick:()=>g(new Set),children:(0,h.jsx)(Xi,{})})]}),S&&(0,h.jsx)(`div`,{className:`pointer-events-none absolute inset-2 z-20 grid place-items-center rounded-xl border-2 border-dashed border-primary bg-primary/5`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-primary`,children:[(0,h.jsx)(Hi,{className:`size-8`}),(0,h.jsxs)(`p`,{className:`font-medium`,children:[`Drop to upload to `,e,`/`,i.prefix]})]})})]}),i.object&&(0,h.jsx)(`div`,{className:`fixed inset-0 z-30 animate-in slide-in-from-right-4 fade-in md:absolute md:inset-y-0 md:right-0 md:left-auto md:w-[min(40rem,55%)]`,children:(0,h.jsx)(EB,{bucket:e,objectKey:i.object,onClose:()=>_x({object:null},{replace:!0})})}),(0,h.jsx)(`input`,{ref:te,type:`file`,multiple:!0,hidden:!0,onChange:e=>(ce(qA(e.target.files)),e.target.value=``)}),(0,h.jsx)(`input`,{ref:P,type:`file`,hidden:!0,webkitdirectory:``,onChange:e=>(ce(qA(e.target.files)),e.target.value=``)}),b?.type===`new-folder`&&(0,h.jsx)(iI,{bucket:e,prefix:i.prefix,onClose:()=>x(null),onCreated:t=>gx({bucket:e,prefix:t})}),b?.type===`delete`&&(0,h.jsx)(aI,{bucket:e,entries:b.entries,onClose:()=>x(null),onDeleted:()=>{g(new Set),i.object&&b.entries.some(e=>e.key===i.object)&&_x({object:null},{replace:!0})}}),b?.type===`rename`&&(0,h.jsx)(oI,{bucket:e,entry:b.entry,onClose:()=>x(null)}),b?.type===`copy`&&(0,h.jsx)(sI,{bucket:e,prefix:i.prefix,entries:b.entries,onClose:()=>x(null)}),b?.type===`share`&&(0,h.jsx)(lI,{bucket:e,objectKey:b.key,onClose:()=>x(null)}),b?.type===`metadata`&&(0,h.jsx)(dI,{bucket:e,keys:b.keys,onClose:()=>x(null)}),b?.type===`tags`&&(0,h.jsx)(mI,{bucket:e,keys:b.keys,onClose:()=>x(null)}),b?.type===`storage-class`&&(0,h.jsx)($F,{bucket:e,keys:b.keys,classes:r,onClose:()=>x(null)}),b?.type===`restore-archive`&&(0,h.jsx)(tI,{bucket:e,keys:b.keys,onClose:()=>x(null)})]})}var MB=1,NB=.9,PB=.8,FB=.17,IB=.1,LB=.999,RB=.9999,zB=.99,BB=/[\\\/_+.#"@\[\(\{&]/,VB=/[\\\/_+.#"@\[\(\{&]/g,HB=/[\s-]/,UB=/[\s-]/g;function WB(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?MB:zB;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=WB(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=MB:BB.test(e.charAt(l-1))?(d*=PB,p=e.slice(i,l-1).match(VB),p&&i>0&&(d*=LB**+p.length)):HB.test(e.charAt(l-1))?(d*=NB,m=e.slice(i,l-1).match(UB),m&&i>0&&(d*=LB**+m.length)):(d*=FB,i>0&&(d*=LB**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=RB)),(d<IB&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=WB(e,t,n,r,l+1,a+2,o),f*IB>d&&(d=f*IB)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function GB(e){return e.toLowerCase().replace(UB,` `)}function KB(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,WB(e,t,GB(e),GB(t),0,0,{})}var qB=`[cmdk-group=""]`,JB=`[cmdk-group-items=""]`,YB=`[cmdk-group-heading=""]`,XB=`[cmdk-item=""]`,ZB=`${XB}:not([aria-disabled="true"])`,QB=`cmdk-item-select`,$B=`data-value`,eV=(e,t,n)=>KB(e,t,n),tV=d.createContext(void 0),nV=()=>d.useContext(tV),rV=d.createContext(void 0),iV=()=>d.useContext(rV),aV=d.createContext(void 0),oV=d.forwardRef((e,t)=>{let n=bV(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=bV(()=>new Set),i=bV(()=>new Map),a=bV(()=>new Map),o=bV(()=>new Set),s=vV(e),{label:c,children:l,value:u,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=Jc(),b=Jc(),x=Jc(),S=d.useRef(null),C=CV();yV(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),yV(()=>{C(6,A)},[]);let w=d.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=d.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??eV;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(JB);t?t.appendChild(e.parentElement===t?e:e.closest(`${JB} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${JB} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${qB}[${$B}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute($B);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(qB)?.querySelector(YB))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${XB}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(ZB)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute($B))}function ee(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute($B))}function te(e){let t=j()?.closest(qB),n;for(;t&&!n;)t=e>0?gV(t,qB):_V(t,qB),n=t?.querySelector(ZB);n?w.setState(`value`,n.getAttribute($B)):ee(e)}let P=()=>N(M().length-1),ne=e=>{e.preventDefault(),e.metaKey?P():e.altKey?te(1):ee(1)},re=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?te(-1):ee(-1)};return d.createElement(q.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&ne(e);break;case`ArrowDown`:ne(e);break;case`p`:case`k`:_&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),P();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(QB);t.dispatchEvent(e)}}}}},d.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:EV},c),TV(e,e=>d.createElement(rV.Provider,{value:w},d.createElement(tV.Provider,{value:T},e))))}),sV=d.forwardRef((e,t)=>{let n=Jc(),r=d.useRef(null),i=d.useContext(aV),a=nV(),o=vV(e),s=o.current?.forceMount??i?.forceMount;yV(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=SV(n,r,[e.value,e.children,r],e.keywords),l=iV(),u=xV(e=>e.value&&e.value===c.current),f=xV(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);d.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(QB,p),()=>t.removeEventListener(QB,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return d.createElement(q.div,{ref:Ss(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),cV=d.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Jc(),s=d.useRef(null),c=d.useRef(null),l=Jc(),u=nV(),f=xV(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));yV(()=>u.group(o),[]),SV(o,s,[e.value,e.heading,c]);let p=d.useMemo(()=>({id:o,forceMount:i}),[i]);return d.createElement(q.div,{ref:Ss(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&d.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),TV(e,e=>d.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},d.createElement(aV.Provider,{value:p},e))))}),lV=d.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=d.useRef(null),a=xV(e=>!e.search);return!n&&!a?null:d.createElement(q.div,{ref:Ss(i,t),...r,"cmdk-separator":``,role:`separator`})}),uV=d.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=iV(),o=xV(e=>e.search),s=xV(e=>e.selectedItemId),c=nV();return d.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),d.createElement(q.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),dV=d.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=d.useRef(null),o=d.useRef(null),s=xV(e=>e.selectedItemId),c=nV();return d.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),d.createElement(q.div,{ref:Ss(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},TV(e,e=>d.createElement(`div`,{ref:Ss(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),fV=d.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return d.createElement(Md,{open:n,onOpenChange:r},d.createElement(Rd,{container:o},d.createElement(Bd,{"cmdk-overlay":``,className:i}),d.createElement(Wd,{"aria-label":e.label,"cmdk-dialog":``,className:a},d.createElement(oV,{ref:t,...s}))))}),pV=d.forwardRef((e,t)=>xV(e=>e.filtered.count===0)?d.createElement(q.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),mV=d.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return d.createElement(q.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},TV(e,e=>d.createElement(`div`,{"aria-hidden":!0},e)))}),hV=Object.assign(oV,{List:dV,Item:sV,Input:uV,Group:cV,Separator:lV,Dialog:fV,Empty:pV,Loading:mV});function gV(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function _V(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function vV(e){let t=d.useRef(e);return yV(()=>{t.current=e}),t}var yV=typeof window>`u`?d.useEffect:d.useLayoutEffect;function bV(e){let t=d.useRef();return t.current===void 0&&(t.current=e()),t}function xV(e){let t=iV(),n=()=>e(t.snapshot());return d.useSyncExternalStore(t.subscribe,n,n)}function SV(e,t,n,r=[]){let i=d.useRef(),a=nV();return yV(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute($B,s),i.current=s}),i}var CV=()=>{let[e,t]=d.useState(),n=bV(()=>new Map);return yV(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function wV(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function TV({asChild:e,children:t},n){return e&&d.isValidElement(t)?d.cloneElement(wV(t),{ref:t.ref},n(t.props.children)):n(t)}var EV={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function DV({className:e,...t}){return(0,h.jsx)(hV,{"data-slot":`command`,className:K(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function OV({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,...a}){return(0,h.jsxs)($b,{...a,children:[(0,h.jsxs)(rx,{className:`sr-only`,children:[(0,h.jsx)(ax,{children:e}),(0,h.jsx)(ox,{children:t})]}),(0,h.jsx)(nx,{className:K(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,h.jsx)(DV,{className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function kV({className:e,...t}){return(0,h.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,h.jsx)(gi,{className:`size-4 shrink-0 opacity-50`}),(0,h.jsx)(hV.Input,{"data-slot":`command-input`,className:K(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function AV({className:e,...t}){return(0,h.jsx)(hV.List,{"data-slot":`command-list`,className:K(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function jV({...e}){return(0,h.jsx)(hV.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function MV({className:e,...t}){return(0,h.jsx)(hV.Group,{"data-slot":`command-group`,className:K(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function NV({className:e,...t}){return(0,h.jsx)(hV.Separator,{"data-slot":`command-separator`,className:K(`-mx-1 h-px bg-border`,e),...t})}function PV({className:e,...t}){return(0,h.jsx)(hV.Item,{"data-slot":`command-item`,className:K(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function FV({className:e,...t}){return(0,h.jsx)(`span`,{"data-slot":`command-shortcut`,className:K(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function IV(){let[e,t]=(0,d.useState)(!1),n=mx(),{connection:r,connections:i,readonly:a,me:o}=XA(),s=jt(),c=kt(),{theme:l,setTheme:u}=ia();(0,d.useEffect)(()=>{let e=e=>{e.key.toLowerCase()===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t(e=>!e))},n=()=>t(!0);return window.addEventListener(`keydown`,e),window.addEventListener(`s3deck:command`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`s3deck:command`,n)}},[]);let f=e=>{t(!1),setTimeout(e,0)},p=e=>f(()=>ZA(e)),m=!!n.bucket&&n.view===`browse`;return(0,h.jsxs)(OV,{open:e,onOpenChange:t,title:`Command menu`,description:`Jump to a bucket or run a command`,children:[(0,h.jsx)(kV,{placeholder:`Jump to a bucket or run a command…`}),(0,h.jsxs)(AV,{children:[(0,h.jsx)(jV,{children:`No results.`}),m&&!a&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(MV,{heading:`This folder`,children:[(0,h.jsxs)(PV,{onSelect:()=>p(`upload`),children:[(0,h.jsx)(Hi,{}),` Upload files`,(0,h.jsxs)(FV,{children:[vs,`U`]})]}),(0,h.jsxs)(PV,{onSelect:()=>p(`upload-folder`),children:[(0,h.jsx)(wr,{}),` Upload a folder`]}),(0,h.jsxs)(PV,{onSelect:()=>p(`new-folder`),children:[(0,h.jsx)(br,{}),` New folder`]}),(0,h.jsxs)(PV,{onSelect:()=>p(`refresh`),children:[(0,h.jsx)(ui,{}),` Refresh`]})]}),(0,h.jsx)(NV,{})]}),(0,h.jsxs)(MV,{heading:`Buckets`,children:[(s.data?.buckets??[]).map(e=>(0,h.jsxs)(PV,{value:`bucket ${e.name}`,onSelect:()=>f(()=>gx({bucket:e.name})),children:[(0,h.jsx)(Jn,{}),` `,e.name]},e.name)),n.bucket&&(0,h.jsxs)(PV,{onSelect:()=>f(()=>gx({bucket:n.bucket,view:`settings`})),children:[(0,h.jsx)(vi,{}),` Settings for `,n.bucket]})]}),(0,h.jsx)(NV,{}),(0,h.jsxs)(MV,{heading:`Connections`,children:[i.filter(e=>e.id!==r.id).map(e=>(0,h.jsxs)(PV,{value:`connection ${e.label}`,onSelect:()=>f(()=>c.mutate(e.id,{onSuccess:()=>gx({}),onError:e=>U.error(V(e))})),children:[(0,h.jsx)(oi,{}),` Switch to `,e.label]},e.id)),o.browserConnections&&(0,h.jsxs)(PV,{onSelect:()=>p(`add-connection`),children:[(0,h.jsx)(ci,{}),` Add connection…`]})]}),(0,h.jsx)(NV,{}),(0,h.jsx)(MV,{heading:`Preferences`,children:(0,h.jsxs)(PV,{onSelect:()=>f(()=>u(l===`dark`?`light`:`dark`)),children:[l===`dark`?(0,h.jsx)(Ai,{}):(0,h.jsx)(Xr,{}),` Toggle theme`]})})]})]})}function LV({...e}){return(0,h.jsx)(nl,{"data-slot":`collapsible`,...e})}function RV({...e}){return(0,h.jsx)(il,{"data-slot":`collapsible-trigger`,...e})}function zV({...e}){return(0,h.jsx)(ol,{"data-slot":`collapsible-content`,...e})}var BV={aws:{name:`AWS S3`,endpoint:``,endpointHint:`Leave empty for AWS`,region:`us-east-1`,regionHint:`e.g. eu-west-2`},r2:{name:`Cloudflare R2`,endpoint:`https://<account-id>.r2.cloudflarestorage.com`,endpointHint:`Replace <account-id> with your ID from Cloudflare dashboard → R2`,region:`auto`,regionHint:`R2 uses "auto"`},minio:{name:`MinIO`,endpoint:`http://<host>:9000`,endpointHint:`Replace <host> with your server, e.g. localhost`,region:`us-east-1`,regionHint:`Usually us-east-1`},b2:{name:`Backblaze B2`,endpoint:`https://s3.<region>.backblazeb2.com`,endpointHint:`Replace <region> with your bucket’s region, e.g. us-west-004`,region:``,regionHint:`Filled from the endpoint`,regionFrom:/^https?:\/\/s3\.([a-z0-9-]+)\.backblazeb2\.com/i},spaces:{name:`DigitalOcean Spaces`,endpoint:`https://<region>.digitaloceanspaces.com`,endpointHint:`Replace <region> with your datacenter, e.g. nyc3`,region:``,regionHint:`Filled from the endpoint`,regionFrom:/^https?:\/\/([a-z0-9-]+)\.digitaloceanspaces\.com/i},wasabi:{name:`Wasabi`,endpoint:`https://s3.<region>.wasabisys.com`,endpointHint:`Replace <region> with your region, e.g. eu-central-1`,region:``,regionHint:`Filled from the endpoint`,regionFrom:/^https?:\/\/s3\.([a-z0-9-]+)\.wasabisys\.com/i},other:{name:`Other S3-compatible`,endpoint:`https://<host>`,endpointHint:`Replace <host> with your gateway (Ceph, Garage, LocalStack, SeaweedFS…)`,region:`us-east-1`,regionHint:``}},VV=xk({provider:jk(Object.keys(BV)),label:fA.shape.label.unwrap(),endpoint:Q().trim(),region:Q().trim(),accessKeyId:fA.shape.accessKeyId,secretAccessKey:fA.shape.secretAccessKey,sessionToken:Q().trim().max(8192),pathStyle:dA,buckets:Q(),publicUrlBase:Q().trim(),remember:pk()}).superRefine((e,t)=>{e.provider!==`aws`&&!e.endpoint&&t.addIssue({code:`custom`,path:[`endpoint`],message:`Endpoint is required for this provider`}),e.endpoint.includes(`<`)&&t.addIssue({code:`custom`,path:[`endpoint`],message:`Replace the placeholder with your own value`})});function HV(e){return{label:e.label||void 0,endpoint:e.endpoint||void 0,region:e.region||void 0,accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken||void 0,pathStyle:e.pathStyle,buckets:e.buckets.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean),publicUrlBase:e.publicUrlBase||void 0,remember:e.remember||void 0}}function UV({onConnected:e,onCancel:t}){let n=Ot(),r=!!Ct().data?.persistence,[i,a]=(0,d.useState)(!1),o=iN({resolver:hN(VV),defaultValues:{provider:`aws`,label:``,endpoint:``,region:`us-east-1`,accessKeyId:``,secretAccessKey:``,sessionToken:``,pathStyle:`auto`,buckets:``,publicUrlBase:``,remember:!1}}),{errors:s}=o.formState,c=BV[o.watch(`provider`)],l=o.handleSubmit(t=>{let r=fA.safeParse(HV(t));if(r.success)n.mutate(r.data,{onSuccess:t=>{o.reset({...o.getValues(),secretAccessKey:``,sessionToken:``});let n=t.bucketCount;U.success(`Connected`,{description:n===null?`Opened your configured buckets.`:`${n} bucket${n===1?``:`s`} available.`}),e?.()}});else for(let e of r.error.issues)o.setError(e.path[0]??`root`,{message:e.message})});return(0,h.jsx)(`form`,{onSubmit:l,noValidate:!0,autoComplete:`off`,children:(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsx)(FN,{label:`Provider`,htmlFor:`provider`,children:(0,h.jsx)(Bj,{control:o.control,name:`provider`,render:({field:e})=>(0,h.jsxs)(aF,{value:e.value,onValueChange:t=>{e.onChange(t),o.setValue(`region`,BV[t].region),o.setValue(`endpoint`,BV[t].endpoint),o.clearErrors(`endpoint`)},children:[(0,h.jsx)(sF,{id:`provider`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsx)(cF,{children:Object.entries(BV).map(([e,t])=>(0,h.jsx)(lF,{value:e,children:t.name},e))})]})})}),(0,h.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-[1fr_9rem]`,children:[(0,h.jsx)(FN,{label:`Endpoint`,htmlFor:`endpoint`,description:c.endpointHint,error:s.endpoint?.message,children:(0,h.jsx)(NN,{id:`endpoint`,placeholder:c.endpoint||`https://s3.amazonaws.com`,spellCheck:!1,"aria-invalid":!!s.endpoint,...o.register(`endpoint`,{onChange:e=>{let t=c.regionFrom&&e.target.value.match(c.regionFrom)?.[1];t&&!t.includes(`<`)&&o.setValue(`region`,t.toLowerCase())}}),onFocus:e=>{let t=e.currentTarget,n=t.value.indexOf(`<`),r=t.value.indexOf(`>`,n);n!==-1&&r!==-1&&requestAnimationFrame(()=>t.setSelectionRange(n,r+1))}})}),(0,h.jsx)(FN,{label:`Region`,htmlFor:`region`,description:c.regionHint,error:s.region?.message,children:(0,h.jsx)(NN,{id:`region`,placeholder:`us-east-1`,"aria-invalid":!!s.region,...o.register(`region`)})})]}),(0,h.jsx)(FN,{label:`Access key ID`,htmlFor:`accessKeyId`,error:s.accessKeyId?.message,children:(0,h.jsx)(NN,{id:`accessKeyId`,spellCheck:!1,autoComplete:`off`,className:`font-mono`,"aria-invalid":!!s.accessKeyId,...o.register(`accessKeyId`)})}),(0,h.jsx)(FN,{label:`Secret access key`,htmlFor:`secretAccessKey`,error:s.secretAccessKey?.message,children:(0,h.jsx)(NN,{id:`secretAccessKey`,type:`password`,spellCheck:!1,autoComplete:`new-password`,className:`font-mono`,"aria-invalid":!!s.secretAccessKey,...o.register(`secretAccessKey`)})}),(0,h.jsxs)(LV,{open:i,onOpenChange:a,children:[(0,h.jsx)(RV,{asChild:!0,children:(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`-ml-2 text-muted-foreground`,children:[(0,h.jsx)(Pn,{className:K(`transition-transform`,i&&`rotate-90`)}),`Advanced`]})}),(0,h.jsx)(zV,{children:(0,h.jsxs)(TN,{className:`mt-2 gap-4 rounded-lg border bg-muted/30 p-4`,children:[(0,h.jsx)(FN,{label:`Name`,htmlFor:`label`,description:`Shown in the connection switcher`,error:s.label?.message,children:(0,h.jsx)(NN,{id:`label`,placeholder:`${c.name} (prod)`,...o.register(`label`)})}),(0,h.jsx)(FN,{label:`Session token`,htmlFor:`sessionToken`,description:`Only for temporary (STS) credentials`,error:s.sessionToken?.message,children:(0,h.jsx)(HN,{id:`sessionToken`,rows:2,className:`font-mono text-xs`,spellCheck:!1,...o.register(`sessionToken`)})}),(0,h.jsx)(FN,{label:`URL style`,htmlFor:`pathStyle`,description:`Auto picks path-style for MinIO and unknown endpoints`,children:(0,h.jsx)(Bj,{control:o.control,name:`pathStyle`,render:({field:e})=>(0,h.jsxs)(aF,{value:e.value,onValueChange:e.onChange,children:[(0,h.jsx)(sF,{id:`pathStyle`,className:`w-full`,children:(0,h.jsx)(oF,{})}),(0,h.jsxs)(cF,{children:[(0,h.jsx)(lF,{value:`auto`,children:`Auto`}),(0,h.jsx)(lF,{value:`path`,children:`Path-style (host/bucket/key)`}),(0,h.jsx)(lF,{value:`virtual`,children:`Virtual-hosted (bucket.host/key)`})]})]})})}),(0,h.jsx)(FN,{label:`Buckets`,htmlFor:`buckets`,description:`For keys that can't list buckets: bucket names to open, separated by commas or spaces`,error:s.buckets?.message,children:(0,h.jsx)(NN,{id:`buckets`,placeholder:`my-app-uploads, logs`,...o.register(`buckets`)})}),(0,h.jsx)(FN,{label:`Public URL base`,htmlFor:`publicUrlBase`,description:`Custom domain for public objects`,error:s.publicUrlBase?.message,children:(0,h.jsx)(NN,{id:`publicUrlBase`,placeholder:`https://cdn.example.com`,...o.register(`publicUrlBase`)})})]})})]}),r&&(0,h.jsxs)(DN,{orientation:`horizontal`,children:[(0,h.jsx)(Bj,{control:o.control,name:`remember`,render:({field:e})=>(0,h.jsx)(bN,{id:`remember`,checked:e.value,onCheckedChange:t=>e.onChange(t===!0)})}),(0,h.jsxs)(ON,{children:[(0,h.jsx)(kN,{htmlFor:`remember`,children:`Remember this connection`}),(0,h.jsx)(AN,{children:`Saved encrypted on the s3deck server, so it’s still here after a restart. Only you can use it.`})]})]}),n.isError&&(0,h.jsxs)(_N,{variant:`destructive`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:V(n.error)})]}),(0,h.jsxs)(AN,{className:`flex items-start gap-2`,children:[(0,h.jsx)(Wr,{className:`mt-0.5 size-3.5 shrink-0`}),o.watch(`remember`)?`Keys are sent once to the s3deck server and stored there encrypted (AES-256-GCM). They are never sent back to the browser.`:`Keys are sent once to the s3deck server and kept in its memory for this session. They are never sent back to the browser or written to disk, and are forgotten when you log out or s3deck restarts.`]}),(0,h.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[t&&(0,h.jsx)(Y,{type:`button`,variant:`outline`,onClick:t,children:`Cancel`}),(0,h.jsxs)(Y,{type:`submit`,disabled:n.isPending,children:[n.isPending?(0,h.jsx)(PN,{}):(0,h.jsx)(Pr,{}),`Connect`]})]})]})})}function WV({className:e=`size-6`}){return(0,h.jsxs)(`svg`,{viewBox:`0 0 32 32`,className:e,"aria-hidden":`true`,children:[(0,h.jsx)(`rect`,{width:`32`,height:`32`,rx:`7`,className:`fill-primary`}),(0,h.jsx)(`path`,{d:`M8 11.5 16 7l8 4.5-8 4.5-8-4.5Z`,className:`fill-primary-foreground`}),(0,h.jsx)(`path`,{d:`m8 16 8 4.5 8-4.5M8 20.5 16 25l8-4.5`,fill:`none`,className:`stroke-primary-foreground`,strokeWidth:`2`,strokeLinejoin:`round`})]})}function GV(){let{connection:e,connections:t,me:n}=XA(),r=kt(),i=At(),a=e=>r.mutate(e,{onSuccess:()=>gx({}),onError:e=>U.error(V(e))});return(0,h.jsxs)(bF,{children:[(0,h.jsx)(xF,{asChild:!0,children:(0,h.jsxs)(Y,{variant:`ghost`,className:`h-auto w-full justify-start gap-2.5 px-2 py-1.5 text-left`,children:[(0,h.jsx)(WV,{className:`!size-7 shrink-0`}),(0,h.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`span`,{className:`block truncate text-sm font-semibold leading-tight`,children:e.label}),(0,h.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[e.providerName,` · `,e.region]})]}),(0,h.jsx)(Mn,{className:`text-muted-foreground`})]})}),(0,h.jsxs)(SF,{align:`start`,className:`w-72`,children:[(0,h.jsx)(DF,{children:`Connections`}),t.map(t=>(0,h.jsxs)(CF,{onSelect:()=>t.id!==e.id&&a(t.id),children:[(0,h.jsx)(oi,{}),(0,h.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`span`,{className:`block truncate`,children:t.label}),(0,h.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[t.endpoint??`AWS`,` `,t.accessKeyHint&&`· ${t.accessKeyHint}`]})]}),t.source===`saved`&&(0,h.jsx)(En,{className:`size-3.5`,"aria-label":`Remembered`}),t.id===e.id&&(0,h.jsx)(An,{className:`text-primary`})]},t.id)),n.browserConnections&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(OF,{}),(0,h.jsxs)(CF,{onSelect:()=>ZA(`add-connection`),children:[(0,h.jsx)(ci,{}),` Add connection…`]})]}),e.source!==`cli`&&(0,h.jsxs)(CF,{variant:`destructive`,onSelect:()=>i.mutate(e.id,{onSuccess:()=>gx({}),onError:e=>U.error(V(e))}),children:[(0,h.jsx)(Bi,{}),` `,e.source===`saved`?`Forget`:`Disconnect`,` “`,e.label,`”`]})]})]})}function KV(){let{theme:e,setTheme:t}=ia();return(0,h.jsxs)(bF,{children:[(0,h.jsx)(xF,{asChild:!0,children:(0,h.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Theme`,children:(0,h.jsx)(e===`light`?Ai:e===`dark`?Xr:Jr,{})})}),(0,h.jsx)(SF,{align:`end`,side:`top`,children:[`light`,`dark`,`system`].map(n=>(0,h.jsxs)(CF,{onSelect:()=>t(n),className:`capitalize`,children:[n===`light`?(0,h.jsx)(Ai,{}):n===`dark`?(0,h.jsx)(Xr,{}):(0,h.jsx)(Jr,{}),n,e===n&&(0,h.jsx)(An,{className:`ml-auto text-primary`})]},n))})]})}function qV({className:e}){let{me:t,connection:n,isAdmin:r}=XA(),i=mx(),a=jt(),o=Tt(),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(!1),f=(a.data?.buckets??[]).filter(e=>e.name.toLowerCase().includes(s.toLowerCase())),p=r&&!t.readonly&&n.capabilities.bucketCreate&&!a.data?.fallback,m=(e,t,n)=>{let r=i.view===e;return(0,h.jsxs)(`a`,{href:hx({view:e}),onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||t.button!==0||(t.preventDefault(),gx({view:e}))},className:K(`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm`,r?`bg-primary/10 font-medium text-primary dark:bg-primary/15`:`text-foreground/80 hover:bg-muted`),"aria-current":r?`page`:void 0,children:[(0,h.jsx)(n,{className:K(`size-4 shrink-0`,r?`text-primary`:`text-muted-foreground`)}),t]})};return(0,h.jsxs)(`aside`,{className:K(`flex h-full w-64 shrink-0 flex-col border-r bg-sidebar`,e),children:[(0,h.jsx)(`div`,{className:`p-2`,children:(0,h.jsx)(GV,{})}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between px-4 pt-2 pb-1`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buckets`}),p&&(0,h.jsx)(zN,{label:`New bucket`,onClick:()=>u(!0),children:(0,h.jsx)(ci,{})})]}),(a.data?.buckets.length??0)>6&&(0,h.jsx)(`div`,{className:`px-3 pb-1`,children:(0,h.jsxs)(UN,{className:`h-8`,children:[(0,h.jsx)(GN,{children:(0,h.jsx)(gi,{})}),(0,h.jsx)(KN,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter buckets`,"aria-label":`Filter buckets`})]})}),(0,h.jsxs)(`nav`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-1`,"aria-label":`Buckets`,children:[a.isPending&&(0,h.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,h.jsx)(PN,{})}),a.isError&&(0,h.jsx)(`p`,{className:`px-2 py-3 text-xs text-destructive`,children:V(a.error)}),f.map(e=>{let t=i.bucket===e.name;return(0,h.jsxs)(`a`,{href:hx({bucket:e.name}),onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||t.button!==0||(t.preventDefault(),gx({bucket:e.name}))},className:K(`group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm`,t?`bg-primary/10 font-medium text-primary dark:bg-primary/15`:`text-foreground/80 hover:bg-muted`),"aria-current":t?`page`:void 0,children:[(0,h.jsx)(Jn,{className:K(`size-4 shrink-0`,t?`text-primary`:`text-muted-foreground`)}),(0,h.jsx)(`span`,{className:`truncate`,children:e.name}),t&&(0,h.jsx)(zN,{label:`Bucket settings`,size:`icon-xs`,className:`ml-auto opacity-70 hover:opacity-100`,onClick:t=>{t.preventDefault(),t.stopPropagation(),gx({bucket:e.name,view:`settings`})},children:(0,h.jsx)(vi,{})})]},e.name)}),a.data&&f.length===0&&(0,h.jsx)(`p`,{className:`px-2 py-3 text-xs text-muted-foreground`,children:s?`No matching buckets`:`No buckets yet`})]}),(0,h.jsxs)(`nav`,{className:`space-y-0.5 border-t p-2`,"aria-label":`Tools`,children:[m(`sync`,`Sync`,Sr),r&&m(`activity`,`Activity`,fi),r&&m(`users`,`Users`,Wi)]}),(0,h.jsxs)(`div`,{className:`border-t p-2`,children:[(0,h.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`mb-1 w-full justify-start text-muted-foreground`,onClick:()=>window.dispatchEvent(new Event(`s3deck:command`)),children:[(0,h.jsx)(gi,{}),` Jump to…`,(0,h.jsxs)(SI,{className:`ml-auto`,children:[(0,h.jsx)(xI,{children:vs}),(0,h.jsx)(xI,{children:`K`})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1 px-1`,children:[(0,h.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:[t.user&&t.authRequired?t.user:`s3deck`,` · v`,t.version]}),t.readonly?(0,h.jsx)(VN,{variant:`secondary`,children:`read-only`}):t.role&&t.role!==`admin`&&(0,h.jsx)(VN,{variant:`outline`,className:`capitalize`,children:t.role}),(0,h.jsx)(KV,{}),t.authRequired&&(0,h.jsx)(zN,{label:`Log out`,onClick:()=>o.mutate(),children:(0,h.jsx)(Hr,{})})]})]}),(0,h.jsx)(LN,{open:l,onOpenChange:u})]})}function JV(){let e=UA(),[t,n]=(0,d.useState)(!0);if(e.length===0)return null;let r=e.filter(e=>e.status===`uploading`||e.status===`queued`),i=e.filter(e=>e.status===`error`),a=e.filter(e=>e.status===`paused`),o=r.reduce((e,t)=>e+t.file.size,0),s=r.reduce((e,t)=>e+t.loaded,0),c=r.reduce((e,t)=>e+(t.status===`uploading`?t.speed:0),0),l=c>0?(o-s)/c:1/0;return(0,h.jsx)(LV,{open:t,onOpenChange:n,asChild:!0,children:(0,h.jsxs)(HP,{className:`fixed right-4 bottom-4 z-40 w-[min(26rem,calc(100vw-2rem))] gap-0 py-0`,"aria-label":`Uploads`,children:[(0,h.jsxs)(UP,{className:`border-b px-4 py-3 [.border-b]:pb-3`,children:[(0,h.jsxs)(WP,{className:`flex items-center gap-2 text-sm`,children:[(0,h.jsx)(Hi,{className:`size-4 text-primary`}),r.length?`Uploading ${r.length} file${r.length===1?``:`s`}`:a.length?`${a.length} upload${a.length===1?``:`s`} paused`:`Uploads finished`]}),(0,h.jsx)(GP,{className:`text-xs`,children:r.length?`${lP(c)} · ${Number.isFinite(l)?`${cP(l)} left`:`starting…`}`:i.length?(0,h.jsxs)(`span`,{className:`text-destructive`,children:[i.length,` failed`]}):`All done`}),(0,h.jsxs)(KP,{className:`flex items-center gap-1`,children:[(0,h.jsx)(RV,{asChild:!0,children:(0,h.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":t?`Collapse`:`Expand`,children:(0,h.jsx)(Mn,{className:K(`transition-transform`,!t&&`rotate-180`)})})}),r.length||a.length?(0,h.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>HA.cancelAll(),children:`Cancel all`}):(0,h.jsx)(zN,{label:`Close`,onClick:()=>HA.clearFinished(),children:(0,h.jsx)(Xi,{})})]}),r.length>0&&(0,h.jsx)(qN,{value:o?s/o*100:0,className:`col-span-full mt-2 h-1`})]}),(0,h.jsx)(zV,{children:(0,h.jsx)(qP,{className:`max-h-72 overflow-y-auto px-0 py-1`,children:(0,h.jsx)(`ul`,{children:e.map(e=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2 px-4 py-1.5 text-sm`,children:[(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`truncate`,title:e.key,children:e.key.split(`/`).pop()}),e.status===`uploading`||e.status===`paused`?(0,h.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,h.jsx)(qN,{value:e.file.size?e.loaded/e.file.size*100:100,className:`h-1.5`}),(0,h.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.status===`paused`?`Paused · `:e.resumed?`Resumed · `:``,nP(e.loaded),` / `,nP(e.file.size)]})]}):(0,h.jsx)(`p`,{className:K(`truncate text-xs`,e.status===`error`?`text-destructive`:`text-muted-foreground`),children:e.status===`error`?e.error:e.status===`queued`?`Queued · ${nP(e.file.size)}`:e.status===`cancelled`?`Cancelled`:nP(e.file.size)})]}),e.status===`done`&&(0,h.jsx)(An,{className:`size-4 text-primary`}),e.status===`error`&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Bn,{className:`size-4 text-destructive`}),(0,h.jsx)(zN,{label:`Retry`,onClick:()=>HA.retry(e.id),children:(0,h.jsx)(mi,{})})]}),e.status===`uploading`&&e.file.size>16777216&&(0,h.jsx)(zN,{label:`Pause`,onClick:()=>HA.pause(e.id),children:(0,h.jsx)(ei,{})}),e.status===`paused`&&(0,h.jsx)(zN,{label:`Resume`,onClick:()=>HA.resume(e.id),children:(0,h.jsx)(ii,{})}),(e.status===`uploading`||e.status===`queued`||e.status===`paused`)&&(0,h.jsx)(zN,{label:`Cancel upload`,onClick:()=>HA.cancel(e.id),children:(0,h.jsx)(Xi,{})})]},e.id))})})})]})})}function YV({me:e,connections:t}){let n=mx(),r=_(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),c=(0,d.useMemo)(()=>({me:e,connection:t.connections.find(e=>e.id===t.activeId),connections:t.connections,readonly:!e.can.write,isAdmin:e.can.admin}),[e,t]);return(0,d.useEffect)(()=>HA.onComplete(e=>void St(r,e)),[r]),(0,d.useEffect)(()=>QA(e=>e===`add-connection`&&s(!0)),[]),(0,d.useEffect)(()=>a(!1),[n.bucket,n.view]),(0,h.jsxs)(YA.Provider,{value:c,children:[(0,h.jsxs)(`div`,{className:`flex h-full`,children:[(0,h.jsx)(`div`,{className:K(`fixed inset-0 z-30 bg-black/40 md:hidden`,i?`block`:`hidden`),onClick:()=>a(!1),"aria-hidden":`true`}),(0,h.jsx)(qV,{className:K(`fixed inset-y-0 left-0 z-40 transition-transform md:static md:translate-x-0`,i?`translate-x-0`:`-translate-x-full`)}),(0,h.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2 md:hidden`,children:[(0,h.jsx)(zN,{label:`Open navigation`,onClick:()=>a(!0),children:(0,h.jsx)(Kr,{})}),(0,h.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.bucket??(n.view===`browse`?`s3deck`:n.view)})]}),n.view===`sync`?(0,h.jsx)(yF,{}):n.view===`activity`&&e.can.admin?(0,h.jsx)(VP,{}):n.view===`users`&&e.can.admin?(0,h.jsx)(PF,{}):n.bucket?n.view===`settings`?(0,h.jsx)(wP,{bucket:n.bucket},n.bucket):(0,h.jsx)(jB,{bucket:n.bucket},n.bucket):(0,h.jsx)(JP,{})]})]}),(0,h.jsx)(JV,{}),(0,h.jsx)(IV,{}),(0,h.jsx)($b,{open:o,onOpenChange:s,children:(0,h.jsxs)(nx,{className:`max-h-[90vh] overflow-y-auto sm:max-w-lg`,children:[(0,h.jsxs)(rx,{children:[(0,h.jsx)(ax,{children:`Add connection`}),(0,h.jsx)(ox,{children:`Connect to another account, endpoint or provider.`})]}),(0,h.jsx)(UV,{onConnected:()=>{s(!1),gx({})},onCancel:()=>s(!1)})]})})]})}function XV(){let e=Ct(),t=Tt();return(0,h.jsx)(`main`,{className:`min-h-full bg-muted/40 px-4 py-10`,children:(0,h.jsxs)(HP,{className:`mx-auto w-full max-w-lg`,children:[(0,h.jsxs)(UP,{children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(WV,{className:`size-9 shrink-0`}),(0,h.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,h.jsx)(WP,{className:`text-lg`,children:`Connect to storage`}),(0,h.jsx)(GP,{children:`Enter an access key for AWS S3 or any S3-compatible service.`})]})]}),e.data?.authRequired&&(0,h.jsx)(KP,{children:(0,h.jsx)(zN,{label:`Log out`,onClick:()=>t.mutate(),children:(0,h.jsx)(Hr,{})})})]}),(0,h.jsx)(qP,{children:e.data?.browserConnections?(0,h.jsx)(UV,{}):(0,h.jsxs)(_N,{children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(vN,{children:`No storage credentials`}),(0,h.jsx)(yN,{children:`Entering credentials in the browser is disabled on this server. Restart s3deck with credentials (see s3deck --help).`})]})})]})})}var ZV=(()=>{let e=new URLSearchParams(location.search),t=e.get(`login_error`);return t&&(e.delete(`login_error`),history.replaceState(null,``,`${location.pathname}${e.size?`?${e}`:``}`)),t})();function QV(){let e=wt(),t=Ct().data?.sso,n=iN({resolver:hN(uA),defaultValues:{username:``,password:``}}),{errors:r}=n.formState;return(0,h.jsx)(`main`,{className:`grid min-h-full place-items-center bg-muted/40 p-4`,children:(0,h.jsxs)(HP,{className:`w-full max-w-sm`,children:[(0,h.jsx)(UP,{children:(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(WV,{className:`size-9 shrink-0`}),(0,h.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,h.jsx)(WP,{className:`text-lg`,children:`Sign in to s3deck`}),(0,h.jsx)(GP,{children:`Use the login printed when s3deck started.`})]})]})}),(0,h.jsx)(qP,{children:(0,h.jsx)(`form`,{onSubmit:n.handleSubmit(t=>e.mutate(t)),noValidate:!0,children:(0,h.jsxs)(TN,{className:`gap-4`,children:[(0,h.jsx)(FN,{label:`Username`,htmlFor:`username`,error:r.username?.message,children:(0,h.jsx)(NN,{id:`username`,autoComplete:`username`,autoFocus:!0,"aria-invalid":!!r.username,...n.register(`username`)})}),(0,h.jsx)(FN,{label:`Password`,htmlFor:`password`,error:r.password?.message,children:(0,h.jsx)(NN,{id:`password`,type:`password`,autoComplete:`current-password`,"aria-invalid":!!r.password,...n.register(`password`)})}),ZV&&!e.isError&&(0,h.jsxs)(_N,{variant:`destructive`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:ZV})]}),e.isError&&(0,h.jsxs)(_N,{variant:`destructive`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(yN,{children:V(e.error)})]}),(0,h.jsxs)(Y,{type:`submit`,className:`w-full`,disabled:e.isPending,children:[e.isPending&&(0,h.jsx)(PN,{}),`Sign in`]}),t?.enabled&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(jN,{children:`or`}),(0,h.jsx)(Y,{asChild:!0,variant:`outline`,className:`w-full`,children:(0,h.jsxs)(`a`,{href:`api/auth/sso/start`,children:[(0,h.jsx)(Br,{}),` `,t.label]})})]})]})})})]})})}function $V({title:e,error:t}){return(0,h.jsx)(`div`,{className:`grid h-full place-items-center p-4`,children:(0,h.jsxs)(_N,{variant:`destructive`,className:`max-w-md`,children:[(0,h.jsx)(Bn,{}),(0,h.jsx)(vN,{children:e}),(0,h.jsx)(yN,{children:V(t)})]})})}function eH(){let e=Ct(),t=!!e.data?.authenticated,n=Et(t);return e.isPending||t&&n.isPending?(0,h.jsx)(`div`,{className:`grid h-full place-items-center`,children:(0,h.jsx)(PN,{className:`size-6 text-muted-foreground`})}):e.isError?(0,h.jsx)($V,{title:`Can’t reach s3deck`,error:e.error}):t?n.isError?(0,h.jsx)($V,{title:`Couldn’t load connections`,error:n.error}):n.data?.activeId?(0,h.jsx)(YV,{me:e.data,connections:n.data}):(0,h.jsx)(XV,{}):(0,h.jsx)(QV,{})}var tH=new qe({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(e,t)=>!(t instanceof pt&&t.status<500)&&e<2}}});_t(()=>void tH.invalidateQueries({queryKey:xt.me})),(0,lt.createRoot)(document.getElementById(`root`)).render((0,h.jsx)(d.StrictMode,{children:(0,h.jsx)(v,{client:tH,children:(0,h.jsxs)(Gb,{delayDuration:300,children:[(0,h.jsx)(eH,{}),(0,h.jsx)(La,{position:`bottom-right`,richColors:!0,closeButton:!0})]})})}));export{c as n,o as t};
|