autoforge-ai 0.1.16 → 0.1.18

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.
@@ -0,0 +1 @@
1
+ function Bt(t,e){for(var s=0;s<e.length;s++){const i=e[s];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in t)){const a=Object.getOwnPropertyDescriptor(i,n);a&&Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var et={exports:{}},z={};var yt;function Wt(){if(yt)return z;yt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(i,n,a){var c=null;if(a!==void 0&&(c=""+a),n.key!==void 0&&(c=""+n.key),"key"in n){a={};for(var u in n)u!=="key"&&(a[u]=n[u])}else a=n;return n=a.ref,{$$typeof:t,type:i,key:c,ref:n!==void 0?n:null,props:a}}return z.Fragment=e,z.jsx=s,z.jsxs=s,z}var vt;function Jt(){return vt||(vt=1,et.exports=Wt()),et.exports}var Zt=Jt(),st={exports:{}},l={};var mt;function Vt(){if(mt)return l;mt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),R=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),v=Symbol.iterator;function x(r){return r===null||typeof r!="object"?null:(r=v&&r[v]||r["@@iterator"],typeof r=="function"?r:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,T={};function O(r,o,d){this.props=r,this.context=o,this.refs=T,this.updater=d||C}O.prototype.isReactComponent={},O.prototype.setState=function(r,o){if(typeof r!="object"&&typeof r!="function"&&r!=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,r,o,"setState")},O.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function F(){}F.prototype=O.prototype;function I(r,o,d){this.props=r,this.context=o,this.refs=T,this.updater=d||C}var j=I.prototype=new F;j.constructor=I,m(j,O.prototype),j.isPureReactComponent=!0;var D=Array.isArray;function N(){}var y={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function U(r,o,d){var f=d.ref;return{$$typeof:t,type:r,key:o,ref:f!==void 0?f:null,props:d}}function k(r,o){return U(r.type,o,r.props)}function H(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function Nt(r){var o={"=":"=0",":":"=2"};return"$"+r.replace(/[=:]/g,function(d){return o[d]})}var dt=/\/+/g;function tt(r,o){return typeof r=="object"&&r!==null&&r.key!=null?Nt(""+r.key):o.toString(36)}function Kt(r){switch(r.status){case"fulfilled":return r.value;case"rejected":throw r.reason;default:switch(typeof r.status=="string"?r.then(N,N):(r.status="pending",r.then(function(o){r.status==="pending"&&(r.status="fulfilled",r.value=o)},function(o){r.status==="pending"&&(r.status="rejected",r.reason=o)})),r.status){case"fulfilled":return r.value;case"rejected":throw r.reason}}throw r}function Y(r,o,d,f,g){var b=typeof r;(b==="undefined"||b==="boolean")&&(r=null);var E=!1;if(r===null)E=!0;else switch(b){case"bigint":case"string":case"number":E=!0;break;case"object":switch(r.$$typeof){case t:case e:E=!0;break;case p:return E=r._init,Y(E(r._payload),o,d,f,g)}}if(E)return g=g(r),E=f===""?"."+tt(r,0):f,D(g)?(d="",E!=null&&(d=E.replace(dt,"$&/")+"/"),Y(g,o,d,"",function(Yt){return Yt})):g!=null&&(H(g)&&(g=k(g,d+(g.key==null||r&&r.key===g.key?"":(""+g.key).replace(dt,"$&/")+"/")+E)),o.push(g)),1;E=0;var q=f===""?".":f+":";if(D(r))for(var A=0;A<r.length;A++)f=r[A],b=q+tt(f,A),E+=Y(f,o,d,b,g);else if(A=x(r),typeof A=="function")for(r=A.call(r),A=0;!(f=r.next()).done;)f=f.value,b=q+tt(f,A++),E+=Y(f,o,d,b,g);else if(b==="object"){if(typeof r.then=="function")return Y(Kt(r),o,d,f,g);throw o=String(r),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return E}function J(r,o,d){if(r==null)return r;var f=[],g=0;return Y(r,f,"","",function(b){return o.call(d,b,g++)}),f}function $t(r){if(r._status===-1){var o=r._result;o=o(),o.then(function(d){(r._status===0||r._status===-1)&&(r._status=1,r._result=d)},function(d){(r._status===0||r._status===-1)&&(r._status=2,r._result=d)}),r._status===-1&&(r._status=0,r._result=o)}if(r._status===1)return r._result.default;throw r._result}var pt=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Gt={map:J,forEach:function(r,o,d){J(r,function(){o.apply(this,arguments)},d)},count:function(r){var o=0;return J(r,function(){o++}),o},toArray:function(r){return J(r,function(o){return o})||[]},only:function(r){if(!H(r))throw Error("React.Children.only expected to receive a single React element child.");return r}};return l.Activity=P,l.Children=Gt,l.Component=O,l.Fragment=s,l.Profiler=n,l.PureComponent=I,l.StrictMode=i,l.Suspense=h,l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,l.__COMPILER_RUNTIME={__proto__:null,c:function(r){return y.H.useMemoCache(r)}},l.cache=function(r){return function(){return r.apply(null,arguments)}},l.cacheSignal=function(){return null},l.cloneElement=function(r,o,d){if(r==null)throw Error("The argument must be a React element, but you passed "+r+".");var f=m({},r.props),g=r.key;if(o!=null)for(b in o.key!==void 0&&(g=""+o.key),o)!_.call(o,b)||b==="key"||b==="__self"||b==="__source"||b==="ref"&&o.ref===void 0||(f[b]=o[b]);var b=arguments.length-2;if(b===1)f.children=d;else if(1<b){for(var E=Array(b),q=0;q<b;q++)E[q]=arguments[q+2];f.children=E}return U(r.type,g,f)},l.createContext=function(r){return r={$$typeof:c,_currentValue:r,_currentValue2:r,_threadCount:0,Provider:null,Consumer:null},r.Provider=r,r.Consumer={$$typeof:a,_context:r},r},l.createElement=function(r,o,d){var f,g={},b=null;if(o!=null)for(f in o.key!==void 0&&(b=""+o.key),o)_.call(o,f)&&f!=="key"&&f!=="__self"&&f!=="__source"&&(g[f]=o[f]);var E=arguments.length-2;if(E===1)g.children=d;else if(1<E){for(var q=Array(E),A=0;A<E;A++)q[A]=arguments[A+2];g.children=q}if(r&&r.defaultProps)for(f in E=r.defaultProps,E)g[f]===void 0&&(g[f]=E[f]);return U(r,b,g)},l.createRef=function(){return{current:null}},l.forwardRef=function(r){return{$$typeof:u,render:r}},l.isValidElement=H,l.lazy=function(r){return{$$typeof:p,_payload:{_status:-1,_result:r},_init:$t}},l.memo=function(r,o){return{$$typeof:R,type:r,compare:o===void 0?null:o}},l.startTransition=function(r){var o=y.T,d={};y.T=d;try{var f=r(),g=y.S;g!==null&&g(d,f),typeof f=="object"&&f!==null&&typeof f.then=="function"&&f.then(N,pt)}catch(b){pt(b)}finally{o!==null&&d.types!==null&&(o.types=d.types),y.T=o}},l.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},l.use=function(r){return y.H.use(r)},l.useActionState=function(r,o,d){return y.H.useActionState(r,o,d)},l.useCallback=function(r,o){return y.H.useCallback(r,o)},l.useContext=function(r){return y.H.useContext(r)},l.useDebugValue=function(){},l.useDeferredValue=function(r,o){return y.H.useDeferredValue(r,o)},l.useEffect=function(r,o){return y.H.useEffect(r,o)},l.useEffectEvent=function(r){return y.H.useEffectEvent(r)},l.useId=function(){return y.H.useId()},l.useImperativeHandle=function(r,o,d){return y.H.useImperativeHandle(r,o,d)},l.useInsertionEffect=function(r,o){return y.H.useInsertionEffect(r,o)},l.useLayoutEffect=function(r,o){return y.H.useLayoutEffect(r,o)},l.useMemo=function(r,o){return y.H.useMemo(r,o)},l.useOptimistic=function(r,o){return y.H.useOptimistic(r,o)},l.useReducer=function(r,o,d){return y.H.useReducer(r,o,d)},l.useRef=function(r){return y.H.useRef(r)},l.useState=function(r){return y.H.useState(r)},l.useSyncExternalStore=function(r,o,d){return y.H.useSyncExternalStore(r,o,d)},l.useTransition=function(){return y.H.useTransition()},l.version="19.2.3",l}var gt;function Xt(){return gt||(gt=1,st.exports=Vt()),st.exports}var w=Xt();const te=zt(w),De=Bt({__proto__:null,default:te},[w]);var B=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ee={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},se=class{#t=ee;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},K=new se;function re(t){setTimeout(t,0)}var $=typeof window>"u"||"Deno"in globalThis;function M(){}function ie(t,e){return typeof t=="function"?t(e):t}function rt(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ft(t,e){return Math.max(t+(e||0)-Date.now(),0)}function L(t,e){return typeof t=="function"?t(e):t}function Q(t,e){return typeof t=="function"?t(e):t}function bt(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:c,stale:u}=t;if(c){if(i){if(e.queryHash!==ct(c,e.options))return!1}else if(!W(e.queryKey,c))return!1}if(s!=="all"){const h=e.isActive();if(s==="active"&&!h||s==="inactive"&&h)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||n&&n!==e.state.fetchStatus||a&&!a(e))}function Rt(t,e){const{exact:s,status:i,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(G(e.options.mutationKey)!==G(a))return!1}else if(!W(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function ct(t,e){return(e?.queryKeyHashFn||G)(t)}function G(t){return JSON.stringify(t,(e,s)=>it(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function W(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>W(t[s],e[s])):!1}var ne=Object.prototype.hasOwnProperty;function At(t,e){if(t===e)return t;const s=Et(t)&&Et(e);if(!s&&!(it(t)&&it(e)))return e;const n=(s?t:Object.keys(t)).length,a=s?e:Object.keys(e),c=a.length,u=s?new Array(c):{};let h=0;for(let R=0;R<c;R++){const p=s?R:a[R],P=t[p],v=e[p];if(P===v){u[p]=P,(s?R<n:ne.call(t,p))&&h++;continue}if(P===null||v===null||typeof P!="object"||typeof v!="object"){u[p]=v;continue}const x=At(P,v);u[p]=x,x===P&&h++}return n===c&&h===n?t:u}function V(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function Et(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function it(t){if(!Ct(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!Ct(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ct(t){return Object.prototype.toString.call(t)==="[object Object]"}function oe(t){return new Promise(e=>{K.setTimeout(e,t)})}function nt(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?At(t,e):e}function ae(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function ue(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var ht=Symbol();function xt(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===ht?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function It(t,e){return typeof t=="function"?t(...e):!!t}function ce(t,e,s){let i=!1,n;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(n??=e(),i||(i=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),t}var he=class extends B{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!$&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},lt=new he;function ot(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),t(n)},s.reject=n=>{i({status:"rejected",reason:n}),e(n)},s}var le=re;function fe(){let t=[],e=0,s=u=>{u()},i=u=>{u()},n=le;const a=u=>{e?t.push(u):n(()=>{s(u)})},c=()=>{const u=t;t=[],u.length&&n(()=>{i(()=>{u.forEach(h=>{s(h)})})})};return{batch:u=>{let h;e++;try{h=u()}finally{e--,e||c()}return h},batchCalls:u=>(...h)=>{a(()=>{u(...h)})},schedule:a,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{n=u}}}var S=fe(),de=class extends B{#t=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!$&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#t}},X=new de;function pe(t){return Math.min(1e3*2**t,3e4)}function Qt(t){return(t??"online")==="online"?X.isOnline():!0}var at=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function jt(t){let e=!1,s=0,i;const n=ot(),a=()=>n.status!=="pending",c=m=>{if(!a()){const T=new at(m);v(T),t.onCancel?.(T)}},u=()=>{e=!0},h=()=>{e=!1},R=()=>lt.isFocused()&&(t.networkMode==="always"||X.isOnline())&&t.canRun(),p=()=>Qt(t.networkMode)&&t.canRun(),P=m=>{a()||(i?.(),n.resolve(m))},v=m=>{a()||(i?.(),n.reject(m))},x=()=>new Promise(m=>{i=T=>{(a()||R())&&m(T)},t.onPause?.()}).then(()=>{i=void 0,a()||t.onContinue?.()}),C=()=>{if(a())return;let m;const T=s===0?t.initialPromise:void 0;try{m=T??t.fn()}catch(O){m=Promise.reject(O)}Promise.resolve(m).then(P).catch(O=>{if(a())return;const F=t.retry??($?0:3),I=t.retryDelay??pe,j=typeof I=="function"?I(s,O):I,D=F===!0||typeof F=="number"&&s<F||typeof F=="function"&&F(s,O);if(e||!D){v(O);return}s++,t.onFail?.(s,O),oe(j).then(()=>R()?void 0:x()).then(()=>{e?v(O):C()})})};return{promise:n,status:()=>n.status,cancel:c,continue:()=>(i?.(),n),cancelRetry:u,continueRetry:h,canStart:p,start:()=>(p()?C():x().then(C),n)}}var Dt=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rt(this.gcTime)&&(this.#t=K.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($?1/0:300*1e3))}clearGcTimeout(){this.#t&&(K.clearTimeout(this.#t),this.#t=void 0)}},ye=class extends Dt{#t;#e;#s;#i;#r;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#s=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=St(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=St(this.options);e.data!==void 0&&(this.setState(Ot(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=nt(this.state.data,t,this.options);return this.#n({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#n({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>Q(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ht||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>L(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ft(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(h=>h.options.queryFn);u&&this.setOptions(u.options)}const s=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},n=()=>{const u=xt(this.options,e),R=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(p),p})();return this.#a=!1,this.options.persister?this.options.persister(u,R,this):u(R)},c=(()=>{const u={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:n};return i(u),u})();this.options.behavior?.onFetch(c,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#n({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=jt({initialPromise:e?.initialPromise,fn:c.fetchFn,onCancel:u=>{u instanceof at&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(u,h)=>{this.#n({type:"failed",failureCount:u,error:h})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#s.config.onSuccess?.(u,this),this.#s.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof at){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#n({type:"error",error:u}),this.#s.config.onError?.(u,this),this.#s.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#n(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...qt(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,...Ot(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=t.manual?i:void 0,i;case"error":const n=t.error;return{...s,error:n,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),S.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function qt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Ot(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function St(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var ve=class extends B{constructor(t,e){super(),this.options=e,this.#t=t,this.#n=null,this.#a=ot(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#s=void 0;#i=void 0;#r;#o;#a;#n;#y;#f;#d;#c;#h;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),wt(this.#e,this.options)?this.#l():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ut(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ut(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#E(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Q(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#e.setOptions(this.options),e._defaulted&&!V(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const i=this.hasListeners();i&&Pt(this.#e,s,this.options,e)&&this.#l(),this.updateResult(),i&&(this.#e!==s||Q(this.options.enabled,this.#e)!==Q(e.enabled,this.#e)||L(this.options.staleTime,this.#e)!==L(e.staleTime,this.#e))&&this.#v();const n=this.#m();i&&(this.#e!==s||Q(this.options.enabled,this.#e)!==Q(e.enabled,this.#e)||n!==this.#u)&&this.#g(n)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),s=this.createResult(e,t);return ge(this,s)&&(this.#i=s,this.#o=this.options,this.#r=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#C();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(M)),e}#v(){this.#R();const t=L(this.options.staleTime,this.#e);if($||this.#i.isStale||!rt(t))return;const s=Ft(this.#i.dataUpdatedAt,t)+1;this.#c=K.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#g(t){this.#E(),this.#u=t,!($||Q(this.options.enabled,this.#e)===!1||!rt(this.#u)||this.#u===0)&&(this.#h=K.setInterval(()=>{(this.options.refetchIntervalInBackground||lt.isFocused())&&this.#l()},this.#u))}#b(){this.#v(),this.#g(this.#m())}#R(){this.#c&&(K.clearTimeout(this.#c),this.#c=void 0)}#E(){this.#h&&(K.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#e,i=this.options,n=this.#i,a=this.#r,c=this.#o,h=t!==s?t.state:this.#s,{state:R}=t;let p={...R},P=!1,v;if(e._optimisticResults){const _=this.hasListeners(),U=!_&&wt(t,e),k=_&&Pt(t,s,e,i);(U||k)&&(p={...p,...qt(R.data,t.options)}),e._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:m}=p;v=p.data;let T=!1;if(e.placeholderData!==void 0&&v===void 0&&m==="pending"){let _;n?.isPlaceholderData&&e.placeholderData===c?.placeholderData?(_=n.data,T=!0):_=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,_!==void 0&&(m="success",v=nt(n?.data,_,e),P=!0)}if(e.select&&v!==void 0&&!T)if(n&&v===a?.data&&e.select===this.#y)v=this.#f;else try{this.#y=e.select,v=e.select(v),v=nt(n?.data,v,e),this.#f=v,this.#n=null}catch(_){this.#n=_}this.#n&&(x=this.#n,v=this.#f,C=Date.now(),m="error");const O=p.fetchStatus==="fetching",F=m==="pending",I=m==="error",j=F&&O,D=v!==void 0,y={status:m,fetchStatus:p.fetchStatus,isPending:F,isSuccess:m==="success",isError:I,isInitialLoading:j,isLoading:j,data:v,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:C,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:O,isRefetching:O&&!F,isLoadingError:I&&!D,isPaused:p.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:I&&D,isStale:ft(t,e),refetch:this.refetch,promise:this.#a,isEnabled:Q(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const _=H=>{y.status==="error"?H.reject(y.error):y.data!==void 0&&H.resolve(y.data)},U=()=>{const H=this.#a=y.promise=ot();_(H)},k=this.#a;switch(k.status){case"pending":t.queryHash===s.queryHash&&_(k);break;case"fulfilled":(y.status==="error"||y.data!==k.value)&&U();break;case"rejected":(y.status!=="error"||y.error!==k.reason)&&U();break}}return y}updateResult(){const t=this.#i,e=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#o=this.options,this.#r.data!==void 0&&(this.#d=this.#e),V(e,t))return;this.#i=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,n=typeof i=="function"?i():i;if(n==="all"||!n&&!this.#p.size)return!0;const a=new Set(n??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(c=>{const u=c;return this.#i[u]!==t[u]&&a.has(u)})};this.#O({listeners:s()})}#C(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(t){S.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function me(t,e){return Q(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function wt(t,e){return me(t,e)||t.state.data!==void 0&&ut(t,e,e.refetchOnMount)}function ut(t,e,s){if(Q(e.enabled,t)!==!1&&L(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&ft(t,e)}return!1}function Pt(t,e,s,i){return(t!==e||Q(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&ft(t,s)}function ft(t,e){return Q(e.enabled,t)!==!1&&t.isStaleByTime(L(e.staleTime,t))}function ge(t,e){return!V(t.getCurrentResult(),e)}function Tt(t){return{onFetch:(e,s)=>{const i=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],c=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},h=0;const R=async()=>{let p=!1;const P=C=>{ce(C,()=>e.signal,()=>p=!0)},v=xt(e.options,e.fetchOptions),x=async(C,m,T)=>{if(p)return Promise.reject();if(m==null&&C.pages.length)return Promise.resolve(C);const F=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:m,direction:T?"backward":"forward",meta:e.options.meta};return P(N),N})(),I=await v(F),{maxPages:j}=e.options,D=T?ue:ae;return{pages:D(C.pages,I,j),pageParams:D(C.pageParams,m,j)}};if(n&&a.length){const C=n==="backward",m=C?be:_t,T={pages:a,pageParams:c},O=m(i,T);u=await x(T,O,C)}else{const C=t??a.length;do{const m=h===0?c[0]??i.initialPageParam:_t(i,u);if(h>0&&m==null)break;u=await x(u,m),h++}while(h<C)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(R,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=R}}}function _t(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function be(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var Re=class extends Dt{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||Ut(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=jt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(a,c)=>{this.#r({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i=this.state.status==="pending",n=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:n}),await this.#s.config.onMutate?.(t,this,s);const c=await this.options.onMutate?.(t,s);c!==this.state.context&&this.#r({type:"pending",context:c,variables:t,isPaused:n})}const a=await this.#i.start();return await this.#s.config.onSuccess?.(a,t,this.state.context,this,s),await this.options.onSuccess?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,t,this.state.context,s),this.#r({type:"success",data:a}),a}catch(a){try{await this.#s.config.onError?.(a,t,this.state.context,this,s)}catch(c){Promise.reject(c)}try{await this.options.onError?.(a,t,this.state.context,s)}catch(c){Promise.reject(c)}try{await this.#s.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,s)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,a,t,this.state.context,s)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:a}),a}finally{this.#s.runNext(this)}}#r(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),S.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function Ut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ee=class extends B{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new Re({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=Z(t);if(typeof e=="string"){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=Z(t);if(typeof e=="string"){const s=this.#e.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Z(t);if(typeof e=="string"){const i=this.#e.get(e)?.find(n=>n.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=Z(t);return typeof e=="string"?this.#e.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>Rt(e,s))}findAll(t={}){return this.getAll().filter(e=>Rt(t,e))}notify(t){S.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(t.map(e=>e.continue().catch(M))))}};function Z(t){return t.options.scope?.id}var Ce=class extends B{#t;#e=void 0;#s;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),V(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&G(e.mutationKey)!==G(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#o()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#t.getMutationCache().build(this.#t,this.options),this.#s.addObserver(this),this.#s.execute(t)}#r(){const t=this.#s?.state??Ut();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){S.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#e.variables,s=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,e,s,i)}catch(n){Promise.reject(n)}try{this.#i.onSettled?.(t.data,null,e,s,i)}catch(n){Promise.reject(n)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,e,s,i)}catch(n){Promise.reject(n)}try{this.#i.onSettled?.(void 0,t.error,e,s,i)}catch(n){Promise.reject(n)}}}this.listeners.forEach(e=>{e(this.#e)})})}},Oe=class extends B{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,s){const i=e.queryKey,n=e.queryHash??ct(i,e);let a=this.get(n);return a||(a=new ye({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){S.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>bt(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>bt(t,s)):e}notify(t){S.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){S.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},qe=class{#t;#e;#s;#i;#r;#o;#a;#n;constructor(t={}){this.#t=t.queryCache||new Oe,this.#e=t.mutationCache||new Ee,this.#s=t.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=lt.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#n=X.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#n?.(),this.#n=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#t.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(L(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#t.get(i.queryHash)?.state.data,c=ie(e,a);if(c!==void 0)return this.#t.build(this,i).setData(c,{...s,manual:!0})}setQueriesData(t,e,s){return S.batch(()=>this.#t.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){const e=this.#t;S.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#t;return S.batch(()=>(s.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=S.batch(()=>this.#t.findAll(t).map(n=>n.cancel(s)));return Promise.all(i).then(M).catch(M)}invalidateQueries(t,e={}){return S.batch(()=>(this.#t.findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=S.batch(()=>this.#t.findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(M)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(M)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#t.build(this,e);return s.isStaleByTime(L(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(M).catch(M)}fetchInfiniteQuery(t){return t.behavior=Tt(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(M).catch(M)}ensureInfiniteQueryData(t){return t.behavior=Tt(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return X.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#i.set(G(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{W(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#r.set(G(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#r.values()],s={};return e.forEach(i=>{W(t,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=ct(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===ht&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},kt=w.createContext(void 0),Ht=t=>{const e=w.useContext(kt);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ue=({client:t,children:e})=>(w.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Zt.jsx(kt.Provider,{value:t,children:e})),Lt=w.createContext(!1),Se=()=>w.useContext(Lt);Lt.Provider;function we(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Pe=w.createContext(we()),Te=()=>w.useContext(Pe),_e=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Me=t=>{w.useEffect(()=>{t.clearReset()},[t])},Fe=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(n&&t.data===void 0||It(s,[t.error,i])),Ae=t=>{if(t.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...n)=>s(i(...n)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},xe=(t,e)=>t.isLoading&&t.isFetching&&!e,Ie=(t,e)=>t?.suspense&&e.isPending,Mt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function Qe(t,e,s){const i=Se(),n=Te(),a=Ht(),c=a.defaultQueryOptions(t);a.getDefaultOptions().queries?._experimental_beforeQuery?.(c),c._optimisticResults=i?"isRestoring":"optimistic",Ae(c),_e(c,n),Me(n);const u=!a.getQueryCache().get(c.queryHash),[h]=w.useState(()=>new e(a,c)),R=h.getOptimisticResult(c),p=!i&&t.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(P=>{const v=p?h.subscribe(S.batchCalls(P)):M;return h.updateResult(),v},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),w.useEffect(()=>{h.setOptions(c)},[c,h]),Ie(c,R))throw Mt(c,h,n);if(Fe({result:R,errorResetBoundary:n,throwOnError:c.throwOnError,query:a.getQueryCache().get(c.queryHash),suspense:c.suspense}))throw R.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(c,R),c.experimental_prefetchInRender&&!$&&xe(R,i)&&(u?Mt(c,h,n):a.getQueryCache().get(c.queryHash)?.promise)?.catch(M).finally(()=>{h.updateResult()}),c.notifyOnChangeProps?R:h.trackResult(R)}function ke(t,e){return Qe(t,ve)}function He(t,e){const s=Ht(),[i]=w.useState(()=>new Ce(s,t));w.useEffect(()=>{i.setOptions(t)},[i,t]);const n=w.useSyncExternalStore(w.useCallback(c=>i.subscribe(S.batchCalls(c)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=w.useCallback((c,u)=>{i.mutate(c,u).catch(M)},[i]);if(n.error&&It(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}export{qe as Q,De as R,Xt as a,te as b,je as c,Ht as d,He as e,Ue as f,zt as g,Zt as j,w as r,ke as u};
@@ -0,0 +1,45 @@
1
+ import{a as Uo,g as Ho,r as c,j as v,R as Ft,b as ve}from"./vendor-query-CcgjkJlA.js";var wt={exports:{}},U={};var fn;function Go(){if(fn)return U;fn=1;var e=Uo();function t(u){var l="https://react.dev/errors/"+u;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+u+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function i(u,l,f){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:d==null?null:""+d,children:u,containerInfo:l,implementation:f}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(u,l){if(u==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return U.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,U.createPortal=function(u,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return i(u,l,null,f)},U.flushSync=function(u){var l=a.T,f=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=l,r.p=f,r.d.f()}},U.preconnect=function(u,l){typeof u=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,r.d.C(u,l))},U.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},U.preinit=function(u,l){if(typeof u=="string"&&l&&typeof l.as=="string"){var f=l.as,d=s(f,l.crossOrigin),p=typeof l.integrity=="string"?l.integrity:void 0,h=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;f==="style"?r.d.S(u,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:d,integrity:p,fetchPriority:h}):f==="script"&&r.d.X(u,{crossOrigin:d,integrity:p,fetchPriority:h,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},U.preinitModule=function(u,l){if(typeof u=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var f=s(l.as,l.crossOrigin);r.d.M(u,{crossOrigin:f,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&r.d.M(u)},U.preload=function(u,l){if(typeof u=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var f=l.as,d=s(f,l.crossOrigin);r.d.L(u,f,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},U.preloadModule=function(u,l){if(typeof u=="string")if(l){var f=s(l.as,l.crossOrigin);r.d.m(u,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:f,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else r.d.m(u)},U.requestFormReset=function(u){r.d.r(u)},U.unstable_batchedUpdates=function(u,l){return u(l)},U.useFormState=function(u,l,f){return a.H.useFormState(u,l,f)},U.useFormStatus=function(){return a.H.useHostTransitionStatus()},U.version="19.2.3",U}var dn;function Ko(){if(dn)return wt.exports;dn=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wt.exports=Go(),wt.exports}var jt=Ko();const zo=Ho(jt);function pn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function de(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pn(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():pn(e[o],null)}}}}function $(...e){return c.useCallback(de(...e),e)}var Yo=Symbol.for("react.lazy"),et=Ft[" use ".trim().toString()];function Xo(e){return typeof e=="object"&&e!==null&&"then"in e}function Wn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Yo&&"_payload"in e&&Xo(e._payload)}function $t(e){const t=qo(e),n=c.forwardRef((r,o)=>{let{children:i,...a}=r;Wn(i)&&typeof et=="function"&&(i=et(i._payload));const s=c.Children.toArray(i),u=s.find(Qo);if(u){const l=u.props.children,f=s.map(d=>d===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return v.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return v.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var ou=$t("Slot");function qo(e){const t=c.forwardRef((n,r)=>{let{children:o,...i}=n;if(Wn(o)&&typeof et=="function"&&(o=et(o._payload)),c.isValidElement(o)){const a=ei(o),s=Jo(i,o.props);return o.type!==c.Fragment&&(s.ref=r?de(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zo=Symbol("radix.slottable");function Qo(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zo}function Jo(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ei(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)}function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ti(e,t){const n=c.createContext(t),r=i=>{const{children:a,...s}=i,u=c.useMemo(()=>s,Object.values(s));return v.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(i){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function pe(e,t=[]){let n=[];function r(i,a){const s=c.createContext(a),u=n.length;n=[...n,a];const l=d=>{const{scope:p,children:h,...g}=d,m=p?.[e]?.[u]||s,y=c.useMemo(()=>g,Object.values(g));return v.jsx(m.Provider,{value:y,children:h})};l.displayName=i+"Provider";function f(d,p){const h=p?.[e]?.[u]||s,g=c.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(a=>c.createContext(a));return function(s){const u=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,ni(o,...t)]}function ni(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const d=u(i)[`__scope${l}`];return{...s,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var le=globalThis?.document?c.useLayoutEffect:()=>{},ri=Ft[" useId ".trim().toString()]||(()=>{}),oi=0;function Se(e){const[t,n]=c.useState(ri());return le(()=>{n(r=>r??String(oi++))},[e]),t?`radix-${t}`:""}var ii=Ft[" useInsertionEffect ".trim().toString()]||le;function je({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=si({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=c.useCallback(f=>{if(s){const d=ci(f)?f(e):f;d!==e&&a.current?.(d)}else i(f)},[s,e,i,a]);return[u,l]}function si({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return ii(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function ci(e){return typeof e=="function"}function ai(e){const t=li(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(fi);if(u){const l=u.props.children,f=s.map(d=>d===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return v.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return v.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function li(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=pi(o),s=di(i,o.props);return o.type!==c.Fragment&&(s.ref=r?de(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ui=Symbol("radix.slottable");function fi(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ui}function di(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function pi(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)}var mi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],k=mi.reduce((e,t)=>{const n=ai(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bn(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}function re(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function hi(e,t=globalThis?.document){const n=re(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var vi="DismissableLayer",Ot="dismissableLayer.update",gi="dismissableLayer.pointerDownOutside",yi="dismissableLayer.focusOutside",mn,Vn=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wt=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...u}=e,l=c.useContext(Vn),[f,d]=c.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=c.useState({}),g=$(t,S=>d(S)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),x=f?m.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,C=x>=w,E=bi(S=>{const _=S.target,T=[...l.branches].some(O=>O.contains(_));!C||T||(o?.(S),a?.(S),S.defaultPrevented||s?.())},p),P=Ci(S=>{const _=S.target;[...l.branches].some(O=>O.contains(_))||(i?.(S),a?.(S),S.defaultPrevented||s?.())},p);return hi(S=>{x===l.layers.size-1&&(r?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},p),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(mn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),hn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=mn)}},[f,p,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),hn())},[f,l]),c.useEffect(()=>{const S=()=>h({});return document.addEventListener(Ot,S),()=>document.removeEventListener(Ot,S)},[]),v.jsx(k.div,{...u,ref:g,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,P.onFocusCapture),onBlurCapture:A(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,E.onPointerDownCapture)})});Wt.displayName=vi;var wi="DismissableLayerBranch",xi=c.forwardRef((e,t)=>{const n=c.useContext(Vn),r=c.useRef(null),o=$(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),v.jsx(k.div,{...e,ref:o})});xi.displayName=wi;function bi(e,t=globalThis?.document){const n=re(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){Un(gi,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ci(e,t=globalThis?.document){const n=re(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&Un(yi,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hn(){const e=new CustomEvent(Ot);document.dispatchEvent(e)}function Un(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bn(o,i):o.dispatchEvent(i)}var xt="focusScope.autoFocusOnMount",bt="focusScope.autoFocusOnUnmount",vn={bubbles:!1,cancelable:!0},Ei="FocusScope",Bt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,u]=c.useState(null),l=re(o),f=re(i),d=c.useRef(null),p=$(t,m=>u(m)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let m=function(b){if(h.paused||!s)return;const C=b.target;s.contains(C)?d.current=C:ce(d.current,{select:!0})},y=function(b){if(h.paused||!s)return;const C=b.relatedTarget;C!==null&&(s.contains(C)||ce(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&ce(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(w);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,s,h.paused]),c.useEffect(()=>{if(s){yn.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(xt,vn);s.addEventListener(xt,l),s.dispatchEvent(w),w.defaultPrevented||(Si(Mi(Hn(s)),{select:!0}),document.activeElement===m&&ce(s))}return()=>{s.removeEventListener(xt,l),setTimeout(()=>{const w=new CustomEvent(bt,vn);s.addEventListener(bt,f),s.dispatchEvent(w),w.defaultPrevented||ce(m??document.body,{select:!0}),s.removeEventListener(bt,f),yn.remove(h)},0)}}},[s,l,f,h]);const g=c.useCallback(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(y&&w){const x=m.currentTarget,[b,C]=Ri(x);b&&C?!m.shiftKey&&w===C?(m.preventDefault(),n&&ce(b,{select:!0})):m.shiftKey&&w===b&&(m.preventDefault(),n&&ce(C,{select:!0})):w===x&&m.preventDefault()}},[n,r,h.paused]);return v.jsx(k.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});Bt.displayName=Ei;function Si(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ce(r,{select:t}),document.activeElement!==n)return}function Ri(e){const t=Hn(e),n=gn(t,e),r=gn(t.reverse(),e);return[n,r]}function Hn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gn(e,t){for(const n of e)if(!Pi(n,{upTo:t}))return n}function Pi(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}function Ai(e){return e instanceof HTMLInputElement&&"select"in e}function ce(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ai(e)&&t&&e.select()}}var yn=_i();function _i(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wn(e,t),e.unshift(t)},remove(t){e=wn(e,t),e[0]?.resume()}}}function wn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mi(e){return e.filter(t=>t.tagName!=="A")}var Oi="Portal",Vt=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=c.useState(!1);le(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?zo.createPortal(v.jsx(k.div,{...r,ref:t}),a):null});Vt.displayName=Oi;function Di(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var se=e=>{const{present:t,children:n}=e,r=Ti(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=$(r.ref,Ii(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};se.displayName="Presence";function Ti(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),a=e?"mounted":"unmounted",[s,u]=Di(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Ge(r.current);i.current=s==="mounted"?l:"none"},[s]),le(()=>{const l=r.current,f=o.current;if(f!==e){const p=i.current,h=Ge(l);e?u("MOUNT"):h==="none"||l?.display==="none"?u("UNMOUNT"):u(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),le(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=h=>{const m=Ge(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Ge(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ge(e){return e?.animationName||"none"}function Ii(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)}var Ct=0;function Gn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xn()),document.body.insertAdjacentElement("beforeend",e[1]??xn()),Ct++,()=>{Ct===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ct--}},[])}function xn(){const 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}var Q=function(){return Q=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Q.apply(this,arguments)};function Kn(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ni(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ze="right-scroll-bar-position",Qe="width-before-scroll-bar",ki="with-scroll-bars-hidden",Li="--removed-body-scroll-bar-size";function Et(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Fi(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ji=typeof window<"u"?c.useLayoutEffect:c.useEffect,bn=new WeakMap;function $i(e,t){var n=Fi(null,function(r){return e.forEach(function(o){return Et(o,r)})});return ji(function(){var r=bn.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Et(s,null)}),i.forEach(function(s){o.has(s)||Et(s,a)})}bn.set(n,e)},[e]),n}function Wi(e){return e}function Bi(e,t){t===void 0&&(t=Wi);var n=[],r=!1,o={read:function(){if(r)throw new 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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var u=function(){var f=a;a=[],f.forEach(i)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function Vi(e){e===void 0&&(e={});var t=Bi(null);return t.options=Q({async:!0,ssr:!1},e),t}var zn=function(e){var t=e.sideCar,n=Kn(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,Q({},n))};zn.isSideCarExport=!0;function Ui(e,t){return e.useMedium(t),zn}var Yn=Vi(),St=function(){},at=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:St,onWheelCapture:St,onTouchMoveCapture:St}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,m=e.inert,y=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,b=e.gapMode,C=Kn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,P=$i([n,t]),S=Q(Q({},C),o);return c.createElement(c.Fragment,null,f&&c.createElement(E,{sideCar:Yn,removeScrollBar:l,shards:d,noRelative:h,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:b}),a?c.cloneElement(c.Children.only(s),Q(Q({},S),{ref:P})):c.createElement(x,Q({},S,{className:u,ref:P}),s))});at.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};at.classNames={fullWidth:Qe,zeroRight:Ze};var Hi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Hi();return t&&e.setAttribute("nonce",t),e}function Ki(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Yi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gi())&&(Ki(t,n),zi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xi=function(){var e=Yi();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xn=function(){var e=Xi(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},qi={left:0,top:0,right:0,gap:0},Rt=function(e){return parseInt(e||"",10)||0},Zi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Rt(n),Rt(r),Rt(o)]},Qi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qi;var t=Zi(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])}},Ji=Xn(),Re="data-scroll-locked",es=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(ki,` {
3
+ overflow: hidden `).concat(r,`;
4
+ padding-right: `).concat(s,"px ").concat(r,`;
5
+ }
6
+ body[`).concat(Re,`] {
7
+ overflow: hidden `).concat(r,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
10
+ padding-left: `.concat(o,`px;
11
+ padding-top: `).concat(i,`px;
12
+ padding-right: `).concat(a,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(s,"px ").concat(r,`;
16
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(Ze,` {
20
+ right: `).concat(s,"px ").concat(r,`;
21
+ }
22
+
23
+ .`).concat(Qe,` {
24
+ margin-right: `).concat(s,"px ").concat(r,`;
25
+ }
26
+
27
+ .`).concat(Ze," .").concat(Ze,` {
28
+ right: 0 `).concat(r,`;
29
+ }
30
+
31
+ .`).concat(Qe," .").concat(Qe,` {
32
+ margin-right: 0 `).concat(r,`;
33
+ }
34
+
35
+ body[`).concat(Re,`] {
36
+ `).concat(Li,": ").concat(s,`px;
37
+ }
38
+ `)},Cn=function(){var e=parseInt(document.body.getAttribute(Re)||"0",10);return isFinite(e)?e:0},ts=function(){c.useEffect(function(){return document.body.setAttribute(Re,(Cn()+1).toString()),function(){var e=Cn()-1;e<=0?document.body.removeAttribute(Re):document.body.setAttribute(Re,e.toString())}},[])},ns=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ts();var i=c.useMemo(function(){return Qi(o)},[o]);return c.createElement(Ji,{styles:es(i,!t,o,n?"":"!important")})},Dt=!1;if(typeof window<"u")try{var Ke=Object.defineProperty({},"passive",{get:function(){return Dt=!0,!0}});window.addEventListener("test",Ke,Ke),window.removeEventListener("test",Ke,Ke)}catch{Dt=!1}var be=Dt?{passive:!1}:!1,rs=function(e){return e.tagName==="TEXTAREA"},qn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rs(e)&&n[t]==="visible")},os=function(e){return qn(e,"overflowY")},is=function(e){return qn(e,"overflowX")},En=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Zn(e,r);if(o){var i=Qn(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ss=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cs=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Zn=function(e,t){return e==="v"?os(t):is(t)},Qn=function(e,t){return e==="v"?ss(t):cs(t)},as=function(e,t){return e==="h"&&t==="rtl"?-1:1},ls=function(e,t,n,r,o){var i=as(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,u=t.contains(s),l=!1,f=a>0,d=0,p=0;do{if(!s)break;var h=Qn(e,s),g=h[0],m=h[1],y=h[2],w=m-y-i*g;(g||w)&&Zn(e,s)&&(d+=w,p+=g);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(f&&Math.abs(d)<1||!f&&Math.abs(p)<1)&&(l=!0),l},ze=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sn=function(e){return[e.deltaX,e.deltaY]},Rn=function(e){return e&&"current"in e?e.current:e},us=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fs=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},ds=0,Ce=[];function ps(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(ds++)[0],i=c.useState(Xn)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Ni([e.lockRef.current],(e.shards||[]).map(Rn),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var w=ze(m),x=n.current,b="deltaX"in m?m.deltaX:x[0]-w[0],C="deltaY"in m?m.deltaY:x[1]-w[1],E,P=m.target,S=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in m&&S==="h"&&P.type==="range")return!1;var _=window.getSelection(),T=_&&_.anchorNode,O=T?T===P||T.contains(P):!1;if(O)return!1;var I=En(S,P);if(!I)return!0;if(I?E=S:(E=S==="v"?"h":"v",I=En(S,P)),!I)return!1;if(!r.current&&"changedTouches"in m&&(b||C)&&(r.current=E),!E)return!0;var L=r.current||E;return ls(L,y,m,L==="h"?b:C)},[]),u=c.useCallback(function(m){var y=m;if(!(!Ce.length||Ce[Ce.length-1]!==i)){var w="deltaY"in y?Sn(y):ze(y),x=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&us(E.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var b=(a.current.shards||[]).map(Rn).filter(Boolean).filter(function(E){return E.contains(y.target)}),C=b.length>0?s(y,b[0]):!a.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),l=c.useCallback(function(m,y,w,x){var b={name:m,delta:y,target:w,should:x,shadowParent:ms(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=c.useCallback(function(m){n.current=ze(m),r.current=void 0},[]),d=c.useCallback(function(m){l(m.type,Sn(m),m.target,s(m,e.lockRef.current))},[]),p=c.useCallback(function(m){l(m.type,ze(m),m.target,s(m,e.lockRef.current))},[]);c.useEffect(function(){return Ce.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,be),document.addEventListener("touchmove",u,be),document.addEventListener("touchstart",f,be),function(){Ce=Ce.filter(function(m){return m!==i}),document.removeEventListener("wheel",u,be),document.removeEventListener("touchmove",u,be),document.removeEventListener("touchstart",f,be)}},[]);var h=e.removeScrollBar,g=e.inert;return c.createElement(c.Fragment,null,g?c.createElement(i,{styles:fs(o)}):null,h?c.createElement(ns,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ms(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hs=Ui(Yn,ps);var Ut=c.forwardRef(function(e,t){return c.createElement(at,Q({},e,{ref:t,sideCar:hs}))});Ut.classNames=at.classNames;var vs=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ee=new WeakMap,Ye=new WeakMap,Xe={},Pt=0,Jn=function(e){return e&&(e.host||Jn(e.parentNode))},gs=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Jn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ys=function(e,t,n,r){var o=gs(t,Array.isArray(e)?e:[e]);Xe[n]||(Xe[n]=new WeakMap);var i=Xe[n],a=[],s=new Set,u=new Set(o),l=function(d){!d||s.has(d)||(s.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))f(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",m=(Ee.get(p)||0)+1,y=(i.get(p)||0)+1;Ee.set(p,m),i.set(p,y),a.push(p),m===1&&g&&Ye.set(p,!0),y===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return f(t),s.clear(),Pt++,function(){a.forEach(function(d){var p=Ee.get(d)-1,h=i.get(d)-1;Ee.set(d,p),i.set(d,h),p||(Ye.has(d)||d.removeAttribute(r),Ye.delete(d)),h||d.removeAttribute(n)}),Pt--,Pt||(Ee=new WeakMap,Ee=new WeakMap,Ye=new WeakMap,Xe={})}},er=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=vs(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ys(r,o,n,"aria-hidden")):function(){return null}};function ws(e){const t=xs(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(Cs);if(u){const l=u.props.children,f=s.map(d=>d===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return v.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return v.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function xs(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=Ss(o),s=Es(i,o.props);return o.type!==c.Fragment&&(s.ref=r?de(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bs=Symbol("radix.slottable");function Cs(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bs}function Es(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ss(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)}var lt="Dialog",[tr]=pe(lt),[Rs,q]=tr(lt),nr=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=c.useRef(null),u=c.useRef(null),[l,f]=je({prop:r,defaultProp:o??!1,onChange:i,caller:lt});return v.jsx(Rs,{scope:t,triggerRef:s,contentRef:u,contentId:Se(),titleId:Se(),descriptionId:Se(),open:l,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};nr.displayName=lt;var rr="DialogTrigger",Ps=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(rr,n),i=$(t,o.triggerRef);return v.jsx(k.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Kt(o.open),...r,ref:i,onClick:A(e.onClick,o.onOpenToggle)})});Ps.displayName=rr;var Ht="DialogPortal",[As,or]=tr(Ht,{forceMount:void 0}),ir=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=q(Ht,t);return v.jsx(As,{scope:t,forceMount:n,children:c.Children.map(r,a=>v.jsx(se,{present:n||i.open,children:v.jsx(Vt,{asChild:!0,container:o,children:a})}))})};ir.displayName=Ht;var tt="DialogOverlay",sr=c.forwardRef((e,t)=>{const n=or(tt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=q(tt,e.__scopeDialog);return i.modal?v.jsx(se,{present:r||i.open,children:v.jsx(Ms,{...o,ref:t})}):null});sr.displayName=tt;var _s=ws("DialogOverlay.RemoveScroll"),Ms=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(tt,n);return v.jsx(Ut,{as:_s,allowPinchZoom:!0,shards:[o.contentRef],children:v.jsx(k.div,{"data-state":Kt(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ge="DialogContent",cr=c.forwardRef((e,t)=>{const n=or(ge,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=q(ge,e.__scopeDialog);return v.jsx(se,{present:r||i.open,children:i.modal?v.jsx(Os,{...o,ref:t}):v.jsx(Ds,{...o,ref:t})})});cr.displayName=ge;var Os=c.forwardRef((e,t)=>{const n=q(ge,e.__scopeDialog),r=c.useRef(null),o=$(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return er(i)},[]),v.jsx(ar,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:A(e.onFocusOutside,i=>i.preventDefault())})}),Ds=c.forwardRef((e,t)=>{const n=q(ge,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return v.jsx(ar,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ar=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=q(ge,n),u=c.useRef(null),l=$(t,u);return Gn(),v.jsxs(v.Fragment,{children:[v.jsx(Bt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:v.jsx(Wt,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Kt(s.open),...a,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(Ts,{titleId:s.titleId}),v.jsx(Ns,{contentRef:u,descriptionId:s.descriptionId})]})]})}),Gt="DialogTitle",lr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(Gt,n);return v.jsx(k.h2,{id:o.titleId,...r,ref:t})});lr.displayName=Gt;var ur="DialogDescription",fr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(ur,n);return v.jsx(k.p,{id:o.descriptionId,...r,ref:t})});fr.displayName=ur;var dr="DialogClose",pr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=q(dr,n);return v.jsx(k.button,{type:"button",...r,ref:t,onClick:A(e.onClick,()=>o.onOpenChange(!1))})});pr.displayName=dr;function Kt(e){return e?"open":"closed"}var mr="DialogTitleWarning",[iu,hr]=ti(mr,{contentName:ge,titleName:Gt,docsSlug:"dialog"}),Ts=({titleId:e})=>{const t=hr(mr),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Is="DialogDescriptionWarning",Ns=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hr(Is).contentName}}.`;return c.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},su=nr,cu=ir,au=sr,lu=cr,uu=lr,fu=fr,du=pr,ks=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ls=ks.reduce((e,t)=>{const n=$t(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Fs="Label",vr=c.forwardRef((e,t)=>v.jsx(Ls.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vr.displayName=Fs;var pu=vr;function Pn(e){const t=js(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(Ws);if(u){const l=u.props.children,f=s.map(d=>d===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return v.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return v.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function js(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=Vs(o),s=Bs(i,o.props);return o.type!==c.Fragment&&(s.ref=r?de(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $s=Symbol("radix.slottable");function Ws(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$s}function Bs(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Vs(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)}function gr(e){const t=e+"CollectionProvider",[n,r]=pe(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:y,children:w}=m,x=ve.useRef(null),b=ve.useRef(new Map).current;return v.jsx(o,{scope:y,itemMap:b,collectionRef:x,children:w})};a.displayName=t;const s=e+"CollectionSlot",u=Pn(s),l=ve.forwardRef((m,y)=>{const{scope:w,children:x}=m,b=i(s,w),C=$(y,b.collectionRef);return v.jsx(u,{ref:C,children:x})});l.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Pn(f),h=ve.forwardRef((m,y)=>{const{scope:w,children:x,...b}=m,C=ve.useRef(null),E=$(y,C),P=i(f,w);return ve.useEffect(()=>(P.itemMap.set(C,{ref:C,...b}),()=>{P.itemMap.delete(C)})),v.jsx(p,{[d]:"",ref:E,children:x})});h.displayName=f;function g(m){const y=i(e+"CollectionConsumer",m);return ve.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((P,S)=>b.indexOf(P.ref.current)-b.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},g,r]}var Us=c.createContext(void 0);function yr(e){const t=c.useContext(Us);return e||t||"ltr"}const Hs=["top","right","bottom","left"],ue=Math.min,G=Math.max,nt=Math.round,qe=Math.floor,ee=e=>({x:e,y:e}),Gs={left:"right",right:"left",bottom:"top",top:"bottom"},Ks={start:"end",end:"start"};function Tt(e,t,n){return G(e,ue(t,n))}function oe(e,t){return typeof e=="function"?e(t):e}function ie(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function zt(e){return e==="x"?"y":"x"}function Yt(e){return e==="y"?"height":"width"}const zs=new Set(["top","bottom"]);function J(e){return zs.has(ie(e))?"y":"x"}function Xt(e){return zt(J(e))}function Ys(e,t,n){n===void 0&&(n=!1);const r=_e(e),o=Xt(e),i=Yt(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=rt(a)),[a,rt(a)]}function Xs(e){const t=rt(e);return[It(e),t,It(t)]}function It(e){return e.replace(/start|end/g,t=>Ks[t])}const An=["left","right"],_n=["right","left"],qs=["top","bottom"],Zs=["bottom","top"];function Qs(e,t,n){switch(e){case"top":case"bottom":return n?t?_n:An:t?An:_n;case"left":case"right":return t?qs:Zs;default:return[]}}function Js(e,t,n,r){const o=_e(e);let i=Qs(ie(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(It)))),i}function rt(e){return e.replace(/left|right|bottom|top/g,t=>Gs[t])}function ec(e){return{top:0,right:0,bottom:0,left:0,...e}}function wr(e){return typeof e!="number"?ec(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Mn(e,t,n){let{reference:r,floating:o}=e;const i=J(t),a=Xt(t),s=Yt(a),u=ie(t),l=i==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(u){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(_e(t)){case"start":h[a]-=p*(n&&l?-1:1);break;case"end":h[a]+=p*(n&&l?-1:1);break}return h}const tc=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Mn(l,r,u),p=r,h={},g=0;for(let m=0;m<s.length;m++){const{name:y,fn:w}=s[m],{x,y:b,data:C,reset:E}=await w({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});f=x??f,d=b??d,h={...h,[y]:{...h[y],...C}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(l=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:f,y:d}=Mn(l,p,u)),m=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};async function Ne(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=oe(t,e),g=wr(h),y=s[p?d==="floating"?"reference":"floating":d],w=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:f,strategy:u})),x=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},E=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:b,strategy:u}):x);return{top:(w.top-E.top+g.top)/C.y,bottom:(E.bottom-w.bottom+g.bottom)/C.y,left:(w.left-E.left+g.left)/C.x,right:(E.right-w.right+g.right)/C.x}}const nc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:f=0}=oe(e,t)||{};if(l==null)return{};const d=wr(f),p={x:n,y:r},h=Xt(o),g=Yt(h),m=await a.getDimensions(l),y=h==="y",w=y?"top":"left",x=y?"bottom":"right",b=y?"clientHeight":"clientWidth",C=i.reference[g]+i.reference[h]-p[h]-i.floating[g],E=p[h]-i.reference[h],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let S=P?P[b]:0;(!S||!await(a.isElement==null?void 0:a.isElement(P)))&&(S=s.floating[b]||i.floating[g]);const _=C/2-E/2,T=S/2-m[g]/2-1,O=ue(d[w],T),I=ue(d[x],T),L=O,F=S-m[g]-I,N=S/2-m[g]/2+_,B=Tt(L,N,F),D=!u.arrow&&_e(o)!=null&&N!==B&&i.reference[g]/2-(N<L?O:I)-m[g]/2<0,j=D?N<L?N-L:N-F:0;return{[h]:p[h]+j,data:{[h]:B,centerOffset:N-B-j,...D&&{alignmentOffset:j}},reset:D}}}),rc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...y}=oe(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=ie(o),x=J(s),b=ie(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(l.floating)),E=p||(b||!m?[rt(s)]:Xs(s)),P=g!=="none";!p&&P&&E.push(...Js(s,m,g,C));const S=[s,...E],_=await Ne(t,y),T=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&T.push(_[w]),d){const N=Ys(o,a,C);T.push(_[N[0]],_[N[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(N=>N<=0)){var I,L;const N=(((I=i.flip)==null?void 0:I.index)||0)+1,B=S[N];if(B&&(!(d==="alignment"?x!==J(B):!1)||O.every(M=>J(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:N,overflows:O},reset:{placement:B}};let D=(L=O.filter(j=>j.overflows[0]<=0).sort((j,M)=>j.overflows[1]-M.overflows[1])[0])==null?void 0:L.placement;if(!D)switch(h){case"bestFit":{var F;const j=(F=O.filter(M=>{if(P){const R=J(M.placement);return R===x||R==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(R=>R>0).reduce((R,V)=>R+V,0)]).sort((M,R)=>M[1]-R[1])[0])==null?void 0:F[0];j&&(D=j);break}case"initialPlacement":D=s;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function On(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Dn(e){return Hs.some(t=>e[t]>=0)}const oc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=oe(e,t);switch(r){case"referenceHidden":{const i=await Ne(t,{...o,elementContext:"reference"}),a=On(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Dn(a)}}}case"escaped":{const i=await Ne(t,{...o,altBoundary:!0}),a=On(i,n.floating);return{data:{escapedOffsets:a,escaped:Dn(a)}}}default:return{}}}}},xr=new Set(["left","top"]);async function ic(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=ie(n),s=_e(n),u=J(n)==="y",l=xr.has(a)?-1:1,f=i&&u?-1:1,d=oe(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),u?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const sc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await ic(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},cc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...u}=oe(e,t),l={x:n,y:r},f=await Ne(t,u),d=J(ie(o)),p=zt(d);let h=l[p],g=l[d];if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=h+f[y],b=h-f[w];h=Tt(x,h,b)}if(a){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",x=g+f[y],b=g-f[w];g=Tt(x,g,b)}const m=s.fn({...t,[p]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},ac=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=oe(e,t),f={x:n,y:r},d=J(o),p=zt(d);let h=f[p],g=f[d];const m=oe(s,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const b=p==="y"?"height":"width",C=i.reference[p]-i.floating[b]+y.mainAxis,E=i.reference[p]+i.reference[b]-y.mainAxis;h<C?h=C:h>E&&(h=E)}if(l){var w,x;const b=p==="y"?"width":"height",C=xr.has(ie(o)),E=i.reference[d]-i.floating[b]+(C&&((w=a.offset)==null?void 0:w[d])||0)+(C?0:y.crossAxis),P=i.reference[d]+i.reference[b]+(C?0:((x=a.offset)==null?void 0:x[d])||0)-(C?y.crossAxis:0);g<E?g=E:g>P&&(g=P)}return{[p]:h,[d]:g}}}},lc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...l}=oe(e,t),f=await Ne(t,l),d=ie(o),p=_e(o),h=J(o)==="y",{width:g,height:m}=i.floating;let y,w;d==="top"||d==="bottom"?(y=d,w=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,y=p==="end"?"top":"bottom");const x=m-f.top-f.bottom,b=g-f.left-f.right,C=ue(m-f[y],x),E=ue(g-f[w],b),P=!t.middlewareData.shift;let S=C,_=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=x),P&&!p){const O=G(f.left,0),I=G(f.right,0),L=G(f.top,0),F=G(f.bottom,0);h?_=g-2*(O!==0||I!==0?O+I:G(f.left,f.right)):S=m-2*(L!==0||F!==0?L+F:G(f.top,f.bottom))}await u({...t,availableWidth:_,availableHeight:S});const T=await a.getDimensions(s.floating);return g!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function Me(e){return br(e)?(e.nodeName||"").toLowerCase():"#document"}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ne(e){var t;return(t=(br(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function br(e){return ut()?e instanceof Node||e instanceof K(e).Node:!1}function Y(e){return ut()?e instanceof Element||e instanceof K(e).Element:!1}function te(e){return ut()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function Tn(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}const uc=new Set(["inline","contents"]);function $e(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!uc.has(o)}const fc=new Set(["table","td","th"]);function dc(e){return fc.has(Me(e))}const pc=[":popover-open",":modal"];function ft(e){return pc.some(t=>{try{return e.matches(t)}catch{return!1}})}const mc=["transform","translate","scale","rotate","perspective"],hc=["transform","translate","scale","rotate","perspective","filter"],vc=["paint","layout","strict","content"];function qt(e){const t=Zt(),n=Y(e)?X(e):e;return mc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hc.some(r=>(n.willChange||"").includes(r))||vc.some(r=>(n.contain||"").includes(r))}function gc(e){let t=fe(e);for(;te(t)&&!Ae(t);){if(qt(t))return t;if(ft(t))return null;t=fe(t)}return null}function Zt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yc=new Set(["html","body","#document"]);function Ae(e){return yc.has(Me(e))}function X(e){return K(e).getComputedStyle(e)}function dt(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(Me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tn(e)&&e.host||ne(e);return Tn(t)?t.host:t}function Cr(e){const t=fe(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:te(t)&&$e(t)?t:Cr(t)}function ke(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cr(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=K(o);if(i){const s=Nt(a);return t.concat(a,a.visualViewport||[],$e(o)?o:[],s&&n?ke(s):[])}return t.concat(o,ke(o,[],n))}function Nt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Er(e){const t=X(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=te(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=nt(n)!==i||nt(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Qt(e){return Y(e)?e:e.contextElement}function Pe(e){const t=Qt(e);if(!te(t))return ee(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Er(t);let a=(i?nt(n.width):n.width)/r,s=(i?nt(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const wc=ee(0);function Sr(e){const t=K(e);return!Zt()||!t.visualViewport?wc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==K(e)?!1:t}function ye(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qt(e);let a=ee(1);t&&(r?Y(r)&&(a=Pe(r)):a=Pe(e));const s=xc(i,n,r)?Sr(i):ee(0);let u=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(i){const p=K(i),h=r&&Y(r)?K(r):r;let g=p,m=Nt(g);for(;m&&r&&h!==g;){const y=Pe(m),w=m.getBoundingClientRect(),x=X(m),b=w.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,C=w.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,l*=y.y,f*=y.x,d*=y.y,u+=b,l+=C,g=K(m),m=Nt(g)}}return ot({width:f,height:d,x:u,y:l})}function pt(e,t){const n=dt(e).scrollLeft;return t?t.left+n:ye(ne(e)).left+n}function Rr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function bc(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=ne(r),s=t?ft(t.floating):!1;if(r===a||s&&i)return n;let u={scrollLeft:0,scrollTop:0},l=ee(1);const f=ee(0),d=te(r);if((d||!d&&!i)&&((Me(r)!=="body"||$e(a))&&(u=dt(r)),te(r))){const h=ye(r);l=Pe(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=a&&!d&&!i?Rr(a,u):ee(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-u.scrollTop*l.y+f.y+p.y}}function Cc(e){return Array.from(e.getClientRects())}function Ec(e){const t=ne(e),n=dt(e),r=e.ownerDocument.body,o=G(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=G(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pt(e);const s=-n.scrollTop;return X(r).direction==="rtl"&&(a+=G(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const In=25;function Sc(e,t){const n=K(e),r=ne(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const f=Zt();(!f||f&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}const l=pt(r);if(l<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-h);g<=In&&(i-=g)}else l<=In&&(i+=l);return{width:i,height:a,x:s,y:u}}const Rc=new Set(["absolute","fixed"]);function Pc(e,t){const n=ye(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=te(e)?Pe(e):ee(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,l=r*i.y;return{width:a,height:s,x:u,y:l}}function Nn(e,t,n){let r;if(t==="viewport")r=Sc(e,n);else if(t==="document")r=Ec(ne(e));else if(Y(t))r=Pc(t,n);else{const o=Sr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(r)}function Pr(e,t){const n=fe(e);return n===t||!Y(n)||Ae(n)?!1:X(n).position==="fixed"||Pr(n,t)}function Ac(e,t){const n=t.get(e);if(n)return n;let r=ke(e,[],!1).filter(s=>Y(s)&&Me(s)!=="body"),o=null;const i=X(e).position==="fixed";let a=i?fe(e):e;for(;Y(a)&&!Ae(a);){const s=X(a),u=qt(a);!u&&s.position==="fixed"&&(o=null),(i?!u&&!o:!u&&s.position==="static"&&!!o&&Rc.has(o.position)||$e(a)&&!u&&Pr(e,a))?r=r.filter(f=>f!==a):o=s,a=fe(a)}return t.set(e,r),r}function _c(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?ft(t)?[]:Ac(t,this._c):[].concat(n),r],s=a[0],u=a.reduce((l,f)=>{const d=Nn(t,f,o);return l.top=G(d.top,l.top),l.right=ue(d.right,l.right),l.bottom=ue(d.bottom,l.bottom),l.left=G(d.left,l.left),l},Nn(t,s,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Mc(e){const{width:t,height:n}=Er(e);return{width:t,height:n}}function Oc(e,t,n){const r=te(t),o=ne(t),i=n==="fixed",a=ye(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=ee(0);function l(){u.x=pt(o)}if(r||!r&&!i)if((Me(t)!=="body"||$e(o))&&(s=dt(t)),r){const h=ye(t,!0,i,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&l();i&&!r&&o&&l();const f=o&&!r&&!i?Rr(o,s):ee(0),d=a.left+s.scrollLeft-u.x-f.x,p=a.top+s.scrollTop-u.y-f.y;return{x:d,y:p,width:a.width,height:a.height}}function At(e){return X(e).position==="static"}function kn(e,t){if(!te(e)||X(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ne(e)===n&&(n=n.ownerDocument.body),n}function Ar(e,t){const n=K(e);if(ft(e))return n;if(!te(e)){let o=fe(e);for(;o&&!Ae(o);){if(Y(o)&&!At(o))return o;o=fe(o)}return n}let r=kn(e,t);for(;r&&dc(r)&&At(r);)r=kn(r,t);return r&&Ae(r)&&At(r)&&!qt(r)?n:r||gc(e)||n}const Dc=async function(e){const t=this.getOffsetParent||Ar,n=this.getDimensions,r=await n(e.floating);return{reference:Oc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tc(e){return X(e).direction==="rtl"}const Ic={convertOffsetParentRelativeRectToViewportRelativeRect:bc,getDocumentElement:ne,getClippingRect:_c,getOffsetParent:Ar,getElementRects:Dc,getClientRects:Cc,getDimensions:Mc,getScale:Pe,isElement:Y,isRTL:Tc};function _r(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nc(e,t){let n=null,r;const o=ne(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),i();const l=e.getBoundingClientRect(),{left:f,top:d,width:p,height:h}=l;if(s||t(),!p||!h)return;const g=qe(d),m=qe(o.clientWidth-(f+p)),y=qe(o.clientHeight-(d+h)),w=qe(f),b={rootMargin:-g+"px "+-m+"px "+-y+"px "+-w+"px",threshold:G(0,ue(1,u))||1};let C=!0;function E(P){const S=P[0].intersectionRatio;if(S!==u){if(!C)return a();S?a(!1,S):r=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!_r(l,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return a(!0),i}function kc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Qt(e),f=o||i?[...l?ke(l):[],...ke(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=l&&s?Nc(l,n):null;let p=-1,h=null;a&&(h=new ResizeObserver(w=>{let[x]=w;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let g,m=u?ye(e):null;u&&y();function y(){const w=ye(e);m&&!_r(m,w)&&n(),m=w,g=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d?.(),(w=h)==null||w.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const Lc=sc,Fc=cc,jc=rc,$c=lc,Wc=oc,Ln=nc,Bc=ac,Vc=(e,t,n)=>{const r=new Map,o={platform:Ic,...n},i={...o.platform,_c:r};return tc(e,t,{...o,platform:i})};var Uc=typeof document<"u",Hc=function(){},Je=Uc?c.useLayoutEffect:Hc;function it(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,o;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(!it(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!it(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Mr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fn(e,t){const n=Mr(e);return Math.round(t*n)/n}function _t(e){const t=c.useRef(e);return Je(()=>{t.current=e}),t}function Gc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[f,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=c.useState(r);it(p,r)||h(r);const[g,m]=c.useState(null),[y,w]=c.useState(null),x=c.useCallback(M=>{M!==P.current&&(P.current=M,m(M))},[]),b=c.useCallback(M=>{M!==S.current&&(S.current=M,w(M))},[]),C=i||g,E=a||y,P=c.useRef(null),S=c.useRef(null),_=c.useRef(f),T=u!=null,O=_t(u),I=_t(o),L=_t(l),F=c.useCallback(()=>{if(!P.current||!S.current)return;const M={placement:t,strategy:n,middleware:p};I.current&&(M.platform=I.current),Vc(P.current,S.current,M).then(R=>{const V={...R,isPositioned:L.current!==!1};N.current&&!it(_.current,V)&&(_.current=V,jt.flushSync(()=>{d(V)}))})},[p,t,n,I,L]);Je(()=>{l===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[l]);const N=c.useRef(!1);Je(()=>(N.current=!0,()=>{N.current=!1}),[]),Je(()=>{if(C&&(P.current=C),E&&(S.current=E),C&&E){if(O.current)return O.current(C,E,F);F()}},[C,E,F,O,T]);const B=c.useMemo(()=>({reference:P,floating:S,setReference:x,setFloating:b}),[x,b]),D=c.useMemo(()=>({reference:C,floating:E}),[C,E]),j=c.useMemo(()=>{const M={position:n,left:0,top:0};if(!D.floating)return M;const R=Fn(D.floating,f.x),V=Fn(D.floating,f.y);return s?{...M,transform:"translate("+R+"px, "+V+"px)",...Mr(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:V}},[n,s,D.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:F,refs:B,elements:D,floatingStyles:j}),[f,F,B,D,j])}const Kc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ln({element:r.current,padding:o}).fn(n):{}:r?Ln({element:r,padding:o}).fn(n):{}}}},zc=(e,t)=>({...Lc(e),options:[e,t]}),Yc=(e,t)=>({...Fc(e),options:[e,t]}),Xc=(e,t)=>({...Bc(e),options:[e,t]}),qc=(e,t)=>({...jc(e),options:[e,t]}),Zc=(e,t)=>({...$c(e),options:[e,t]}),Qc=(e,t)=>({...Wc(e),options:[e,t]}),Jc=(e,t)=>({...Kc(e),options:[e,t]});var ea="Arrow",Or=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return v.jsx(k.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Or.displayName=ea;var ta=Or;function Jt(e){const[t,n]=c.useState(void 0);return le(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const u=i.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var en="Popper",[Dr,Tr]=pe(en),[na,Ir]=Dr(en),Nr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return v.jsx(na,{scope:t,anchor:r,onAnchorChange:o,children:n})};Nr.displayName=en;var kr="PopperAnchor",Lr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Ir(kr,n),a=c.useRef(null),s=$(t,a),u=c.useRef(null);return c.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&i.onAnchorChange(u.current)}),r?null:v.jsx(k.div,{...o,ref:s})});Lr.displayName=kr;var tn="PopperContent",[ra,oa]=Dr(tn),Fr=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...m}=e,y=Ir(tn,n),[w,x]=c.useState(null),b=$(t,W=>x(W)),[C,E]=c.useState(null),P=Jt(C),S=P?.width??0,_=P?.height??0,T=r+(i!=="center"?"-"+i:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(l)?l:[l],L=I.length>0,F={padding:O,boundary:I.filter(sa),altBoundary:L},{refs:N,floatingStyles:B,placement:D,isPositioned:j,middlewareData:M}=Gc({strategy:"fixed",placement:T,whileElementsMounted:(...W)=>kc(...W,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[zc({mainAxis:o+_,alignmentAxis:a}),u&&Yc({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Xc():void 0,...F}),u&&qc({...F}),Zc({...F,apply:({elements:W,rects:Te,availableWidth:$o,availableHeight:Wo})=>{const{width:Bo,height:Vo}=Te.reference,He=W.floating.style;He.setProperty("--radix-popper-available-width",`${$o}px`),He.setProperty("--radix-popper-available-height",`${Wo}px`),He.setProperty("--radix-popper-anchor-width",`${Bo}px`),He.setProperty("--radix-popper-anchor-height",`${Vo}px`)}}),C&&Jc({element:C,padding:s}),ca({arrowWidth:S,arrowHeight:_}),p&&Qc({strategy:"referenceHidden",...F})]}),[R,V]=Wr(D),Z=re(g);le(()=>{j&&Z?.()},[j,Z]);const me=M.arrow?.x,Oe=M.arrow?.y,De=M.arrow?.centerOffset!==0,[Ue,he]=c.useState();return le(()=>{w&&he(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:j?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ue,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(ra,{scope:n,placedSide:R,onArrowChange:E,arrowX:me,arrowY:Oe,shouldHideArrow:De,children:v.jsx(k.div,{"data-side":R,"data-align":V,...m,ref:b,style:{...m.style,animation:j?void 0:"none"}})})})});Fr.displayName=tn;var jr="PopperArrow",ia={top:"bottom",right:"left",bottom:"top",left:"right"},$r=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=oa(jr,r),a=ia[i.placedSide];return v.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:v.jsx(ta,{...o,ref:n,style:{...o.style,display:"block"}})})});$r.displayName=jr;function sa(e){return e!==null}var ca=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,f]=Wr(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+u/2;let g="",m="";return l==="bottom"?(g=a?d:`${p}px`,m=`${-u}px`):l==="top"?(g=a?d:`${p}px`,m=`${r.floating.height+u}px`):l==="right"?(g=`${-u}px`,m=a?d:`${h}px`):l==="left"&&(g=`${r.floating.width+u}px`,m=a?d:`${h}px`),{data:{x:g,y:m}}}});function Wr(e){const[t,n="center"]=e.split("-");return[t,n]}var aa=Nr,la=Lr,ua=Fr,fa=$r,Mt="rovingFocusGroup.onEntryFocus",da={bubbles:!1,cancelable:!0},We="RovingFocusGroup",[kt,Br,pa]=gr(We),[ma,Vr]=pe(We,[pa]),[ha,va]=ma(We),Ur=c.forwardRef((e,t)=>v.jsx(kt.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(kt.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(ga,{...e,ref:t})})}));Ur.displayName=We;var ga=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=e,p=c.useRef(null),h=$(t,p),g=yr(i),[m,y]=je({prop:a,defaultProp:s??null,onChange:u,caller:We}),[w,x]=c.useState(!1),b=re(l),C=Br(n),E=c.useRef(!1),[P,S]=c.useState(0);return c.useEffect(()=>{const _=p.current;if(_)return _.addEventListener(Mt,b),()=>_.removeEventListener(Mt,b)},[b]),v.jsx(ha,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:m,onItemFocus:c.useCallback(_=>y(_),[y]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>S(_=>_+1),[]),onFocusableItemRemove:c.useCallback(()=>S(_=>_-1),[]),children:v.jsx(k.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{E.current=!0}),onFocus:A(e.onFocus,_=>{const T=!E.current;if(_.target===_.currentTarget&&T&&!w){const O=new CustomEvent(Mt,da);if(_.currentTarget.dispatchEvent(O),!O.defaultPrevented){const I=C().filter(D=>D.focusable),L=I.find(D=>D.active),F=I.find(D=>D.id===m),B=[L,F,...I].filter(Boolean).map(D=>D.ref.current);Kr(B,f)}}E.current=!1}),onBlur:A(e.onBlur,()=>x(!1))})})}),Hr="RovingFocusGroupItem",Gr=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...s}=e,u=Se(),l=i||u,f=va(Hr,n),d=f.currentTabStopId===l,p=Br(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:m}=f;return c.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),v.jsx(kt.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:v.jsx(k.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:A(e.onMouseDown,y=>{r?f.onItemFocus(l):y.preventDefault()}),onFocus:A(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:A(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=xa(y,f.orientation,f.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=p().filter(C=>C.focusable).map(C=>C.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const C=b.indexOf(y.currentTarget);b=f.loop?ba(b,C+1):b.slice(C+1)}setTimeout(()=>Kr(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:m!=null}):a})})});Gr.displayName=Hr;var ya={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wa(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xa(e,t,n){const r=wa(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ya[r]}function Kr(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ba(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ca=Ur,Ea=Gr;function Sa(e){const t=Ra(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(Aa);if(u){const l=u.props.children,f=s.map(d=>d===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return v.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return v.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ra(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=Ma(o),s=_a(i,o.props);return o.type!==c.Fragment&&(s.ref=r?de(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pa=Symbol("radix.slottable");function Aa(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pa}function _a(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ma(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)}var Lt=["Enter"," "],Oa=["ArrowDown","PageUp","Home"],zr=["ArrowUp","PageDown","End"],Da=[...Oa,...zr],Ta={ltr:[...Lt,"ArrowRight"],rtl:[...Lt,"ArrowLeft"]},Ia={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Be="Menu",[Le,Na,ka]=gr(Be),[we,Yr]=pe(Be,[ka,Tr,Vr]),mt=Tr(),Xr=Vr(),[La,xe]=we(Be),[Fa,Ve]=we(Be),qr=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=mt(t),[u,l]=c.useState(null),f=c.useRef(!1),d=re(i),p=yr(o);return c.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),v.jsx(aa,{...s,children:v.jsx(La,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:v.jsx(Fa,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};qr.displayName=Be;var ja="MenuAnchor",nn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=mt(n);return v.jsx(la,{...o,...r,ref:t})});nn.displayName=ja;var rn="MenuPortal",[$a,Zr]=we(rn,{forceMount:void 0}),Qr=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=xe(rn,t);return v.jsx($a,{scope:t,forceMount:n,children:v.jsx(se,{present:n||i.open,children:v.jsx(Vt,{asChild:!0,container:o,children:r})})})};Qr.displayName=rn;var z="MenuContent",[Wa,on]=we(z),Jr=c.forwardRef((e,t)=>{const n=Zr(z,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=xe(z,e.__scopeMenu),a=Ve(z,e.__scopeMenu);return v.jsx(Le.Provider,{scope:e.__scopeMenu,children:v.jsx(se,{present:r||i.open,children:v.jsx(Le.Slot,{scope:e.__scopeMenu,children:a.modal?v.jsx(Ba,{...o,ref:t}):v.jsx(Va,{...o,ref:t})})})})}),Ba=c.forwardRef((e,t)=>{const n=xe(z,e.__scopeMenu),r=c.useRef(null),o=$(t,r);return c.useEffect(()=>{const i=r.current;if(i)return er(i)},[]),v.jsx(sn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:A(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Va=c.forwardRef((e,t)=>{const n=xe(z,e.__scopeMenu);return v.jsx(sn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ua=Sa("MenuContent.ScrollLock"),sn=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...m}=e,y=xe(z,n),w=Ve(z,n),x=mt(n),b=Xr(n),C=Na(n),[E,P]=c.useState(null),S=c.useRef(null),_=$(t,S,y.onContentChange),T=c.useRef(0),O=c.useRef(""),I=c.useRef(0),L=c.useRef(null),F=c.useRef("right"),N=c.useRef(0),B=g?Ut:c.Fragment,D=g?{as:Ua,allowPinchZoom:!0}:void 0,j=R=>{const V=O.current+R,Z=C().filter(W=>!W.disabled),me=document.activeElement,Oe=Z.find(W=>W.ref.current===me)?.textValue,De=Z.map(W=>W.textValue),Ue=tl(De,V,Oe),he=Z.find(W=>W.textValue===Ue)?.ref.current;(function W(Te){O.current=Te,window.clearTimeout(T.current),Te!==""&&(T.current=window.setTimeout(()=>W(""),1e3))})(V),he&&setTimeout(()=>he.focus())};c.useEffect(()=>()=>window.clearTimeout(T.current),[]),Gn();const M=c.useCallback(R=>F.current===L.current?.side&&rl(R,L.current?.area),[]);return v.jsx(Wa,{scope:n,searchRef:O,onItemEnter:c.useCallback(R=>{M(R)&&R.preventDefault()},[M]),onItemLeave:c.useCallback(R=>{M(R)||(S.current?.focus(),P(null))},[M]),onTriggerLeave:c.useCallback(R=>{M(R)&&R.preventDefault()},[M]),pointerGraceTimerRef:I,onPointerGraceIntentChange:c.useCallback(R=>{L.current=R},[]),children:v.jsx(B,{...D,children:v.jsx(Bt,{asChild:!0,trapped:o,onMountAutoFocus:A(i,R=>{R.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:v.jsx(Wt,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:v.jsx(Ca,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:A(u,R=>{w.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(ua,{role:"menu","aria-orientation":"vertical","data-state":vo(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...m,ref:_,style:{outline:"none",...m.style},onKeyDown:A(m.onKeyDown,R=>{const Z=R.target.closest("[data-radix-menu-content]")===R.currentTarget,me=R.ctrlKey||R.altKey||R.metaKey,Oe=R.key.length===1;Z&&(R.key==="Tab"&&R.preventDefault(),!me&&Oe&&j(R.key));const De=S.current;if(R.target!==De||!Da.includes(R.key))return;R.preventDefault();const he=C().filter(W=>!W.disabled).map(W=>W.ref.current);zr.includes(R.key)&&he.reverse(),Ja(he)}),onBlur:A(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(T.current),O.current="")}),onPointerMove:A(e.onPointerMove,Fe(R=>{const V=R.target,Z=N.current!==R.clientX;if(R.currentTarget.contains(V)&&Z){const me=R.clientX>N.current?"right":"left";F.current=me,N.current=R.clientX}}))})})})})})})});Jr.displayName=z;var Ha="MenuGroup",cn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(k.div,{role:"group",...r,ref:t})});cn.displayName=Ha;var Ga="MenuLabel",eo=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(k.div,{...r,ref:t})});eo.displayName=Ga;var st="MenuItem",jn="menu.itemSelect",ht=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=c.useRef(null),a=Ve(st,e.__scopeMenu),s=on(st,e.__scopeMenu),u=$(t,i),l=c.useRef(!1),f=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(jn,{bubbles:!0,cancelable:!0});d.addEventListener(jn,h=>r?.(h),{once:!0}),Bn(d,p),p.defaultPrevented?l.current=!1:a.onClose()}};return v.jsx(to,{...o,ref:u,disabled:n,onClick:A(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:A(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:A(e.onKeyDown,d=>{const p=s.searchRef.current!=="";n||p&&d.key===" "||Lt.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ht.displayName=st;var to=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=on(st,n),s=Xr(n),u=c.useRef(null),l=$(t,u),[f,d]=c.useState(!1),[p,h]=c.useState("");return c.useEffect(()=>{const g=u.current;g&&h((g.textContent??"").trim())},[i.children]),v.jsx(Le.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:v.jsx(Ea,{asChild:!0,...s,focusable:!r,children:v.jsx(k.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:l,onPointerMove:A(e.onPointerMove,Fe(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:A(e.onPointerLeave,Fe(g=>a.onItemLeave(g))),onFocus:A(e.onFocus,()=>d(!0)),onBlur:A(e.onBlur,()=>d(!1))})})})}),Ka="MenuCheckboxItem",no=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return v.jsx(co,{scope:e.__scopeMenu,checked:n,children:v.jsx(ht,{role:"menuitemcheckbox","aria-checked":ct(n)?"mixed":n,...o,ref:t,"data-state":ln(n),onSelect:A(o.onSelect,()=>r?.(ct(n)?!0:!n),{checkForDefaultPrevented:!1})})})});no.displayName=Ka;var ro="MenuRadioGroup",[za,Ya]=we(ro,{value:void 0,onValueChange:()=>{}}),oo=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=re(r);return v.jsx(za,{scope:e.__scopeMenu,value:n,onValueChange:i,children:v.jsx(cn,{...o,ref:t})})});oo.displayName=ro;var io="MenuRadioItem",so=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ya(io,e.__scopeMenu),i=n===o.value;return v.jsx(co,{scope:e.__scopeMenu,checked:i,children:v.jsx(ht,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":ln(i),onSelect:A(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});so.displayName=io;var an="MenuItemIndicator",[co,Xa]=we(an,{checked:!1}),ao=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Xa(an,n);return v.jsx(se,{present:r||ct(i.checked)||i.checked===!0,children:v.jsx(k.span,{...o,ref:t,"data-state":ln(i.checked)})})});ao.displayName=an;var qa="MenuSeparator",lo=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(k.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});lo.displayName=qa;var Za="MenuArrow",uo=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=mt(n);return v.jsx(fa,{...o,...r,ref:t})});uo.displayName=Za;var Qa="MenuSub",[mu,fo]=we(Qa),Ie="MenuSubTrigger",po=c.forwardRef((e,t)=>{const n=xe(Ie,e.__scopeMenu),r=Ve(Ie,e.__scopeMenu),o=fo(Ie,e.__scopeMenu),i=on(Ie,e.__scopeMenu),a=c.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=i,l={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),u(null)}},[s,u]),v.jsx(nn,{asChild:!0,...l,children:v.jsx(to,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":vo(n.open),...e,ref:de(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:A(e.onPointerMove,Fe(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:A(e.onPointerLeave,Fe(d=>{f();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,g=h==="right",m=g?-5:5,y=p[g?"left":"right"],w=p[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:y,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:y,y:p.bottom}],side:h}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:A(e.onKeyDown,d=>{const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||Ta[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});po.displayName=Ie;var mo="MenuSubContent",ho=c.forwardRef((e,t)=>{const n=Zr(z,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=xe(z,e.__scopeMenu),a=Ve(z,e.__scopeMenu),s=fo(mo,e.__scopeMenu),u=c.useRef(null),l=$(t,u);return v.jsx(Le.Provider,{scope:e.__scopeMenu,children:v.jsx(se,{present:r||i.open,children:v.jsx(Le.Slot,{scope:e.__scopeMenu,children:v.jsx(sn,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:A(e.onFocusOutside,f=>{f.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:A(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:A(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),p=Ia[a.dir].includes(f.key);d&&p&&(i.onOpenChange(!1),s.trigger?.focus(),f.preventDefault())})})})})})});ho.displayName=mo;function vo(e){return e?"open":"closed"}function ct(e){return e==="indeterminate"}function ln(e){return ct(e)?"indeterminate":e?"checked":"unchecked"}function Ja(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function el(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tl(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=el(e,Math.max(i,0));o.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function nl(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],u=t[a],l=s.x,f=s.y,d=u.x,p=u.y;f>r!=p>r&&n<(d-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function rl(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nl(n,t)}function Fe(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ol=qr,il=nn,sl=Qr,cl=Jr,al=cn,ll=eo,ul=ht,fl=no,dl=oo,pl=so,ml=ao,hl=lo,vl=uo,gl=po,yl=ho,vt="DropdownMenu",[wl]=pe(vt,[Yr]),H=Yr(),[xl,go]=wl(vt),yo=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,u=H(t),l=c.useRef(null),[f,d]=je({prop:o,defaultProp:i??!1,onChange:a,caller:vt});return v.jsx(xl,{scope:t,triggerId:Se(),triggerRef:l,contentId:Se(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(p=>!p),[d]),modal:s,children:v.jsx(ol,{...u,open:f,onOpenChange:d,dir:r,modal:s,children:n})})};yo.displayName=vt;var wo="DropdownMenuTrigger",xo=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=go(wo,n),a=H(n);return v.jsx(il,{asChild:!0,...a,children:v.jsx(k.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:de(t,i.triggerRef),onPointerDown:A(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:A(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});xo.displayName=wo;var bl="DropdownMenuPortal",bo=e=>{const{__scopeDropdownMenu:t,...n}=e,r=H(t);return v.jsx(sl,{...r,...n})};bo.displayName=bl;var Co="DropdownMenuContent",Eo=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=go(Co,n),i=H(n),a=c.useRef(!1);return v.jsx(cl,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:A(e.onCloseAutoFocus,s=>{a.current||o.triggerRef.current?.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:A(e.onInteractOutside,s=>{const u=s.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;(!o.modal||f)&&(a.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)"}})});Eo.displayName=Co;var Cl="DropdownMenuGroup",El=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(al,{...o,...r,ref:t})});El.displayName=Cl;var Sl="DropdownMenuLabel",Rl=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(ll,{...o,...r,ref:t})});Rl.displayName=Sl;var Pl="DropdownMenuItem",So=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(ul,{...o,...r,ref:t})});So.displayName=Pl;var Al="DropdownMenuCheckboxItem",_l=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(fl,{...o,...r,ref:t})});_l.displayName=Al;var Ml="DropdownMenuRadioGroup",Ol=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(dl,{...o,...r,ref:t})});Ol.displayName=Ml;var Dl="DropdownMenuRadioItem",Tl=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(pl,{...o,...r,ref:t})});Tl.displayName=Dl;var Il="DropdownMenuItemIndicator",Nl=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(ml,{...o,...r,ref:t})});Nl.displayName=Il;var kl="DropdownMenuSeparator",Ro=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(hl,{...o,...r,ref:t})});Ro.displayName=kl;var Ll="DropdownMenuArrow",Fl=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(vl,{...o,...r,ref:t})});Fl.displayName=Ll;var jl="DropdownMenuSubTrigger",$l=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(gl,{...o,...r,ref:t})});$l.displayName=jl;var Wl="DropdownMenuSubContent",Bl=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=H(n);return v.jsx(yl,{...o,...r,ref:t,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)"}})});Bl.displayName=Wl;var hu=yo,vu=xo,gu=bo,yu=Eo,wu=So,xu=Ro;function Po(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var gt="Checkbox",[Vl]=pe(gt),[Ul,un]=Vl(gt);function Hl(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:u,required:l,value:f="on",internal_do_not_use_render:d}=e,[p,h]=je({prop:n,defaultProp:o??!1,onChange:u,caller:gt}),[g,m]=c.useState(null),[y,w]=c.useState(null),x=c.useRef(!1),b=g?!!a||!!g.closest("form"):!0,C={checked:p,disabled:i,setChecked:h,control:g,setControl:m,name:s,form:a,value:f,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:ae(o)?!1:o,isFormControl:b,bubbleInput:y,setBubbleInput:w};return v.jsx(Ul,{scope:t,...C,children:zl(d)?d(C):r})}var Ao="CheckboxTrigger",_o=c.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:u,required:l,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=un(Ao,e),m=$(o,f),y=c.useRef(u);return c.useEffect(()=>{const w=i?.form;if(w){const x=()=>d(y.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[i,d]),v.jsx(k.button,{type:"button",role:"checkbox","aria-checked":ae(u)?"mixed":u,"aria-required":l,"data-state":To(u),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:m,onKeyDown:A(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:A(n,w=>{d(x=>ae(x)?!0:!x),g&&h&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})})});_o.displayName=Ao;var Gl=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:u,onCheckedChange:l,form:f,...d}=e;return v.jsx(Hl,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:l,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>v.jsxs(v.Fragment,{children:[v.jsx(_o,{...d,ref:t,__scopeCheckbox:n}),p&&v.jsx(Do,{__scopeCheckbox:n})]})})});Gl.displayName=gt;var Mo="CheckboxIndicator",Kl=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=un(Mo,n);return v.jsx(se,{present:r||ae(i.checked)||i.checked===!0,children:v.jsx(k.span,{"data-state":To(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Kl.displayName=Mo;var Oo="CheckboxBubbleInput",Do=c.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:u,name:l,value:f,form:d,bubbleInput:p,setBubbleInput:h}=un(Oo,e),g=$(n,h),m=Po(i),y=Jt(r);c.useEffect(()=>{const x=p;if(!x)return;const b=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(b,"checked").set,P=!o.current;if(m!==i&&E){const S=new Event("click",{bubbles:P});x.indeterminate=ae(i),E.call(x,ae(i)?!1:i),x.dispatchEvent(S)}},[p,m,i,o]);const w=c.useRef(ae(i)?!1:i);return v.jsx(k.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:s,disabled:u,name:l,value:f,form:d,...t,tabIndex:-1,ref:g,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Do.displayName=Oo;function zl(e){return typeof e=="function"}function ae(e){return e==="indeterminate"}function To(e){return ae(e)?"indeterminate":e?"checked":"unchecked"}var Yl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xl=Yl.reduce((e,t)=>{const n=$t(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ql="Separator",$n="horizontal",Zl=["horizontal","vertical"],Io=c.forwardRef((e,t)=>{const{decorative:n,orientation:r=$n,...o}=e,i=Ql(r)?r:$n,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return v.jsx(Xl.div,{"data-orientation":i,...s,...o,ref:t})});Io.displayName=ql;function Ql(e){return Zl.includes(e)}var bu=Io,yt="Switch",[Jl]=pe(yt),[eu,tu]=Jl(yt),No=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:u="on",onCheckedChange:l,form:f,...d}=e,[p,h]=c.useState(null),g=$(t,b=>h(b)),m=c.useRef(!1),y=p?f||!!p.closest("form"):!0,[w,x]=je({prop:o,defaultProp:i??!1,onChange:l,caller:yt});return v.jsxs(eu,{scope:n,checked:w,disabled:s,children:[v.jsx(k.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":jo(w),"data-disabled":s?"":void 0,disabled:s,value:u,...d,ref:g,onClick:A(e.onClick,b=>{x(C=>!C),y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),y&&v.jsx(Fo,{control:p,bubbles:!m.current,name:r,value:u,checked:w,required:a,disabled:s,form:f,style:{transform:"translateX(-100%)"}})]})});No.displayName=yt;var ko="SwitchThumb",Lo=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=tu(ko,n);return v.jsx(k.span,{"data-state":jo(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Lo.displayName=ko;var nu="SwitchBubbleInput",Fo=c.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=c.useRef(null),s=$(a,i),u=Po(n),l=Jt(t);return c.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(u!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[u,n,r]),v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Fo.displayName=nu;function jo(e){return e?"checked":"unchecked"}var Cu=No,Eu=Lo;export{la as A,pe as B,lu as C,fu as D,wu as I,au as O,cu as P,su as R,ou as S,uu as T,du as a,pu as b,jt as c,hu as d,vu as e,gu as f,yu as g,xu as h,Gl as i,Kl as j,bu as k,Cu as l,Eu as m,k as n,je as o,aa as p,$ as q,Ko as r,A as s,se as t,Se as u,Vt as v,fa as w,Tr as x,Wt as y,ua as z};