@wellesley/notifications 1.0.756 → 1.0.757

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.
Files changed (2) hide show
  1. package/index.mjs +2 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var AH=Object.defineProperty,RH=(e,t,r)=>t in e?AH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,An=(e,t,r)=>RH(e,"symbol"!=typeof t?t+"":t,r);function TH(e,t){for(var r=0;r<t.length;r++){const n=t[r];if("string"!=typeof n&&!Array.isArray(n))for(const t in n)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function vC(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Yx=()=>Math.random().toString(36).substring(7).split("").join("."),PH={INIT:`@@redux/INIT${Yx()}`,REPLACE:`@@redux/REPLACE${Yx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yx()}`},S9=PH;function hp(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function $H(e){Object.keys(e).forEach((t=>{const r=e[t];if(typeof r(void 0,{type:S9.INIT})>"u")throw new Error(vC(12));if(typeof r(void 0,{type:S9.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(vC(13))}))}function Nj(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const a=t[n];"function"==typeof e[a]&&(r[a]=e[a])}const n=Object.keys(r);let a;try{$H(r)}catch(e){a=e}return function(e={},t){if(a)throw a;let o=!1;const i={};for(let a=0;a<n.length;a++){const s=n[a],l=r[s],c=e[s],u=l(c,t);if(typeof u>"u")throw t&&t.type,new Error(vC(14));i[s]=u,o=o||u!==c}return o=o||n.length!==Object.keys(e).length,o?i:e}}function Dj(e){return hp(e)&&"type"in e&&"string"==typeof e.type}var rA=Symbol.for("immer-nothing"),zy=Symbol.for("immer-draftable"),Is=Symbol.for("immer-state");function uo(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var om=Object.getPrototypeOf;function qc(e){return!!e&&!!e[Is]}function Wc(e){var t;return!!e&&(jj(e)||Array.isArray(e)||!!e[zy]||!(null==(t=e.constructor)||!t[zy])||zv(e)||Mv(e))}var zH=Object.prototype.constructor.toString();function jj(e){if(!e||"object"!=typeof e)return!1;const t=om(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===zH}function MH(e){return qc(e)||uo(15,e),e[Is].base_}function w0(e,t){0===sm(e)?Object.entries(e).forEach((([r,n])=>{t(r,n,e)})):e.forEach(((r,n)=>t(n,r,e)))}function sm(e){const t=e[Is];return t?t.type_:Array.isArray(e)?1:zv(e)?2:Mv(e)?3:0}function Qy(e,t){return 2===sm(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Kx(e,t){return 2===sm(e)?e.get(t):e[t]}function Lj(e,t,r){const n=sm(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function OH(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function zv(e){return e instanceof Map}function Mv(e){return e instanceof Set}function Wh(e){return e.copy_||e.base_}function bC(e,t){if(zv(e))return new Map(e);if(Mv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&jj(e))return om(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[Is];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const a=n[t],o=r[a];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(om(e),r)}function aA(e,t=!1){return Xw(e)||qc(e)||!Wc(e)||(sm(e)>1&&(e.set=e.add=e.clear=e.delete=NH),Object.freeze(e),t&&w0(e,((e,t)=>aA(t,!0)))),e}function NH(){uo(2)}function Xw(e){return Object.isFrozen(e)}var Yy,_C={};function im(e){const t=_C[e];return t||uo(0,e),t}function DH(e,t){_C[e]||(_C[e]=t)}function Vj(){return Yy}function jH(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function E9(e,t){t&&(im("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wC(e){kC(e),e.drafts_.forEach(LH),e.drafts_=null}function kC(e){e===Yy&&(Yy=e.parent_)}function C9(e){return Yy=jH(Yy,e)}function LH(e){const t=e[Is];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function I9(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[Is].modified_&&(wC(t),uo(4)),Wc(e)&&(e=Z_(t,e),t.parent_||J_(t,e)),t.patches_&&im("Patches").generateReplacementPatches_(r[Is].base_,e,t.patches_,t.inversePatches_)):e=Z_(t,r,[]),wC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rA?e:void 0}function Z_(e,t,r){if(Xw(t))return t;const n=t[Is];if(!n)return w0(t,((a,o)=>A9(e,n,t,a,o,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return J_(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let a=t,o=!1;3===n.type_&&(a=new Set(t),t.clear(),o=!0),w0(a,((a,i)=>A9(e,n,t,a,i,r,o))),J_(e,t,!1),r&&e.patches_&&im("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function A9(e,t,r,n,a,o,i){if(qc(a)){const i=Z_(e,a,o&&t&&3!==t.type_&&!Qy(t.assigned_,n)?o.concat(n):void 0);if(Lj(r,n,i),!qc(i))return;e.canAutoFreeze_=!1}else i&&r.add(a);if(Wc(a)&&!Xw(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Z_(e,a),(!t||!t.scope_.parent_)&&J_(e,a)}}function J_(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&aA(t,r)}function VH(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Vj(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,o=oA;r&&(a=[n],o=Ky);const{revoke:i,proxy:s}=Proxy.revocable(a,o);return n.draft_=s,n.revoke_=i,s}var oA={get(e,t){if(t===Is)return e;const r=Wh(e);if(!Qy(r,t))return BH(e,r,t);const n=r[t];return e.finalized_||!Wc(n)?n:n===Xx(e.base_,t)?(Zx(e),e.copy_[t]=SC(n,e)):n},has:(e,t)=>t in Wh(e),ownKeys:e=>Reflect.ownKeys(Wh(e)),set(e,t,r){const n=Bj(Wh(e),t);if(null!=n&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=Xx(Wh(e),t),a=null==n?void 0:n[Is];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(OH(r,n)&&(void 0!==r||Qy(e.base_,t)))return!0;Zx(e),xC(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Xx(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Zx(e),xC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=Wh(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){uo(11)},getPrototypeOf:e=>om(e.base_),setPrototypeOf(){uo(12)}},Ky={};function Xx(e,t){const r=e[Is];return(r?Wh(r):e)[t]}function BH(e,t,r){var n;const a=Bj(t,r);return a?"value"in a?a.value:null==(n=a.get)?void 0:n.call(e.draft_):void 0}function Bj(e,t){if(!(t in e))return;let r=om(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=om(r)}}function xC(e){e.modified_||(e.modified_=!0,e.parent_&&xC(e.parent_))}function Zx(e){e.copy_||(e.copy_=bC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}w0(oA,((e,t)=>{Ky[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ky.deleteProperty=function(e,t){return Ky.set.call(this,e,t,void 0)},Ky.set=function(e,t,r){return oA.set.call(this,e[0],t,r,e[0])};var FH=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...a){return n.produce(e,(e=>t.call(this,e,...a)))}}let n;if("function"!=typeof t&&uo(6),void 0!==r&&"function"!=typeof r&&uo(7),Wc(e)){const a=C9(this),o=SC(e,void 0);let i=!0;try{n=t(o),i=!1}finally{i?wC(a):kC(a)}return E9(a,r),I9(n,a)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===rA&&(n=void 0),this.autoFreeze_&&aA(n,!0),r){const t=[],a=[];im("Patches").generateReplacementPatches_(e,n,t,a),r(t,a)}return n}uo(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Wc(e)||uo(8),qc(e)&&(e=Fj(e));const t=C9(this),r=SC(e,void 0);return r[Is].isManual_=!0,kC(t),r}finishDraft(e,t){const r=e&&e[Is];(!r||!r.isManual_)&&uo(9);const{scope_:n}=r;return E9(n,t),I9(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=im("Patches").applyPatches_;return qc(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};function SC(e,t){const r=zv(e)?im("MapSet").proxyMap_(e,t):Mv(e)?im("MapSet").proxySet_(e,t):VH(e,t);return(t?t.scope_:Vj()).drafts_.push(r),r}function Fj(e){return qc(e)||uo(10,e),Uj(e)}function Uj(e){if(!Wc(e)||Xw(e))return e;const t=e[Is];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=bC(e,t.scope_.immer_.useStrictShallowCopy_)}else r=bC(e,!0);return w0(r,((e,t)=>{Lj(r,e,Uj(t))})),t&&(t.finalized_=!1),r}function UH(){const e="replace",t="remove";function r(e){if(!Wc(e))return e;if(Array.isArray(e))return e.map(r);if(zv(e))return new Map(Array.from(e.entries()).map((([e,t])=>[e,r(t)])));if(Mv(e))return new Set(Array.from(e).map(r));const t=Object.create(om(e));for(const n in e)t[n]=r(e[n]);return Qy(e,zy)&&(t[zy]=e[zy]),t}function n(e){return qc(e)?r(e):e}DH("Patches",{applyPatches_:function(n,a){return a.forEach((a=>{const{path:o,op:i}=a;let s=n;for(let e=0;e<o.length-1;e++){const t=sm(s);let r=o[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||"constructor"===r)&&uo(19),"function"==typeof s&&"prototype"===r&&uo(19),s=Kx(s,r),"object"!=typeof s&&uo(18,o.join("/"))}const l=sm(s),c=r(a.value),u=o[o.length-1];switch(i){case e:switch(l){case 2:return s.set(u,c);case 3:uo(16);default:return s[u]=c}case"add":switch(l){case 1:return"-"===u?s.push(c):s.splice(u,0,c);case 2:return s.set(u,c);case 3:return s.add(c);default:return s[u]=c}case t:switch(l){case 1:return s.splice(u,1);case 2:return s.delete(u);case 3:return s.delete(a.value);default:return delete s[u]}default:uo(17,i)}})),n},generatePatches_:function(r,a,o,i){switch(r.type_){case 0:case 2:return function(r,a,o,i){const{base_:s,copy_:l}=r;w0(r.assigned_,((r,c)=>{const u=Kx(s,r),f=Kx(l,r),d=c?Qy(s,r)?e:"add":t;if(u===f&&d===e)return;const p=a.concat(r);o.push(d===t?{op:d,path:p}:{op:d,path:p,value:f}),i.push("add"===d?{op:t,path:p}:d===t?{op:"add",path:p,value:n(u)}:{op:e,path:p,value:n(u)})}))}(r,a,o,i);case 1:return function(r,a,o,i){let{base_:s,assigned_:l}=r,c=r.copy_;c.length<s.length&&([s,c]=[c,s],[o,i]=[i,o]);for(let t=0;t<s.length;t++)if(l[t]&&c[t]!==s[t]){const r=a.concat([t]);o.push({op:e,path:r,value:n(c[t])}),i.push({op:e,path:r,value:n(s[t])})}for(let e=s.length;e<c.length;e++){const t=a.concat([e]);o.push({op:"add",path:t,value:n(c[e])})}for(let e=c.length-1;s.length<=e;--e){const r=a.concat([e]);i.push({op:t,path:r})}}(r,a,o,i);case 3:return function(e,r,n,a){let{base_:o,copy_:i}=e,s=0;o.forEach((e=>{if(!i.has(e)){const o=r.concat([s]);n.push({op:t,path:o,value:e}),a.unshift({op:"add",path:o,value:e})}s++})),s=0,i.forEach((e=>{if(!o.has(e)){const o=r.concat([s]);n.push({op:"add",path:o,value:e}),a.unshift({op:t,path:o,value:e})}s++}))}(r,a,o,i)}},generateReplacementPatches_:function(t,r,n,a){n.push({op:e,path:[],value:r===rA?void 0:r}),a.push({op:e,path:[],value:t})}})}var oi=new FH,Ov=oi.produce,Gj=oi.produceWithPatches.bind(oi);oi.setAutoFreeze.bind(oi),oi.setUseStrictShallowCopy.bind(oi);var R9=oi.applyPatches.bind(oi);function GH(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}function qH(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}function WH(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const r=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${r}]`)}}oi.createDraft.bind(oi),oi.finishDraft.bind(oi);var T9=e=>Array.isArray(e)?e:[e];function HH(e){const t=Array.isArray(e[0])?e[0]:e;return WH(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function QH(e,t){const r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var YH=class{constructor(e){this.value=e}deref(){return this.value}},KH=typeof WeakRef<"u"?WeakRef:YH,XH=0,P9=1;function Ub(){return{s:XH,v:void 0,o:null,p:null}}function Xy(e,t={}){let r=Ub();const{resultEqualityCheck:n}=t;let a,o=0;function i(){var t;let i=r;const{length:s}=arguments;for(let e=0,t=s;e<t;e++){const t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=i.o;null===e&&(i.o=e=new WeakMap);const r=e.get(t);void 0===r?(i=Ub(),e.set(t,i)):i=r}else{let e=i.p;null===e&&(i.p=e=new Map);const r=e.get(t);void 0===r?(i=Ub(),e.set(t,i)):i=r}}const l=i;let c;if(i.s===P9?c=i.v:(c=e.apply(null,arguments),o++),l.s=P9,n){const e=(null==(t=null==a?void 0:a.deref)?void 0:t.call(a))??a;null!=e&&n(e,c)&&(c=e,0!==o&&o--),a="object"==typeof c&&null!==c||"function"==typeof c?new KH(c):c}return l.v=c,c}return i.clearCache=()=>{r=Ub(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function qj(e,...t){const r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n=0,a=0,o={},i=e.pop();"object"==typeof i&&(o=i,i=e.pop()),GH(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);const s={...r,...o},{memoize:l,memoizeOptions:c=[],argsMemoize:u=Xy,argsMemoizeOptions:f=[],devModeChecks:d={}}=s,p=T9(c),h=T9(f),g=HH(e),m=l((function(){return n++,i.apply(null,arguments)}),...p),y=u((function(){a++;const e=QH(g,arguments);return t=m.apply(null,e),t}),...h);return Object.assign(y,{resultFunc:i,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>t,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:l,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var zr=qj(Xy),ZH=Object.assign(((e,t=zr)=>{qH(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const r=Object.keys(e);return t(r.map((t=>e[t])),((...e)=>e.reduce(((e,t,n)=>(e[r[n]]=t,e)),{})))}),{withTypes:()=>ZH}),JH=(...e)=>{const t=qj(...e),r=Object.assign(((...e)=>{const r=t(...e),n=(e,...t)=>r(qc(e)?Fj(e):e,...t);return Object.assign(n,r),n}),{withTypes:()=>r});return r};JH(Xy);var eQ=e=>e&&"function"==typeof e.match;function kr(e,t){function r(...r){if(t){let n=t(...r);if(!n)throw new Error(po(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>Dj(t)&&t.type===e,r}function $9(e){return Wc(e)?Ov(e,(()=>{})):e}function EC(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw new Error(po(10));const n=r.insert(t,e);return e.set(t,n),n}var _y="RTK_autoBatch",Y1=()=>e=>({payload:e,meta:{[_y]:!0}});function Wj(e){const t={},r=[];let n;const a={addCase(e,r){const n="string"==typeof e?e:e.type;if(!n)throw new Error(po(28));if(n in t)throw new Error(po(29));return t[n]=r,a},addMatcher:(e,t)=>(r.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(n=e,a)};return e(a),[t,r,n]}function tQ(e){return"function"==typeof e}function nQ(e,t){let r,[n,a,o]=Wj(t);if(tQ(e))r=()=>$9(e());else{const t=$9(e);r=()=>t}function i(e=r(),t){let i=[n[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===i.filter((e=>!!e)).length&&(i=[o]),i.reduce(((e,r)=>{if(r){if(qc(e)){const n=r(e,t);return void 0===n?e:n}if(Wc(e))return Ov(e,(e=>r(e,t)));{const n=r(e,t);if(void 0===n){if(null===e)return e;throw new Error(po(9))}return n}}return e}),e)}return i.getInitialState=r,i}var rQ="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Zw=(e=21)=>{let t="",r=e;for(;r--;)t+=rQ[64*Math.random()|0];return t},Hj=(e,t)=>eQ(e)?e.match(t):e(t);function mp(...e){return t=>e.some((e=>Hj(e,t)))}function My(...e){return t=>e.every((e=>Hj(e,t)))}function Jw(e,t){if(!e||!e.meta)return!1;const r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Nv(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function sA(...e){return 0===e.length?e=>Jw(e,["pending"]):Nv(e)?t=>mp(...e.map((e=>e.pending)))(t):sA()(e[0])}function k0(...e){return 0===e.length?e=>Jw(e,["rejected"]):Nv(e)?t=>mp(...e.map((e=>e.rejected)))(t):k0()(e[0])}function e2(...e){const t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||Nv(e)?r=>My(k0(...e),t)(r):e2()(e[0])}function gp(...e){return 0===e.length?e=>Jw(e,["fulfilled"]):Nv(e)?t=>mp(...e.map((e=>e.fulfilled)))(t):gp()(e[0])}function CC(...e){return 0===e.length?e=>Jw(e,["pending","fulfilled","rejected"]):Nv(e)?t=>{const r=[];for(const t of e)r.push(t.pending,t.rejected,t.fulfilled);return mp(...r)(t)}:CC()(e[0])}var aQ=["name","message","stack","code"],Jx=class{constructor(e,t){An(this,"_type"),this.payload=e,this.meta=t}},z9=class{constructor(e,t){An(this,"_type"),this.payload=e,this.meta=t}},oQ=e=>{if("object"==typeof e&&null!==e){const t={};for(const r of aQ)"string"==typeof e[r]&&(t[r]=e[r]);return t}return{message:String(e)}},M9=(()=>{function e(e,t,r){const n=kr(e+"/fulfilled",((e,t,r,n)=>({payload:e,meta:{...n||{},arg:r,requestId:t,requestStatus:"fulfilled"}}))),a=kr(e+"/pending",((e,t,r)=>({payload:void 0,meta:{...r||{},arg:t,requestId:e,requestStatus:"pending"}}))),o=kr(e+"/rejected",((e,t,n,a,o)=>({payload:a,error:(r&&r.serializeError||oQ)(e||"Rejected"),meta:{...o||{},arg:n,requestId:t,rejectedWithValue:!!a,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)}})));return Object.assign((function(e){return(i,s,l)=>{const c=null!=r&&r.idGenerator?r.idGenerator(e):Zw(),u=new AbortController;let f,d;function p(e){d=e,u.abort()}const h=async function(){var h,g;let m;try{let o=null==(h=null==r?void 0:r.condition)?void 0:h.call(r,e,{getState:s,extra:l});if(iQ(o)&&(o=await o),!1===o||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise(((e,t)=>{f=()=>{t({name:"AbortError",message:d||"Aborted"})},u.signal.addEventListener("abort",f)}));i(a(c,e,null==(g=null==r?void 0:r.getPendingMeta)?void 0:g.call(r,{requestId:c,arg:e},{getState:s,extra:l}))),m=await Promise.race([y,Promise.resolve(t(e,{dispatch:i,getState:s,extra:l,requestId:c,signal:u.signal,abort:p,rejectWithValue:(e,t)=>new Jx(e,t),fulfillWithValue:(e,t)=>new z9(e,t)})).then((t=>{if(t instanceof Jx)throw t;return t instanceof z9?n(t.payload,c,e,t.meta):n(t,c,e)}))])}catch(t){m=t instanceof Jx?o(null,c,e,t.payload,t.meta):o(t,c,e)}finally{f&&u.signal.removeEventListener("abort",f)}return r&&!r.dispatchConditionRejection&&o.match(m)&&m.meta.condition||i(m),m}();return Object.assign(h,{abort:p,requestId:c,arg:e,unwrap:()=>h.then(sQ)})}}),{pending:a,rejected:o,fulfilled:n,settled:mp(o,n),typePrefix:e})}return e.withTypes=()=>e,e})();function sQ(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function iQ(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}var cQ=Symbol.for("rtk-slice-createasyncthunk");function lQ(e,t){return`${e}/${t}`}function uQ({creators:e}={}){var t;const r=null==(t=null==e?void 0:e.asyncThunk)?void 0:t[cQ];return function(e){const{name:t,reducerPath:n=t}=e;if(!t)throw new Error(po(11));const a=("function"==typeof e.reducers?e.reducers(dQ()):e.reducers)||{},o=Object.keys(a),i={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const r="string"==typeof e?e:e.type;if(!r)throw new Error(po(12));if(r in i.sliceCaseReducersByType)throw new Error(po(13));return i.sliceCaseReducersByType[r]=t,s},addMatcher:(e,t)=>(i.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(i.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(i.sliceCaseReducersByName[e]=t,s)};function l(){const[t={},r=[],n]="function"==typeof e.extraReducers?Wj(e.extraReducers):[e.extraReducers],a={...t,...i.sliceCaseReducersByType};return nQ(e.initialState,(e=>{for(let t in a)e.addCase(t,a[t]);for(let t of i.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)}))}o.forEach((n=>{const o=a[n],i={reducerName:n,type:lQ(t,n),createNotation:"function"==typeof e.reducers};hQ(o)?gQ(i,o,s,r):pQ(i,o,s)}));const c=e=>e,u=new Map;let f;function d(e,t){return f||(f=l()),f(e,t)}function p(){return f||(f=l()),f.getInitialState()}function h(t,r=!1){function n(e){let n=e[t];return typeof n>"u"&&r&&(n=p()),n}function a(t=c){const n=EC(u,r,{insert:()=>new WeakMap});return EC(n,t,{insert:()=>{const n={};for(const[a,o]of Object.entries(e.selectors??{}))n[a]=fQ(o,t,p,r);return n}})}return{reducerPath:t,getSelectors:a,get selectors(){return a(n)},selectSlice:n}}const g={name:t,reducer:d,actions:i.actionCreators,caseReducers:i.sliceCaseReducersByName,getInitialState:p,...h(n),injectInto(e,{reducerPath:t,...r}={}){const a=t??n;return e.inject({reducerPath:a,reducer:d},r),{...g,...h(a,!0)}}};return g}}function fQ(e,t,r,n){function a(a,...o){let i=t(a);return typeof i>"u"&&n&&(i=r()),e(i,...o)}return a.unwrapped=e,a}var ur=uQ();function dQ(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}function pQ({type:e,reducerName:t,createNotation:r},n,a){let o,i;if("reducer"in n){if(r&&!mQ(n))throw new Error(po(17));o=n.reducer,i=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?kr(e,i):kr(e))}function hQ(e){return"asyncThunk"===e._reducerDefinitionType}function mQ(e){return"reducerWithPrepare"===e._reducerDefinitionType}function gQ({type:e,reducerName:t},r,n,a){if(!a)throw new Error(po(18));const{payloadCreator:o,fulfilled:i,pending:s,rejected:l,settled:c,options:u}=r,f=a(e,o,u);n.exposeAction(t,f),i&&n.addCase(f.fulfilled,i),s&&n.addCase(f.pending,s),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:i||Gb,pending:s||Gb,rejected:l||Gb,settled:c||Gb})}function Gb(){}var yQ=(e,t)=>{if("function"!=typeof e)throw new Error(po(32))},iA="listenerMiddleware",vQ=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:o}=e;if(t)a=kr(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(po(21));return yQ(o),{predicate:a,type:t,effect:o}},bQ=Object.assign((e=>{const{type:t,predicate:r,effect:n}=vQ(e);return{id:Zw(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(po(22))}}}),{withTypes:()=>bQ}),_Q=Object.assign(kr(`${iA}/add`),{withTypes:()=>_Q});kr(`${iA}/removeAll`);var wQ=Object.assign(kr(`${iA}/remove`),{withTypes:()=>wQ}),kQ=e=>"reducerPath"in e&&"string"==typeof e.reducerPath,xQ=e=>e.flatMap((e=>kQ(e)?[[e.reducerPath,e.reducer]]:Object.entries(e))),cA=Symbol.for("rtk-state-proxy-original"),SQ=e=>!!e&&!!e[cA],EQ=new WeakMap,CQ=(e,t)=>EC(EQ,e,{insert:()=>new Proxy(e,{get:(e,r,n)=>{if(r===cA)return e;const a=Reflect.get(e,r,n);if(typeof a>"u"){const e=t[r.toString()];if(e){const t=e(void 0,{type:Zw()});if(typeof t>"u")throw new Error(po(24));return t}}return a}})}),IQ=e=>{if(!SQ(e))throw new Error(po(25));return e[cA]},AQ=(e={})=>e;function RQ(...e){const t=Object.fromEntries(xQ(e)),r=()=>Object.keys(t).length?Nj(t):AQ;let n=r();function a(e,t){return n(e,t)}a.withLazyLoadedSlices=()=>a;const o=Object.assign((function(e,r){return function(n,...a){return e(CQ(r?r(n,...a):n,t),...a)}}),{original:IQ});return Object.assign(a,{inject:(e,o={})=>{const{reducerPath:i,reducer:s}=e,l=t[i];return!o.overrideExisting&&l&&l!==s||(t[i]=s,n=r()),a},selector:o})}function po(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var TQ={USER:"teamcity",npm_config_user_agent:"npm/10.9.3 node/v22.18.0 linux x64 workspaces/true",SENTRY_AUTH_TOKEN:"1d93ff28a44e4c3aaaaff854277cd8583c1de670bd8744bc895670dfd9300840",npm_node_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_config_noproxy:"",HOME:"/home/teamcity",npm_package_json:"/mnt/agent/work/70fcd8585843667f/packages/notifications/package.json",npm_config_userconfig:"/home/teamcity/.npmrc",npm_config_local_prefix:"/mnt/agent/work/70fcd8585843667f",COLOR:"1",npm_config_progress:"",TEMP:"/mnt/agent/temp/buildTmp",npm_config_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_config_npm_version:"10.9.3",npm_config_cache:"/home/teamcity/.npm",USE_NPM_LIBS:"false",npm_config_ignore_scripts:"true",npm_config_node_gyp:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/mnt/agent/work/70fcd8585843667f/packages/notifications/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/packages/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/teamcity/.cargo/bin:/home/teamcity/.rvm/gems/ruby-3.3.9/bin:/home/teamcity/.rvm/gems/ruby-3.3.9@global/bin:/home/teamcity/.rvm/rubies/ruby-3.3.9/bin:/home/teamcity/.rvm/bin:/home/teamcity/.local/bin:/usr/lib/jvm/java-21-amazon-corretto/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin:/usr/share/dotnet:/usr/share/dotnet/tools:/home/teamcity/google-cloud-sdk/bin:/home/teamcity/go/bin:/usr/bin/mvn:/home/teamcity/.nvm/versions/node/v22.18.0/bin",TURBO_HASH:"0d4f7be643740c50",NODE:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_package_name:"@wellesley/notifications",npm_config_color:"always",DOMAIN_ENV:"test",LANG:"en_US.UTF-8",TURBO_TEAM:"wellesley",TMP:"/mnt/agent/temp/buildTmp",TURBO_API:"https://turborepo-remote-cache-fo3np.ondigitalocean.app",npm_lifecycle_script:"vite build",SHELL:"/bin/bash",npm_package_version:"1.0.756",npm_lifecycle_event:"build",TURBO_CACHE:"remote:rw",SENTRY_MAPS_UPLOAD:"true",npm_config_globalconfig:"/home/teamcity/.nvm/versions/node/v22.18.0/etc/npmrc",npm_config_init_module:"/home/teamcity/.npm-init.js",PWD:"/mnt/agent/work/70fcd8585843667f/packages/notifications",npm_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_command:"run-script",TURBO_TOKEN:"wellesley-turbo-token",USE_PACKAGES_FROM_NPM:"false",INIT_CWD:"/mnt/agent/work/70fcd8585843667f/packages/notifications",EDITOR:"vi",NODE_ENV:"production",BUILD_NUMBER:"3782",APP_NAME:"@wellesley/notifications"},Qj=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Qj||{});function PQ(e){return{status:e,isUninitialized:"uninitialized"===e,isLoading:"pending"===e,isSuccess:"fulfilled"===e,isError:"rejected"===e}}function $Q(e){return new RegExp("(^|:)//").test(e)}var zQ=e=>e.replace(/\/$/,""),MQ=e=>e.replace(/^\//,"");function OQ(e,t){if(!e)return t;if(!t)return e;if($Q(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return`${e=zQ(e)}${r}${t=MQ(t)}`}var O9=e=>[].concat(...e);function NQ(){return typeof navigator>"u"||void 0===navigator.onLine||navigator.onLine}function DQ(){return typeof document>"u"||"hidden"!==document.visibilityState}var N9=hp;function Yj(e,t){if(e===t||!(N9(e)&&N9(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),n=Object.keys(e);let a=r.length===n.length;const o=Array.isArray(t)?[]:{};for(const n of r)o[n]=Yj(e[n],t[n]),a&&(a=e[n]===o[n]);return a?e:o}var D9=(...e)=>fetch(...e),jQ=e=>e.status>=200&&e.status<=299,LQ=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function j9(e){if(!hp(e))return e;const t={...e};for(const[e,r]of Object.entries(t))void 0===r&&delete t[e];return t}function VQ({baseUrl:e,prepareHeaders:t=e=>e,fetchFn:r=D9,paramsSerializer:n,isJsonContentType:a=LQ,jsonContentType:o="application/json",jsonReplacer:i,timeout:s,responseHandler:l,validateStatus:c,...u}={}){return typeof fetch>"u"&&r===D9&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(d,p)=>{const{signal:h,getState:g,extra:m,endpoint:y,forced:v,type:b}=p;let w,{url:_,headers:k=new Headers(u.headers),params:x,responseHandler:E=l??"json",validateStatus:A=c??jQ,timeout:S=s,...C}="string"==typeof d?{url:d}:d,z={...u,signal:h,...C};k=new Headers(j9(k)),z.headers=await t(k,{getState:g,extra:m,endpoint:y,forced:v,type:b})||k;const I=e=>"object"==typeof e&&(hp(e)||Array.isArray(e)||"function"==typeof e.toJSON);if(!z.headers.has("content-type")&&I(z.body)&&z.headers.set("content-type",o),I(z.body)&&a(z.headers)&&(z.body=JSON.stringify(z.body,i)),x){const e=~_.indexOf("?")?"&":"?";_+=e+(n?n(x):new URLSearchParams(j9(x)))}_=OQ(e,_);const j=new Request(_,z);w={request:new Request(_,z)};let P,T=!1,R=S&&setTimeout((()=>{T=!0,p.abort()}),S);try{P=await r(j)}catch(e){return{error:{status:T?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:w}}finally{R&&clearTimeout(R)}const N=P.clone();w.response=N;let O,M="";try{let e;if(await Promise.all([f(P,E).then((e=>O=e),(t=>e=t)),N.text().then((e=>M=e),(()=>{}))]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:P.status,data:M,error:String(e)},meta:w}}return A(P,O)?{data:O,meta:w}:{error:{status:P.status,data:O},meta:w}};async function f(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=a(e.headers)?"json":"text"),"json"===t){const t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}var L9=class{constructor(e,t=void 0){this.value=e,this.meta=t}},lA=kr("__rtkq/focused"),Kj=kr("__rtkq/unfocused"),uA=kr("__rtkq/online"),Xj=kr("__rtkq/offline");function Zj(e){return"query"===e.type}function BQ(e){return"mutation"===e.type}function fA(e,t,r,n,a,o){return FQ(e)?e(t,r,n,a).map(IC).map(o):Array.isArray(e)?e.map(IC).map(o):[]}function FQ(e){return"function"==typeof e}function IC(e){return"string"==typeof e?{type:e}:e}function V9(e){return null!=e}function p0(e){let t=0;for(const r in e)t++;return t}function UQ(e,t){return e.catch(t)}var Zy=Symbol("forceQueryFn"),AC=e=>"function"==typeof e[Zy];function GQ({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:a}){const o=new Map,i=new Map,{unsubscribeQueryResult:s,removeMutationResult:l,updateSubscriptionOptions:c}=n.internalActions;return{buildInitiateQuery:function(r,a){const i=(l,{subscribe:u=!0,forceRefetch:f,subscriptionOptions:d,[Zy]:p,...h}={})=>(g,m)=>{var y;const v=e({queryArgs:l,endpointDefinition:a,endpointName:r}),b=t({...h,type:"query",subscribe:u,forceRefetch:f,subscriptionOptions:d,endpointName:r,originalArgs:l,queryCacheKey:v,[Zy]:p}),w=n.endpoints[r].select(l),_=g(b),k=w(m()),{requestId:x,abort:E}=_,A=k.requestId!==x,S=null==(y=o.get(g))?void 0:y[v],C=()=>w(m()),z=Object.assign(p?_.then(C):A&&!S?Promise.resolve(k):Promise.all([S,_]).then(C),{arg:l,requestId:x,subscriptionOptions:d,queryCacheKey:v,abort:E,async unwrap(){const e=await z;if(e.isError)throw e.error;return e.data},refetch:()=>g(i(l,{subscribe:!1,forceRefetch:!0})),unsubscribe(){u&&g(s({queryCacheKey:v,requestId:x}))},updateSubscriptionOptions(e){z.subscriptionOptions=e,g(c({endpointName:r,requestId:x,queryCacheKey:v,options:e}))}});if(!S&&!A&&!p){const e=o.get(g)||{};e[v]=z,o.set(g,e),z.then((()=>{delete e[v],p0(e)||o.delete(g)}))}return z};return i},buildInitiateMutation:function(e){return(t,{track:n=!0,fixedCacheKey:a}={})=>(o,s)=>{const c=r({type:"mutation",endpointName:e,originalArgs:t,track:n,fixedCacheKey:a}),u=o(c),{requestId:f,abort:d,unwrap:p}=u,h=UQ(u.unwrap().then((e=>({data:e}))),(e=>({error:e}))),g=Object.assign(h,{arg:u.arg,requestId:f,abort:d,unwrap:p,reset:()=>{o(l({requestId:f,fixedCacheKey:a}))}}),m=i.get(o)||{};return i.set(o,m),m[f]=g,g.then((()=>{delete m[f],p0(m)||i.delete(o)})),a&&(m[a]=g,g.then((()=>{m[a]===g&&(delete m[a],p0(m)||i.delete(o))}))),g}},getRunningQueryThunk:function(t,r){return n=>{var i;const s=a.endpointDefinitions[t],l=e({queryArgs:r,endpointDefinition:s,endpointName:t});return null==(i=o.get(n))?void 0:i[l]}},getRunningMutationThunk:function(e,t){return e=>{var r;return null==(r=i.get(e))?void 0:r[t]}},getRunningQueriesThunk:function(){return e=>Object.values(o.get(e)||{}).filter(V9)},getRunningMutationsThunk:function(){return e=>Object.values(i.get(e)||{}).filter(V9)}}}function B9(e){return e}function qQ({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:a,assertTagType:o}){const i=async(e,{signal:n,abort:a,rejectWithValue:o,fulfillWithValue:i,dispatch:l,getState:c,extra:u})=>{const f=r[e.endpointName];try{let r,o=B9;const d={signal:n,abort:a,dispatch:l,getState:c,extra:u,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?s(e,c()):void 0},p="query"===e.type?e[Zy]:void 0;if(p?r=p():f.query?(r=await t(f.query(e.originalArgs),d,f.extraOptions),f.transformResponse&&(o=f.transformResponse)):r=await f.queryFn(e.originalArgs,d,f.extraOptions,(e=>t(e,d,f.extraOptions))),typeof process<"u"&&TQ.NODE_ENV,r.error)throw new L9(r.error,r.meta);return i(await o(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[_y]:!0})}catch(t){let r=t;if(r instanceof L9){let t=B9;f.query&&f.transformErrorResponse&&(t=f.transformErrorResponse);try{return o(await t(r.value,r.meta,e.originalArgs),{baseQueryMeta:r.meta,[_y]:!0})}catch(e){r=e}}throw console.error(r),r}};function s(t,r){var n,a,o;const i=null==(a=null==(n=r[e])?void 0:n.queries)?void 0:a[t.queryCacheKey],s=null==(o=r[e])?void 0:o.config.refetchOnMountOrArgChange,l=null==i?void 0:i.fulfilledTimeStamp,c=t.forceRefetch??(t.subscribe&&s);return!!c&&(!0===c||(Number(new Date)-Number(l))/1e3>=c)}const l=M9(`${e}/executeQuery`,i,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[_y]:!0}),condition(t,{getState:n}){var a,o,i;const l=n(),c=null==(o=null==(a=l[e])?void 0:a.queries)?void 0:o[t.queryCacheKey],u=null==c?void 0:c.fulfilledTimeStamp,f=t.originalArgs,d=null==c?void 0:c.originalArgs,p=r[t.endpointName];return!!AC(t)||"pending"!==(null==c?void 0:c.status)&&(!!(s(t,l)||Zj(p)&&null!=(i=null==p?void 0:p.forceRefetch)&&i.call(p,{currentArg:f,previousArg:d,endpointState:c,state:l}))||!u)},dispatchConditionRejection:!0}),c=M9(`${e}/executeMutation`,i,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[_y]:!0})});function u(e){return t=>{var r,n;return(null==(n=null==(r=null==t?void 0:t.meta)?void 0:r.arg)?void 0:n.endpointName)===e}}return{queryThunk:l,mutationThunk:c,prefetch:(e,t,r)=>(n,o)=>{const i=(e=>"force"in e)(r)&&r.force,s=(e=>"ifOlderThan"in e)(r)&&r.ifOlderThan,l=(r=!0)=>{const n={forceRefetch:r,isPrefetch:!0};return a.endpoints[e].initiate(t,n)},c=a.endpoints[e].select(t)(o());if(i)n(l());else if(s){const e=null==c?void 0:c.fulfilledTimeStamp;if(!e)return void n(l());(Number(new Date)-Number(new Date(e)))/1e3>=s&&n(l())}else n(l(!1))},updateQueryData:(e,t,r,n=!0)=>(o,i)=>{const s=a.endpoints[e].select(t)(i());let l,c={patches:[],inversePatches:[],undo:()=>o(a.util.patchQueryData(e,t,c.inversePatches,n))};if("uninitialized"===s.status)return c;if("data"in s)if(Wc(s.data)){const[e,t,n]=Gj(s.data,r);c.patches.push(...t),c.inversePatches.push(...n),l=e}else l=r(s.data),c.patches.push({op:"replace",path:[],value:l}),c.inversePatches.push({op:"replace",path:[],value:s.data});return o(a.util.patchQueryData(e,t,c.patches,n)),c},upsertQueryData:(e,t,r)=>n=>n(a.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[Zy]:()=>({data:r})})),patchQueryData:(e,t,i,s)=>(l,c)=>{const u=r[e],f=n({queryArgs:t,endpointDefinition:u,endpointName:e});if(l(a.internalActions.queryResultPatched({queryCacheKey:f,patches:i})),!s)return;const d=a.endpoints[e].select(t)(c()),p=fA(u.providesTags,d.data,void 0,t,{},o);l(a.internalActions.updateProvidedBy({queryCacheKey:f,providedTags:p}))},buildMatchThunkActions:function(e,t){return{matchPending:My(sA(e),u(t)),matchFulfilled:My(gp(e),u(t)),matchRejected:My(k0(e),u(t))}}}}function Jj(e,t,r,n){return fA(r[e.meta.arg.endpointName][t],gp(e)?e.payload:void 0,e2(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function qb(e,t,r){const n=e[t];n&&r(n)}function Jy(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function F9(e,t,r){const n=e[Jy(t)];n&&r(n)}var K1={};function WQ({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:a,extractRehydrationInfo:o,hasRehydrationInfo:i},assertTagType:s,config:l}){const c=kr(`${e}/resetApiState`),u=ur({name:`${e}/queries`,initialState:K1,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:Y1()},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:r}}){qb(e,t,(e=>{e.data=R9(e.data,r.concat())}))},prepare:Y1()}},extraReducers(e){e.addCase(t.pending,((e,{meta:t,meta:{arg:r}})=>{var n;const a=AC(r);e[n=r.queryCacheKey]??(e[n]={status:"uninitialized",endpointName:r.endpointName}),qb(e,r.queryCacheKey,(e=>{e.status="pending",e.requestId=a&&e.requestId?e.requestId:t.requestId,void 0!==r.originalArgs&&(e.originalArgs=r.originalArgs),e.startedTimeStamp=t.startedTimeStamp}))})).addCase(t.fulfilled,((e,{meta:t,payload:r})=>{qb(e,t.arg.queryCacheKey,(e=>{if(e.requestId!==t.requestId&&!AC(t.arg))return;const{merge:a}=n[t.arg.endpointName];if(e.status="fulfilled",a)if(void 0!==e.data){const{fulfilledTimeStamp:n,arg:o,baseQueryMeta:i,requestId:s}=t;let l=Ov(e.data,(e=>a(e,r,{arg:o.originalArgs,baseQueryMeta:i,fulfilledTimeStamp:n,requestId:s})));e.data=l}else e.data=r;else e.data=n[t.arg.endpointName].structuralSharing??1?Yj(qc(e.data)?MH(e.data):e.data,r):r;delete e.error,e.fulfilledTimeStamp=t.fulfilledTimeStamp}))})).addCase(t.rejected,((e,{meta:{condition:t,arg:r,requestId:n},error:a,payload:o})=>{qb(e,r.queryCacheKey,(e=>{if(!t){if(e.requestId!==n)return;e.status="rejected",e.error=o??a}}))})).addMatcher(i,((e,t)=>{const{queries:r}=o(t);for(const[t,n]of Object.entries(r))("fulfilled"===(null==n?void 0:n.status)||"rejected"===(null==n?void 0:n.status))&&(e[t]=n)}))}}),f=ur({name:`${e}/mutations`,initialState:K1,reducers:{removeMutationResult:{reducer(e,{payload:t}){const r=Jy(t);r in e&&delete e[r]},prepare:Y1()}},extraReducers(e){e.addCase(r.pending,((e,{meta:t,meta:{requestId:r,arg:n,startedTimeStamp:a}})=>{n.track&&(e[Jy(t)]={requestId:r,status:"pending",endpointName:n.endpointName,startedTimeStamp:a})})).addCase(r.fulfilled,((e,{payload:t,meta:r})=>{r.arg.track&&F9(e,r,(e=>{e.requestId===r.requestId&&(e.status="fulfilled",e.data=t,e.fulfilledTimeStamp=r.fulfilledTimeStamp)}))})).addCase(r.rejected,((e,{payload:t,error:r,meta:n})=>{n.arg.track&&F9(e,n,(e=>{e.requestId===n.requestId&&(e.status="rejected",e.error=t??r)}))})).addMatcher(i,((e,t)=>{const{mutations:r}=o(t);for(const[t,n]of Object.entries(r))("fulfilled"===(null==n?void 0:n.status)||"rejected"===(null==n?void 0:n.status))&&t!==(null==n?void 0:n.requestId)&&(e[t]=n)}))}}),d=ur({name:`${e}/invalidation`,initialState:K1,reducers:{updateProvidedBy:{reducer(e,t){var r,n;const{queryCacheKey:a,providedTags:o}=t.payload;for(const t of Object.values(e))for(const e of Object.values(t)){const t=e.indexOf(a);-1!==t&&e.splice(t,1)}for(const{type:t,id:i}of o){const o=(r=e[t]??(e[t]={}))[n=i||"__internal_without_id"]??(r[n]=[]);o.includes(a)||o.push(a)}},prepare:Y1()}},extraReducers(e){e.addCase(u.actions.removeQueryResult,((e,{payload:{queryCacheKey:t}})=>{for(const r of Object.values(e))for(const e of Object.values(r)){const r=e.indexOf(t);-1!==r&&e.splice(r,1)}})).addMatcher(i,((e,t)=>{var r,n;const{provided:a}=o(t);for(const[t,o]of Object.entries(a))for(const[a,i]of Object.entries(o)){const o=(r=e[t]??(e[t]={}))[n=a||"__internal_without_id"]??(r[n]=[]);for(const e of i)o.includes(e)||o.push(e)}})).addMatcher(mp(gp(t),e2(t)),((e,t)=>{const r=Jj(t,"providesTags",n,s),{queryCacheKey:a}=t.meta.arg;d.caseReducers.updateProvidedBy(e,d.actions.updateProvidedBy({queryCacheKey:a,providedTags:r}))}))}}),p=ur({name:`${e}/subscriptions`,initialState:K1,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),h=ur({name:`${e}/internalSubscriptions`,initialState:K1,reducers:{subscriptionsUpdated:{reducer:(e,t)=>R9(e,t.payload),prepare:Y1()}}}),g=ur({name:`${e}/config`,initialState:{online:NQ(),focused:DQ(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&a===t||"conflict"}},extraReducers:e=>{e.addCase(uA,(e=>{e.online=!0})).addCase(Xj,(e=>{e.online=!1})).addCase(lA,(e=>{e.focused=!0})).addCase(Kj,(e=>{e.focused=!1})).addMatcher(i,(e=>({...e})))}}),m=Nj({queries:u.reducer,mutations:f.reducer,provided:d.reducer,subscriptions:h.reducer,config:g.reducer});return{reducer:(e,t)=>m(c.match(t)?void 0:e,t),actions:{...g.actions,...u.actions,...p.actions,...h.actions,...f.actions,...d.actions,resetApiState:c}}}var Xh=Symbol.for("RTKQ/skipToken"),e8={status:"uninitialized"},U9=Ov(e8,(()=>{})),G9=Ov(e8,(()=>{}));function HQ({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const n=e=>U9,a=e=>G9;return{buildQuerySelector:function(t,a){return s=>{const l=e({queryArgs:s,endpointDefinition:a,endpointName:t});return r(s===Xh?n:e=>{var t,r;return(null==(r=null==(t=i(e))?void 0:t.queries)?void 0:r[l])??U9},o)}},buildMutationSelector:function(){return e=>{let t;return t="object"==typeof e?Jy(e)??Xh:e,r(t===Xh?a:e=>{var r,n;return(null==(n=null==(r=i(e))?void 0:r.mutations)?void 0:n[t])??G9},o)}},selectInvalidatedBy:function(e,r){const n=e[t],a=new Set;for(const e of r.map(IC)){const t=n.provided[e.type];if(!t)continue;let r=(void 0!==e.id?t[e.id]:O9(Object.values(t)))??[];for(const e of r)a.add(e)}return O9(Array.from(a.values()).map((e=>{const t=n.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))},selectCachedArgsForQuery:function(e,r){return Object.values(e[t].queries).filter((e=>(null==e?void 0:e.endpointName)===r&&"uninitialized"!==e.status)).map((e=>e.originalArgs))}};function o(e){return{...e,...PQ(e.status)}}function i(e){return e[t]}}var Yg=WeakMap?new WeakMap:void 0,q9=({endpointName:e,queryArgs:t})=>{let r="";const n=null==Yg?void 0:Yg.get(t);if("string"==typeof n)r=n;else{const e=JSON.stringify(t,((e,t)=>hp(t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t));hp(t)&&(null==Yg||Yg.set(t,e)),r=e}return`${e}(${r})`};function QQ(...e){return function(t){const r=Xy((e=>{var r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:t.reducerPath??"api"})})),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=q9;if("serializeQueryArgs"in e.endpointDefinition){const t=e.endpointDefinition.serializeQueryArgs;r=e=>{const r=t(e);return"string"==typeof r?r:q9({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},a={endpointDefinitions:{},batch(e){e()},apiUid:Zw(),extractRehydrationInfo:r,hasRehydrationInfo:Xy((e=>null!=r(e)))},o={injectEndpoints:function(e){const t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"})});for(const[r,n]of Object.entries(t))if(!0!==e.overrideExisting&&r in a.endpointDefinitions){if("throw"===e.overrideExisting)throw new Error(po(39))}else{a.endpointDefinitions[r]=n;for(const e of i)e.injectEndpoint(r,n)}return o},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(const[e,r]of Object.entries(t))"function"==typeof r?r(a.endpointDefinitions[e]):Object.assign(a.endpointDefinitions[e]||{},r);return o}},i=e.map((e=>e.init(o,n,a)));return o.injectEndpoints({endpoints:t.endpoints})}}function YQ(e){for(let t in e)return!1;return!0}var KQ=2147482.647,XQ=({reducerPath:e,api:t,context:r,internalState:n})=>{const{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions;function i(e){const t=n.currentSubscriptions[e];return!!t&&!YQ(t)}const s={};function l(e,t,n,o){const l=r.endpointDefinitions[t],c=(null==l?void 0:l.keepUnusedDataFor)??o.keepUnusedDataFor;if(c===1/0)return;const u=Math.max(0,Math.min(c,KQ));if(!i(e)){const t=s[e];t&&clearTimeout(t),s[e]=setTimeout((()=>{i(e)||n.dispatch(a({queryCacheKey:e})),delete s[e]}),1e3*u)}}return(n,a,i)=>{var c;if(o.match(n)){const t=a.getState()[e],{queryCacheKey:r}=n.payload;l(r,null==(c=t.queries[r])?void 0:c.endpointName,a,t.config)}if(t.util.resetApiState.match(n))for(const[e,t]of Object.entries(s))t&&clearTimeout(t),delete s[e];if(r.hasRehydrationInfo(n)){const t=a.getState()[e],{queries:o}=r.extractRehydrationInfo(n);for(const[e,r]of Object.entries(o))l(e,null==r?void 0:r.endpointName,a,t.config)}}},ZQ=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:a,api:o,assertTagType:i,refetchQuery:s,internalState:l})=>{const{removeQueryResult:c}=o.internalActions,u=mp(gp(n),e2(n)),f=mp(gp(n,a),k0(n,a));let d=[];function p(r,n){const a=n.getState(),i=a[e];if(d.push(...r),"delayed"===i.config.invalidationBehavior&&function(e){var t,r;for(const r in e.queries)if("pending"===(null==(t=e.queries[r])?void 0:t.status))return!0;for(const t in e.mutations)if("pending"===(null==(r=e.mutations[t])?void 0:r.status))return!0;return!1}(i))return;const u=d;if(d=[],0===u.length)return;const f=o.util.selectInvalidatedBy(a,u);t.batch((()=>{const e=Array.from(f.values());for(const{queryCacheKey:t}of e){const e=i.queries[t],r=l.currentSubscriptions[t]??{};e&&(0===p0(r)?n.dispatch(c({queryCacheKey:t})):"uninitialized"!==e.status&&n.dispatch(s(e,t)))}}))}return(e,t)=>{u(e)?p(Jj(e,"invalidatesTags",r,i),t):f(e)?p([],t):o.util.invalidateTags.match(e)&&p(fA(e.payload,void 0,void 0,void 0,void 0,i),t)}},JQ=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:a})=>{const o={};function i({queryCacheKey:t},r){const s=r.getState()[e],l=s.queries[t],u=a.currentSubscriptions[t];if(!l||"uninitialized"===l.status)return;const{lowestPollingInterval:f,skipPollingIfUnfocused:d}=c(u);if(!Number.isFinite(f))return;const p=o[t];null!=p&&p.timeout&&(clearTimeout(p.timeout),p.timeout=void 0);const h=Date.now()+f;o[t]={nextPollTimestamp:h,pollingInterval:f,timeout:setTimeout((()=>{(s.config.focused||!d)&&r.dispatch(n(l,t)),i({queryCacheKey:t},r)}),f)}}function s({queryCacheKey:t},r){const n=r.getState()[e].queries[t],s=a.currentSubscriptions[t];if(!n||"uninitialized"===n.status)return;const{lowestPollingInterval:u}=c(s);if(!Number.isFinite(u))return void l(t);const f=o[t],d=Date.now()+u;(!f||d<f.nextPollTimestamp)&&i({queryCacheKey:t},r)}function l(e){const t=o[e];null!=t&&t.timeout&&clearTimeout(t.timeout),delete o[e]}function c(e={}){let t=!1,r=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(r=Math.min(e[n].pollingInterval,r),t=e[n].skipPollingIfUnfocused||t);return{lowestPollingInterval:r,skipPollingIfUnfocused:t}}return(e,n)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,n),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,n),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&i(e.meta.arg,n),r.util.resetApiState.match(e)&&function(){for(const e of Object.keys(o))l(e)}()}},eY=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:a})=>{const{removeQueryResult:o}=r.internalActions;function i(r,i){const s=r.getState()[e],l=s.queries,c=a.currentSubscriptions;t.batch((()=>{for(const e of Object.keys(c)){const t=l[e],a=c[e];a&&t&&((Object.values(a).some((e=>!0===e[i]))||Object.values(a).every((e=>void 0===e[i]))&&s.config[i])&&(0===p0(a)?r.dispatch(o({queryCacheKey:e})):"uninitialized"!==t.status&&r.dispatch(n(t,e))))}}))}return(e,t)=>{lA.match(e)&&i(t,"refetchOnFocus"),uA.match(e)&&i(t,"refetchOnReconnect")}},W9=new Error("Promise never resolved before cacheEntryRemoved."),tY=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:a,internalState:o})=>{const i=CC(n),s=CC(a),l=gp(n,a),c={};function u(t,n,a,o,i){const s=r.endpointDefinitions[t],l=null==s?void 0:s.onCacheEntryAdded;if(!l)return;let u={};const f=new Promise((e=>{u.cacheEntryRemoved=e})),d=Promise.race([new Promise((e=>{u.valueResolved=e})),f.then((()=>{throw W9}))]);d.catch((()=>{})),c[a]=u;const p=e.endpoints[t].select("query"===s.type?n:a),h=o.dispatch(((e,t,r)=>r)),g={...o,getCacheEntry:()=>p(o.getState()),requestId:i,extra:h,updateCachedData:"query"===s.type?r=>o.dispatch(e.util.updateQueryData(t,n,r)):void 0,cacheDataLoaded:d,cacheEntryRemoved:f},m=l(n,g);Promise.resolve(m).catch((e=>{if(e!==W9)throw e}))}return(r,o,f)=>{const d=function(t){return i(t)?t.meta.arg.queryCacheKey:s(t)?t.meta.arg.fixedCacheKey??t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?Jy(t.payload):""}(r);if(n.pending.match(r)){const e=f[t].queries[d],n=o.getState()[t].queries[d];!e&&n&&u(r.meta.arg.endpointName,r.meta.arg.originalArgs,d,o,r.meta.requestId)}else if(a.pending.match(r))o.getState()[t].mutations[d]&&u(r.meta.arg.endpointName,r.meta.arg.originalArgs,d,o,r.meta.requestId);else if(l(r)){const e=c[d];null!=e&&e.valueResolved&&(e.valueResolved({data:r.payload,meta:r.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r)){const e=c[d];e&&(delete c[d],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(r))for(const[e,t]of Object.entries(c))delete c[e],t.cacheEntryRemoved()}},nY=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{const a=sA(r,n),o=k0(r,n),i=gp(r,n),s={};return(r,n)=>{var l,c;if(a(r)){const{requestId:a,arg:{endpointName:o,originalArgs:i}}=r.meta,l=t.endpointDefinitions[o],c=null==l?void 0:l.onQueryStarted;if(c){const t={},r=new Promise(((e,r)=>{t.resolve=e,t.reject=r}));r.catch((()=>{})),s[a]=t;const u=e.endpoints[o].select("query"===l.type?i:a),f=n.dispatch(((e,t,r)=>r)),d={...n,getCacheEntry:()=>u(n.getState()),requestId:a,extra:f,updateCachedData:"query"===l.type?t=>n.dispatch(e.util.updateQueryData(o,i,t)):void 0,queryFulfilled:r};c(i,d)}}else if(i(r)){const{requestId:e,baseQueryMeta:t}=r.meta;null==(l=s[e])||l.resolve({data:r.payload,meta:t}),delete s[e]}else if(o(r)){const{requestId:e,rejectedWithValue:t,baseQueryMeta:n}=r.meta;null==(c=s[e])||c.reject({error:r.payload??r.error,isUnhandledError:!t,meta:n}),delete s[e]}}},rY=({api:e,context:{apiUid:t},reducerPath:r})=>(r,n)=>{e.util.resetApiState.match(r)&&n.dispatch(e.internalActions.middlewareRegistered(t))},aY=({api:e,queryThunk:t,internalState:r})=>{const n=`${e.reducerPath}/subscriptions`;let a=null,o=null;const{updateSubscriptionOptions:i,unsubscribeQueryResult:s}=e.internalActions,l=()=>r.currentSubscriptions,c={getSubscriptions:l,getSubscriptionCount:e=>p0(l()[e]??{}),isRequestSubscribed:(e,t)=>{var r;const n=l();return!(null==(r=null==n?void 0:n[e])||!r[t])}};return(l,u)=>{if(a||(a=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(l))return a=r.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(l))return[!1,c];const f=((r,n)=>{var a,o,l;if(i.match(n)){const{queryCacheKey:e,requestId:t,options:o}=n.payload;return null!=(a=null==r?void 0:r[e])&&a[t]&&(r[e][t]=o),!0}if(s.match(n)){const{queryCacheKey:e,requestId:t}=n.payload;return r[e]&&delete r[e][t],!0}if(e.internalActions.removeQueryResult.match(n))return delete r[n.payload.queryCacheKey],!0;if(t.pending.match(n)){const{meta:{arg:e,requestId:t}}=n,a=r[o=e.queryCacheKey]??(r[o]={});return a[`${t}_running`]={},e.subscribe&&(a[t]=e.subscriptionOptions??a[t]??{}),!0}let c=!1;if(t.fulfilled.match(n)||t.rejected.match(n)){const e=r[n.meta.arg.queryCacheKey]||{},t=`${n.meta.requestId}_running`;c||(c=!!e[t]),delete e[t]}if(t.rejected.match(n)){const{meta:{condition:e,arg:t,requestId:a}}=n;if(e&&t.subscribe){const e=r[l=t.queryCacheKey]??(r[l]={});e[a]=t.subscriptionOptions??e[a]??{},c=!0}}return c})(r.currentSubscriptions,l);let d=!0;if(f){o||(o=setTimeout((()=>{const t=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,n]=Gj(a,(()=>t));u.next(e.internalActions.subscriptionsUpdated(n)),a=t,o=null}),500));const i="string"==typeof l.type&&!!l.type.startsWith(n),s=t.rejected.match(l)&&l.meta.condition&&!!l.meta.arg.subscribe;d=!i&&!s}return[d,!1]}};function oY(e){const{reducerPath:t,queryThunk:r,api:n,context:a}=e,{apiUid:o}=a,i={invalidateTags:kr(`${t}/invalidateTags`)},s=e=>e.type.startsWith(`${t}/`),l=[rY,XQ,ZQ,JQ,tY,nY];return{middleware:r=>{let i=!1;const u={...e,internalState:{currentSubscriptions:{}},refetchQuery:c,isThisApiSliceAction:s},f=l.map((e=>e(u))),d=aY(u),p=eY(u);return e=>l=>{if(!Dj(l))return e(l);i||(i=!0,r.dispatch(n.internalActions.middlewareRegistered(o)));const c={...r,next:e},u=r.getState(),[h,g]=d(l,c,u);let m;if(m=h?e(l):g,r.getState()[t]&&(p(l,c,u),s(l)||a.hasRehydrationInfo(l)))for(let e of f)e(l,c,u);return m}},actions:i};function c(e,t,n={}){return r({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t,...n})}}function Zd(e,...t){return Object.assign(e,...t)}var H9=Symbol(),sY=({createSelector:e=zr}={})=>({name:H9,init(t,{baseQuery:r,tagTypes:n,reducerPath:a,serializeQueryArgs:o,keepUnusedDataFor:i,refetchOnMountOrArgChange:s,refetchOnFocus:l,refetchOnReconnect:c,invalidationBehavior:u},f){UH();const d=e=>e;Object.assign(t,{reducerPath:a,endpoints:{},internalActions:{onOnline:uA,onOffline:Xj,onFocus:lA,onFocusLost:Kj},util:{}});const{queryThunk:p,mutationThunk:h,patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,buildMatchThunkActions:b}=qQ({baseQuery:r,reducerPath:a,context:f,api:t,serializeQueryArgs:o,assertTagType:d}),{reducer:w,actions:_}=WQ({context:f,queryThunk:p,mutationThunk:h,reducerPath:a,assertTagType:d,config:{refetchOnFocus:l,refetchOnReconnect:c,refetchOnMountOrArgChange:s,keepUnusedDataFor:i,reducerPath:a,invalidationBehavior:u}});Zd(t.util,{patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,resetApiState:_.resetApiState}),Zd(t.internalActions,_);const{middleware:k,actions:x}=oY({reducerPath:a,context:f,queryThunk:p,mutationThunk:h,api:t,assertTagType:d});Zd(t.util,x),Zd(t,{reducer:w,middleware:k});const{buildQuerySelector:E,buildMutationSelector:A,selectInvalidatedBy:S,selectCachedArgsForQuery:C}=HQ({serializeQueryArgs:o,reducerPath:a,createSelector:e});Zd(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:C});const{buildInitiateQuery:z,buildInitiateMutation:I,getRunningMutationThunk:j,getRunningMutationsThunk:P,getRunningQueriesThunk:T,getRunningQueryThunk:R}=GQ({queryThunk:p,mutationThunk:h,api:t,serializeQueryArgs:o,context:f});return Zd(t.util,{getRunningMutationThunk:j,getRunningMutationsThunk:P,getRunningQueryThunk:R,getRunningQueriesThunk:T}),{name:H9,injectEndpoint(e,r){var n;const a=t;(n=a.endpoints)[e]??(n[e]={}),Zj(r)?Zd(a.endpoints[e],{name:e,select:E(e,r),initiate:z(e,r)},b(p,e)):BQ(r)&&Zd(a.endpoints[e],{name:e,select:A(),initiate:I(e)},b(h,e))}}}}),qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q9,Y9,e3={exports:{}},Kt={};
1
+ var AH=Object.defineProperty,RH=(e,t,r)=>t in e?AH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,An=(e,t,r)=>RH(e,"symbol"!=typeof t?t+"":t,r);function TH(e,t){for(var r=0;r<t.length;r++){const n=t[r];if("string"!=typeof n&&!Array.isArray(n))for(const t in n)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function vC(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Yx=()=>Math.random().toString(36).substring(7).split("").join("."),PH={INIT:`@@redux/INIT${Yx()}`,REPLACE:`@@redux/REPLACE${Yx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yx()}`},S9=PH;function hp(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function $H(e){Object.keys(e).forEach((t=>{const r=e[t];if(typeof r(void 0,{type:S9.INIT})>"u")throw new Error(vC(12));if(typeof r(void 0,{type:S9.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(vC(13))}))}function Nj(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const a=t[n];"function"==typeof e[a]&&(r[a]=e[a])}const n=Object.keys(r);let a;try{$H(r)}catch(e){a=e}return function(e={},t){if(a)throw a;let o=!1;const i={};for(let a=0;a<n.length;a++){const s=n[a],l=r[s],c=e[s],u=l(c,t);if(typeof u>"u")throw t&&t.type,new Error(vC(14));i[s]=u,o=o||u!==c}return o=o||n.length!==Object.keys(e).length,o?i:e}}function Dj(e){return hp(e)&&"type"in e&&"string"==typeof e.type}var rA=Symbol.for("immer-nothing"),zy=Symbol.for("immer-draftable"),Is=Symbol.for("immer-state");function uo(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var om=Object.getPrototypeOf;function qc(e){return!!e&&!!e[Is]}function Wc(e){var t;return!!e&&(jj(e)||Array.isArray(e)||!!e[zy]||!(null==(t=e.constructor)||!t[zy])||zv(e)||Mv(e))}var zH=Object.prototype.constructor.toString();function jj(e){if(!e||"object"!=typeof e)return!1;const t=om(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===zH}function MH(e){return qc(e)||uo(15,e),e[Is].base_}function w0(e,t){0===sm(e)?Object.entries(e).forEach((([r,n])=>{t(r,n,e)})):e.forEach(((r,n)=>t(n,r,e)))}function sm(e){const t=e[Is];return t?t.type_:Array.isArray(e)?1:zv(e)?2:Mv(e)?3:0}function Qy(e,t){return 2===sm(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Kx(e,t){return 2===sm(e)?e.get(t):e[t]}function Lj(e,t,r){const n=sm(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function OH(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function zv(e){return e instanceof Map}function Mv(e){return e instanceof Set}function Wh(e){return e.copy_||e.base_}function bC(e,t){if(zv(e))return new Map(e);if(Mv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&jj(e))return om(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[Is];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const a=n[t],o=r[a];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(om(e),r)}function aA(e,t=!1){return Xw(e)||qc(e)||!Wc(e)||(sm(e)>1&&(e.set=e.add=e.clear=e.delete=NH),Object.freeze(e),t&&w0(e,((e,t)=>aA(t,!0)))),e}function NH(){uo(2)}function Xw(e){return Object.isFrozen(e)}var Yy,_C={};function im(e){const t=_C[e];return t||uo(0,e),t}function DH(e,t){_C[e]||(_C[e]=t)}function Vj(){return Yy}function jH(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function E9(e,t){t&&(im("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wC(e){kC(e),e.drafts_.forEach(LH),e.drafts_=null}function kC(e){e===Yy&&(Yy=e.parent_)}function C9(e){return Yy=jH(Yy,e)}function LH(e){const t=e[Is];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function I9(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[Is].modified_&&(wC(t),uo(4)),Wc(e)&&(e=Z_(t,e),t.parent_||J_(t,e)),t.patches_&&im("Patches").generateReplacementPatches_(r[Is].base_,e,t.patches_,t.inversePatches_)):e=Z_(t,r,[]),wC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rA?e:void 0}function Z_(e,t,r){if(Xw(t))return t;const n=t[Is];if(!n)return w0(t,((a,o)=>A9(e,n,t,a,o,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return J_(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let a=t,o=!1;3===n.type_&&(a=new Set(t),t.clear(),o=!0),w0(a,((a,i)=>A9(e,n,t,a,i,r,o))),J_(e,t,!1),r&&e.patches_&&im("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function A9(e,t,r,n,a,o,i){if(qc(a)){const i=Z_(e,a,o&&t&&3!==t.type_&&!Qy(t.assigned_,n)?o.concat(n):void 0);if(Lj(r,n,i),!qc(i))return;e.canAutoFreeze_=!1}else i&&r.add(a);if(Wc(a)&&!Xw(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Z_(e,a),(!t||!t.scope_.parent_)&&J_(e,a)}}function J_(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&aA(t,r)}function VH(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Vj(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,o=oA;r&&(a=[n],o=Ky);const{revoke:i,proxy:s}=Proxy.revocable(a,o);return n.draft_=s,n.revoke_=i,s}var oA={get(e,t){if(t===Is)return e;const r=Wh(e);if(!Qy(r,t))return BH(e,r,t);const n=r[t];return e.finalized_||!Wc(n)?n:n===Xx(e.base_,t)?(Zx(e),e.copy_[t]=SC(n,e)):n},has:(e,t)=>t in Wh(e),ownKeys:e=>Reflect.ownKeys(Wh(e)),set(e,t,r){const n=Bj(Wh(e),t);if(null!=n&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=Xx(Wh(e),t),a=null==n?void 0:n[Is];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(OH(r,n)&&(void 0!==r||Qy(e.base_,t)))return!0;Zx(e),xC(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Xx(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Zx(e),xC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=Wh(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){uo(11)},getPrototypeOf:e=>om(e.base_),setPrototypeOf(){uo(12)}},Ky={};function Xx(e,t){const r=e[Is];return(r?Wh(r):e)[t]}function BH(e,t,r){var n;const a=Bj(t,r);return a?"value"in a?a.value:null==(n=a.get)?void 0:n.call(e.draft_):void 0}function Bj(e,t){if(!(t in e))return;let r=om(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=om(r)}}function xC(e){e.modified_||(e.modified_=!0,e.parent_&&xC(e.parent_))}function Zx(e){e.copy_||(e.copy_=bC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}w0(oA,((e,t)=>{Ky[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ky.deleteProperty=function(e,t){return Ky.set.call(this,e,t,void 0)},Ky.set=function(e,t,r){return oA.set.call(this,e[0],t,r,e[0])};var FH=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...a){return n.produce(e,(e=>t.call(this,e,...a)))}}let n;if("function"!=typeof t&&uo(6),void 0!==r&&"function"!=typeof r&&uo(7),Wc(e)){const a=C9(this),o=SC(e,void 0);let i=!0;try{n=t(o),i=!1}finally{i?wC(a):kC(a)}return E9(a,r),I9(n,a)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===rA&&(n=void 0),this.autoFreeze_&&aA(n,!0),r){const t=[],a=[];im("Patches").generateReplacementPatches_(e,n,t,a),r(t,a)}return n}uo(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Wc(e)||uo(8),qc(e)&&(e=Fj(e));const t=C9(this),r=SC(e,void 0);return r[Is].isManual_=!0,kC(t),r}finishDraft(e,t){const r=e&&e[Is];(!r||!r.isManual_)&&uo(9);const{scope_:n}=r;return E9(n,t),I9(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=im("Patches").applyPatches_;return qc(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};function SC(e,t){const r=zv(e)?im("MapSet").proxyMap_(e,t):Mv(e)?im("MapSet").proxySet_(e,t):VH(e,t);return(t?t.scope_:Vj()).drafts_.push(r),r}function Fj(e){return qc(e)||uo(10,e),Uj(e)}function Uj(e){if(!Wc(e)||Xw(e))return e;const t=e[Is];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=bC(e,t.scope_.immer_.useStrictShallowCopy_)}else r=bC(e,!0);return w0(r,((e,t)=>{Lj(r,e,Uj(t))})),t&&(t.finalized_=!1),r}function UH(){const e="replace",t="remove";function r(e){if(!Wc(e))return e;if(Array.isArray(e))return e.map(r);if(zv(e))return new Map(Array.from(e.entries()).map((([e,t])=>[e,r(t)])));if(Mv(e))return new Set(Array.from(e).map(r));const t=Object.create(om(e));for(const n in e)t[n]=r(e[n]);return Qy(e,zy)&&(t[zy]=e[zy]),t}function n(e){return qc(e)?r(e):e}DH("Patches",{applyPatches_:function(n,a){return a.forEach((a=>{const{path:o,op:i}=a;let s=n;for(let e=0;e<o.length-1;e++){const t=sm(s);let r=o[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||"constructor"===r)&&uo(19),"function"==typeof s&&"prototype"===r&&uo(19),s=Kx(s,r),"object"!=typeof s&&uo(18,o.join("/"))}const l=sm(s),c=r(a.value),u=o[o.length-1];switch(i){case e:switch(l){case 2:return s.set(u,c);case 3:uo(16);default:return s[u]=c}case"add":switch(l){case 1:return"-"===u?s.push(c):s.splice(u,0,c);case 2:return s.set(u,c);case 3:return s.add(c);default:return s[u]=c}case t:switch(l){case 1:return s.splice(u,1);case 2:return s.delete(u);case 3:return s.delete(a.value);default:return delete s[u]}default:uo(17,i)}})),n},generatePatches_:function(r,a,o,i){switch(r.type_){case 0:case 2:return function(r,a,o,i){const{base_:s,copy_:l}=r;w0(r.assigned_,((r,c)=>{const u=Kx(s,r),f=Kx(l,r),d=c?Qy(s,r)?e:"add":t;if(u===f&&d===e)return;const p=a.concat(r);o.push(d===t?{op:d,path:p}:{op:d,path:p,value:f}),i.push("add"===d?{op:t,path:p}:d===t?{op:"add",path:p,value:n(u)}:{op:e,path:p,value:n(u)})}))}(r,a,o,i);case 1:return function(r,a,o,i){let{base_:s,assigned_:l}=r,c=r.copy_;c.length<s.length&&([s,c]=[c,s],[o,i]=[i,o]);for(let t=0;t<s.length;t++)if(l[t]&&c[t]!==s[t]){const r=a.concat([t]);o.push({op:e,path:r,value:n(c[t])}),i.push({op:e,path:r,value:n(s[t])})}for(let e=s.length;e<c.length;e++){const t=a.concat([e]);o.push({op:"add",path:t,value:n(c[e])})}for(let e=c.length-1;s.length<=e;--e){const r=a.concat([e]);i.push({op:t,path:r})}}(r,a,o,i);case 3:return function(e,r,n,a){let{base_:o,copy_:i}=e,s=0;o.forEach((e=>{if(!i.has(e)){const o=r.concat([s]);n.push({op:t,path:o,value:e}),a.unshift({op:"add",path:o,value:e})}s++})),s=0,i.forEach((e=>{if(!o.has(e)){const o=r.concat([s]);n.push({op:"add",path:o,value:e}),a.unshift({op:t,path:o,value:e})}s++}))}(r,a,o,i)}},generateReplacementPatches_:function(t,r,n,a){n.push({op:e,path:[],value:r===rA?void 0:r}),a.push({op:e,path:[],value:t})}})}var oi=new FH,Ov=oi.produce,Gj=oi.produceWithPatches.bind(oi);oi.setAutoFreeze.bind(oi),oi.setUseStrictShallowCopy.bind(oi);var R9=oi.applyPatches.bind(oi);function GH(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}function qH(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}function WH(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const r=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${r}]`)}}oi.createDraft.bind(oi),oi.finishDraft.bind(oi);var T9=e=>Array.isArray(e)?e:[e];function HH(e){const t=Array.isArray(e[0])?e[0]:e;return WH(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function QH(e,t){const r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var YH=class{constructor(e){this.value=e}deref(){return this.value}},KH=typeof WeakRef<"u"?WeakRef:YH,XH=0,P9=1;function Ub(){return{s:XH,v:void 0,o:null,p:null}}function Xy(e,t={}){let r=Ub();const{resultEqualityCheck:n}=t;let a,o=0;function i(){var t;let i=r;const{length:s}=arguments;for(let e=0,t=s;e<t;e++){const t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=i.o;null===e&&(i.o=e=new WeakMap);const r=e.get(t);void 0===r?(i=Ub(),e.set(t,i)):i=r}else{let e=i.p;null===e&&(i.p=e=new Map);const r=e.get(t);void 0===r?(i=Ub(),e.set(t,i)):i=r}}const l=i;let c;if(i.s===P9?c=i.v:(c=e.apply(null,arguments),o++),l.s=P9,n){const e=(null==(t=null==a?void 0:a.deref)?void 0:t.call(a))??a;null!=e&&n(e,c)&&(c=e,0!==o&&o--),a="object"==typeof c&&null!==c||"function"==typeof c?new KH(c):c}return l.v=c,c}return i.clearCache=()=>{r=Ub(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function qj(e,...t){const r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n=0,a=0,o={},i=e.pop();"object"==typeof i&&(o=i,i=e.pop()),GH(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);const s={...r,...o},{memoize:l,memoizeOptions:c=[],argsMemoize:u=Xy,argsMemoizeOptions:f=[],devModeChecks:d={}}=s,p=T9(c),h=T9(f),g=HH(e),m=l((function(){return n++,i.apply(null,arguments)}),...p),y=u((function(){a++;const e=QH(g,arguments);return t=m.apply(null,e),t}),...h);return Object.assign(y,{resultFunc:i,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>t,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:l,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var zr=qj(Xy),ZH=Object.assign(((e,t=zr)=>{qH(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const r=Object.keys(e);return t(r.map((t=>e[t])),((...e)=>e.reduce(((e,t,n)=>(e[r[n]]=t,e)),{})))}),{withTypes:()=>ZH}),JH=(...e)=>{const t=qj(...e),r=Object.assign(((...e)=>{const r=t(...e),n=(e,...t)=>r(qc(e)?Fj(e):e,...t);return Object.assign(n,r),n}),{withTypes:()=>r});return r};JH(Xy);var eQ=e=>e&&"function"==typeof e.match;function kr(e,t){function r(...r){if(t){let n=t(...r);if(!n)throw new Error(po(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>Dj(t)&&t.type===e,r}function $9(e){return Wc(e)?Ov(e,(()=>{})):e}function EC(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw new Error(po(10));const n=r.insert(t,e);return e.set(t,n),n}var _y="RTK_autoBatch",Y1=()=>e=>({payload:e,meta:{[_y]:!0}});function Wj(e){const t={},r=[];let n;const a={addCase(e,r){const n="string"==typeof e?e:e.type;if(!n)throw new Error(po(28));if(n in t)throw new Error(po(29));return t[n]=r,a},addMatcher:(e,t)=>(r.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(n=e,a)};return e(a),[t,r,n]}function tQ(e){return"function"==typeof e}function nQ(e,t){let r,[n,a,o]=Wj(t);if(tQ(e))r=()=>$9(e());else{const t=$9(e);r=()=>t}function i(e=r(),t){let i=[n[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===i.filter((e=>!!e)).length&&(i=[o]),i.reduce(((e,r)=>{if(r){if(qc(e)){const n=r(e,t);return void 0===n?e:n}if(Wc(e))return Ov(e,(e=>r(e,t)));{const n=r(e,t);if(void 0===n){if(null===e)return e;throw new Error(po(9))}return n}}return e}),e)}return i.getInitialState=r,i}var rQ="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Zw=(e=21)=>{let t="",r=e;for(;r--;)t+=rQ[64*Math.random()|0];return t},Hj=(e,t)=>eQ(e)?e.match(t):e(t);function mp(...e){return t=>e.some((e=>Hj(e,t)))}function My(...e){return t=>e.every((e=>Hj(e,t)))}function Jw(e,t){if(!e||!e.meta)return!1;const r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Nv(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function sA(...e){return 0===e.length?e=>Jw(e,["pending"]):Nv(e)?t=>mp(...e.map((e=>e.pending)))(t):sA()(e[0])}function k0(...e){return 0===e.length?e=>Jw(e,["rejected"]):Nv(e)?t=>mp(...e.map((e=>e.rejected)))(t):k0()(e[0])}function e2(...e){const t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||Nv(e)?r=>My(k0(...e),t)(r):e2()(e[0])}function gp(...e){return 0===e.length?e=>Jw(e,["fulfilled"]):Nv(e)?t=>mp(...e.map((e=>e.fulfilled)))(t):gp()(e[0])}function CC(...e){return 0===e.length?e=>Jw(e,["pending","fulfilled","rejected"]):Nv(e)?t=>{const r=[];for(const t of e)r.push(t.pending,t.rejected,t.fulfilled);return mp(...r)(t)}:CC()(e[0])}var aQ=["name","message","stack","code"],Jx=class{constructor(e,t){An(this,"_type"),this.payload=e,this.meta=t}},z9=class{constructor(e,t){An(this,"_type"),this.payload=e,this.meta=t}},oQ=e=>{if("object"==typeof e&&null!==e){const t={};for(const r of aQ)"string"==typeof e[r]&&(t[r]=e[r]);return t}return{message:String(e)}},M9=(()=>{function e(e,t,r){const n=kr(e+"/fulfilled",((e,t,r,n)=>({payload:e,meta:{...n||{},arg:r,requestId:t,requestStatus:"fulfilled"}}))),a=kr(e+"/pending",((e,t,r)=>({payload:void 0,meta:{...r||{},arg:t,requestId:e,requestStatus:"pending"}}))),o=kr(e+"/rejected",((e,t,n,a,o)=>({payload:a,error:(r&&r.serializeError||oQ)(e||"Rejected"),meta:{...o||{},arg:n,requestId:t,rejectedWithValue:!!a,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)}})));return Object.assign((function(e){return(i,s,l)=>{const c=null!=r&&r.idGenerator?r.idGenerator(e):Zw(),u=new AbortController;let f,d;function p(e){d=e,u.abort()}const h=async function(){var h,g;let m;try{let o=null==(h=null==r?void 0:r.condition)?void 0:h.call(r,e,{getState:s,extra:l});if(iQ(o)&&(o=await o),!1===o||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise(((e,t)=>{f=()=>{t({name:"AbortError",message:d||"Aborted"})},u.signal.addEventListener("abort",f)}));i(a(c,e,null==(g=null==r?void 0:r.getPendingMeta)?void 0:g.call(r,{requestId:c,arg:e},{getState:s,extra:l}))),m=await Promise.race([y,Promise.resolve(t(e,{dispatch:i,getState:s,extra:l,requestId:c,signal:u.signal,abort:p,rejectWithValue:(e,t)=>new Jx(e,t),fulfillWithValue:(e,t)=>new z9(e,t)})).then((t=>{if(t instanceof Jx)throw t;return t instanceof z9?n(t.payload,c,e,t.meta):n(t,c,e)}))])}catch(t){m=t instanceof Jx?o(null,c,e,t.payload,t.meta):o(t,c,e)}finally{f&&u.signal.removeEventListener("abort",f)}return r&&!r.dispatchConditionRejection&&o.match(m)&&m.meta.condition||i(m),m}();return Object.assign(h,{abort:p,requestId:c,arg:e,unwrap:()=>h.then(sQ)})}}),{pending:a,rejected:o,fulfilled:n,settled:mp(o,n),typePrefix:e})}return e.withTypes=()=>e,e})();function sQ(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function iQ(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}var cQ=Symbol.for("rtk-slice-createasyncthunk");function lQ(e,t){return`${e}/${t}`}function uQ({creators:e}={}){var t;const r=null==(t=null==e?void 0:e.asyncThunk)?void 0:t[cQ];return function(e){const{name:t,reducerPath:n=t}=e;if(!t)throw new Error(po(11));const a=("function"==typeof e.reducers?e.reducers(dQ()):e.reducers)||{},o=Object.keys(a),i={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const r="string"==typeof e?e:e.type;if(!r)throw new Error(po(12));if(r in i.sliceCaseReducersByType)throw new Error(po(13));return i.sliceCaseReducersByType[r]=t,s},addMatcher:(e,t)=>(i.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(i.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(i.sliceCaseReducersByName[e]=t,s)};function l(){const[t={},r=[],n]="function"==typeof e.extraReducers?Wj(e.extraReducers):[e.extraReducers],a={...t,...i.sliceCaseReducersByType};return nQ(e.initialState,(e=>{for(let t in a)e.addCase(t,a[t]);for(let t of i.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)}))}o.forEach((n=>{const o=a[n],i={reducerName:n,type:lQ(t,n),createNotation:"function"==typeof e.reducers};hQ(o)?gQ(i,o,s,r):pQ(i,o,s)}));const c=e=>e,u=new Map;let f;function d(e,t){return f||(f=l()),f(e,t)}function p(){return f||(f=l()),f.getInitialState()}function h(t,r=!1){function n(e){let n=e[t];return typeof n>"u"&&r&&(n=p()),n}function a(t=c){const n=EC(u,r,{insert:()=>new WeakMap});return EC(n,t,{insert:()=>{const n={};for(const[a,o]of Object.entries(e.selectors??{}))n[a]=fQ(o,t,p,r);return n}})}return{reducerPath:t,getSelectors:a,get selectors(){return a(n)},selectSlice:n}}const g={name:t,reducer:d,actions:i.actionCreators,caseReducers:i.sliceCaseReducersByName,getInitialState:p,...h(n),injectInto(e,{reducerPath:t,...r}={}){const a=t??n;return e.inject({reducerPath:a,reducer:d},r),{...g,...h(a,!0)}}};return g}}function fQ(e,t,r,n){function a(a,...o){let i=t(a);return typeof i>"u"&&n&&(i=r()),e(i,...o)}return a.unwrapped=e,a}var ur=uQ();function dQ(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}function pQ({type:e,reducerName:t,createNotation:r},n,a){let o,i;if("reducer"in n){if(r&&!mQ(n))throw new Error(po(17));o=n.reducer,i=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?kr(e,i):kr(e))}function hQ(e){return"asyncThunk"===e._reducerDefinitionType}function mQ(e){return"reducerWithPrepare"===e._reducerDefinitionType}function gQ({type:e,reducerName:t},r,n,a){if(!a)throw new Error(po(18));const{payloadCreator:o,fulfilled:i,pending:s,rejected:l,settled:c,options:u}=r,f=a(e,o,u);n.exposeAction(t,f),i&&n.addCase(f.fulfilled,i),s&&n.addCase(f.pending,s),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:i||Gb,pending:s||Gb,rejected:l||Gb,settled:c||Gb})}function Gb(){}var yQ=(e,t)=>{if("function"!=typeof e)throw new Error(po(32))},iA="listenerMiddleware",vQ=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:o}=e;if(t)a=kr(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(po(21));return yQ(o),{predicate:a,type:t,effect:o}},bQ=Object.assign((e=>{const{type:t,predicate:r,effect:n}=vQ(e);return{id:Zw(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(po(22))}}}),{withTypes:()=>bQ}),_Q=Object.assign(kr(`${iA}/add`),{withTypes:()=>_Q});kr(`${iA}/removeAll`);var wQ=Object.assign(kr(`${iA}/remove`),{withTypes:()=>wQ}),kQ=e=>"reducerPath"in e&&"string"==typeof e.reducerPath,xQ=e=>e.flatMap((e=>kQ(e)?[[e.reducerPath,e.reducer]]:Object.entries(e))),cA=Symbol.for("rtk-state-proxy-original"),SQ=e=>!!e&&!!e[cA],EQ=new WeakMap,CQ=(e,t)=>EC(EQ,e,{insert:()=>new Proxy(e,{get:(e,r,n)=>{if(r===cA)return e;const a=Reflect.get(e,r,n);if(typeof a>"u"){const e=t[r.toString()];if(e){const t=e(void 0,{type:Zw()});if(typeof t>"u")throw new Error(po(24));return t}}return a}})}),IQ=e=>{if(!SQ(e))throw new Error(po(25));return e[cA]},AQ=(e={})=>e;function RQ(...e){const t=Object.fromEntries(xQ(e)),r=()=>Object.keys(t).length?Nj(t):AQ;let n=r();function a(e,t){return n(e,t)}a.withLazyLoadedSlices=()=>a;const o=Object.assign((function(e,r){return function(n,...a){return e(CQ(r?r(n,...a):n,t),...a)}}),{original:IQ});return Object.assign(a,{inject:(e,o={})=>{const{reducerPath:i,reducer:s}=e,l=t[i];return!o.overrideExisting&&l&&l!==s||(t[i]=s,n=r()),a},selector:o})}function po(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var TQ={USER:"teamcity",npm_config_user_agent:"npm/10.9.3 node/v22.18.0 linux x64 workspaces/true",SENTRY_AUTH_TOKEN:"1d93ff28a44e4c3aaaaff854277cd8583c1de670bd8744bc895670dfd9300840",npm_node_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_config_noproxy:"",HOME:"/home/teamcity",npm_package_json:"/mnt/agent/work/70fcd8585843667f/packages/notifications/package.json",npm_config_userconfig:"/home/teamcity/.npmrc",npm_config_local_prefix:"/mnt/agent/work/70fcd8585843667f",COLOR:"1",npm_config_progress:"",TEMP:"/mnt/agent/temp/buildTmp",npm_config_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_config_npm_version:"10.9.3",npm_config_cache:"/home/teamcity/.npm",USE_NPM_LIBS:"false",npm_config_ignore_scripts:"true",npm_config_node_gyp:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/mnt/agent/work/70fcd8585843667f/packages/notifications/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/packages/node_modules/.bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/mnt/agent/work/70fcd8585843667f/node_modules/.bin:/mnt/agent/work/node_modules/.bin:/mnt/agent/node_modules/.bin:/mnt/node_modules/.bin:/node_modules/.bin:/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/teamcity/.cargo/bin:/home/teamcity/.rvm/gems/ruby-3.3.9/bin:/home/teamcity/.rvm/gems/ruby-3.3.9@global/bin:/home/teamcity/.rvm/rubies/ruby-3.3.9/bin:/home/teamcity/.rvm/bin:/home/teamcity/.local/bin:/usr/lib/jvm/java-21-amazon-corretto/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin:/usr/share/dotnet:/usr/share/dotnet/tools:/home/teamcity/google-cloud-sdk/bin:/home/teamcity/go/bin:/usr/bin/mvn:/home/teamcity/.nvm/versions/node/v22.18.0/bin",TURBO_HASH:"caadd5f91348bb30",NODE:"/home/teamcity/.nvm/versions/node/v22.18.0/bin/node",npm_package_name:"@wellesley/notifications",npm_config_color:"always",DOMAIN_ENV:"test",LANG:"en_US.UTF-8",TURBO_TEAM:"wellesley",TMP:"/mnt/agent/temp/buildTmp",TURBO_API:"https://turborepo-remote-cache-fo3np.ondigitalocean.app",npm_lifecycle_script:"vite build",SHELL:"/bin/bash",npm_package_version:"1.0.757",npm_lifecycle_event:"build",TURBO_CACHE:"remote:rw",SENTRY_MAPS_UPLOAD:"true",npm_config_globalconfig:"/home/teamcity/.nvm/versions/node/v22.18.0/etc/npmrc",npm_config_init_module:"/home/teamcity/.npm-init.js",PWD:"/mnt/agent/work/70fcd8585843667f/packages/notifications",npm_execpath:"/home/teamcity/.nvm/versions/node/v22.18.0/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_prefix:"/home/teamcity/.nvm/versions/node/v22.18.0",npm_command:"run-script",TURBO_TOKEN:"wellesley-turbo-token",USE_PACKAGES_FROM_NPM:"false",INIT_CWD:"/mnt/agent/work/70fcd8585843667f/packages/notifications",EDITOR:"vi",NODE_ENV:"production",BUILD_NUMBER:"3783",APP_NAME:"@wellesley/notifications"},Qj=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Qj||{});function PQ(e){return{status:e,isUninitialized:"uninitialized"===e,isLoading:"pending"===e,isSuccess:"fulfilled"===e,isError:"rejected"===e}}function $Q(e){return new RegExp("(^|:)//").test(e)}var zQ=e=>e.replace(/\/$/,""),MQ=e=>e.replace(/^\//,"");function OQ(e,t){if(!e)return t;if(!t)return e;if($Q(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return`${e=zQ(e)}${r}${t=MQ(t)}`}var O9=e=>[].concat(...e);function NQ(){return typeof navigator>"u"||void 0===navigator.onLine||navigator.onLine}function DQ(){return typeof document>"u"||"hidden"!==document.visibilityState}var N9=hp;function Yj(e,t){if(e===t||!(N9(e)&&N9(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),n=Object.keys(e);let a=r.length===n.length;const o=Array.isArray(t)?[]:{};for(const n of r)o[n]=Yj(e[n],t[n]),a&&(a=e[n]===o[n]);return a?e:o}var D9=(...e)=>fetch(...e),jQ=e=>e.status>=200&&e.status<=299,LQ=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function j9(e){if(!hp(e))return e;const t={...e};for(const[e,r]of Object.entries(t))void 0===r&&delete t[e];return t}function VQ({baseUrl:e,prepareHeaders:t=e=>e,fetchFn:r=D9,paramsSerializer:n,isJsonContentType:a=LQ,jsonContentType:o="application/json",jsonReplacer:i,timeout:s,responseHandler:l,validateStatus:c,...u}={}){return typeof fetch>"u"&&r===D9&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(d,p)=>{const{signal:h,getState:g,extra:m,endpoint:y,forced:v,type:b}=p;let w,{url:_,headers:k=new Headers(u.headers),params:x,responseHandler:E=l??"json",validateStatus:A=c??jQ,timeout:S=s,...C}="string"==typeof d?{url:d}:d,z={...u,signal:h,...C};k=new Headers(j9(k)),z.headers=await t(k,{getState:g,extra:m,endpoint:y,forced:v,type:b})||k;const I=e=>"object"==typeof e&&(hp(e)||Array.isArray(e)||"function"==typeof e.toJSON);if(!z.headers.has("content-type")&&I(z.body)&&z.headers.set("content-type",o),I(z.body)&&a(z.headers)&&(z.body=JSON.stringify(z.body,i)),x){const e=~_.indexOf("?")?"&":"?";_+=e+(n?n(x):new URLSearchParams(j9(x)))}_=OQ(e,_);const j=new Request(_,z);w={request:new Request(_,z)};let P,T=!1,R=S&&setTimeout((()=>{T=!0,p.abort()}),S);try{P=await r(j)}catch(e){return{error:{status:T?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:w}}finally{R&&clearTimeout(R)}const N=P.clone();w.response=N;let O,M="";try{let e;if(await Promise.all([f(P,E).then((e=>O=e),(t=>e=t)),N.text().then((e=>M=e),(()=>{}))]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:P.status,data:M,error:String(e)},meta:w}}return A(P,O)?{data:O,meta:w}:{error:{status:P.status,data:O},meta:w}};async function f(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=a(e.headers)?"json":"text"),"json"===t){const t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}var L9=class{constructor(e,t=void 0){this.value=e,this.meta=t}},lA=kr("__rtkq/focused"),Kj=kr("__rtkq/unfocused"),uA=kr("__rtkq/online"),Xj=kr("__rtkq/offline");function Zj(e){return"query"===e.type}function BQ(e){return"mutation"===e.type}function fA(e,t,r,n,a,o){return FQ(e)?e(t,r,n,a).map(IC).map(o):Array.isArray(e)?e.map(IC).map(o):[]}function FQ(e){return"function"==typeof e}function IC(e){return"string"==typeof e?{type:e}:e}function V9(e){return null!=e}function p0(e){let t=0;for(const r in e)t++;return t}function UQ(e,t){return e.catch(t)}var Zy=Symbol("forceQueryFn"),AC=e=>"function"==typeof e[Zy];function GQ({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:a}){const o=new Map,i=new Map,{unsubscribeQueryResult:s,removeMutationResult:l,updateSubscriptionOptions:c}=n.internalActions;return{buildInitiateQuery:function(r,a){const i=(l,{subscribe:u=!0,forceRefetch:f,subscriptionOptions:d,[Zy]:p,...h}={})=>(g,m)=>{var y;const v=e({queryArgs:l,endpointDefinition:a,endpointName:r}),b=t({...h,type:"query",subscribe:u,forceRefetch:f,subscriptionOptions:d,endpointName:r,originalArgs:l,queryCacheKey:v,[Zy]:p}),w=n.endpoints[r].select(l),_=g(b),k=w(m()),{requestId:x,abort:E}=_,A=k.requestId!==x,S=null==(y=o.get(g))?void 0:y[v],C=()=>w(m()),z=Object.assign(p?_.then(C):A&&!S?Promise.resolve(k):Promise.all([S,_]).then(C),{arg:l,requestId:x,subscriptionOptions:d,queryCacheKey:v,abort:E,async unwrap(){const e=await z;if(e.isError)throw e.error;return e.data},refetch:()=>g(i(l,{subscribe:!1,forceRefetch:!0})),unsubscribe(){u&&g(s({queryCacheKey:v,requestId:x}))},updateSubscriptionOptions(e){z.subscriptionOptions=e,g(c({endpointName:r,requestId:x,queryCacheKey:v,options:e}))}});if(!S&&!A&&!p){const e=o.get(g)||{};e[v]=z,o.set(g,e),z.then((()=>{delete e[v],p0(e)||o.delete(g)}))}return z};return i},buildInitiateMutation:function(e){return(t,{track:n=!0,fixedCacheKey:a}={})=>(o,s)=>{const c=r({type:"mutation",endpointName:e,originalArgs:t,track:n,fixedCacheKey:a}),u=o(c),{requestId:f,abort:d,unwrap:p}=u,h=UQ(u.unwrap().then((e=>({data:e}))),(e=>({error:e}))),g=Object.assign(h,{arg:u.arg,requestId:f,abort:d,unwrap:p,reset:()=>{o(l({requestId:f,fixedCacheKey:a}))}}),m=i.get(o)||{};return i.set(o,m),m[f]=g,g.then((()=>{delete m[f],p0(m)||i.delete(o)})),a&&(m[a]=g,g.then((()=>{m[a]===g&&(delete m[a],p0(m)||i.delete(o))}))),g}},getRunningQueryThunk:function(t,r){return n=>{var i;const s=a.endpointDefinitions[t],l=e({queryArgs:r,endpointDefinition:s,endpointName:t});return null==(i=o.get(n))?void 0:i[l]}},getRunningMutationThunk:function(e,t){return e=>{var r;return null==(r=i.get(e))?void 0:r[t]}},getRunningQueriesThunk:function(){return e=>Object.values(o.get(e)||{}).filter(V9)},getRunningMutationsThunk:function(){return e=>Object.values(i.get(e)||{}).filter(V9)}}}function B9(e){return e}function qQ({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:a,assertTagType:o}){const i=async(e,{signal:n,abort:a,rejectWithValue:o,fulfillWithValue:i,dispatch:l,getState:c,extra:u})=>{const f=r[e.endpointName];try{let r,o=B9;const d={signal:n,abort:a,dispatch:l,getState:c,extra:u,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?s(e,c()):void 0},p="query"===e.type?e[Zy]:void 0;if(p?r=p():f.query?(r=await t(f.query(e.originalArgs),d,f.extraOptions),f.transformResponse&&(o=f.transformResponse)):r=await f.queryFn(e.originalArgs,d,f.extraOptions,(e=>t(e,d,f.extraOptions))),typeof process<"u"&&TQ.NODE_ENV,r.error)throw new L9(r.error,r.meta);return i(await o(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[_y]:!0})}catch(t){let r=t;if(r instanceof L9){let t=B9;f.query&&f.transformErrorResponse&&(t=f.transformErrorResponse);try{return o(await t(r.value,r.meta,e.originalArgs),{baseQueryMeta:r.meta,[_y]:!0})}catch(e){r=e}}throw console.error(r),r}};function s(t,r){var n,a,o;const i=null==(a=null==(n=r[e])?void 0:n.queries)?void 0:a[t.queryCacheKey],s=null==(o=r[e])?void 0:o.config.refetchOnMountOrArgChange,l=null==i?void 0:i.fulfilledTimeStamp,c=t.forceRefetch??(t.subscribe&&s);return!!c&&(!0===c||(Number(new Date)-Number(l))/1e3>=c)}const l=M9(`${e}/executeQuery`,i,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[_y]:!0}),condition(t,{getState:n}){var a,o,i;const l=n(),c=null==(o=null==(a=l[e])?void 0:a.queries)?void 0:o[t.queryCacheKey],u=null==c?void 0:c.fulfilledTimeStamp,f=t.originalArgs,d=null==c?void 0:c.originalArgs,p=r[t.endpointName];return!!AC(t)||"pending"!==(null==c?void 0:c.status)&&(!!(s(t,l)||Zj(p)&&null!=(i=null==p?void 0:p.forceRefetch)&&i.call(p,{currentArg:f,previousArg:d,endpointState:c,state:l}))||!u)},dispatchConditionRejection:!0}),c=M9(`${e}/executeMutation`,i,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[_y]:!0})});function u(e){return t=>{var r,n;return(null==(n=null==(r=null==t?void 0:t.meta)?void 0:r.arg)?void 0:n.endpointName)===e}}return{queryThunk:l,mutationThunk:c,prefetch:(e,t,r)=>(n,o)=>{const i=(e=>"force"in e)(r)&&r.force,s=(e=>"ifOlderThan"in e)(r)&&r.ifOlderThan,l=(r=!0)=>{const n={forceRefetch:r,isPrefetch:!0};return a.endpoints[e].initiate(t,n)},c=a.endpoints[e].select(t)(o());if(i)n(l());else if(s){const e=null==c?void 0:c.fulfilledTimeStamp;if(!e)return void n(l());(Number(new Date)-Number(new Date(e)))/1e3>=s&&n(l())}else n(l(!1))},updateQueryData:(e,t,r,n=!0)=>(o,i)=>{const s=a.endpoints[e].select(t)(i());let l,c={patches:[],inversePatches:[],undo:()=>o(a.util.patchQueryData(e,t,c.inversePatches,n))};if("uninitialized"===s.status)return c;if("data"in s)if(Wc(s.data)){const[e,t,n]=Gj(s.data,r);c.patches.push(...t),c.inversePatches.push(...n),l=e}else l=r(s.data),c.patches.push({op:"replace",path:[],value:l}),c.inversePatches.push({op:"replace",path:[],value:s.data});return o(a.util.patchQueryData(e,t,c.patches,n)),c},upsertQueryData:(e,t,r)=>n=>n(a.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[Zy]:()=>({data:r})})),patchQueryData:(e,t,i,s)=>(l,c)=>{const u=r[e],f=n({queryArgs:t,endpointDefinition:u,endpointName:e});if(l(a.internalActions.queryResultPatched({queryCacheKey:f,patches:i})),!s)return;const d=a.endpoints[e].select(t)(c()),p=fA(u.providesTags,d.data,void 0,t,{},o);l(a.internalActions.updateProvidedBy({queryCacheKey:f,providedTags:p}))},buildMatchThunkActions:function(e,t){return{matchPending:My(sA(e),u(t)),matchFulfilled:My(gp(e),u(t)),matchRejected:My(k0(e),u(t))}}}}function Jj(e,t,r,n){return fA(r[e.meta.arg.endpointName][t],gp(e)?e.payload:void 0,e2(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function qb(e,t,r){const n=e[t];n&&r(n)}function Jy(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function F9(e,t,r){const n=e[Jy(t)];n&&r(n)}var K1={};function WQ({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:a,extractRehydrationInfo:o,hasRehydrationInfo:i},assertTagType:s,config:l}){const c=kr(`${e}/resetApiState`),u=ur({name:`${e}/queries`,initialState:K1,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:Y1()},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:r}}){qb(e,t,(e=>{e.data=R9(e.data,r.concat())}))},prepare:Y1()}},extraReducers(e){e.addCase(t.pending,((e,{meta:t,meta:{arg:r}})=>{var n;const a=AC(r);e[n=r.queryCacheKey]??(e[n]={status:"uninitialized",endpointName:r.endpointName}),qb(e,r.queryCacheKey,(e=>{e.status="pending",e.requestId=a&&e.requestId?e.requestId:t.requestId,void 0!==r.originalArgs&&(e.originalArgs=r.originalArgs),e.startedTimeStamp=t.startedTimeStamp}))})).addCase(t.fulfilled,((e,{meta:t,payload:r})=>{qb(e,t.arg.queryCacheKey,(e=>{if(e.requestId!==t.requestId&&!AC(t.arg))return;const{merge:a}=n[t.arg.endpointName];if(e.status="fulfilled",a)if(void 0!==e.data){const{fulfilledTimeStamp:n,arg:o,baseQueryMeta:i,requestId:s}=t;let l=Ov(e.data,(e=>a(e,r,{arg:o.originalArgs,baseQueryMeta:i,fulfilledTimeStamp:n,requestId:s})));e.data=l}else e.data=r;else e.data=n[t.arg.endpointName].structuralSharing??1?Yj(qc(e.data)?MH(e.data):e.data,r):r;delete e.error,e.fulfilledTimeStamp=t.fulfilledTimeStamp}))})).addCase(t.rejected,((e,{meta:{condition:t,arg:r,requestId:n},error:a,payload:o})=>{qb(e,r.queryCacheKey,(e=>{if(!t){if(e.requestId!==n)return;e.status="rejected",e.error=o??a}}))})).addMatcher(i,((e,t)=>{const{queries:r}=o(t);for(const[t,n]of Object.entries(r))("fulfilled"===(null==n?void 0:n.status)||"rejected"===(null==n?void 0:n.status))&&(e[t]=n)}))}}),f=ur({name:`${e}/mutations`,initialState:K1,reducers:{removeMutationResult:{reducer(e,{payload:t}){const r=Jy(t);r in e&&delete e[r]},prepare:Y1()}},extraReducers(e){e.addCase(r.pending,((e,{meta:t,meta:{requestId:r,arg:n,startedTimeStamp:a}})=>{n.track&&(e[Jy(t)]={requestId:r,status:"pending",endpointName:n.endpointName,startedTimeStamp:a})})).addCase(r.fulfilled,((e,{payload:t,meta:r})=>{r.arg.track&&F9(e,r,(e=>{e.requestId===r.requestId&&(e.status="fulfilled",e.data=t,e.fulfilledTimeStamp=r.fulfilledTimeStamp)}))})).addCase(r.rejected,((e,{payload:t,error:r,meta:n})=>{n.arg.track&&F9(e,n,(e=>{e.requestId===n.requestId&&(e.status="rejected",e.error=t??r)}))})).addMatcher(i,((e,t)=>{const{mutations:r}=o(t);for(const[t,n]of Object.entries(r))("fulfilled"===(null==n?void 0:n.status)||"rejected"===(null==n?void 0:n.status))&&t!==(null==n?void 0:n.requestId)&&(e[t]=n)}))}}),d=ur({name:`${e}/invalidation`,initialState:K1,reducers:{updateProvidedBy:{reducer(e,t){var r,n;const{queryCacheKey:a,providedTags:o}=t.payload;for(const t of Object.values(e))for(const e of Object.values(t)){const t=e.indexOf(a);-1!==t&&e.splice(t,1)}for(const{type:t,id:i}of o){const o=(r=e[t]??(e[t]={}))[n=i||"__internal_without_id"]??(r[n]=[]);o.includes(a)||o.push(a)}},prepare:Y1()}},extraReducers(e){e.addCase(u.actions.removeQueryResult,((e,{payload:{queryCacheKey:t}})=>{for(const r of Object.values(e))for(const e of Object.values(r)){const r=e.indexOf(t);-1!==r&&e.splice(r,1)}})).addMatcher(i,((e,t)=>{var r,n;const{provided:a}=o(t);for(const[t,o]of Object.entries(a))for(const[a,i]of Object.entries(o)){const o=(r=e[t]??(e[t]={}))[n=a||"__internal_without_id"]??(r[n]=[]);for(const e of i)o.includes(e)||o.push(e)}})).addMatcher(mp(gp(t),e2(t)),((e,t)=>{const r=Jj(t,"providesTags",n,s),{queryCacheKey:a}=t.meta.arg;d.caseReducers.updateProvidedBy(e,d.actions.updateProvidedBy({queryCacheKey:a,providedTags:r}))}))}}),p=ur({name:`${e}/subscriptions`,initialState:K1,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),h=ur({name:`${e}/internalSubscriptions`,initialState:K1,reducers:{subscriptionsUpdated:{reducer:(e,t)=>R9(e,t.payload),prepare:Y1()}}}),g=ur({name:`${e}/config`,initialState:{online:NQ(),focused:DQ(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&a===t||"conflict"}},extraReducers:e=>{e.addCase(uA,(e=>{e.online=!0})).addCase(Xj,(e=>{e.online=!1})).addCase(lA,(e=>{e.focused=!0})).addCase(Kj,(e=>{e.focused=!1})).addMatcher(i,(e=>({...e})))}}),m=Nj({queries:u.reducer,mutations:f.reducer,provided:d.reducer,subscriptions:h.reducer,config:g.reducer});return{reducer:(e,t)=>m(c.match(t)?void 0:e,t),actions:{...g.actions,...u.actions,...p.actions,...h.actions,...f.actions,...d.actions,resetApiState:c}}}var Xh=Symbol.for("RTKQ/skipToken"),e8={status:"uninitialized"},U9=Ov(e8,(()=>{})),G9=Ov(e8,(()=>{}));function HQ({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const n=e=>U9,a=e=>G9;return{buildQuerySelector:function(t,a){return s=>{const l=e({queryArgs:s,endpointDefinition:a,endpointName:t});return r(s===Xh?n:e=>{var t,r;return(null==(r=null==(t=i(e))?void 0:t.queries)?void 0:r[l])??U9},o)}},buildMutationSelector:function(){return e=>{let t;return t="object"==typeof e?Jy(e)??Xh:e,r(t===Xh?a:e=>{var r,n;return(null==(n=null==(r=i(e))?void 0:r.mutations)?void 0:n[t])??G9},o)}},selectInvalidatedBy:function(e,r){const n=e[t],a=new Set;for(const e of r.map(IC)){const t=n.provided[e.type];if(!t)continue;let r=(void 0!==e.id?t[e.id]:O9(Object.values(t)))??[];for(const e of r)a.add(e)}return O9(Array.from(a.values()).map((e=>{const t=n.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))},selectCachedArgsForQuery:function(e,r){return Object.values(e[t].queries).filter((e=>(null==e?void 0:e.endpointName)===r&&"uninitialized"!==e.status)).map((e=>e.originalArgs))}};function o(e){return{...e,...PQ(e.status)}}function i(e){return e[t]}}var Yg=WeakMap?new WeakMap:void 0,q9=({endpointName:e,queryArgs:t})=>{let r="";const n=null==Yg?void 0:Yg.get(t);if("string"==typeof n)r=n;else{const e=JSON.stringify(t,((e,t)=>hp(t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t));hp(t)&&(null==Yg||Yg.set(t,e)),r=e}return`${e}(${r})`};function QQ(...e){return function(t){const r=Xy((e=>{var r;return null==(r=t.extractRehydrationInfo)?void 0:r.call(t,e,{reducerPath:t.reducerPath??"api"})})),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=q9;if("serializeQueryArgs"in e.endpointDefinition){const t=e.endpointDefinition.serializeQueryArgs;r=e=>{const r=t(e);return"string"==typeof r?r:q9({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},a={endpointDefinitions:{},batch(e){e()},apiUid:Zw(),extractRehydrationInfo:r,hasRehydrationInfo:Xy((e=>null!=r(e)))},o={injectEndpoints:function(e){const t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"})});for(const[r,n]of Object.entries(t))if(!0!==e.overrideExisting&&r in a.endpointDefinitions){if("throw"===e.overrideExisting)throw new Error(po(39))}else{a.endpointDefinitions[r]=n;for(const e of i)e.injectEndpoint(r,n)}return o},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(const[e,r]of Object.entries(t))"function"==typeof r?r(a.endpointDefinitions[e]):Object.assign(a.endpointDefinitions[e]||{},r);return o}},i=e.map((e=>e.init(o,n,a)));return o.injectEndpoints({endpoints:t.endpoints})}}function YQ(e){for(let t in e)return!1;return!0}var KQ=2147482.647,XQ=({reducerPath:e,api:t,context:r,internalState:n})=>{const{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions;function i(e){const t=n.currentSubscriptions[e];return!!t&&!YQ(t)}const s={};function l(e,t,n,o){const l=r.endpointDefinitions[t],c=(null==l?void 0:l.keepUnusedDataFor)??o.keepUnusedDataFor;if(c===1/0)return;const u=Math.max(0,Math.min(c,KQ));if(!i(e)){const t=s[e];t&&clearTimeout(t),s[e]=setTimeout((()=>{i(e)||n.dispatch(a({queryCacheKey:e})),delete s[e]}),1e3*u)}}return(n,a,i)=>{var c;if(o.match(n)){const t=a.getState()[e],{queryCacheKey:r}=n.payload;l(r,null==(c=t.queries[r])?void 0:c.endpointName,a,t.config)}if(t.util.resetApiState.match(n))for(const[e,t]of Object.entries(s))t&&clearTimeout(t),delete s[e];if(r.hasRehydrationInfo(n)){const t=a.getState()[e],{queries:o}=r.extractRehydrationInfo(n);for(const[e,r]of Object.entries(o))l(e,null==r?void 0:r.endpointName,a,t.config)}}},ZQ=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:a,api:o,assertTagType:i,refetchQuery:s,internalState:l})=>{const{removeQueryResult:c}=o.internalActions,u=mp(gp(n),e2(n)),f=mp(gp(n,a),k0(n,a));let d=[];function p(r,n){const a=n.getState(),i=a[e];if(d.push(...r),"delayed"===i.config.invalidationBehavior&&function(e){var t,r;for(const r in e.queries)if("pending"===(null==(t=e.queries[r])?void 0:t.status))return!0;for(const t in e.mutations)if("pending"===(null==(r=e.mutations[t])?void 0:r.status))return!0;return!1}(i))return;const u=d;if(d=[],0===u.length)return;const f=o.util.selectInvalidatedBy(a,u);t.batch((()=>{const e=Array.from(f.values());for(const{queryCacheKey:t}of e){const e=i.queries[t],r=l.currentSubscriptions[t]??{};e&&(0===p0(r)?n.dispatch(c({queryCacheKey:t})):"uninitialized"!==e.status&&n.dispatch(s(e,t)))}}))}return(e,t)=>{u(e)?p(Jj(e,"invalidatesTags",r,i),t):f(e)?p([],t):o.util.invalidateTags.match(e)&&p(fA(e.payload,void 0,void 0,void 0,void 0,i),t)}},JQ=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:a})=>{const o={};function i({queryCacheKey:t},r){const s=r.getState()[e],l=s.queries[t],u=a.currentSubscriptions[t];if(!l||"uninitialized"===l.status)return;const{lowestPollingInterval:f,skipPollingIfUnfocused:d}=c(u);if(!Number.isFinite(f))return;const p=o[t];null!=p&&p.timeout&&(clearTimeout(p.timeout),p.timeout=void 0);const h=Date.now()+f;o[t]={nextPollTimestamp:h,pollingInterval:f,timeout:setTimeout((()=>{(s.config.focused||!d)&&r.dispatch(n(l,t)),i({queryCacheKey:t},r)}),f)}}function s({queryCacheKey:t},r){const n=r.getState()[e].queries[t],s=a.currentSubscriptions[t];if(!n||"uninitialized"===n.status)return;const{lowestPollingInterval:u}=c(s);if(!Number.isFinite(u))return void l(t);const f=o[t],d=Date.now()+u;(!f||d<f.nextPollTimestamp)&&i({queryCacheKey:t},r)}function l(e){const t=o[e];null!=t&&t.timeout&&clearTimeout(t.timeout),delete o[e]}function c(e={}){let t=!1,r=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(r=Math.min(e[n].pollingInterval,r),t=e[n].skipPollingIfUnfocused||t);return{lowestPollingInterval:r,skipPollingIfUnfocused:t}}return(e,n)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,n),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,n),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&i(e.meta.arg,n),r.util.resetApiState.match(e)&&function(){for(const e of Object.keys(o))l(e)}()}},eY=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:a})=>{const{removeQueryResult:o}=r.internalActions;function i(r,i){const s=r.getState()[e],l=s.queries,c=a.currentSubscriptions;t.batch((()=>{for(const e of Object.keys(c)){const t=l[e],a=c[e];a&&t&&((Object.values(a).some((e=>!0===e[i]))||Object.values(a).every((e=>void 0===e[i]))&&s.config[i])&&(0===p0(a)?r.dispatch(o({queryCacheKey:e})):"uninitialized"!==t.status&&r.dispatch(n(t,e))))}}))}return(e,t)=>{lA.match(e)&&i(t,"refetchOnFocus"),uA.match(e)&&i(t,"refetchOnReconnect")}},W9=new Error("Promise never resolved before cacheEntryRemoved."),tY=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:a,internalState:o})=>{const i=CC(n),s=CC(a),l=gp(n,a),c={};function u(t,n,a,o,i){const s=r.endpointDefinitions[t],l=null==s?void 0:s.onCacheEntryAdded;if(!l)return;let u={};const f=new Promise((e=>{u.cacheEntryRemoved=e})),d=Promise.race([new Promise((e=>{u.valueResolved=e})),f.then((()=>{throw W9}))]);d.catch((()=>{})),c[a]=u;const p=e.endpoints[t].select("query"===s.type?n:a),h=o.dispatch(((e,t,r)=>r)),g={...o,getCacheEntry:()=>p(o.getState()),requestId:i,extra:h,updateCachedData:"query"===s.type?r=>o.dispatch(e.util.updateQueryData(t,n,r)):void 0,cacheDataLoaded:d,cacheEntryRemoved:f},m=l(n,g);Promise.resolve(m).catch((e=>{if(e!==W9)throw e}))}return(r,o,f)=>{const d=function(t){return i(t)?t.meta.arg.queryCacheKey:s(t)?t.meta.arg.fixedCacheKey??t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?Jy(t.payload):""}(r);if(n.pending.match(r)){const e=f[t].queries[d],n=o.getState()[t].queries[d];!e&&n&&u(r.meta.arg.endpointName,r.meta.arg.originalArgs,d,o,r.meta.requestId)}else if(a.pending.match(r))o.getState()[t].mutations[d]&&u(r.meta.arg.endpointName,r.meta.arg.originalArgs,d,o,r.meta.requestId);else if(l(r)){const e=c[d];null!=e&&e.valueResolved&&(e.valueResolved({data:r.payload,meta:r.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r)){const e=c[d];e&&(delete c[d],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(r))for(const[e,t]of Object.entries(c))delete c[e],t.cacheEntryRemoved()}},nY=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{const a=sA(r,n),o=k0(r,n),i=gp(r,n),s={};return(r,n)=>{var l,c;if(a(r)){const{requestId:a,arg:{endpointName:o,originalArgs:i}}=r.meta,l=t.endpointDefinitions[o],c=null==l?void 0:l.onQueryStarted;if(c){const t={},r=new Promise(((e,r)=>{t.resolve=e,t.reject=r}));r.catch((()=>{})),s[a]=t;const u=e.endpoints[o].select("query"===l.type?i:a),f=n.dispatch(((e,t,r)=>r)),d={...n,getCacheEntry:()=>u(n.getState()),requestId:a,extra:f,updateCachedData:"query"===l.type?t=>n.dispatch(e.util.updateQueryData(o,i,t)):void 0,queryFulfilled:r};c(i,d)}}else if(i(r)){const{requestId:e,baseQueryMeta:t}=r.meta;null==(l=s[e])||l.resolve({data:r.payload,meta:t}),delete s[e]}else if(o(r)){const{requestId:e,rejectedWithValue:t,baseQueryMeta:n}=r.meta;null==(c=s[e])||c.reject({error:r.payload??r.error,isUnhandledError:!t,meta:n}),delete s[e]}}},rY=({api:e,context:{apiUid:t},reducerPath:r})=>(r,n)=>{e.util.resetApiState.match(r)&&n.dispatch(e.internalActions.middlewareRegistered(t))},aY=({api:e,queryThunk:t,internalState:r})=>{const n=`${e.reducerPath}/subscriptions`;let a=null,o=null;const{updateSubscriptionOptions:i,unsubscribeQueryResult:s}=e.internalActions,l=()=>r.currentSubscriptions,c={getSubscriptions:l,getSubscriptionCount:e=>p0(l()[e]??{}),isRequestSubscribed:(e,t)=>{var r;const n=l();return!(null==(r=null==n?void 0:n[e])||!r[t])}};return(l,u)=>{if(a||(a=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(l))return a=r.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(l))return[!1,c];const f=((r,n)=>{var a,o,l;if(i.match(n)){const{queryCacheKey:e,requestId:t,options:o}=n.payload;return null!=(a=null==r?void 0:r[e])&&a[t]&&(r[e][t]=o),!0}if(s.match(n)){const{queryCacheKey:e,requestId:t}=n.payload;return r[e]&&delete r[e][t],!0}if(e.internalActions.removeQueryResult.match(n))return delete r[n.payload.queryCacheKey],!0;if(t.pending.match(n)){const{meta:{arg:e,requestId:t}}=n,a=r[o=e.queryCacheKey]??(r[o]={});return a[`${t}_running`]={},e.subscribe&&(a[t]=e.subscriptionOptions??a[t]??{}),!0}let c=!1;if(t.fulfilled.match(n)||t.rejected.match(n)){const e=r[n.meta.arg.queryCacheKey]||{},t=`${n.meta.requestId}_running`;c||(c=!!e[t]),delete e[t]}if(t.rejected.match(n)){const{meta:{condition:e,arg:t,requestId:a}}=n;if(e&&t.subscribe){const e=r[l=t.queryCacheKey]??(r[l]={});e[a]=t.subscriptionOptions??e[a]??{},c=!0}}return c})(r.currentSubscriptions,l);let d=!0;if(f){o||(o=setTimeout((()=>{const t=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,n]=Gj(a,(()=>t));u.next(e.internalActions.subscriptionsUpdated(n)),a=t,o=null}),500));const i="string"==typeof l.type&&!!l.type.startsWith(n),s=t.rejected.match(l)&&l.meta.condition&&!!l.meta.arg.subscribe;d=!i&&!s}return[d,!1]}};function oY(e){const{reducerPath:t,queryThunk:r,api:n,context:a}=e,{apiUid:o}=a,i={invalidateTags:kr(`${t}/invalidateTags`)},s=e=>e.type.startsWith(`${t}/`),l=[rY,XQ,ZQ,JQ,tY,nY];return{middleware:r=>{let i=!1;const u={...e,internalState:{currentSubscriptions:{}},refetchQuery:c,isThisApiSliceAction:s},f=l.map((e=>e(u))),d=aY(u),p=eY(u);return e=>l=>{if(!Dj(l))return e(l);i||(i=!0,r.dispatch(n.internalActions.middlewareRegistered(o)));const c={...r,next:e},u=r.getState(),[h,g]=d(l,c,u);let m;if(m=h?e(l):g,r.getState()[t]&&(p(l,c,u),s(l)||a.hasRehydrationInfo(l)))for(let e of f)e(l,c,u);return m}},actions:i};function c(e,t,n={}){return r({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t,...n})}}function Zd(e,...t){return Object.assign(e,...t)}var H9=Symbol(),sY=({createSelector:e=zr}={})=>({name:H9,init(t,{baseQuery:r,tagTypes:n,reducerPath:a,serializeQueryArgs:o,keepUnusedDataFor:i,refetchOnMountOrArgChange:s,refetchOnFocus:l,refetchOnReconnect:c,invalidationBehavior:u},f){UH();const d=e=>e;Object.assign(t,{reducerPath:a,endpoints:{},internalActions:{onOnline:uA,onOffline:Xj,onFocus:lA,onFocusLost:Kj},util:{}});const{queryThunk:p,mutationThunk:h,patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,buildMatchThunkActions:b}=qQ({baseQuery:r,reducerPath:a,context:f,api:t,serializeQueryArgs:o,assertTagType:d}),{reducer:w,actions:_}=WQ({context:f,queryThunk:p,mutationThunk:h,reducerPath:a,assertTagType:d,config:{refetchOnFocus:l,refetchOnReconnect:c,refetchOnMountOrArgChange:s,keepUnusedDataFor:i,reducerPath:a,invalidationBehavior:u}});Zd(t.util,{patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,resetApiState:_.resetApiState}),Zd(t.internalActions,_);const{middleware:k,actions:x}=oY({reducerPath:a,context:f,queryThunk:p,mutationThunk:h,api:t,assertTagType:d});Zd(t.util,x),Zd(t,{reducer:w,middleware:k});const{buildQuerySelector:E,buildMutationSelector:A,selectInvalidatedBy:S,selectCachedArgsForQuery:C}=HQ({serializeQueryArgs:o,reducerPath:a,createSelector:e});Zd(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:C});const{buildInitiateQuery:z,buildInitiateMutation:I,getRunningMutationThunk:j,getRunningMutationsThunk:P,getRunningQueriesThunk:T,getRunningQueryThunk:R}=GQ({queryThunk:p,mutationThunk:h,api:t,serializeQueryArgs:o,context:f});return Zd(t.util,{getRunningMutationThunk:j,getRunningMutationsThunk:P,getRunningQueryThunk:R,getRunningQueriesThunk:T}),{name:H9,injectEndpoint(e,r){var n;const a=t;(n=a.endpoints)[e]??(n[e]={}),Zj(r)?Zd(a.endpoints[e],{name:e,select:E(e,r),initiate:z(e,r)},b(p,e)):BQ(r)&&Zd(a.endpoints[e],{name:e,select:A(),initiate:I(e)},b(h,e))}}}}),qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q9,Y9,e3={exports:{}},Kt={};
2
2
  /**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -84,7 +84,7 @@ var AH=Object.defineProperty,RH=(e,t,r)=>t in e?AH(e,t,{enumerable:!0,configurab
84
84
  *
85
85
  * This source code is licensed under the MIT license found in the
86
86
  * LICENSE file in the root directory of this source tree.
87
- */function Jne(){if(K$)return Rn;K$=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case n:case o:case a:case u:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case c:case p:case d:case i:return e;default:return h}}case r:return h}}}return e=Symbol.for("react.module.reference"),Rn.ContextConsumer=s,Rn.ContextProvider=i,Rn.Element=t,Rn.ForwardRef=c,Rn.Fragment=n,Rn.Lazy=p,Rn.Memo=d,Rn.Portal=r,Rn.Profiler=o,Rn.StrictMode=a,Rn.Suspense=u,Rn.SuspenseList=f,Rn.isAsyncMode=function(){return!1},Rn.isConcurrentMode=function(){return!1},Rn.isContextConsumer=function(e){return g(e)===s},Rn.isContextProvider=function(e){return g(e)===i},Rn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Rn.isForwardRef=function(e){return g(e)===c},Rn.isFragment=function(e){return g(e)===n},Rn.isLazy=function(e){return g(e)===p},Rn.isMemo=function(e){return g(e)===d},Rn.isPortal=function(e){return g(e)===r},Rn.isProfiler=function(e){return g(e)===o},Rn.isStrictMode=function(e){return g(e)===a},Rn.isSuspense=function(e){return g(e)===u},Rn.isSuspenseList=function(e){return g(e)===f},Rn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===o||t===a||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===i||t.$$typeof===s||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},Rn.typeOf=g,Rn}function ere(){return X$||(X$=1,w6.exports=Jne()),w6.exports}function eL(){if(Z$)return k6;Z$=1;var e=wf(),t=ci();return k6=function(r){return"number"==typeof r||t(r)&&"[object Number]"==e(r)}}function tre(){if(J$)return x6;J$=1;var e=eL();return x6=function(t){return e(t)&&t!=+t}}ere(),tre(),eL();var E6,ez,C6,tz,I6,nz,A6,rz,R6,az,T6,oz,P6,sz,$6,iz,z6,cz,M6,lz,O6,uz,N6,fz,D6,dz,j6,pz,L6,hz,V6,mz,B6,gz,F6,yz,U6,vz,G6,bz,q6,_z,W6,wz,H6,kz,Q6,xz,Y6,Sz,K6,Ez,X6,Cz,Z6,Iz,J6,Az,eS,Rz,tS,Tz,nS,Pz,n_=function(e){return Zne(e)&&e.indexOf("%")===e.length-1},nre=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},S6=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a]};function rre(){if(ez)return E6;return ez=1,E6=function(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(a);++n<a;)o[n]=e[n+t];return o}}function are(){if(tz)return C6;tz=1;var e=rre();return C6=function(t,r,n){var a=t.length;return n=void 0===n?a:n,!r&&n>=a?t:e(t,r,n)}}function tL(){if(nz)return I6;nz=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return I6=function(t){return e.test(t)}}function ore(){if(rz)return A6;return rz=1,A6=function(e){return e.split("")}}function sre(){if(az)return R6;az=1;var e="\\ud800-\\udfff",t="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",a="[^"+e+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",i="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+r+"|"+n+")"+"?",l="[\\ufe0e\\ufe0f]?",c=l+s+("(?:\\u200d(?:"+[a,o,i].join("|")+")"+l+s+")*"),u="(?:"+[a+r+"?",r,o,i,t].join("|")+")",f=RegExp(n+"(?="+n+")|"+u+c,"g");return R6=function(e){return e.match(f)||[]}}function ire(){if(oz)return T6;oz=1;var e=ore(),t=tL(),r=sre();return T6=function(n){return t(n)?r(n):e(n)}}function cre(){if(sz)return P6;sz=1;var e=are(),t=tL(),r=ire(),n=k2();return P6=function(a){return function(o){o=n(o);var i=t(o)?r(o):void 0,s=i?i[0]:o.charAt(0),l=i?e(i,1).join(""):o.slice(1);return s[a]()+l}}}function lre(){if(iz)return $6;iz=1;var e=cre()("toUpperCase");return $6=e}function ure(){if(cz)return z6;cz=1;var e=_2();return z6=function(){this.__data__=new e,this.size=0}}function fre(){if(lz)return M6;return lz=1,M6=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}}function dre(){if(uz)return O6;return uz=1,O6=function(e){return this.__data__.get(e)}}function pre(){if(fz)return N6;return fz=1,N6=function(e){return this.__data__.has(e)}}function hre(){if(dz)return D6;dz=1;var e=_2(),t=FA(),r=UA();return D6=function(n,a){var o=this.__data__;if(o instanceof e){var i=o.__data__;if(!t||i.length<199)return i.push([n,a]),this.size=++o.size,this;o=this.__data__=new r(i)}return o.set(n,a),this.size=o.size,this}}function GA(){if(pz)return j6;pz=1;var e=_2(),t=ure(),r=fre(),n=dre(),a=pre(),o=hre();function i(t){var r=this.__data__=new e(t);this.size=r.size}return i.prototype.clear=t,i.prototype.delete=r,i.prototype.get=n,i.prototype.has=a,i.prototype.set=o,j6=i}function mre(){if(hz)return L6;hz=1;return L6=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}function gre(){if(mz)return V6;return mz=1,V6=function(e){return this.__data__.has(e)}}function yre(){if(gz)return B6;gz=1;var e=UA(),t=mre(),r=gre();function n(t){var r=-1,n=null==t?0:t.length;for(this.__data__=new e;++r<n;)this.add(t[r])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,B6=n}function vre(){if(yz)return F6;return yz=1,F6=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}}function bre(){if(vz)return U6;return vz=1,U6=function(e,t){return e.has(t)}}function nL(){if(bz)return G6;bz=1;var e=yre(),t=vre(),r=bre();return G6=function(n,a,o,i,s,l){var c=1&o,u=n.length,f=a.length;if(u!=f&&!(c&&f>u))return!1;var d=l.get(n),p=l.get(a);if(d&&p)return d==a&&p==n;var h=-1,g=!0,m=2&o?new e:void 0;for(l.set(n,a),l.set(a,n);++h<u;){var y=n[h],v=a[h];if(i)var b=c?i(v,y,h,a,n,l):i(y,v,h,n,a,l);if(void 0!==b){if(b)continue;g=!1;break}if(m){if(!t(a,(function(e,t){if(!r(m,t)&&(y===e||s(y,e,o,i,l)))return m.push(t)}))){g=!1;break}}else if(y!==v&&!s(y,v,o,i,l)){g=!1;break}}return l.delete(n),l.delete(a),g}}function rL(){if(_z)return q6;_z=1;var e=os().Uint8Array;return q6=e}function _re(){if(wz)return W6;return wz=1,W6=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}}function wre(){if(kz)return H6;return kz=1,H6=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}}function kre(){if(xz)return Q6;xz=1;var e=V0(),t=rL(),r=BA(),n=nL(),a=_re(),o=wre(),i=e?e.prototype:void 0,s=i?i.valueOf:void 0;return Q6=function(e,i,l,c,u,f,d){switch(l){case"[object DataView]":if(e.byteLength!=i.byteLength||e.byteOffset!=i.byteOffset)return!1;e=e.buffer,i=i.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=i.byteLength||!f(new t(e),new t(i)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+i);case"[object Error]":return e.name==i.name&&e.message==i.message;case"[object RegExp]":case"[object String]":return e==i+"";case"[object Map]":var p=a;case"[object Set]":var h=1&c;if(p||(p=o),e.size!=i.size&&!h)return!1;var g=d.get(e);if(g)return g==i;c|=2,d.set(e,i);var m=n(p(e),p(i),c,u,f,d);return d.delete(e),m;case"[object Symbol]":if(s)return s.call(e)==s.call(i)}return!1}}function qA(){if(Sz)return Y6;return Sz=1,Y6=function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}}function aL(){if(Ez)return K6;Ez=1;var e=qA(),t=As();return K6=function(r,n,a){var o=n(r);return t(r)?o:e(o,a(r))}}function xre(){if(Cz)return X6;return Cz=1,X6=function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,o=[];++r<n;){var i=e[r];t(i,r,e)&&(o[a++]=i)}return o}}function oL(){if(Iz)return Z6;return Iz=1,Z6=function(){return[]}}function WA(){if(Az)return J6;Az=1;var e=xre(),t=oL(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return J6=n?function(t){return null==t?[]:(t=Object(t),e(n(t),(function(e){return r.call(t,e)})))}:t}function Sre(){if(Rz)return eS;return Rz=1,eS=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}}function Ere(){if(Tz)return tS;Tz=1;var e=wf(),t=ci();return tS=function(r){return t(r)&&"[object Arguments]"==e(r)}}function HA(){if(Pz)return nS;Pz=1;var e=Ere(),t=ci(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(e){return t(e)&&n.call(e,"callee")&&!a.call(e,"callee")};return nS=o}var rS,$z,zz,aS,Mz,oS,Oz,sS,Nz,iS,Dz,ky={exports:{}};function Cre(){if($z)return rS;return $z=1,rS=function(){return!1}}function QA(){return zz||(zz=1,e=ky,t=ky.exports,r=os(),n=Cre(),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,i=o&&o.exports===a?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||n,e.exports=s),ky.exports;var e,t,r,n,a,o,i,s}function YA(){if(Mz)return aS;Mz=1;var e=/^(?:0|[1-9]\d*)$/;return aS=function(t,r){var n=typeof t;return!!(r=r??9007199254740991)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}}function KA(){if(Oz)return oS;Oz=1;return oS=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}function Ire(){if(Nz)return sS;Nz=1;var e=wf(),t=KA(),r=ci(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,sS=function(a){return r(a)&&t(a.length)&&!!n[e(a)]}}function XA(){if(Dz)return iS;return Dz=1,iS=function(e){return function(t){return e(t)}}}ky.exports;var jz,cS,Lz,lS,Vz,uS,Bz,fS,Fz,dS,Uz,pS,Gz,hS,qz,mS,Wz,gS,Hz,yS,Qz,vS,Yz,bS,Kz,_S,Xz,wS,Zz,kS,Jz,xS,eM,SS,tM,ES,nM,CS,rM,IS,aM,AS,oM,RS,sM,TS,iM,PS,cM,$S,lM,zS,uM,MS,fM,OS,dM,NS,pM,DS,hM,jS,mM,LS,gM,VS,yM,BS,vM,FS,bM,US,_M,GS,wM,qS,kM,WS,xM,HS,SM,QS,EM,YS,CM,KS,IM,XS,AM,ZS,RM,JS,TM,e4,PM,t4,$M,n4,zM,r4,MM,a4,OM,o4,NM,xy={exports:{}};function ZA(){return jz||(jz=1,e=xy,t=xy.exports,r=H7(),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,o=a&&a.exports===n&&r.process,i=function(){try{return a&&a.require&&a.require("util").types||o&&o.binding&&o.binding("util")}catch{}}(),e.exports=i),xy.exports;var e,t,r,n,a,o,i}function sL(){if(Lz)return cS;Lz=1;var e=Ire(),t=XA(),r=ZA(),n=r&&r.isTypedArray,a=n?t(n):e;return cS=a}function iL(){if(Vz)return lS;Vz=1;var e=Sre(),t=HA(),r=As(),n=QA(),a=YA(),o=sL(),i=Object.prototype.hasOwnProperty;return lS=function(s,l){var c=r(s),u=!c&&t(s),f=!c&&!u&&n(s),d=!c&&!u&&!f&&o(s),p=c||u||f||d,h=p?e(s.length,String):[],g=h.length;for(var m in s)(l||i.call(s,m))&&(!p||!("length"==m||f&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&h.push(m);return h}}function JA(){if(Bz)return uS;Bz=1;var e=Object.prototype;return uS=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}}function cL(){if(Fz)return fS;return Fz=1,fS=function(e,t){return function(r){return e(t(r))}}}function Are(){if(Uz)return dS;Uz=1;var e=cL()(Object.keys,Object);return dS=e}function lL(){if(Gz)return pS;Gz=1;var e=JA(),t=Are(),r=Object.prototype.hasOwnProperty;return pS=function(n){if(!e(n))return t(n);var a=[];for(var o in Object(n))r.call(n,o)&&"constructor"!=o&&a.push(o);return a}}function uL(){if(qz)return hS;qz=1;var e=y2(),t=KA();return hS=function(r){return null!=r&&t(r.length)&&!e(r)}}function x2(){if(Wz)return mS;Wz=1;var e=iL(),t=lL(),r=uL();return mS=function(n){return r(n)?e(n):t(n)}}function fL(){if(Hz)return gS;Hz=1;var e=aL(),t=WA(),r=x2();return gS=function(n){return e(n,r,t)}}function Rre(){if(Qz)return yS;Qz=1;var e=fL(),t=Object.prototype.hasOwnProperty;return yS=function(r,n,a,o,i,s){var l=1&a,c=e(r),u=c.length;if(u!=e(n).length&&!l)return!1;for(var f=u;f--;){var d=c[f];if(!(l?d in n:t.call(n,d)))return!1}var p=s.get(r),h=s.get(n);if(p&&h)return p==n&&h==r;var g=!0;s.set(r,n),s.set(n,r);for(var m=l;++f<u;){var y=r[d=c[f]],v=n[d];if(o)var b=l?o(v,y,d,n,r,s):o(y,v,d,r,n,s);if(!(void 0===b?y===v||i(y,v,a,o,s):b)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var w=r.constructor,_=n.constructor;w!=_&&"constructor"in r&&"constructor"in n&&!("function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _)&&(g=!1)}return s.delete(r),s.delete(n),g}}function Tre(){if(Yz)return vS;Yz=1;var e=Em()(os(),"DataView");return vS=e}function Pre(){if(Kz)return bS;Kz=1;var e=Em()(os(),"Promise");return bS=e}function $re(){if(Xz)return _S;Xz=1;var e=Em()(os(),"Set");return _S=e}function dL(){if(Zz)return wS;Zz=1;var e=Em()(os(),"WeakMap");return wS=e}function Gv(){if(Jz)return kS;Jz=1;var e=Tre(),t=FA(),r=Pre(),n=$re(),a=dL(),o=wf(),i=Q7(),s="[object Map]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",f="[object DataView]",d=i(e),p=i(t),h=i(r),g=i(n),m=i(a),y=o;return(e&&y(new e(new ArrayBuffer(1)))!=f||t&&y(new t)!=s||r&&y(r.resolve())!=l||n&&y(new n)!=c||a&&y(new a)!=u)&&(y=function(e){var t=o(e),r="[object Object]"==t?e.constructor:void 0,n=r?i(r):"";if(n)switch(n){case d:return f;case p:return s;case h:return l;case g:return c;case m:return u}return t}),kS=y}function zre(){if(eM)return xS;eM=1;var e=GA(),t=nL(),r=kre(),n=Rre(),a=Gv(),o=As(),i=QA(),s=sL(),l="[object Arguments]",c="[object Array]",u="[object Object]",f=Object.prototype.hasOwnProperty;return xS=function(d,p,h,g,m,y){var v=o(d),b=o(p),w=v?c:a(d),_=b?c:a(p),k=(w=w==l?u:w)==u,x=(_=_==l?u:_)==u,E=w==_;if(E&&i(d)){if(!i(p))return!1;v=!0,k=!1}if(E&&!k)return y||(y=new e),v||s(d)?t(d,p,h,g,m,y):r(d,p,w,h,g,m,y);if(!(1&h)){var A=k&&f.call(d,"__wrapped__"),S=x&&f.call(p,"__wrapped__");if(A||S){var C=A?d.value():d,z=S?p.value():p;return y||(y=new e),m(C,z,h,g,y)}}return!!E&&(y||(y=new e),n(d,p,h,g,m,y))}}function pL(){if(tM)return SS;tM=1;var e=zre(),t=ci();return SS=function r(n,a,o,i,s){return n===a||(null==n||null==a||!t(n)&&!t(a)?n!=n&&a!=a:e(n,a,o,i,r,s))},SS}function Mre(){if(nM)return ES;nM=1;var e=GA(),t=pL();return ES=function(r,n,a,o){var i=a.length,s=i,l=!o;if(null==r)return!s;for(r=Object(r);i--;){var c=a[i];if(l&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++i<s;){var u=(c=a[i])[0],f=r[u],d=c[1];if(l&&c[2]){if(void 0===f&&!(u in r))return!1}else{var p=new e;if(o)var h=o(f,d,u,r,n,p);if(!(void 0===h?t(d,f,3,o,p):h))return!1}}return!0}}function hL(){if(rM)return CS;rM=1;var e=Yc();return CS=function(t){return t==t&&!e(t)}}function Ore(){if(aM)return IS;aM=1;var e=hL(),t=x2();return IS=function(r){for(var n=t(r),a=n.length;a--;){var o=n[a],i=r[o];n[a]=[o,i,e(i)]}return n}}function mL(){if(oM)return AS;return oM=1,AS=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}}function Nre(){if(sM)return RS;sM=1;var e=Mre(),t=Ore(),r=mL();return RS=function(n){var a=t(n);return 1==a.length&&a[0][2]?r(a[0][0],a[0][1]):function(t){return t===n||e(t,n,a)}}}function Dre(){if(iM)return TS;return iM=1,TS=function(e,t){return null!=e&&t in Object(e)}}function jre(){if(cM)return PS;cM=1;var e=X7(),t=HA(),r=As(),n=YA(),a=KA(),o=Uv();return PS=function(i,s,l){for(var c=-1,u=(s=e(s,i)).length,f=!1;++c<u;){var d=o(s[c]);if(!(f=null!=i&&l(i,d)))break;i=i[d]}return f||++c!=u?f:!!(u=null==i?0:i.length)&&a(u)&&n(d,u)&&(r(i)||t(i))}}function Lre(){if(lM)return $S;lM=1;var e=Dre(),t=jre();return $S=function(r,n){return null!=r&&t(r,n,e)}}function Vre(){if(uM)return zS;uM=1;var e=pL(),t=J7(),r=Lre(),n=VA(),a=hL(),o=mL(),i=Uv();return zS=function(s,l){return n(s)&&a(l)?o(i(s),l):function(n){var a=t(n,s);return void 0===a&&a===l?r(n,s):e(l,a,3)}}}function eR(){if(fM)return MS;return fM=1,MS=function(e){return e}}function Bre(){if(dM)return OS;return dM=1,OS=function(e){return function(t){return null==t?void 0:t[e]}}}function Fre(){if(pM)return NS;pM=1;var e=Z7();return NS=function(t){return function(r){return e(r,t)}}}function Ure(){if(hM)return DS;hM=1;var e=Bre(),t=Fre(),r=VA(),n=Uv();return DS=function(a){return r(a)?e(n(a)):t(a)}}function Gre(){if(mM)return jS;mM=1;var e=Nre(),t=Vre(),r=eR(),n=As(),a=Ure();return jS=function(o){return"function"==typeof o?o:null==o?r:"object"==typeof o?n(o)?t(o[0],o[1]):e(o):a(o)}}function qre(){if(gM)return LS;return gM=1,LS=function(e,t,r,n){for(var a=e.length,o=r+(n?1:-1);n?o--:++o<a;)if(t(e[o],o,e))return o;return-1}}function Wre(){if(yM)return VS;return yM=1,VS=function(e){return e!=e}}function Hre(){if(vM)return BS;return vM=1,BS=function(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}}function Qre(){if(bM)return FS;bM=1;var e=qre(),t=Wre(),r=Hre();return FS=function(n,a,o){return a==a?r(n,a,o):e(n,t,o)}}function Yre(){if(_M)return US;_M=1;var e=Qre();return US=function(t,r){return!!(null==t?0:t.length)&&e(t,r,0)>-1}}function gL(){if(wM)return GS;return wM=1,GS=function(){}}function Kre(){if(kM)return qS;kM=1;var e=V0(),t=HA(),r=As(),n=e?e.isConcatSpreadable:void 0;return qS=function(e){return r(e)||t(e)||!!(n&&e&&e[n])}}function Xre(){if(xM)return WS;xM=1;var e=qA(),t=Kre();return WS=function r(n,a,o,i,s){var l=-1,c=n.length;for(o||(o=t),s||(s=[]);++l<c;){var u=n[l];a>0&&o(u)?a>1?r(u,a-1,o,i,s):e(s,u):i||(s[s.length]=u)}return s},WS}function tR(){if(SM)return HS;return SM=1,HS=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}}function Zre(){if(EM)return QS;EM=1;var e=tR(),t=Math.max;return QS=function(r,n,a){return n=t(void 0===n?r.length-1:n,0),function(){for(var o=arguments,i=-1,s=t(o.length-n,0),l=Array(s);++i<s;)l[i]=o[n+i];i=-1;for(var c=Array(n+1);++i<n;)c[i]=o[i];return c[n]=a(l),e(r,this,c)}},QS}function Jre(){if(CM)return YS;return CM=1,YS=function(e){return function(){return e}}}function yL(){if(IM)return KS;IM=1;var e=Em(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch{}}();return KS=t}function eae(){if(AM)return XS;AM=1;var e=Jre(),t=yL(),r=eR();return XS=t?function(r,n){return t(r,"toString",{configurable:!0,enumerable:!1,value:e(n),writable:!0})}:r}function vL(){if(RM)return ZS;RM=1;var e=Date.now;return ZS=function(t){var r=0,n=0;return function(){var a=e(),o=16-(a-n);if(n=a,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}},ZS}function bL(){if(TM)return JS;TM=1;var e=eae(),t=vL()(e);return JS=t}function tae(){if(PM)return e4;PM=1;var e=os();return e4=function(){return e.Date.now()}}function nae(){if($M)return t4;$M=1;var e=/\s/;return t4=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}}function rae(){if(zM)return n4;zM=1;var e=nae(),t=/^\s+/;return n4=function(r){return r&&r.slice(0,e(r)+1).replace(t,"")}}function _L(){if(MM)return r4;MM=1;var e=rae(),t=Yc(),r=Fv(),n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt;return r4=function(s){if("number"==typeof s)return s;if(r(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var c=a.test(s);return c||o.test(s)?i(s.slice(2),c?2:8):n.test(s)?NaN:+s}}function wL(){if(OM)return a4;OM=1;var e=Yc(),t=tae(),r=_L(),n=Math.max,a=Math.min;return a4=function(o,i,s){var l,c,u,f,d,p,h=0,g=!1,m=!1,y=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function v(e){var t=l,r=c;return l=c=void 0,h=e,f=o.apply(r,t)}function b(e){var t=e-p;return void 0===p||t>=i||t<0||m&&e-h>=u}function w(){var e=t();if(b(e))return _(e);d=setTimeout(w,function(e){var t=i-(e-p);return m?a(t,u-(e-h)):t}(e))}function _(e){return d=void 0,y&&l?v(e):(l=c=void 0,f)}function k(){var e=t(),r=b(e);if(l=arguments,c=this,p=e,r){if(void 0===d)return function(e){return h=e,d=setTimeout(w,i),g?v(e):f}(p);if(m)return clearTimeout(d),d=setTimeout(w,i),v(p)}return void 0===d&&(d=setTimeout(w,i)),f}return i=r(i)||0,e(s)&&(g=!!s.leading,u=(m="maxWait"in s)?n(r(s.maxWait)||0,i):u,y="trailing"in s?!!s.trailing:y),k.cancel=function(){void 0!==d&&clearTimeout(d),h=0,l=p=c=d=void 0},k.flush=function(){return void 0===d?f:_(t())},k},a4}function aae(){if(NM)return o4;NM=1;var e=wL(),t=Yc();return o4=function(r,n,a){var o=!0,i=!0;if("function"!=typeof r)throw new TypeError("Expected a function");return t(a)&&(o="leading"in a?!!a.leading:o,i="trailing"in a?!!a.trailing:i),e(r,n,{leading:o,maxWait:n,trailing:i})}}xy.exports;var oae=aae();const sae=tu(oae);function sv(e){return(sv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?DM(Object(r),!0).forEach((function(t){iae(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function iae(e,t,r){return(t=cae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cae(e){var t=lae(e,"string");return"symbol"==sv(t)?t:t+""}function lae(e,t){if("object"!=sv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=sv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function uae(e,t){return hae(e)||pae(e,t)||dae(e,t)||fae()}function fae(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function dae(e,t){if(e){if("string"==typeof e)return jM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jM(e,t)}}function jM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pae(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0!==t)for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}function hae(e){if(Array.isArray(e))return e}var s4,LM,i4,VM,c4,BM,l4,FM,u4,UM,f4,GM,d4,qM,p4,WM,h4,HM,m4,QM,g4,YM,y4,KM,v4,XM,mae=g.forwardRef((function(e,t){var r=e.aspect,n=e.initialDimension,a=void 0===n?{width:-1,height:-1}:n,o=e.width,i=void 0===o?"100%":o,s=e.height,l=void 0===s?"100%":s,c=e.minWidth,u=void 0===c?0:c,f=e.minHeight,d=e.maxHeight,p=e.children,h=e.debounce,m=void 0===h?0:h,y=e.id,v=e.className,b=e.onResize,w=e.style,_=void 0===w?{}:w,k=g.useRef(null),x=g.useRef();x.current=b,g.useImperativeHandle(t,(function(){return Object.defineProperty(k.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),k.current},configurable:!0})}));var E=uae(g.useState({containerWidth:a.width,containerHeight:a.height}),2),A=E[0],S=E[1],C=g.useCallback((function(e,t){S((function(r){var n=Math.round(e),a=Math.round(t);return r.containerWidth===n&&r.containerHeight===a?r:{containerWidth:n,containerHeight:a}}))}),[]);g.useEffect((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,a=r.height;C(n,a),null===(t=x.current)||void 0===t||t.call(x,n,a)};m>0&&(e=sae(e,m,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=k.current.getBoundingClientRect(),n=r.width,a=r.height;return C(n,a),t.observe(k.current),function(){t.disconnect()}}),[C,m]);var z=g.useMemo((function(){var e=A.containerWidth,t=A.containerHeight;if(e<0||t<0)return null;S6(n_(i)||n_(l),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",i,l),S6(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=n_(i)?e:i,a=n_(l)?t:l;r&&r>0&&(n?a=n/r:a&&(n=a*r),d&&a>d&&(a=d)),S6(n>0||a>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,a,i,l,u,f,r);var o=!Array.isArray(p)&&nre(p.type).endsWith("Chart");return be.Children.map(p,(function(e){return be.isValidElement(e)?g.cloneElement(e,r_({width:n,height:a},o?{style:r_({height:"100%",width:"100%",maxHeight:a,maxWidth:n},e.props.style)}:{})):e}))}),[r,p,l,d,f,u,A,i]);return be.createElement("div",{id:y?"".concat(y):void 0,className:Ul("recharts-responsive-container",v),style:r_(r_({},_),{},{width:i,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:k},z)}));function gae(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}function nR(){if(LM)return s4;LM=1;var e=cL()(Object.getPrototypeOf,Object);return s4=e}function yae(){if(VM)return i4;VM=1;var e=wf(),t=nR(),r=ci(),n=Function.prototype,a=Object.prototype,o=n.toString,i=a.hasOwnProperty,s=o.call(Object);return i4=function(n){if(!r(n)||"[object Object]"!=e(n))return!1;var a=t(n);if(null===a)return!0;var l=i.call(a,"constructor")&&a.constructor;return"function"==typeof l&&l instanceof l&&o.call(l)==s}}function vae(){if(BM)return c4;BM=1;var e=_L(),t=1/0;return c4=function(r){return r?(r=e(r))===t||r===-t?17976931348623157e292*(r<0?-1:1):r==r?r:0:0===r?r:0}}function kL(){if(FM)return l4;FM=1;var e=yL();return l4=function(t,r,n){"__proto__"==r&&e?e(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}}function xL(){if(UM)return u4;UM=1;var e=vae();return u4=function(t){var r=e(t),n=r%1;return r==r?n?r-n:r:0}}function rR(){if(GM)return f4;return GM=1,f4=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}}function SL(){if(qM)return d4;qM=1;var e=kL(),t=BA(),r=Object.prototype.hasOwnProperty;return d4=function(n,a,o){var i=n[a];(!r.call(n,a)||!t(i,o)||void 0===o&&!(a in n))&&e(n,a,o)}}function S2(){if(WM)return p4;WM=1;var e=SL(),t=kL();return p4=function(r,n,a,o){var i=!a;a||(a={});for(var s=-1,l=n.length;++s<l;){var c=n[s],u=o?o(a[c],r[c],c,a,r):void 0;void 0===u&&(u=r[c]),i?t(a,c,u):e(a,c,u)}return a}}function EL(){if(HM)return h4;HM=1;var e=S2(),t=x2();return h4=function(r,n){return r&&e(n,t(n),r)}}function bae(){if(QM)return m4;return QM=1,m4=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}}function _ae(){if(YM)return g4;YM=1;var e=Yc(),t=JA(),r=bae(),n=Object.prototype.hasOwnProperty;return g4=function(a){if(!e(a))return r(a);var o=t(a),i=[];for(var s in a)"constructor"==s&&(o||!n.call(a,s))||i.push(s);return i}}function aR(){if(KM)return y4;KM=1;var e=iL(),t=_ae(),r=uL();return y4=function(n){return r(n)?e(n,!0):t(n)}}function wae(){if(XM)return v4;XM=1;var e=S2(),t=aR();return v4=function(r,n){return r&&e(n,t(n),r)}}var ZM,b4,JM,_4,eO,w4,tO,k4,nO,x4,rO,S4,aO,E4,oO,C4,sO,I4,iO,A4,cO,R4,lO,T4,uO,P4,fO,$4,dO,z4,pO,M4,hO,O4,mO,N4,gO,D4,yO,j4,vO,L4,bO,Sy={exports:{}};function kae(){return ZM||(ZM=1,e=Sy,t=Sy.exports,r=os(),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,o=a&&a.exports===n?r.Buffer:void 0,i=o?o.allocUnsafe:void 0,e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}),Sy.exports;var e,t,r,n,a,o,i}function E2(){if(JM)return b4;return JM=1,b4=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}}function xae(){if(eO)return _4;eO=1;var e=S2(),t=WA();return _4=function(r,n){return e(r,t(r),n)}}function CL(){if(tO)return w4;tO=1;var e=qA(),t=nR(),r=WA(),n=oL(),a=Object.getOwnPropertySymbols;return w4=a?function(n){for(var a=[];n;)e(a,r(n)),n=t(n);return a}:n}function Sae(){if(nO)return k4;nO=1;var e=S2(),t=CL();return k4=function(r,n){return e(r,t(r),n)}}function Eae(){if(rO)return x4;rO=1;var e=aL(),t=CL(),r=aR();return x4=function(n){return e(n,r,t)}}function Cae(){if(aO)return S4;aO=1;var e=Object.prototype.hasOwnProperty;return S4=function(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}}function oR(){if(oO)return E4;oO=1;var e=rL();return E4=function(t){var r=new t.constructor(t.byteLength);return new e(r).set(new e(t)),r}}function Iae(){if(sO)return C4;sO=1;var e=oR();return C4=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}}function Aae(){if(iO)return I4;iO=1;var e=/\w*$/;return I4=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}}function Rae(){if(cO)return A4;cO=1;var e=V0(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;return A4=function(e){return r?Object(r.call(e)):{}}}function Tae(){if(lO)return R4;lO=1;var e=oR();return R4=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}}function Pae(){if(uO)return T4;uO=1;var e=oR(),t=Iae(),r=Aae(),n=Rae(),a=Tae();return T4=function(o,i,s){var l=o.constructor;switch(i){case"[object ArrayBuffer]":return e(o);case"[object Boolean]":case"[object Date]":return new l(+o);case"[object DataView]":return t(o,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(o,s);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(o);case"[object RegExp]":return r(o);case"[object Symbol]":return n(o)}}}function C2(){if(fO)return P4;fO=1;var e=Yc(),t=Object.create;return P4=function(){function r(){}return function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var a=new r;return r.prototype=void 0,a}}()}function $ae(){if(dO)return $4;dO=1;var e=C2(),t=nR(),r=JA();return $4=function(n){return"function"!=typeof n.constructor||r(n)?{}:e(t(n))}}function zae(){if(pO)return z4;pO=1;var e=Gv(),t=ci();return z4=function(r){return t(r)&&"[object Map]"==e(r)}}function Mae(){if(hO)return M4;hO=1;var e=zae(),t=XA(),r=ZA(),n=r&&r.isMap,a=n?t(n):e;return M4=a}function Oae(){if(mO)return O4;mO=1;var e=Gv(),t=ci();return O4=function(r){return t(r)&&"[object Set]"==e(r)}}function Nae(){if(gO)return N4;gO=1;var e=Oae(),t=XA(),r=ZA(),n=r&&r.isSet,a=n?t(n):e;return N4=a}function IL(){if(yO)return D4;yO=1;var e=GA(),t=rR(),r=SL(),n=EL(),a=wae(),o=kae(),i=E2(),s=xae(),l=Sae(),c=fL(),u=Eae(),f=Gv(),d=Cae(),p=Pae(),h=$ae(),g=As(),m=QA(),y=Mae(),v=Yc(),b=Nae(),w=x2(),_=aR(),k="[object Arguments]",x="[object Function]",E="[object Object]",A={};return A[k]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[E]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[x]=A["[object WeakMap]"]=!1,D4=function S(C,z,I,j,P,T){var R,N=1&z,O=2&z,M=4&z;if(I&&(R=P?I(C,j,P,T):I(C)),void 0!==R)return R;if(!v(C))return C;var D=g(C);if(D){if(R=d(C),!N)return i(C,R)}else{var L=f(C),q=L==x||"[object GeneratorFunction]"==L;if(m(C))return o(C,N);if(L==E||L==k||q&&!P){if(R=O||q?{}:h(C),!N)return O?l(C,a(R,C)):s(C,n(R,C))}else{if(!A[L])return P?C:{};R=p(C,L,N)}}T||(T=new e);var V=T.get(C);if(V)return V;T.set(C,R),b(C)?C.forEach((function(e){R.add(S(e,z,I,e,C,T))})):y(C)&&C.forEach((function(e,t){R.set(t,S(e,z,I,t,C,T))}));var B=D?void 0:(M?O?u:c:O?_:w)(C);return t(B||C,(function(e,t){B&&(e=C[t=e]),r(R,t,S(e,z,I,t,C,T))})),R},D4}function Dae(){if(vO)return j4;vO=1;var e=Xre();return j4=function(t){return(null==t?0:t.length)?e(t,1):[]}}function jae(){if(bO)return L4;bO=1;var e=Dae(),t=Zre(),r=bL();return L4=function(n){return r(t(n,void 0,e),n+"")}}Sy.exports;const Lae={light:"",dark:".dark"},AL=g.createContext(null);function RL(){const e=g.useContext(AL);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const Vae=g.forwardRef((({id:e,className:t,children:r,config:n,...a},o)=>{const i=g.useId(),s=`chart-${e||i.replace(/:/g,"")}`;return E.jsx(AL.Provider,{value:{config:n},children:E.jsxs("div",{"data-chart":s,ref:o,className:he("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[E.jsx(Bae,{id:s,config:n}),E.jsx(mae,{children:r})]})})}));Vae.displayName="Chart";const Bae=({id:e,config:t})=>{const r=Object.entries(t).filter((([,e])=>e.theme||e.color));return r.length?E.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Lae).map((([t,n])=>`\n${n} [data-chart=${e}] {\n${r.map((([e,r])=>{var n;const a=(null==(n=r.theme)?void 0:n[t])||r.color;return a?` --color-${e}: ${a};`:null})).join("\n")}\n}\n`)).join("\n")}}):null},Fae=g.forwardRef((({active:e,payload:t,className:r,indicator:n="dot",hideLabel:a=!1,hideIndicator:o=!1,label:i,labelFormatter:s,labelClassName:l,formatter:c,color:u,nameKey:f,labelKey:d,hoveredItem:p,onItemHover:h},m)=>{const{config:y}=RL(),v=g.useMemo((()=>{var e;if(a||null==t||!t.length)return null;const[r]=t,n=`${d||(null==r?void 0:r.dataKey)||(null==r?void 0:r.name)||"value"}`,o=QC(y,r,n),c=d||"string"!=typeof i?null==o?void 0:o.label:(null==(e=y[i])?void 0:e.label)||i;return s?E.jsx("div",{className:he("font-medium",l),children:s(c,t)}):c?E.jsx("div",{className:he("font-medium",l),children:c}):null}),[i,s,t,a,l,y,d]);if(!e||null==t||!t.length)return null;const b=1===t.length&&"dot"!==n,w=t.length>10;return E.jsxs("div",{ref:m,className:he("grid min-w-[8rem] items-start gap-xxs rounded-sm border border-border/50 bg-background px-xs py-xxs text-xs shadow-xl",w&&"min-w-[16rem]",r),children:[b?null:v,E.jsx("div",{className:he("grid gap-xxs",w&&"grid-cols-2 gap-x-s"),children:t.map(((e,t)=>{var r;const a=`${f||e.name||e.dataKey||"value"}`,i=QC(y,e,a),s=u||(null==(r=e.payload)?void 0:r.fill)||e.color||"",l=a===p;return E.jsx("div",{className:he("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground","dot"===n&&"items-center",l?"":p?"opacity-40":""),onMouseEnter:()=>null==h?void 0:h(a),onMouseLeave:()=>null==h?void 0:h(null),children:c&&void 0!==(null==e?void 0:e.value)&&void 0!==(null==e?void 0:e.payload)&&e.name?c(e.value,e.name,e,t,[e.payload]):E.jsxs(E.Fragment,{children:[null!=i&&i.icon?E.jsx(i.icon,{}):!o&&E.jsx("div",{className:he("shrink-0 rounded-full border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":"dot"===n,"w-1":"line"===n,"w-0 border border-dashed bg-transparent":"dashed"===n,"my-0.5":b&&"dashed"===n}),style:{"--color-bg":s,"--color-border":s}}),E.jsxs("div",{className:he("flex flex-1 justify-between leading-none",b?"items-end":"items-center"),children:[E.jsxs("div",{className:"grid gap-xxs",children:[b?v:null,E.jsx("span",{className:he("text-muted-foreground",l&&"font-medium text-foreground"),children:(null==i?void 0:i.label)||e.name})]}),e.value&&E.jsx("span",{className:he("font-mono font-medium tabular-nums text-foreground",l&&"font-bold"),children:e.value.toLocaleString()})]})]})},e.dataKey)}))})]})}));Fae.displayName="ChartTooltip";const Uae=g.forwardRef((({className:e,hideIcon:t=!1,payload:r,nameKey:n,onItemHover:a,hoveredItem:o},i)=>{const{config:s}=RL(),l=g.useRef({});return g.useEffect((()=>{if(o&&l.current[o]){const e=l.current[o];e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})}}),[o]),null!=r&&r.length?E.jsx("div",{ref:i,className:he("flex h-[150px] w-full flex-wrap items-center justify-center gap-l overflow-y-auto pb-xl",e),children:r.map((e=>{var r;const i=`${n||e.dataKey||"value"}`,c=QC(s,e,i),u=!!a&&i===o;return E.jsxs("div",{ref:e=>{e?l.current[i]=e:delete l.current[i]},className:he("group flex cursor-pointer select-none items-center gap-xs text-base transition-all duration-150",u?"scale-105 text-black":o?"text-gray-700 opacity-40":"text-gray-700"),onMouseEnter:()=>null==a?void 0:a(e.dataKey),onMouseLeave:()=>null==a?void 0:a(null),children:[null!=c&&c.icon&&!t?E.jsx(c.icon,{}):E.jsx("div",{className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.color||""}}),E.jsx("span",{className:"min-w-[max-content]",children:(null==c?void 0:c.label)||e.name})]},(null==(r=e.value)?void 0:r.toString())||i)}))}):null}));function QC(e,t,r){if("object"!=typeof t||null===t)return;const n="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0;let a=r;return r in t&&"string"==typeof t[r]?a=t[r]:n&&r in n&&"string"==typeof n[r]&&(a=n[r]),a in e?e[a]:e[r]}Uae.displayName="ChartLegend";const Gae=({children:e,className:t})=>E.jsx("div",{className:he("flex flex-wrap gap-xxxs",t),children:e}),TL=({text:e,icon:t,disabled:r,isLoading:n,avatarSrc:a,onClick:o,onRemove:i,className:s})=>E.jsxs("div",{onClick:r?void 0:o,className:he("flex cursor-pointer items-center gap-xxxs rounded-sm bg-gray-100 p-xxs text-sm font-medium text-gray-900 transition-all hover:bg-gray-200 [&_svg]:size-4",r&&"cursor-not-allowed bg-gray-100 text-gray-300",s),children:[a&&E.jsxs($A,{className:he("size-6 text-[10px]"),children:[E.jsx(zA,{src:a,alt:e}),E.jsx(V7,{className:"text-xs",children:e.charAt(0).toUpperCase()})]}),t,E.jsx("span",{children:e}),i&&!n&&E.jsx("span",{role:"button",tabIndex:-1,onClick:e=>{e.stopPropagation(),e.preventDefault(),!r&&(null==i||i())},onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},className:he("pointer-events-auto cursor-pointer",r&&"pointer-events-none cursor-not-allowed opacity-50"),children:E.jsx(jv,{size:16})}),n&&E.jsx(yf,{size:16,className:"animate-spin"})]});function I2(e){const t=g.useRef({value:e,previous:e});return g.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}function A2(e){const[t,r]=g.useState(void 0);return zo((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),t}const PL="Checkbox",[qae,$ot]=as(PL),[Wae,Hae]=qae(PL),Qae=g.forwardRef(((e,t)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:o,required:i,disabled:s,value:l="on",onCheckedChange:c,...u}=e,[f,d]=g.useState(null),p=dn(t,(e=>d(e))),h=g.useRef(!1),m=!f||!!f.closest("form"),[y=!1,v]=Yl({prop:a,defaultProp:o,onChange:c}),b=g.useRef(y);return g.useEffect((()=>{const e=null==f?void 0:f.form;if(e){const t=()=>v(b.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[f,v]),g.createElement(Wae,{scope:r,state:y,disabled:s},g.createElement(wt.button,Pe({type:"button",role:"checkbox","aria-checked":tm(y)?"mixed":y,"aria-required":i,"data-state":$L(y),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onKeyDown:ft(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:ft(e.onClick,(e=>{v((e=>!!tm(e)||!e)),m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())}))})),m&&g.createElement(Xae,{control:f,bubbles:!h.current,name:n,value:l,checked:y,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))})),Yae="CheckboxIndicator",Kae=g.forwardRef(((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,o=Hae(Yae,r);return g.createElement(ii,{present:n||tm(o.state)||!0===o.state},g.createElement(wt.span,Pe({"data-state":$L(o.state),"data-disabled":o.disabled?"":void 0},a,{ref:t,style:{pointerEvents:"none",...e.style}})))})),Xae=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,o=g.useRef(null),i=I2(r),s=A2(t);return g.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&a){const t=new Event("click",{bubbles:n});e.indeterminate=tm(r),a.call(e,!tm(r)&&r),e.dispatchEvent(t)}}),[i,r,n]),g.createElement("input",Pe({type:"checkbox","aria-hidden":!0,defaultChecked:!tm(r)&&r},a,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function tm(e){return"indeterminate"===e}function $L(e){return tm(e)?"indeterminate":e?"checked":"unchecked"}const zL=Qae,Zae=Kae,Jae=Yi("relative overflow-hidden ",{variants:{size:{default:"size-xs"},variant:{default:"peer shrink-0 rounded-sm border disabled:cursor-not-allowed disabled:!border-0 disabled:!bg-gray-100"}},defaultVariants:{size:"default",variant:"default"}}),sR=g.forwardRef((({className:e,size:t,variant:r,iconType:n,...a},o)=>{const i=a.checked,[s]=g.useState(i),[l,c]=g.useState(!1);g.useEffect((()=>{s!==i&&c(!0)}),[i]);const u=e=>"minus"===n?E.jsx(W8,{...e}):E.jsx(o2,{...e});return E.jsxs(zL,{ref:o,className:he(Jae({size:t,variant:r}),"transition-[border] duration-100 ease-linear",i?"border-0":"border-gray-300 hover:border-2",e),...a,children:[E.jsx("div",{className:he("transform-origin-center absolute left-0 top-0 size-full rounded-full bg-blue_100",i?"scale-[1.2]":"scale-0",{"animate-fill-in":i&&l,"animate-fill-out":!i&&l})}),E.jsx(Zae,{className:"relative flex items-center justify-center text-current",children:E.jsx(u,{className:"size-xxxs",color:a.disabled?"var(--gray-300)":"white"})})]})}));sR.displayName=zL.displayName;var _O=1,eoe=.9,toe=.8,noe=.17,V4=.1,B4=.999,roe=.9999,aoe=.99,ooe=/[\\\/_+.#"@\[\(\{&]/,soe=/[\\\/_+.#"@\[\(\{&]/g,ioe=/[\s-]/,ML=/[\s-]/g;function YC(e,t,r,n,a,o,i){if(o===t.length)return a===e.length?_O:aoe;var s=`${a},${o}`;if(void 0!==i[s])return i[s];for(var l,c,u,f,d=n.charAt(o),p=r.indexOf(d,a),h=0;p>=0;)(l=YC(e,t,r,n,p+1,o+1,i))>h&&(p===a?l*=_O:ooe.test(e.charAt(p-1))?(l*=toe,(u=e.slice(a,p-1).match(soe))&&a>0&&(l*=Math.pow(B4,u.length))):ioe.test(e.charAt(p-1))?(l*=eoe,(f=e.slice(a,p-1).match(ML))&&a>0&&(l*=Math.pow(B4,f.length))):(l*=noe,a>0&&(l*=Math.pow(B4,p-a))),e.charAt(p)!==t.charAt(o)&&(l*=roe)),(l<V4&&r.charAt(p-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(p-1)!==n.charAt(o))&&((c=YC(e,t,r,n,p+1,o+2,i))*V4>l&&(l=c*V4)),l>h&&(h=l),p=r.indexOf(d,p+1);return i[s]=h,h}function wO(e){return e.toLowerCase().replace(ML," ")}function coe(e,t,r){return YC(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,wO(e),wO(t),0,0,{})}var ey='[cmdk-group=""]',F4='[cmdk-group-items=""]',loe='[cmdk-group-heading=""]',iR='[cmdk-item=""]',kO=`${iR}:not([aria-disabled="true"])`,KC="cmdk-item-select",Kh="data-value",uoe=(e,t,r)=>coe(e,t,r),OL=g.createContext(void 0),qv=()=>g.useContext(OL),NL=g.createContext(void 0),cR=()=>g.useContext(NL),DL=g.createContext(void 0),jL=g.forwardRef(((e,t)=>{let r=i0((()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}})),n=i0((()=>new Set)),a=i0((()=>new Map)),o=i0((()=>new Map)),i=i0((()=>new Set)),s=LL(e),{label:l,children:c,value:u,onValueChange:f,filter:d,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:y=!0,...v}=e,b=g.useId(),w=g.useId(),_=g.useId(),k=g.useRef(null),x=woe();fm((()=>{if(void 0!==u){let e=u.trim();r.current.value=e,E.emit()}}),[u]),fm((()=>{x(6,j)}),[]);let E=g.useMemo((()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)I(),C(),x(1,z);else if("value"===e&&(n||x(5,j),void 0!==(null==(a=s.current)?void 0:a.value))){let e=t??"";return void(null==(i=(o=s.current).onValueChange)||i.call(o,e))}E.emit()}},emit:()=>{i.current.forEach((e=>e()))}})),[]),A=g.useMemo((()=>({value:(e,t,n)=>{var a;t!==(null==(a=o.current.get(e))?void 0:a.value)&&(o.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),x(2,(()=>{C(),E.emit()})))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),x(3,(()=>{I(),C(),r.current.value||z(),E.emit()})),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=P();x(4,(()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&z(),E.emit()}))}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],disablePointerSelection:m,listId:b,inputId:_,labelId:w,listInnerRef:k})),[]);function S(e,t){var n,a;let o=null!=(a=null==(n=s.current)?void 0:n.filter)?a:uoe;return e?o(e,r.current.search,t):0}function C(){if(!r.current.search||!1===s.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach((r=>{let n=a.current.get(r),o=0;n.forEach((t=>{let r=e.get(t);o=Math.max(r,o)})),t.push([r,o])}));let n=k.current;T().sort(((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)})).forEach((e=>{let t=e.closest(F4);t?t.appendChild(e.parentElement===t?e:e.closest(`${F4} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${F4} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=k.current.querySelector(`${ey}[${Kh}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function z(){let e=T().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(Kh);E.setState("value",t||void 0)}function I(){var e,t,i,l;if(!r.current.search||!1===s.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let a of n.current){let n=S(null!=(t=null==(e=o.current.get(a))?void 0:e.value)?t:"",null!=(l=null==(i=o.current.get(a))?void 0:i.keywords)?l:[]);r.current.filtered.items.set(a,n),n>0&&c++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function j(){var e,t,r;let n=P();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(ey))?void 0:t.querySelector(loe))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function P(){var e;return null==(e=k.current)?void 0:e.querySelector(`${iR}[aria-selected="true"]`)}function T(){var e;return Array.from(null==(e=k.current)?void 0:e.querySelectorAll(kO))}function R(e){let t=T()[e];t&&E.setState("value",t.getAttribute(Kh))}function N(e){var t;let r=P(),n=T(),a=n.findIndex((e=>e===r)),o=n[a+e];null!=(t=s.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&E.setState("value",o.getAttribute(Kh))}function O(e){let t,r=P(),n=null==r?void 0:r.closest(ey);for(;n&&!t;)n=e>0?boe(n,ey):_oe(n,ey),t=null==n?void 0:n.querySelector(kO);t?E.setState("value",t.getAttribute(Kh)):N(e)}let M=()=>R(T().length-1),D=e=>{e.preventDefault(),e.metaKey?M():e.altKey?O(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?R(0):e.altKey?O(-1):N(-1)};return g.createElement(wt.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=v.onKeyDown)||t.call(v,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&D(e);break;case"ArrowDown":D(e);break;case"p":case"k":y&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),R(0);break;case"End":e.preventDefault(),M();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=P();if(t){let e=new Event(KC);t.dispatchEvent(e)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:xoe},l),R2(e,(e=>g.createElement(NL.Provider,{value:E},g.createElement(OL.Provider,{value:A},e)))))})),foe=g.forwardRef(((e,t)=>{var r,n;let a=g.useId(),o=g.useRef(null),i=g.useContext(DL),s=qv(),l=LL(e),c=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;fm((()=>{if(!c)return s.item(a,null==i?void 0:i.id)}),[c]);let u=VL(a,o,[e.value,e.children,o],e.keywords),f=cR(),d=dm((e=>e.value&&e.value===u.current)),p=dm((e=>!(!c&&!1!==s.filter())||(!e.search||e.filtered.items.get(a)>0)));function h(){var e,t;m(),null==(t=(e=l.current).onSelect)||t.call(e,u.current)}function m(){f.setState("value",u.current,!0)}if(g.useEffect((()=>{let t=o.current;if(t&&!e.disabled)return t.addEventListener(KC,h),()=>t.removeEventListener(KC,h)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:y,value:v,onSelect:b,forceMount:w,keywords:_,...k}=e;return g.createElement(wt.div,{ref:iv([o,t]),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||s.disablePointerSelection?void 0:m,onClick:y?void 0:h},e.children)})),doe=g.forwardRef(((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,i=g.useId(),s=g.useRef(null),l=g.useRef(null),c=g.useId(),u=qv(),f=dm((e=>!(!a&&!1!==u.filter())||(!e.search||e.filtered.groups.has(i))));fm((()=>u.group(i)),[]),VL(i,s,[e.value,e.heading,l]);let d=g.useMemo((()=>({id:i,forceMount:a})),[a]);return g.createElement(wt.div,{ref:iv([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&g.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),R2(e,(e=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},g.createElement(DL.Provider,{value:d},e)))))})),poe=g.forwardRef(((e,t)=>{let{alwaysRender:r,...n}=e,a=g.useRef(null),o=dm((e=>!e.search));return r||o?g.createElement(wt.div,{ref:iv([a,t]),...n,"cmdk-separator":"",role:"separator"}):null})),hoe=g.forwardRef(((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,o=cR(),i=dm((e=>e.search)),s=dm((e=>e.value)),l=qv(),c=g.useMemo((()=>{var e;let t=null==(e=l.listInnerRef.current)?void 0:e.querySelector(`${iR}[${Kh}="${encodeURIComponent(s)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return g.useEffect((()=>{null!=e.value&&o.setState("search",e.value)}),[e.value]),g.createElement(wt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:a?e.value:i,onChange:e=>{a||o.setState("search",e.target.value),null==r||r(e.target.value)}})})),moe=g.forwardRef(((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=g.useRef(null),i=g.useRef(null),s=qv();return g.useEffect((()=>{if(i.current&&o.current){let e,t=i.current,r=o.current,n=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")}))}));return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}}),[]),g.createElement(wt.div,{ref:iv([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":n,id:s.listId},R2(e,(e=>g.createElement("div",{ref:iv([i,s.listInnerRef]),"cmdk-list-sizer":""},e))))})),goe=g.forwardRef(((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:i,...s}=e;return g.createElement(PA,{open:r,onOpenChange:n},g.createElement(h2,{container:i},g.createElement(j0,{"cmdk-overlay":"",className:a}),g.createElement(L0,{"aria-label":e.label,"cmdk-dialog":"",className:o},g.createElement(jL,{ref:t,...s}))))})),yoe=g.forwardRef(((e,t)=>dm((e=>0===e.filtered.count))?g.createElement(wt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),voe=g.forwardRef(((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return g.createElement(wt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},R2(e,(e=>g.createElement("div",{"aria-hidden":!0},e))))})),Rs=Object.assign(jL,{List:moe,Item:foe,Input:hoe,Group:doe,Separator:poe,Dialog:goe,Empty:yoe,Loading:voe});function boe(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function _oe(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function LL(e){let t=g.useRef(e);return fm((()=>{t.current=e})),t}var fm=typeof window>"u"?g.useEffect:g.useLayoutEffect;function i0(e){let t=g.useRef();return void 0===t.current&&(t.current=e()),t}function iv(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function dm(e){let t=cR(),r=()=>e(t.snapshot());return g.useSyncExternalStore(t.subscribe,r,r)}function VL(e,t,r,n=[]){let a=g.useRef(),o=qv();return fm((()=>{var i;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=n.map((e=>e.trim()));o.value(e,s,l),null==(i=t.current)||i.setAttribute(Kh,s),a.current=s})),a}var woe=()=>{let[e,t]=g.useState(),r=i0((()=>new Map));return fm((()=>{r.current.forEach((e=>e())),r.current=new Map}),[e]),(e,n)=>{r.current.set(e,n),t({})}};function koe(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}function R2({asChild:e,children:t},r){return e&&g.isValidElement(t)?g.cloneElement(koe(t),{ref:t.ref},r(t.props.children)):r(t)}var xoe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Soe=PA,Eoe=h2,BL=g.forwardRef((({className:e,...t},r)=>(g.useEffect((()=>{const e=document.querySelectorAll(".blured-modal-overlay");return e.forEach((e=>e&&(e.style.filter="blur(5px)"))),()=>{0===Array.from(document.querySelectorAll('[role="dialog"]')).length&&e.forEach((e=>e&&(e.style.filter="none")))}}),[]),E.jsx(j0,{ref:r,"data-testid":"dialog_overlay",className:he("fixed inset-0 z-dialog bg-black opacity-[0.8] data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}))));BL.displayName=j0.displayName;const Coe=Yi("",{variants:{closeVariant:{none:"",insideCard:"absolute right-m top-m rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-gray-400",outsideCard:"fixed right-[30px] top-[30px] z-100 text-gray-400",mobileGallery:"fixed right-m top-[62px] text-white z-[110]"}},defaultVariants:{closeVariant:"outsideCard"}}),Ioe=Yi("",{variants:{closeSize:{small:"size-6",big:"size-[42px]","18x18":"size-[18px]"}},defaultVariants:{closeSize:"small"}}),FL=g.forwardRef((({title:e,titleIcon:t,className:r,dialogName:n,showClose:a=!0,closeVariant:o="outsideCard",closeSize:i="big",children:s,titleClassName:l,overlayClassName:c,childrenClassName:u,footerClassName:f,onBack:d,onCloseModal:p,renderFooter:h,onScroll:g,...m},y)=>{const v=E.jsxs(m2,{className:he(Coe({closeVariant:o})),children:[E.jsx(jv,{onClick:p,fill:"currentColor",className:he(Ioe({closeSize:i}))}),E.jsx("span",{className:"sr-only",children:"Close"})]});return E.jsxs(Eoe,{children:[E.jsx(BL,{className:c,onClick:p}),a&&"insideCard"!==o&&v,E.jsxs(L0,{ref:y,className:he("fixed left-[50%] top-[50%] z-[101] grid max-w-[600px] translate-x-[-50%] translate-y-[-50%] !overflow-visible rounded-sm bg-background shadow-lg outline-none duration-200 data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] max-md:w-[calc(100vw-32px)] md:w-full [&>div]:min-w-0",r),...m,children:[e&&E.jsxs("h3",{className:he("flex items-center justify-center gap-xxs border-b border-gray-200 p-m text-center text-lg font-semibold text-gray-700",l),children:[t,e]}),E.jsx("div",{id:n||"dialog-content",className:he("p-m",u),onScroll:g,children:s}),a&&"insideCard"===o&&v,d&&E.jsx("button",{"data-testid":"dialog-back-button","aria-label":"Back",onClick:d,className:"absolute left-m top-m",children:E.jsx(F8,{color:"var(--gray-400)",size:24})}),E.jsx(UL,{className:he("empty:hidden",f),children:null==h?void 0:h()})]})]})}));FL.displayName=L0.displayName;const UL=({className:e,...t})=>E.jsx("div",{className:he("flex border-t border-gray-200 p-m",e),...t});UL.displayName="DialogFooter";const Aoe=g.forwardRef((({className:e,...t},r)=>E.jsx(Lv,{ref:r,className:he("text-lg font-semibold leading-none tracking-tight",e),...t})));Aoe.displayName=Lv.displayName;const Roe=g.forwardRef((({className:e,...t},r)=>E.jsx(Vv,{ref:r,className:he("text-sm text-muted-foreground",e),...t})));Roe.displayName=Vv.displayName;const lR=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs,{ref:r,className:he("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})));lR.displayName=Rs.displayName;const Toe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:E.jsx(Rs.Input,{ref:r,className:he("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})})));Toe.displayName=Rs.Input.displayName;const uR=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.List,{ref:r,className:he("mt-2 max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t})));uR.displayName=Rs.List.displayName;const GL=g.forwardRef(((e,t)=>E.jsx(Rs.Empty,{ref:t,className:"py-6 text-center text-sm",...e})));GL.displayName=Rs.Empty.displayName;const Poe=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.Group,{ref:r,className:he("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})));Poe.displayName=Rs.Group.displayName;const $oe=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.Separator,{ref:r,className:he("-mx-1 h-px bg-border",e),...t})));$oe.displayName=Rs.Separator.displayName;const fR=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.Item,{ref:r,className:he("relative flex max-w-[215px] cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t})));function fp(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function xO(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function qL(...e){return t=>{let r=!1;const n=e.map((e=>{const n=xO(e,t);return!r&&"function"==typeof n&&(r=!0),n}));if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():xO(e[t],null)}}}}function Cm(...e){return g.useCallback(qL(...e),e)}function zoe(e,t){const r=g.createContext(t),n=e=>{const{children:t,...n}=e,a=g.useMemo((()=>n),Object.values(n));return E.jsx(r.Provider,{value:a,children:t})};return n.displayName=e+"Provider",[n,function(n){const a=g.useContext(r);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}function Moe(e,t=[]){let r=[];const n=()=>{const t=r.map((e=>g.createContext(e)));return function(r){const n=(null==r?void 0:r[e])||t;return g.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const a=g.createContext(n),o=r.length;r=[...r,n];const i=t=>{var r;const{scope:n,children:i,...s}=t,l=(null==(r=null==n?void 0:n[e])?void 0:r[o])||a,c=g.useMemo((()=>s),Object.values(s));return E.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(r,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=g.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},Ooe(n,...t)]}function Ooe(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return g.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}fR.displayName=Rs.Item.displayName;var aw=null!=globalThis&&globalThis.document?g.useLayoutEffect:()=>{},Noe=ew[" useId ".trim().toString()]||(()=>{}),Doe=0;function U4(e){const[t,r]=g.useState(Noe());return aw((()=>{e||r((e=>e??String(Doe++)))}),[e]),e||(t?`radix-${t}`:"")}function pm(e){const t=g.useRef(e);return g.useEffect((()=>{t.current=e})),g.useMemo((()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)}),[])}function joe({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=Loe({defaultProp:t,onChange:r}),o=void 0!==e,i=o?e:n,s=pm(r);return[i,g.useCallback((t=>{if(o){const r="function"==typeof t?t(e):t;r!==e&&s(r)}else a(t)}),[o,e,a,s])]}function Loe({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,a=g.useRef(n),o=pm(t);return g.useEffect((()=>{a.current!==n&&(o(n),a.current=n)}),[n,a,o]),r}function WL(e){const t=Voe(e),r=g.forwardRef(((e,r)=>{const{children:n,...a}=e,o=g.Children.toArray(n),i=o.find(Foe);if(i){const e=i.props.children,n=o.map((t=>t===i?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t));return E.jsx(t,{...a,ref:r,children:g.isValidElement(e)?g.cloneElement(e,void 0,n):null})}return E.jsx(t,{...a,ref:r,children:n})}));return r.displayName=`${e}.Slot`,r}function Voe(e){const t=g.forwardRef(((e,t)=>{const{children:r,...n}=e;if(g.isValidElement(r)){const e=Goe(r),a=Uoe(n,r.props);return r.type!==g.Fragment&&(a.ref=t?qL(t,e):e),g.cloneElement(r,a)}return g.Children.count(r)>1?g.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var Boe=Symbol("radix.slottable");function Foe(e){return g.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Boe}function Uoe(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{o(...e),a(...e)}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}function Goe(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var qoe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],kf=qoe.reduce(((e,t)=>{const r=WL(`Primitive.${t}`),n=g.forwardRef(((e,n)=>{const{asChild:a,...o}=e,i=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function Woe(e,t){e&&Qc.flushSync((()=>e.dispatchEvent(t)))}function Hoe(e,t=(null==globalThis?void 0:globalThis.document)){const r=pm(e);g.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[r,t])}var SO,Qoe="DismissableLayer",XC="dismissableLayer.update",Yoe="dismissableLayer.pointerDownOutside",Koe="dismissableLayer.focusOutside",HL=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QL=g.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=g.useContext(HL),[u,f]=g.useState(null),d=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=g.useState({}),h=Cm(t,(e=>f(e))),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(y),b=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,_=b>=v,k=Joe((e=>{const t=e.target,r=[...c.branches].some((e=>e.contains(t)));!_||r||(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),d),x=ese((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),d);return Hoe((e=>{b===c.layers.size-1&&(null==n||n(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),d),g.useEffect((()=>{if(u)return r&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(SO=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),EO(),()=>{r&&1===c.layersWithOutsidePointerEventsDisabled.size&&(d.body.style.pointerEvents=SO)}}),[u,d,r,c]),g.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),EO())}),[u,c]),g.useEffect((()=>{const e=()=>p({});return document.addEventListener(XC,e),()=>document.removeEventListener(XC,e)}),[]),E.jsx(kf.div,{...l,ref:h,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:fp(e.onFocusCapture,x.onFocusCapture),onBlurCapture:fp(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:fp(e.onPointerDownCapture,k.onPointerDownCapture)})}));QL.displayName=Qoe;var Xoe="DismissableLayerBranch",Zoe=g.forwardRef(((e,t)=>{const r=g.useContext(HL),n=g.useRef(null),a=Cm(t,n);return g.useEffect((()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E.jsx(kf.div,{...e,ref:a})}));function Joe(e,t=(null==globalThis?void 0:globalThis.document)){const r=pm(e),n=g.useRef(!1),a=g.useRef((()=>{}));return g.useEffect((()=>{const e=e=>{if(e.target&&!n.current){let n=function(){YL(Yoe,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ese(e,t=(null==globalThis?void 0:globalThis.document)){const r=pm(e),n=g.useRef(!1);return g.useEffect((()=>{const e=e=>{e.target&&!n.current&&YL(Koe,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function EO(){const e=new CustomEvent(XC);document.dispatchEvent(e)}function YL(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Woe(a,o):a.dispatchEvent(o)}Zoe.displayName=Xoe;var G4="focusScope.autoFocusOnMount",q4="focusScope.autoFocusOnUnmount",CO={bubbles:!1,cancelable:!0},tse="FocusScope",KL=g.forwardRef(((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[s,l]=g.useState(null),c=pm(a),u=pm(o),f=g.useRef(null),d=Cm(t,(e=>l(e))),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect((()=>{if(n){let e=function(e){if(p.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:op(f.current,{select:!0})},t=function(e){if(p.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||op(f.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&op(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return s&&n.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}}),[n,s,p.paused]),g.useEffect((()=>{if(s){AO.add(p);const e=document.activeElement;if(!s.contains(e)){const t=new CustomEvent(G4,CO);s.addEventListener(G4,c),s.dispatchEvent(t),t.defaultPrevented||(nse(ise(XL(s)),{select:!0}),document.activeElement===e&&op(s))}return()=>{s.removeEventListener(G4,c),setTimeout((()=>{const t=new CustomEvent(q4,CO);s.addEventListener(q4,u),s.dispatchEvent(t),t.defaultPrevented||op(e??document.body,{select:!0}),s.removeEventListener(q4,u),AO.remove(p)}),0)}}}),[s,c,u,p]);const h=g.useCallback((e=>{if(!r&&!n||p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[n,o]=rse(t);n&&o?e.shiftKey||a!==o?e.shiftKey&&a===n&&(e.preventDefault(),r&&op(o,{select:!0})):(e.preventDefault(),r&&op(n,{select:!0})):a===t&&e.preventDefault()}}),[r,n,p.paused]);return E.jsx(kf.div,{tabIndex:-1,...i,ref:d,onKeyDown:h})}));function nse(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(op(n,{select:t}),document.activeElement!==r)return}function rse(e){const t=XL(e);return[IO(t,e),IO(t.reverse(),e)]}function XL(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function IO(e,t){for(const r of e)if(!ase(r,{upTo:t}))return r}function ase(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ose(e){return e instanceof HTMLInputElement&&"select"in e}function op(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ose(e)&&t&&e.select()}}KL.displayName=tse;var AO=sse();function sse(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=RO(e,t),e.unshift(t)},remove(t){var r;e=RO(e,t),null==(r=e[0])||r.resume()}}}function RO(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}function ise(e){return e.filter((e=>"A"!==e.tagName))}var cse="Portal",ZL=g.forwardRef(((e,t)=>{var r;const{container:n,...a}=e,[o,i]=g.useState(!1);aw((()=>i(!0)),[]);const s=n||o&&(null==(r=null==globalThis?void 0:globalThis.document)?void 0:r.body);return s?xA.createPortal(E.jsx(kf.div,{...a,ref:t}),s):null}));function lse(e,t){return g.useReducer(((e,r)=>t[e][r]??e),e)}ZL.displayName=cse;var T2=e=>{const{present:t,children:r}=e,n=use(t),a="function"==typeof r?r({present:n.isPresent}):g.Children.only(r),o=Cm(n.ref,fse(a));return"function"==typeof r||n.isPresent?g.cloneElement(a,{ref:o}):null};function use(e){const[t,r]=g.useState(),n=g.useRef({}),a=g.useRef(e),o=g.useRef("none"),i=e?"mounted":"unmounted",[s,l]=lse(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect((()=>{const e=a_(n.current);o.current="mounted"===s?e:"none"}),[s]),aw((()=>{const t=n.current,r=a.current;if(r!==e){const n=o.current,i=a_(t);e?l("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?l("UNMOUNT"):l(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),a.current=e}}),[e,l]),aw((()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=o=>{const i=a_(n.current).includes(o.animationName);if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)}))}},s=e=>{e.target===t&&(o.current=a_(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback((e=>{e&&(n.current=getComputedStyle(e)),r(e)}),[])}}function a_(e){return(null==e?void 0:e.animationName)||"none"}function fse(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}T2.displayName="Presence";var W4=0;function dse(){g.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??TO()),document.body.insertAdjacentElement("beforeend",e[1]??TO()),W4++,()=>{1===W4&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),W4--}}),[])}function TO(){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 JL=u7(),H4=function(){},P2=g.forwardRef((function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:H4,onWheelCapture:H4,onTouchMoveCapture:H4}),a=n[0],o=n[1],i=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,p=e.noIsolation,h=e.inert,m=e.allowPinchZoom,y=e.as,v=void 0===y?"div":y,b=e.gapMode,w=RA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=d,k=l7([r,t]),x=To(To({},w),a);return g.createElement(g.Fragment,null,u&&g.createElement(_,{sideCar:JL,removeScrollBar:c,shards:f,noIsolation:p,inert:h,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:b}),i?g.cloneElement(g.Children.only(s),To(To({},x),{ref:k})):g.createElement(v,To({},x,{className:l,ref:k}),s))}));P2.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},P2.classNames={fullWidth:jy,zeroRight:Dy};var ZC=!1;if(typeof window<"u")try{var o_=Object.defineProperty({},"passive",{get:function(){return ZC=!0,!0}});window.addEventListener("test",o_,o_),window.removeEventListener("test",o_,o_)}catch{ZC=!1}var e0=!!ZC&&{passive:!1},pse=function(e){return"TEXTAREA"===e.tagName},eV=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!pse(e)&&"visible"===r[t])},hse=function(e){return eV(e,"overflowY")},mse=function(e){return eV(e,"overflowX")},PO=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),tV(e,n)){var a=nV(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gse=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},yse=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},tV=function(e,t){return"v"===e?hse(t):mse(t)},nV=function(e,t){return"v"===e?gse(t):yse(t)},vse=function(e,t){return"h"===e&&"rtl"===t?-1:1},bse=function(e,t,r,n,a){var o=vse(e,window.getComputedStyle(t).direction),i=o*n,s=r.target,l=t.contains(s),c=!1,u=i>0,f=0,d=0;do{var p=nV(e,s),h=p[0],g=p[1]-p[2]-o*h;(h||g)&&tV(e,s)&&(f+=g,d+=h),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(Math.abs(f)<1||!a)||!u&&(Math.abs(d)<1||!a))&&(c=!0),c},s_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$O=function(e){return[e.deltaX,e.deltaY]},zO=function(e){return e&&"current"in e?e.current:e},_se=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wse=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},kse=0,t0=[];function xse(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),a=g.useState(kse++)[0],o=g.useState(TA)[0],i=g.useRef(e);g.useEffect((function(){i.current=e}),[e]),g.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=c7([e.lockRef.current],(e.shards||[]).map(zO),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=s_(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],u=e.target,f=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===f&&"range"===u.type)return!1;var d=PO(f,u);if(!d)return!0;if(d?a=f:(a="v"===f?"h":"v",d=PO(f,u)),!d)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var p=n.current||a;return bse(p,t,e,"h"===p?l:c,!0)}),[]),l=g.useCallback((function(e){var r=e;if(t0.length&&t0[t0.length-1]===o){var n="deltaY"in r?$O(r):s_(r),a=t.current.filter((function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&_se(e.delta,n)}))[0];if(a&&a.should)return void(r.cancelable&&r.preventDefault());if(!a){var l=(i.current.shards||[]).map(zO).filter(Boolean).filter((function(e){return e.contains(r.target)}));(l.length>0?s(r,l[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}}),[]),c=g.useCallback((function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:Sse(n)};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),u=g.useCallback((function(e){r.current=s_(e),n.current=void 0}),[]),f=g.useCallback((function(t){c(t.type,$O(t),t.target,s(t,e.lockRef.current))}),[]),d=g.useCallback((function(t){c(t.type,s_(t),t.target,s(t,e.lockRef.current))}),[]);g.useEffect((function(){return t0.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,e0),document.addEventListener("touchmove",l,e0),document.addEventListener("touchstart",u,e0),function(){t0=t0.filter((function(e){return e!==o})),document.removeEventListener("wheel",l,e0),document.removeEventListener("touchmove",l,e0),document.removeEventListener("touchstart",u,e0)}}),[]);var p=e.removeScrollBar,h=e.inert;return g.createElement(g.Fragment,null,h?g.createElement(o,{styles:wse(a)}):null,p?g.createElement(h7,{gapMode:e.gapMode}):null)}function Sse(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ese=d7(JL,xse);var rV=g.forwardRef((function(e,t){return g.createElement(P2,To({},e,{ref:t,sideCar:Ese}))}));rV.classNames=P2.classNames;var dR="Dialog",[aV,zot]=Moe(dR),[Cse,Kc]=aV(dR),oV=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,s=g.useRef(null),l=g.useRef(null),[c=!1,u]=joe({prop:n,defaultProp:a,onChange:o});return E.jsx(Cse,{scope:t,triggerRef:s,contentRef:l,contentId:U4(),titleId:U4(),descriptionId:U4(),open:c,onOpenChange:u,onOpenToggle:g.useCallback((()=>u((e=>!e))),[u]),modal:i,children:r})};oV.displayName=dR;var sV="DialogTrigger",iV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(sV,r),o=Cm(t,a.triggerRef);return E.jsx(kf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":mR(a.open),...n,ref:o,onClick:fp(e.onClick,a.onOpenToggle)})}));iV.displayName=sV;var pR="DialogPortal",[Ise,cV]=aV(pR,{forceMount:void 0}),lV=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=Kc(pR,t);return E.jsx(Ise,{scope:t,forceMount:r,children:g.Children.map(n,(e=>E.jsx(T2,{present:r||o.open,children:E.jsx(ZL,{asChild:!0,container:a,children:e})})))})};lV.displayName=pR;var ow="DialogOverlay",uV=g.forwardRef(((e,t)=>{const r=cV(ow,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=Kc(ow,e.__scopeDialog);return o.modal?E.jsx(T2,{present:n||o.open,children:E.jsx(Rse,{...a,ref:t})}):null}));uV.displayName=ow;var Ase=WL("DialogOverlay.RemoveScroll"),Rse=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(ow,r);return E.jsx(rV,{as:Ase,allowPinchZoom:!0,shards:[a.contentRef],children:E.jsx(kf.div,{"data-state":mR(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})})),hm="DialogContent",fV=g.forwardRef(((e,t)=>{const r=cV(hm,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=Kc(hm,e.__scopeDialog);return E.jsx(T2,{present:n||o.open,children:o.modal?E.jsx(Tse,{...a,ref:t}):E.jsx(Pse,{...a,ref:t})})}));fV.displayName=hm;var Tse=g.forwardRef(((e,t)=>{const r=Kc(hm,e.__scopeDialog),n=g.useRef(null),a=Cm(t,r.contentRef,n);return g.useEffect((()=>{const e=n.current;if(e)return p2(e)}),[]),E.jsx(dV,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fp(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null==(t=r.triggerRef.current)||t.focus()})),onPointerDownOutside:fp(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()})),onFocusOutside:fp(e.onFocusOutside,(e=>e.preventDefault()))})})),Pse=g.forwardRef(((e,t)=>{const r=Kc(hm,e.__scopeDialog),n=g.useRef(!1),a=g.useRef(!1);return E.jsx(dV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,i;null==(o=e.onCloseAutoFocus)||o.call(e,t),t.defaultPrevented||(n.current||null==(i=r.triggerRef.current)||i.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{var o,i;null==(o=e.onInteractOutside)||o.call(e,t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=r.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})})),dV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,s=Kc(hm,r),l=g.useRef(null),c=Cm(t,l);return dse(),E.jsxs(E.Fragment,{children:[E.jsx(KL,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:E.jsx(QL,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":mR(s.open),...i,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),E.jsxs(E.Fragment,{children:[E.jsx($se,{titleId:s.titleId}),E.jsx(Mse,{contentRef:l,descriptionId:s.descriptionId})]})]})})),hR="DialogTitle",pV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(hR,r);return E.jsx(kf.h2,{id:a.titleId,...n,ref:t})}));pV.displayName=hR;var hV="DialogDescription",mV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(hV,r);return E.jsx(kf.p,{id:a.descriptionId,...n,ref:t})}));mV.displayName=hV;var gV="DialogClose",yV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(gV,r);return E.jsx(kf.button,{type:"button",...n,ref:t,onClick:fp(e.onClick,(()=>a.onOpenChange(!1)))})}));function mR(e){return e?"open":"closed"}yV.displayName=gV;var vV="DialogTitleWarning",[Mot,bV]=zoe(vV,{contentName:hm,titleName:hR,docsSlug:"dialog"}),$se=({titleId:e})=>{const t=bV(vV),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect((()=>{e&&(document.getElementById(e)||console.error(r))}),[r,e]),null},zse="DialogDescriptionWarning",Mse=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bV(zse).contentName}}.`;return g.useEffect((()=>{var n;const a=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))}),[r,e,t]),null},Ose=oV,Nse=iV,Dse=lV,jse=uV,Lse=fV,Vse=pV,Bse=mV,Fse=yV;function Use(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const _V=be.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),B0=()=>{const e=be.useContext(_V);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Use("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}");const Gse=24,qse=typeof window<"u"?g.useLayoutEffect:g.useEffect;function MO(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function Wse(){return gR(/^Mac/)}function Hse(){return gR(/^iPhone/)}function OO(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Qse(){return gR(/^iPad/)||Wse()&&navigator.maxTouchPoints>1}function wV(){return Hse()||Qse()}function gR(e){return typeof window<"u"&&null!=window.navigator?e.test(window.navigator.platform):void 0}const Q4=typeof document<"u"&&window.visualViewport;function NO(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function kV(e){for(NO(e)&&(e=e.parentElement);e&&!NO(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Yse=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Y4,i_=0;function Kse(e={}){let{isDisabled:t}=e;qse((()=>{if(!t)return i_++,1===i_&&wV()&&(Y4=Xse()),()=>{i_--,0===i_&&(null==Y4||Y4())}}),[t])}function Xse(){let e,t=0,r=window.pageXOffset,n=window.pageYOffset,a=MO(Zse(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let o=MO(ty(document,"touchstart",(r=>{e=kV(r.target),(e!==document.documentElement||e!==document.body)&&(t=r.changedTouches[0].pageY)}),{passive:!1,capture:!0}),ty(document,"touchmove",(r=>{if(!e||e===document.documentElement||e===document.body)return void r.preventDefault();let n=r.changedTouches[0].pageY,a=e.scrollTop,o=e.scrollHeight-e.clientHeight;0!==o&&((a<=0&&n>t||a>=o&&n<t)&&r.preventDefault(),t=n)}),{passive:!1,capture:!0}),ty(document,"touchend",(e=>{let t=e.target;JC(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame((()=>{t.style.transform=""})))}),{passive:!1,capture:!0}),ty(document,"focus",(e=>{let t=e.target;JC(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame((()=>{t.style.transform="",Q4&&(Q4.height<window.innerHeight?requestAnimationFrame((()=>{DO(t)})):Q4.addEventListener("resize",(()=>DO(t)),{once:!0}))})))}),!0),ty(window,"scroll",(()=>{window.scrollTo(0,0)})));return()=>{a(),o(),window.scrollTo(r,n)}}function Zse(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function ty(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function DO(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=kV(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=n-r)}e=t.parentElement}}function JC(e){return e instanceof HTMLInputElement&&!Yse.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Jse(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function eie(...e){return t=>e.forEach((e=>Jse(e,t)))}function xV(...e){return g.useCallback(eie(...e),e)}const SV=new WeakMap;function Ea(e,t,r=!1){if(!(e&&e instanceof HTMLElement))return;let n={};Object.entries(t).forEach((([t,r])=>{t.startsWith("--")?e.style.setProperty(t,r):(n[t]=e.style[t],e.style[t]=r)})),!r&&SV.set(e,n)}function tie(e,t){if(!(e&&e instanceof HTMLElement))return;let r=SV.get(e);r&&(e.style[t]=r[t])}const Ca=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function c_(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let a=n.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[Ca(t)?13:12]):(a=n.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[Ca(t)?5:4]):null)}function nie(e){return 8*(Math.log(e+1)-2)}function K4(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function rie(...e){return(...t)=>{for(const r of e)"function"==typeof r&&r(...t)}}const br={DURATION:.5,EASE:[.32,.72,0,1]},EV=.4,aie=.25,oie=100,CV=8,Fh=16,eI=26,X4="vaul-dragging";function IV(e){const t=be.useRef(e);return be.useEffect((()=>{t.current=e})),be.useMemo((()=>(...e)=>null==t.current?void 0:t.current.call(t,...e)),[])}function sie({defaultProp:e,onChange:t}){const r=be.useState(e),[n]=r,a=be.useRef(n),o=IV(t);return be.useEffect((()=>{a.current!==n&&(o(n),a.current=n)}),[n,a,o]),r}function AV({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=sie({defaultProp:t,onChange:r}),o=void 0!==e,i=o?e:n,s=IV(r);return[i,be.useCallback((t=>{if(o){const r="function"==typeof t?t(e):t;r!==e&&s(r)}else a(t)}),[o,e,a,s])]}function iie({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:a,fadeFromIndex:o,onSnapPointChange:i,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,f]=AV({prop:e,defaultProp:null==r?void 0:r[0],onChange:t}),[d,p]=be.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);be.useEffect((()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const h=be.useMemo((()=>u===(null==r?void 0:r[r.length-1])||null),[r,u]),g=be.useMemo((()=>null==r?void 0:r.findIndex((e=>e===u))),[r,u]),m=r&&r.length>0&&(o||0===o)&&!Number.isNaN(o)&&r[o]===u||!r,y=be.useMemo((()=>{const e=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==r?void 0:r.map((t=>{const r="string"==typeof t;let n=0;if(r&&(n=parseInt(t,10)),Ca(s)){const a=r?n:d?t*e.height:0;return d?"bottom"===s?e.height-a:-e.height+a:a}const a=r?n:d?t*e.width:0;return d?"right"===s?e.width-a:-e.width+a:a})))?t:[]}),[r,d,l]),v=be.useMemo((()=>null!==g?null==y?void 0:y[g]:null),[y,g]),b=be.useCallback((e=>{var t;const l=null!=(t=null==y?void 0:y.findIndex((t=>t===e)))?t:null;i(l),Ea(n.current,{transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,transform:Ca(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),y&&l!==y.length-1&&l!==o&&l<o?Ea(a.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,opacity:"0"}):Ea(a.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(l,0)])}),[n.current,r,y,o,a,f]);return be.useEffect((()=>{if(u||e){var t;const n=null!=(t=null==r?void 0:r.findIndex((t=>t===e||t===u)))?t:-1;y&&-1!==n&&"number"==typeof y[n]&&b(y[n])}}),[u,e,r,y,b]),{isLastSnapPoint:h,activeSnapPoint:u,shouldFade:m,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!y||void 0===o)return null;const n=g===o-1;if(g>=o&&t)return 0;if(n&&!t)return 1;if(!m&&!n)return null;const a=n?g+1:g-1,i=n?y[a]-y[a-1]:y[a+1]-y[a],s=e/Math.abs(i);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:i}){if(void 0===o)return;const l="bottom"===s||"right"===s?(v??0)-e:(v??0)+e,u=0===g,f=e>0;if(g===o-1&&Ea(a.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`}),!c&&n>2&&!f)return void(i?t():b(y[0]));if(!c&&n>2&&f&&y&&r)return void b(y[r.length-1]);const d=null==y?void 0:y.reduce(((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-l)<Math.abs(e-l)?t:e)),p=Ca(s)?window.innerHeight:window.innerWidth;if(n>EV&&Math.abs(e)<.4*p){const e=f?1:-1;if(e>0&&h)return void b(y[r.length-1]);if(u&&e<0&&i&&t(),null===g)return;b(y[g+e])}else b(d)},onDrag:function({draggedDistance:e}){if(null===v)return;const t="bottom"===s||"right"===s?v-e:v+e;("bottom"===s||"right"===s)&&t<y[y.length-1]||("top"===s||"left"===s)&&t>y[y.length-1]||Ea(n.current,{transform:Ca(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:y}}const cie=()=>()=>{};function lie(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:a}=B0(),o=be.useRef(null),i=g.useMemo((()=>document.body.style.backgroundColor),[]);function s(){return(window.innerWidth-26)/window.innerWidth}be.useEffect((()=>{if(t&&r){o.current&&clearTimeout(o.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;rie(n&&!a?K4(document.body,{background:"black"}):cie,K4(t,{transformOrigin:Ca(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${br.DURATION}s`,transitionTimingFunction:`cubic-bezier(${br.EASE.join(",")})`}));const r=K4(t,{borderRadius:"8px",overflow:"hidden",...Ca(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{r(),o.current=window.setTimeout((()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")}),1e3*br.DURATION)}}}),[t,r,i])}let ny=null;function uie({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:a,noBodyStyles:o}){const[i,s]=be.useState((()=>typeof window<"u"?window.location.href:"")),l=be.useRef(0),c=be.useCallback((()=>{if(OO()&&null===ny&&e&&!o){ny={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-l.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout((()=>window.requestAnimationFrame((()=>{const e=t-window.innerHeight;e&&l.current>=t&&(document.body.style.top=-(l.current+e)+"px")}))),300)}}),[e]),u=be.useCallback((()=>{if(OO()&&null!==ny&&!o){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,ny),window.requestAnimationFrame((()=>{a&&i!==window.location.href?s(window.location.href):window.scrollTo(t,e)})),ny=null}}),[i]);return be.useEffect((()=>{function e(){l.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]),be.useEffect((()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout((()=>{u()}),500)):u())}),[e,n,i,t,r,c,u]),{restorePositionSetting:u}}function RV({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:a,snapPoints:o,shouldScaleBackground:i=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=aie,scrollLockTimeout:c=100,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:d=o&&o.length-1,activeSnapPoint:p,setActiveSnapPoint:h,fixed:g,modal:m=!0,onClose:y,nested:v,noBodyStyles:b,direction:w="bottom",defaultOpen:_=!1,disablePreventScroll:k=!0,snapToSequentialPoint:x=!1,preventScrollRestoration:E=!1,repositionInputs:A=!0,onAnimationEnd:S,container:C,autoFocus:z=!1}){var I,j;const[P=!1,T]=AV({defaultProp:_,prop:e,onChange:e=>{null==t||t(e),!e&&!v&&le(),setTimeout((()=>{null==S||S(e)}),1e3*br.DURATION),e&&!m&&typeof window<"u"&&window.requestAnimationFrame((()=>{document.body.style.pointerEvents="auto"})),e||(document.body.style.pointerEvents="auto")}}),[R,N]=be.useState(!1),[O,M]=be.useState(!1),[D,L]=be.useState(!1),q=be.useRef(null),V=be.useRef(null),B=be.useRef(null),U=be.useRef(null),F=be.useRef(null),$=be.useRef(!1),G=be.useRef(null),Q=be.useRef(0),W=be.useRef(!1),H=be.useRef(0),K=be.useRef(null),Y=be.useRef((null==(I=K.current)?void 0:I.getBoundingClientRect().height)||0),Z=be.useRef((null==(j=K.current)?void 0:j.getBoundingClientRect().width)||0),X=be.useRef(0),J=be.useCallback((e=>{o&&e===ae.length-1&&(V.current=new Date)}),[]),{activeSnapPoint:ee,activeSnapPointIndex:te,setActiveSnapPoint:re,onRelease:ne,snapPointsOffset:ae,onDrag:oe,shouldFade:ie,getPercentageDragged:se}=iie({snapPoints:o,activeSnapPointProp:p,setActiveSnapPointProp:h,drawerRef:K,fadeFromIndex:d,overlayRef:q,onSnapPointChange:J,direction:w,container:C,snapToSequentialPoint:x});Kse({isDisabled:!P||O||!m||D||!R||!A||!k});const{restorePositionSetting:le}=uie({isOpen:P,modal:m,nested:v,hasBeenOpened:R,preventScrollRestoration:E,noBodyStyles:b});function ce(){return(window.innerWidth-26)/window.innerWidth}function ue(e,t){var r,n;let a=e;const o=null==(r=window.getSelection())?void 0:r.toString(),i=K.current?c_(K.current,w):null,s=new Date;if(a.hasAttribute("data-vaul-no-drag")||a.closest("[data-vaul-no-drag]"))return!1;if("right"===w||"left"===w)return!0;if(V.current&&s.getTime()-V.current.getTime()<500)return!1;if(null!==i&&("bottom"===w?i>0:i<0))return!0;if(o&&o.length>0)return!1;if(s.getTime()-(null==(n=F.current)?void 0:n.getTime())<c&&0===i||t)return F.current=s,!1;for(;a;){if(a.scrollHeight>a.clientHeight){if(0!==a.scrollTop)return F.current=new Date,!1;if("dialog"===a.getAttribute("role"))return!0}a=a.parentNode}return!0}function fe(e){!O||!K.current||(K.current.classList.remove(X4),$.current=!1,M(!1),U.current=new Date),null==y||y(),e||T(!1),setTimeout((()=>{o&&re(o[0])}),1e3*br.DURATION)}function de(){if(!K.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=c_(K.current,w);Ea(K.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`}),Ea(q.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,opacity:"1"}),i&&t&&t>0&&P&&Ea(e,{borderRadius:"8px",overflow:"hidden",...Ca(w)?{transform:`scale(${ce()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ce()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${br.DURATION}s`,transitionTimingFunction:`cubic-bezier(${br.EASE.join(",")})`},!0)}return be.useEffect((()=>{var e;function t(){if(!K.current||!A)return;if(JC(document.activeElement)||W.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,r=window.innerHeight;let n=r-t;const a=K.current.getBoundingClientRect().height||0,i=a>.8*r;X.current||(X.current=a);const s=K.current.getBoundingClientRect().top;if(Math.abs(H.current-n)>60&&(W.current=!W.current),o&&o.length>0&&ae&&te){n+=ae[te]||0}if(H.current=n,a>t||W.current){const e=K.current.getBoundingClientRect().height;let r=e;e>t&&(r=t-(i?s:26)),K.current.style.height=g?e-Math.max(n,0)+"px":`${Math.max(r,t-s)}px`}else K.current.style.height=`${X.current}px`;o&&o.length>0&&!W.current?K.current.style.bottom="0px":K.current.style.bottom=`${Math.max(n,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}}),[te,o,ae]),be.useEffect((()=>(P&&(Ea(document.documentElement,{scrollBehavior:"auto"}),V.current=new Date),()=>{tie(document.documentElement,"scrollBehavior")})),[P]),be.createElement(Ose,{defaultOpen:_,onOpenChange:e=>{!u&&!e||(e?N(!0):fe(!0),T(e))},open:P},be.createElement(_V.Provider,{value:{activeSnapPoint:ee,snapPoints:o,setActiveSnapPoint:re,drawerRef:K,overlayRef:q,onOpenChange:t,onPress:function(e){var t,r;!u&&!o||K.current&&!K.current.contains(e.target)||(Y.current=(null==(t=K.current)?void 0:t.getBoundingClientRect().height)||0,Z.current=(null==(r=K.current)?void 0:r.getBoundingClientRect().width)||0,M(!0),B.current=new Date,wV()&&window.addEventListener("touchend",(()=>$.current=!1),{once:!0}),e.target.setPointerCapture(e.pointerId),Q.current=Ca(w)?e.pageY:e.pageX)},onRelease:function(e){if(!O||!K.current)return;K.current.classList.remove(X4),$.current=!1,M(!1),U.current=new Date;const t=c_(K.current,w);if(!ue(e.target,!1)||!t||Number.isNaN(t)||null===B.current)return;const r=U.current.getTime()-B.current.getTime(),n=Q.current-(Ca(w)?e.pageY:e.pageX),i=Math.abs(n)/r;if(i>.05&&(L(!0),setTimeout((()=>{L(!1)}),200)),o)return ne({draggedDistance:n*("bottom"===w||"right"===w?1:-1),closeDrawer:fe,velocity:i,dismissible:u}),void(null==a||a(e,!0));if("bottom"===w||"right"===w?n>0:n<0)return de(),void(null==a||a(e,!0));if(i>EV)return fe(),void(null==a||a(e,!1));var s;const c=Math.min(null!=(s=K.current.getBoundingClientRect().height)?s:0,window.innerHeight);var f;const d=Math.min(null!=(f=K.current.getBoundingClientRect().width)?f:0,window.innerWidth),p="left"===w||"right"===w;if(Math.abs(t)>=(p?d:c)*l)return fe(),void(null==a||a(e,!1));null==a||a(e,!0),de()},onDrag:function(e){if(K.current&&O){const t="bottom"===w||"right"===w?1:-1,r=(Q.current-(Ca(w)?e.pageY:e.pageX))*t,a=r>0,s=o&&!u&&!a;if(s&&0===te)return;const l=Math.abs(r),c=document.querySelector("[data-vaul-drawer-wrapper]");let f=l/("bottom"===w||"top"===w?Y.current:Z.current);const p=se(l,a);if(null!==p&&(f=p),s&&f>=1||!$.current&&!ue(e.target,a))return;if(K.current.classList.add(X4),$.current=!0,Ea(K.current,{transition:"none"}),Ea(q.current,{transition:"none"}),o&&oe({draggedDistance:r}),a&&!o){const e=nie(r),n=Math.min(-1*e,0)*t;return void Ea(K.current,{transform:Ca(w)?`translate3d(0, ${n}px, 0)`:`translate3d(${n}px, 0, 0)`})}const h=1-f;if((ie||d&&te===d-1)&&(null==n||n(e,f),Ea(q.current,{opacity:`${h}`,transition:"none"},!0)),c&&q.current&&i){const e=Math.min(ce()+f*(1-ce()),1),t=8-8*f,r=Math.max(0,14-14*f);Ea(c,{borderRadius:`${t}px`,transform:Ca(w)?`scale(${e}) translate3d(0, ${r}px, 0)`:`scale(${e}) translate3d(${r}px, 0, 0)`,transition:"none"},!0)}if(!o){const e=l*t;Ea(K.current,{transform:Ca(w)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:u,handleOnly:f,isOpen:P,isDragging:O,shouldFade:ie,closeDrawer:fe,onNestedDrag:function(e,t){if(t<0)return;const r=(window.innerWidth-16)/window.innerWidth,n=r+t*(1-r),a=16*t-16;Ea(K.current,{transform:Ca(w)?`scale(${n}) translate3d(0, ${a}px, 0)`:`scale(${n}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-16)/window.innerWidth:1,r=e?-16:0;G.current&&window.clearTimeout(G.current),Ea(K.current,{transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,transform:`scale(${t}) translate3d(0, ${r}px, 0)`}),!e&&K.current&&(G.current=setTimeout((()=>{const e=c_(K.current,w);Ea(K.current,{transition:"none",transform:Ca(w)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}),500))},onNestedRelease:function(e,t){const r=Ca(w)?window.innerHeight:window.innerWidth,n=t?(r-16)/r:1,a=t?-16:0;t&&Ea(K.current,{transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,transform:Ca(w)?`scale(${n}) translate3d(0, ${a}px, 0)`:`scale(${n}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:W,modal:m,snapPointsOffset:ae,direction:w,shouldScaleBackground:i,setBackgroundColorOnScale:s,noBodyStyles:b,container:C,autoFocus:z}},r))}const TV=be.forwardRef((function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:a,shouldFade:o,isOpen:i,modal:s}=B0(),l=xV(t,r),c=n&&n.length>0;return s?be.createElement(jse,{onMouseUp:a,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":i&&c?"true":"false","data-vaul-snap-points-overlay":i&&o?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame((()=>{document.body.style.pointerEvents="auto"})),null)}));TV.displayName="Drawer.Overlay";const PV=be.forwardRef((function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},a){const{drawerRef:o,onPress:i,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,modal:f,isOpen:d,direction:p,snapPoints:h,container:g,handleOnly:m,autoFocus:y}=B0(),[v,b]=be.useState(!1),w=xV(a,o),_=be.useRef(null),k=be.useRef(null),x=be.useRef(!1),E=h&&h.length>0;lie();function A(e){_.current=null,x.current=!1,s(e)}return be.useEffect((()=>{E&&window.requestAnimationFrame((()=>{b(!0)}))}),[]),be.createElement(Lse,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":v?"true":"false","data-vaul-snap-points":d&&E?"true":"false","data-vaul-custom-container":g?"true":"false",...n,ref:w,style:u&&u.length>0?{"--snap-point-height":`${u[0]}px`,...t}:t,onPointerDown:e=>{m||(null==n.onPointerDown||n.onPointerDown.call(n,e),_.current={x:e.pageX,y:e.pageY},i(e))},onOpenAutoFocus:e=>{null==r||r(e),y||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),f&&!t.defaultPrevented?c.current&&(c.current=!1):t.preventDefault()},onFocusOutside:e=>{f||e.preventDefault()},onPointerMove:e=>{if(k.current=e,m||(null==n.onPointerMove||n.onPointerMove.call(n,e),!_.current))return;const t=e.pageY-_.current.y,r=e.pageX-_.current.x,a="touch"===e.pointerType?10:2;((e,t,r=0)=>{if(x.current)return!0;const n=Math.abs(e.y),a=Math.abs(e.x),o=a>n,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&a>=0&&a<=r)return o}else if(!(e.y*i<0)&&n>=0&&n<=r)return!o;return x.current=!0,!0})({x:r,y:t},p,a)?l(e):(Math.abs(r)>a||Math.abs(t)>a)&&(_.current=null)},onPointerUp:e=>{null==n.onPointerUp||n.onPointerUp.call(n,e),_.current=null,x.current=!1,s(e)},onPointerOut:e=>{null==n.onPointerOut||n.onPointerOut.call(n,e),A(k.current)},onContextMenu:e=>{null==n.onContextMenu||n.onContextMenu.call(n,e),A(k.current)}})}));PV.displayName="Drawer.Content";const fie=250,die=120,$V=be.forwardRef((function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:a,isDragging:o,snapPoints:i,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:f,onPress:d,onDrag:p}=B0(),h=be.useRef(null),g=be.useRef(!1);function m(){window.clearTimeout(h.current),g.current=!1}return be.createElement("div",{onClick:function(){g.current?m():window.setTimeout((()=>{!function(){if(o||e||g.current)return void m();if(m(),(!i||0===i.length)&&c)return void a();if(s===i[i.length-1]&&c)return void a();const t=i.findIndex((e=>e===s));if(-1===t)return;const r=i[t+1];l(r)}()}),120)},onPointerCancel:m,onPointerDown:e=>{u&&d(e),h.current=window.setTimeout((()=>{g.current=!0}),250)},onPointerMove:e=>{u&&p(e)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},be.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))}));function pie({onDrag:e,onOpenChange:t,...r}){const{onNestedDrag:n,onNestedOpenChange:a,onNestedRelease:o}=B0();if(!n)throw new Error("Drawer.NestedRoot must be placed in another drawer");return be.createElement(RV,{nested:!0,onClose:()=>{a(!1)},onDrag:(t,r)=>{n(t,r),null==e||e(t,r)},onOpenChange:e=>{e&&a(e)},onRelease:o,...r})}function hie(e){const t=B0(),{container:r=t.container,...n}=e;return be.createElement(Dse,{container:r,...n})}$V.displayName="Drawer.Handle";const Ap={Root:RV,NestedRoot:pie,Content:PV,Overlay:TV,Trigger:Nse,Portal:hie,Handle:$V,Close:Fse,Title:Vse,Description:Bse},mie=Ap.Portal,zV=g.forwardRef((({className:e,...t},r)=>E.jsx(Ap.Overlay,{ref:r,className:he("fixed inset-0 z-50 bg-black/5",e),...t})));zV.displayName=Ap.Overlay.displayName;const gie=g.forwardRef((({className:e,children:t,direction:r="bottom",...n},a)=>E.jsxs(mie,{children:[E.jsx(zV,{}),E.jsxs(Ap.Content,{ref:a,className:he("fixed z-50 border bg-background shadow-lg","bottom"===r&&"inset-x-0 bottom-0 mt-24 flex h-auto flex-col rounded-t-sm","top"===r&&"inset-x-0 top-0 mb-24 flex h-auto flex-col rounded-b-sm","left"===r&&"inset-y-0 left-0 flex h-full flex-col","right"===r&&"inset-y-0 right-0 flex h-full w-[346px] flex-col sm:w-[435px]",e),...n,children:["bottom"===r&&E.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]})));gie.displayName="DrawerContent";const yie=g.forwardRef((({className:e,...t},r)=>E.jsx(Ap.Title,{ref:r,className:he("text-lg font-semibold leading-none tracking-tight",e),...t})));yie.displayName=Ap.Title.displayName;const vie=g.forwardRef((({className:e,...t},r)=>E.jsx(Ap.Description,{ref:r,className:he("text-sm text-muted-foreground",e),...t})));function yR(e){const t=e+"CollectionProvider",[r,n]=as(t),[a,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:r}=e,n=be.useRef(null),o=be.useRef(new Map).current;return be.createElement(a,{scope:t,itemMap:o,collectionRef:n},r)},Slot:be.forwardRef(((e,t)=>{const{scope:r,children:n}=e,a=dn(t,o(i,r).collectionRef);return be.createElement(lm,{ref:a},n)})),ItemSlot:be.forwardRef(((e,t)=>{const{scope:r,children:n,...a}=e,i=be.useRef(null),c=dn(t,i),u=o(s,r);return be.useEffect((()=>(u.itemMap.set(i,{ref:i,...a}),()=>{u.itemMap.delete(i)}))),be.createElement(lm,{[l]:"",ref:c},n)}))},function(t){const r=o(e+"CollectionConsumer",t);return be.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`));return Array.from(r.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)))}),[r.collectionRef,r.itemMap])},n]}vie.displayName=Ap.Description.displayName;const bie=g.createContext(void 0);function Wv(e){const t=g.useContext(bie);return e||t||"ltr"}const _ie=["top","right","bottom","left"],yp=Math.min,ei=Math.max,sw=Math.round,l_=Math.floor,vp=e=>({x:e,y:e}),wie={left:"right",right:"left",bottom:"top",top:"bottom"},kie={start:"end",end:"start"};function tI(e,t,r){return ei(e,yp(t,r))}function vf(e,t){return"function"==typeof e?e(t):e}function bf(e){return e.split("-")[0]}function F0(e){return e.split("-")[1]}function vR(e){return"x"===e?"y":"x"}function bR(e){return"y"===e?"height":"width"}function bp(e){return["top","bottom"].includes(bf(e))?"y":"x"}function _R(e){return vR(bp(e))}function xie(e,t,r){void 0===r&&(r=!1);const n=F0(e),a=_R(e),o=bR(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=iw(i)),[i,iw(i)]}function Sie(e){const t=iw(e);return[nI(e),t,nI(t)]}function nI(e){return e.replace(/start|end/g,(e=>kie[e]))}function Eie(e,t,r){const n=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?o:i;default:return[]}}function Cie(e,t,r,n){const a=F0(e);let o=Eie(bf(e),"start"===r,n);return a&&(o=o.map((e=>e+"-"+a)),t&&(o=o.concat(o.map(nI)))),o}function iw(e){return e.replace(/left|right|bottom|top/g,(e=>wie[e]))}function Iie(e){return{top:0,right:0,bottom:0,left:0,...e}}function MV(e){return"number"!=typeof e?Iie(e):{top:e,right:e,bottom:e,left:e}}function cw(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function jO(e,t,r){let{reference:n,floating:a}=e;const o=bp(t),i=_R(t),s=bR(i),l=bf(t),c="y"===o,u=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,d=n[s]/2-a[s]/2;let p;switch(l){case"top":p={x:u,y:n.y-a.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-a.width,y:f};break;default:p={x:n.x,y:n.y}}switch(F0(t)){case"start":p[i]-=d*(r&&c?-1:1);break;case"end":p[i]+=d*(r&&c?-1:1)}return p}const Aie=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:f}=jO(c,n,l),d=n,p={},h=0;for(let r=0;r<s.length;r++){const{name:o,fn:g}=s[r],{x:m,y:y,data:v,reset:b}=await g({x:u,y:f,initialPlacement:n,placement:d,strategy:a,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=m??u,f=y??f,p={...p,[o]:{...p[o],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:u,y:f}=jO(c,d,l))),r=-1)}return{x:u,y:f,placement:d,strategy:a,middlewareData:p}};async function cv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=vf(t,e),h=MV(p),g=s[d?"floating"===f?"reference":"floating":f],m=cw(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===f?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},w=cw(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const Rie=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=vf(e,t)||{};if(null==c)return{};const f=MV(u),d={x:r,y:n},p=_R(a),h=bR(p),g=await i.getDimensions(c),m="y"===p,y=m?"top":"left",v=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[p]-d[p]-o.floating[h],_=d[p]-o.reference[p],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let x=k?k[b]:0;(!x||!await(null==i.isElement?void 0:i.isElement(k)))&&(x=s.floating[b]||o.floating[h]);const E=w/2-_/2,A=x/2-g[h]/2-1,S=yp(f[y],A),C=yp(f[v],A),z=S,I=x-g[h]-C,j=x/2-g[h]/2+E,P=tI(z,j,I),T=!l.arrow&&null!=F0(a)&&j!==P&&o.reference[h]/2-(j<z?S:C)-g[h]/2<0,R=T?j<z?j-z:j-I:0;return{[p]:d[p]+R,data:{[p]:P,centerOffset:j-P-R,...T&&{alignmentOffset:R}},reset:T}}}),Tie=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=vf(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const y=bf(a),v=bp(s),b=bf(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(b||!g?[iw(s)]:Sie(s)),k="none"!==h;!d&&k&&_.push(...Cie(s,g,h,w));const x=[s,..._],E=await cv(t,m),A=[];let S=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&A.push(E[y]),f){const e=xie(a,i,w);A.push(E[e[0]],E[e[1]])}if(S=[...S,{placement:a,overflows:A}],!A.every((e=>e<=0))){var C,z;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let r=null==(z=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:z.placement;if(!r)switch(p){case"bestFit":{var I;const e=null==(I=S.filter((e=>{if(k){const t=bp(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(r=e);break}case"initialPlacement":r=s}if(a!==r)return{reset:{placement:r}}}return{}}}};function LO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VO(e){return _ie.some((t=>e[t]>=0))}const Pie=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=vf(e,t);switch(n){case"referenceHidden":{const e=LO(await cv(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:VO(e)}}}case"escaped":{const e=LO(await cv(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:VO(e)}}}default:return{}}}}};async function $ie(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=bf(r),s=F0(r),l="y"===bp(r),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,f=vf(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}const zie=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await $ie(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},Mie=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=vf(e,t),c={x:r,y:n},u=await cv(t,l),f=bp(bf(a)),d=vR(f);let p=c[d],h=c[f];if(o){const e="y"===d?"bottom":"right";p=tI(p+u["y"===d?"top":"left"],p,p-u[e])}if(i){const e="y"===f?"bottom":"right";h=tI(h+u["y"===f?"top":"left"],h,h-u[e])}const g=s.fn({...t,[d]:p,[f]:h});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[d]:o,[f]:i}}}}}},Oie=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=vf(e,t),u={x:r,y:n},f=bp(a),d=vR(f);let p=u[d],h=u[f];const g=vf(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+m.mainAxis,r=o.reference[d]+o.reference[e]-m.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var y,v;const e="y"===d?"width":"height",t=["top","left"].includes(bf(a)),r=o.reference[f]-o.floating[e]+(t&&(null==(y=i.offset)?void 0:y[f])||0)+(t?0:m.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[f])||0)-(t?m.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[d]:p,[f]:h}}}},Nie=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=vf(e,t),u=await cv(t,c),f=bf(a),d=F0(a),p="y"===bp(a),{width:h,height:g}=o.floating;let m,y;"top"===f||"bottom"===f?(m=f,y=d===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,m="end"===d?"top":"bottom");const v=g-u.top-u.bottom,b=h-u.left-u.right,w=yp(g-u[m],v),_=yp(h-u[y],b),k=!t.middlewareData.shift;let x=w,E=_;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(x=v),k&&!d){const e=ei(u.left,0),t=ei(u.right,0),r=ei(u.top,0),n=ei(u.bottom,0);p?E=h-2*(0!==e||0!==t?e+t:ei(u.left,u.right)):x=g-2*(0!==r||0!==n?r+n:ei(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:x});const A=await i.getDimensions(s.floating);return h!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function $2(){return typeof window<"u"}function _p(e){return OV(e)?(e.nodeName||"").toLowerCase():"#document"}function ri(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function xf(e){var t;return null==(t=(OV(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function OV(e){return!!$2()&&(e instanceof Node||e instanceof ri(e).Node)}function Kl(e){return!!$2()&&(e instanceof Element||e instanceof ri(e).Element)}function Xl(e){return!!$2()&&(e instanceof HTMLElement||e instanceof ri(e).HTMLElement)}function BO(e){return!(!$2()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof ri(e).ShadowRoot)}function Hv(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Wi(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function Die(e){return["table","td","th"].includes(_p(e))}function jie(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch{return!1}}))}function wR(e){const t=kR(),r=Kl(e)?Wi(e):e;return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some((e=>(r.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(r.contain||"").includes(e)))}function NV(e){let t=E0(e);for(;Xl(t)&&!z2(t);){if(wR(t))return t;if(jie(t))return null;t=E0(t)}return null}function kR(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function z2(e){return["html","body","#document"].includes(_p(e))}function Wi(e){return ri(e).getComputedStyle(e)}function M2(e){return Kl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function E0(e){if("html"===_p(e))return e;const t=e.assignedSlot||e.parentNode||BO(e)&&e.host||xf(e);return BO(t)?t.host:t}function DV(e){const t=E0(e);return z2(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xl(t)&&Hv(t)?t:DV(t)}function lv(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=DV(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),i=ri(a);if(o){const e=Lie(i);return t.concat(i,i.visualViewport||[],Hv(a)?a:[],e&&r?lv(e):[])}return t.concat(a,lv(a,[],r))}function Lie(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jV(e){const t=Wi(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Xl(e),o=a?e.offsetWidth:r,i=a?e.offsetHeight:n,s=sw(r)!==o||sw(n)!==i;return s&&(r=o,n=i),{width:r,height:n,$:s}}function xR(e){return Kl(e)?e:e.contextElement}function g0(e){const t=xR(e);if(!Xl(t))return vp(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=jV(t);let i=(o?sw(r.width):r.width)/n,s=(o?sw(r.height):r.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const Vie=vp(0);function LV(e){const t=ri(e);return kR()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Vie}function Bie(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ri(e))&&t}function mm(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=xR(e);let i=vp(1);t&&(n?Kl(n)&&(i=g0(n)):i=g0(e));const s=Bie(o,r,n)?LV(o):vp(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(o){const e=ri(o),t=n&&Kl(n)?ri(n):n;let r=e.frameElement;for(;r&&n&&t!==e;){const e=g0(r),t=r.getBoundingClientRect(),n=Wi(r),a=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,f*=e.y,l+=a,c+=o,r=ri(r).frameElement}}return cw({width:u,height:f,x:l,y:c})}const Fie=[":popover-open",":modal"];function VV(e){let t=!1,r=0,n=0;if(Fie.forEach((r=>{!function(r){try{t=t||e.matches(r)}catch{}}(r)})),t){const t=NV(e);if(t){const e=t.getBoundingClientRect();r=e.x,n=e.y}}return[t,r,n]}function Uie(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o=xf(n),[i]=t?VV(t.floating):[!1];if(n===o||i)return r;let s={scrollLeft:0,scrollTop:0},l=vp(1);const c=vp(0),u=Xl(n);if((u||!u&&"fixed"!==a)&&(("body"!==_p(n)||Hv(o))&&(s=M2(n)),Xl(n))){const e=mm(n);l=g0(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-s.scrollLeft*l.x+c.x,y:r.y*l.y-s.scrollTop*l.y+c.y}}function Gie(e){return Array.from(e.getClientRects())}function BV(e){return mm(xf(e)).left+M2(e).scrollLeft}function qie(e){const t=xf(e),r=M2(e),n=e.ownerDocument.body,a=ei(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=ei(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+BV(e);const s=-r.scrollTop;return"rtl"===Wi(n).direction&&(i+=ei(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:i,y:s}}function Wie(e,t){const r=ri(e),n=xf(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=kR();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}function Hie(e,t){const r=mm(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=Xl(e)?g0(e):vp(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}function FO(e,t,r){let n;if("viewport"===t)n=Wie(e,r);else if("document"===t)n=qie(xf(e));else if(Kl(t))n=Hie(t,r);else{const r=LV(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return cw(n)}function FV(e,t){const r=E0(e);return!(r===t||!Kl(r)||z2(r))&&("fixed"===Wi(r).position||FV(r,t))}function Qie(e,t){const r=t.get(e);if(r)return r;let n=lv(e,[],!1).filter((e=>Kl(e)&&"body"!==_p(e))),a=null;const o="fixed"===Wi(e).position;let i=o?E0(e):e;for(;Kl(i)&&!z2(i);){const t=Wi(i),r=wR(i);!r&&"fixed"===t.position&&(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&["absolute","fixed"].includes(a.position)||Hv(i)&&!r&&FV(e,i))?n=n.filter((e=>e!==i)):a=t,i=E0(i)}return t.set(e,n),n}function Yie(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[..."clippingAncestors"===r?Qie(t,this._c):[].concat(r),n],i=o[0],s=o.reduce(((e,r)=>{const n=FO(t,r,a);return e.top=ei(n.top,e.top),e.right=yp(n.right,e.right),e.bottom=yp(n.bottom,e.bottom),e.left=ei(n.left,e.left),e}),FO(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Kie(e){const{width:t,height:r}=jV(e);return{width:t,height:r}}function Xie(e,t,r,n){const a=Xl(t),o=xf(t),i="fixed"===r,s=mm(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=vp(0);if(a||!a&&!i)if(("body"!==_p(t)||Hv(o))&&(l=M2(t)),a){const e=mm(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=BV(o));let u=s.left+l.scrollLeft-c.x,f=s.top+l.scrollTop-c.y;const[d,p,h]=VV(n);return d&&(u+=p,f+=h,a&&(u+=t.clientLeft,f+=t.clientTop)),{x:u,y:f,width:s.width,height:s.height}}function UO(e,t){return Xl(e)&&"fixed"!==Wi(e).position?t?t(e):e.offsetParent:null}function UV(e,t){const r=ri(e);if(!Xl(e))return r;let n=UO(e,t);for(;n&&Die(n)&&"static"===Wi(n).position;)n=UO(n,t);return n&&("html"===_p(n)||"body"===_p(n)&&"static"===Wi(n).position&&!wR(n))?r:n||NV(e)||r}const Zie=async function(e){const t=this.getOffsetParent||UV,r=this.getDimensions;return{reference:Xie(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await r(e.floating)}}};function Jie(e){return"rtl"===Wi(e).direction}const ece={convertOffsetParentRelativeRectToViewportRelativeRect:Uie,getDocumentElement:xf,getClippingRect:Yie,getOffsetParent:UV,getElementRects:Zie,getClientRects:Gie,getDimensions:Kie,getScale:g0,isElement:Kl,isRTL:Jie};function tce(e,t){let r,n=null;const a=xf(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p={rootMargin:-l_(u)+"px "+-l_(a.clientWidth-(c+f))+"px "+-l_(a.clientHeight-(u+d))+"px "+-l_(c)+"px",threshold:ei(0,yp(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):r=setTimeout((()=>{i(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(g,{...p,root:a.ownerDocument})}catch{n=new IntersectionObserver(g,p)}n.observe(e)}(!0),o}function nce(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=xR(e),u=a||o?[...c?lv(c):[],...lv(t)]:[];u.forEach((e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)}));const f=c&&s?tce(c,r):null;let d=-1,p=null;i&&(p=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),r()})),c&&!l&&p.observe(c),p.observe(t));let h,g=l?mm(e):null;return l&&function t(){const n=mm(e);g&&(n.x!==g.x||n.y!==g.y||n.width!==g.width||n.height!==g.height)&&r(),g=n,h=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)})),null==f||f(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const rce=Mie,ace=Tie,oce=Nie,sce=Pie,GO=Rie,ice=Oie,cce=(e,t,r)=>{const n=new Map,a={platform:ece,...r},o={...a.platform,_c:n};return Aie(e,t,{...a,platform:o})};var B_=typeof document<"u"?g.useLayoutEffect:g.useEffect;function lw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!=n--;)if(!lw(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){const r=a[n];if(!("_owner"===r&&e.$$typeof||lw(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function GV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qO(e,t){const r=GV(e);return Math.round(t*r)/r}function Z4(e){const t=g.useRef(e);return B_((()=>{t.current=e})),t}function lce(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:o,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=g.useState(n);lw(d,n)||p(n);const[h,m]=g.useState(null),[y,v]=g.useState(null),b=g.useCallback((e=>{e!==x.current&&(x.current=e,m(e))}),[]),w=g.useCallback((e=>{e!==E.current&&(E.current=e,v(e))}),[]),_=o||h,k=i||y,x=g.useRef(null),E=g.useRef(null),A=g.useRef(u),S=null!=l,C=Z4(l),z=Z4(a),I=Z4(c),j=g.useCallback((()=>{if(!x.current||!E.current)return;const e={placement:t,strategy:r,middleware:d};z.current&&(e.platform=z.current),cce(x.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==I.current};P.current&&!lw(A.current,t)&&(A.current=t,Qc.flushSync((()=>{f(t)})))}))}),[d,t,r,z,I]);B_((()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const P=g.useRef(!1);B_((()=>(P.current=!0,()=>{P.current=!1})),[]),B_((()=>{if(_&&(x.current=_),k&&(E.current=k),_&&k){if(C.current)return C.current(_,k,j);j()}}),[_,k,j,C,S]);const T=g.useMemo((()=>({reference:x,floating:E,setReference:b,setFloating:w})),[b,w]),R=g.useMemo((()=>({reference:_,floating:k})),[_,k]),N=g.useMemo((()=>{const e={position:r,left:0,top:0};if(!R.floating)return e;const t=qO(R.floating,u.x),n=qO(R.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...GV(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,R.floating,u.x,u.y]);return g.useMemo((()=>({...u,update:j,refs:T,elements:R,floatingStyles:N})),[u,j,T,R,N])}const uce=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?GO({element:r.current,padding:n}).fn(t):{}:r?GO({element:r,padding:n}).fn(t):{}}}),fce=(e,t)=>({...zie(e),options:[e,t]}),dce=(e,t)=>({...rce(e),options:[e,t]}),pce=(e,t)=>({...ice(e),options:[e,t]}),hce=(e,t)=>({...ace(e),options:[e,t]}),mce=(e,t)=>({...oce(e),options:[e,t]}),gce=(e,t)=>({...sce(e),options:[e,t]}),yce=(e,t)=>({...uce(e),options:[e,t]}),qV="Popper",[WV,U0]=as(qV),[vce,HV]=WV(qV),bce=e=>{const{__scopePopper:t,children:r}=e,[n,a]=g.useState(null);return g.createElement(vce,{scope:t,anchor:n,onAnchorChange:a},r)},_ce="PopperAnchor",wce=g.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,o=HV(_ce,r),i=g.useRef(null),s=dn(t,i);return g.useEffect((()=>{o.onAnchorChange((null==n?void 0:n.current)||i.current)})),n?null:g.createElement(wt.div,Pe({},a,{ref:s}))})),QV="PopperContent",[kce,Oot]=WV(QV),xce=g.forwardRef(((e,t)=>{var r,n,a,o,i,s,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:y=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:w="partial",hideWhenDetached:_=!1,updatePositionStrategy:k="optimized",onPlaced:x,...E}=e,A=HV(QV,u),[S,C]=g.useState(null),z=dn(t,(e=>C(e))),[I,j]=g.useState(null),P=A2(I),T=null!==(r=null==P?void 0:P.width)&&void 0!==r?r:0,R=null!==(n=null==P?void 0:P.height)&&void 0!==n?n:0,N=f+("center"!==p?"-"+p:""),O="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},M=Array.isArray(v)?v:[v],D=M.length>0,L={padding:O,boundary:M.filter(Sce),altBoundary:D},{refs:q,floatingStyles:V,placement:B,isPositioned:U,middlewareData:F}=lce({strategy:"fixed",placement:N,whileElementsMounted:(...e)=>nce(...e,{animationFrame:"always"===k}),elements:{reference:A.anchor},middleware:[fce({mainAxis:d+R,alignmentAxis:h}),y&&dce({mainAxis:!0,crossAxis:!1,limiter:"partial"===w?pce():void 0,...L}),y&&hce({...L}),mce({...L,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),I&&yce({element:I,padding:m}),Ece({arrowWidth:T,arrowHeight:R}),_&&gce({strategy:"referenceHidden",...L})]}),[$,G]=YV(B),Q=si(x);zo((()=>{U&&(null==Q||Q())}),[U,Q]);const W=null===(a=F.arrow)||void 0===a?void 0:a.x,H=null===(o=F.arrow)||void 0===o?void 0:o.y,K=0!==(null===(i=F.arrow)||void 0===i?void 0:i.centerOffset),[Y,Z]=g.useState();return zo((()=>{S&&Z(window.getComputedStyle(S).zIndex)}),[S]),g.createElement("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[null===(s=F.transformOrigin)||void 0===s?void 0:s.x,null===(l=F.transformOrigin)||void 0===l?void 0:l.y].join(" ")},dir:e.dir},g.createElement(kce,{scope:u,placedSide:$,onArrowChange:j,arrowX:W,arrowY:H,shouldHideArrow:K},g.createElement(wt.div,Pe({"data-side":$,"data-align":G},E,{ref:z,style:{...E.style,animation:U?void 0:"none",opacity:null!==(c=F.hide)&&void 0!==c&&c.referenceHidden?0:void 0}}))))}));function Sce(e){return null!==e}const Ece=e=>({name:"transformOrigin",options:e,fn(t){var r,n,a,o,i;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(r=c.arrow)||void 0===r?void 0:r.centerOffset),f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[p,h]=YV(s),g={start:"0%",center:"50%",end:"100%"}[h],m=(null!==(n=null===(a=c.arrow)||void 0===a?void 0:a.x)&&void 0!==n?n:0)+f/2,y=(null!==(o=null===(i=c.arrow)||void 0===i?void 0:i.y)&&void 0!==o?o:0)+d/2;let v="",b="";return"bottom"===p?(v=u?g:`${m}px`,b=-d+"px"):"top"===p?(v=u?g:`${m}px`,b=`${l.floating.height+d}px`):"right"===p?(v=-d+"px",b=u?g:`${y}px`):"left"===p&&(v=`${l.floating.width+d}px`,b=u?g:`${y}px`),{data:{x:v,y:b}}}});function YV(e){const[t,r="center"]=e.split("-");return[t,r]}const SR=bce,ER=wce,CR=xce,J4="rovingFocusGroup.onEntryFocus",Cce={bubbles:!1,cancelable:!0},IR="RovingFocusGroup",[rI,KV,Ice]=yR(IR),[Ace,G0]=as(IR,[Ice]),[Rce,Tce]=Ace(IR),Pce=g.forwardRef(((e,t)=>g.createElement(rI.Provider,{scope:e.__scopeRovingFocusGroup},g.createElement(rI.Slot,{scope:e.__scopeRovingFocusGroup},g.createElement($ce,Pe({},e,{ref:t})))))),$ce=g.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=g.useRef(null),d=dn(t,f),p=Wv(o),[h=null,m]=Yl({prop:i,defaultProp:s,onChange:l}),[y,v]=g.useState(!1),b=si(c),w=KV(r),_=g.useRef(!1),[k,x]=g.useState(0);return g.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(J4,b),()=>e.removeEventListener(J4,b)}),[b]),g.createElement(Rce,{scope:r,orientation:n,dir:p,loop:a,currentTabStopId:h,onItemFocus:g.useCallback((e=>m(e)),[m]),onItemShiftTab:g.useCallback((()=>v(!0)),[]),onFocusableItemAdd:g.useCallback((()=>x((e=>e+1))),[]),onFocusableItemRemove:g.useCallback((()=>x((e=>e-1))),[])},g.createElement(wt.div,Pe({tabIndex:y||0===k?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...e.style},onMouseDown:ft(e.onMouseDown,(()=>{_.current=!0})),onFocus:ft(e.onFocus,(e=>{const t=!_.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(J4,Cce);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));XV([e.find((e=>e.active)),e.find((e=>e.id===h)),...e].filter(Boolean).map((e=>e.ref.current)))}}_.current=!1})),onBlur:ft(e.onBlur,(()=>v(!1)))})))})),zce="RovingFocusGroupItem",Mce=g.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:o,...i}=e,s=jc(),l=o||s,c=Tce(zce,r),u=c.currentTabStopId===l,f=KV(r),{onFocusableItemAdd:d,onFocusableItemRemove:p}=c;return g.useEffect((()=>{if(n)return d(),()=>p()}),[n,d,p]),g.createElement(rI.ItemSlot,{scope:r,id:l,focusable:n,active:a},g.createElement(wt.span,Pe({tabIndex:u?0:-1,"data-orientation":c.orientation},i,{ref:t,onMouseDown:ft(e.onMouseDown,(e=>{n?c.onItemFocus(l):e.preventDefault()})),onFocus:ft(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:ft(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=Dce(e,c.orientation,c.dir);if(void 0!==t){e.preventDefault();let r=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=c.loop?jce(r,n+1):r.slice(n+1)}setTimeout((()=>XV(r)))}}))})))})),Oce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nce(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function Dce(e,t,r){const n=Nce(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return Oce[n]}function XV(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function jce(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}const AR=Pce,RR=Mce,aI=["Enter"," "],Lce=["ArrowDown","PageUp","Home"],ZV=["ArrowUp","PageDown","End"],Vce=[...Lce,...ZV],Bce={ltr:[...aI,"ArrowRight"],rtl:[...aI,"ArrowLeft"]},Fce={ltr:["ArrowLeft"],rtl:["ArrowRight"]},O2="Menu",[uv,Uce,Gce]=yR(O2),[Im,JV]=as(O2,[Gce,U0,G0]),TR=U0(),eB=G0(),[qce,Am]=Im(O2),[Wce,Qv]=Im(O2),Hce=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:o,modal:i=!0}=e,s=TR(t),[l,c]=g.useState(null),u=g.useRef(!1),f=si(o),d=Wv(a);return g.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),g.createElement(SR,s,g.createElement(qce,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:c},g.createElement(Wce,{scope:t,onClose:g.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:u,dir:d,modal:i},n)))},tB=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e,a=TR(r);return g.createElement(ER,Pe({},a,n,{ref:t}))})),nB="MenuPortal",[Qce,rB]=Im(nB,{forceMount:void 0}),Yce=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,o=Am(nB,t);return g.createElement(Qce,{scope:t,forceMount:r},g.createElement(ii,{present:r||o.open},g.createElement(u2,{asChild:!0,container:a},n)))},Vc="MenuContent",[Kce,PR]=Im(Vc),Xce=g.forwardRef(((e,t)=>{const r=rB(Vc,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,o=Am(Vc,e.__scopeMenu),i=Qv(Vc,e.__scopeMenu);return g.createElement(uv.Provider,{scope:e.__scopeMenu},g.createElement(ii,{present:n||o.open},g.createElement(uv.Slot,{scope:e.__scopeMenu},i.modal?g.createElement(Zce,Pe({},a,{ref:t})):g.createElement(Jce,Pe({},a,{ref:t})))))})),Zce=g.forwardRef(((e,t)=>{const r=Am(Vc,e.__scopeMenu),n=g.useRef(null),a=dn(t,n);return g.useEffect((()=>{const e=n.current;if(e)return p2(e)}),[]),g.createElement($R,Pe({},e,{ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ft(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))})),Jce=g.forwardRef(((e,t)=>{const r=Am(Vc,e.__scopeMenu);return g.createElement($R,Pe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))})),$R=g.forwardRef(((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:p,disableOutsideScroll:h,...m}=e,y=Am(Vc,r),v=Qv(Vc,r),b=TR(r),w=eB(r),_=Uce(r),[k,x]=g.useState(null),E=g.useRef(null),A=dn(t,E,y.onContentChange),S=g.useRef(0),C=g.useRef(""),z=g.useRef(0),I=g.useRef(null),j=g.useRef("right"),P=g.useRef(0),T=h?d2:g.Fragment,R=h?{as:lm,allowPinchZoom:!0}:void 0;g.useEffect((()=>()=>window.clearTimeout(S.current)),[]),AA();const N=g.useCallback((e=>{var t,r;return j.current===(null===(t=I.current)||void 0===t?void 0:t.side)&&_le(e,null===(r=I.current)||void 0===r?void 0:r.area)}),[]);return g.createElement(Kce,{scope:r,searchRef:C,onItemEnter:g.useCallback((e=>{N(e)&&e.preventDefault()}),[N]),onItemLeave:g.useCallback((e=>{var t;N(e)||(null===(t=E.current)||void 0===t||t.focus(),x(null))}),[N]),onTriggerLeave:g.useCallback((e=>{N(e)&&e.preventDefault()}),[N]),pointerGraceTimerRef:z,onPointerGraceIntentChange:g.useCallback((e=>{I.current=e}),[])},g.createElement(T,R,g.createElement(IA,{asChild:!0,trapped:a,onMountAutoFocus:ft(o,(e=>{var t;e.preventDefault(),null===(t=E.current)||void 0===t||t.focus()})),onUnmountAutoFocus:i},g.createElement(l2,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:p},g.createElement(AR,Pe({asChild:!0},w,{dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:k,onCurrentTabStopIdChange:x,onEntryFocus:ft(l,(e=>{v.isUsingKeyboardRef.current||e.preventDefault()}))}),g.createElement(CR,Pe({role:"menu","aria-orientation":"vertical","data-state":cB(y.open),"data-radix-menu-content":"",dir:v.dir},b,m,{ref:A,style:{outline:"none",...m.style},onKeyDown:ft(m.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&(e=>{var t,r;const n=C.current+e,a=_().filter((e=>!e.disabled)),o=document.activeElement,i=null===(t=a.find((e=>e.ref.current===o)))||void 0===t?void 0:t.textValue,s=vle(a.map((e=>e.textValue)),n,i),l=null===(r=a.find((e=>e.textValue===s)))||void 0===r?void 0:r.ref.current;(function e(t){C.current=t,window.clearTimeout(S.current),""!==t&&(S.current=window.setTimeout((()=>e("")),1e3))})(n),l&&setTimeout((()=>l.focus()))})(e.key));const a=E.current;if(e.target!==a||!Vce.includes(e.key))return;e.preventDefault();const o=_().filter((e=>!e.disabled)).map((e=>e.ref.current));ZV.includes(e.key)&&o.reverse(),gle(o)})),onBlur:ft(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(S.current),C.current="")})),onPointerMove:ft(e.onPointerMove,fv((e=>{const t=e.target,r=P.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>P.current?"right":"left";j.current=t,P.current=e.clientX}})))})))))))})),ele=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return g.createElement(wt.div,Pe({role:"group"},n,{ref:t}))})),tle=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return g.createElement(wt.div,Pe({},n,{ref:t}))})),oI="MenuItem",WO="menu.itemSelect",zR=g.forwardRef(((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,o=g.useRef(null),i=Qv(oI,e.__scopeMenu),s=PR(oI,e.__scopeMenu),l=dn(t,o),c=g.useRef(!1);return g.createElement(aB,Pe({},a,{ref:l,disabled:r,onClick:ft(e.onClick,(()=>{const e=o.current;if(!r&&e){const t=new CustomEvent(WO,{bubbles:!0,cancelable:!0});e.addEventListener(WO,(e=>null==n?void 0:n(e)),{once:!0}),o7(e,t),t.defaultPrevented?c.current=!1:i.onClose()}})),onPointerDown:t=>{var r;null===(r=e.onPointerDown)||void 0===r||r.call(e,t),c.current=!0},onPointerUp:ft(e.onPointerUp,(e=>{var t;c.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:ft(e.onKeyDown,(e=>{const t=""!==s.searchRef.current;r||t&&" "===e.key||aI.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),aB=g.forwardRef(((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...o}=e,i=PR(oI,r),s=eB(r),l=g.useRef(null),c=dn(t,l),[u,f]=g.useState(!1),[d,p]=g.useState("");return g.useEffect((()=>{const e=l.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[o.children]),g.createElement(uv.ItemSlot,{scope:r,disabled:n,textValue:a??d},g.createElement(RR,Pe({asChild:!0},s,{focusable:!n}),g.createElement(wt.div,Pe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:c,onPointerMove:ft(e.onPointerMove,fv((e=>{n?i.onItemLeave(e):(i.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus())}))),onPointerLeave:ft(e.onPointerLeave,fv((e=>i.onItemLeave(e)))),onFocus:ft(e.onFocus,(()=>f(!0))),onBlur:ft(e.onBlur,(()=>f(!1)))}))))})),nle=g.forwardRef(((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return g.createElement(sB,{scope:e.__scopeMenu,checked:r},g.createElement(zR,Pe({role:"menuitemcheckbox","aria-checked":uw(r)?"mixed":r},a,{ref:t,"data-state":MR(r),onSelect:ft(a.onSelect,(()=>null==n?void 0:n(!!uw(r)||!r)),{checkForDefaultPrevented:!1})})))})),rle="MenuRadioGroup",[ale,ole]=Im(rle,{value:void 0,onValueChange:()=>{}}),sle=g.forwardRef(((e,t)=>{const{value:r,onValueChange:n,...a}=e,o=si(n);return g.createElement(ale,{scope:e.__scopeMenu,value:r,onValueChange:o},g.createElement(ele,Pe({},a,{ref:t})))})),ile="MenuRadioItem",cle=g.forwardRef(((e,t)=>{const{value:r,...n}=e,a=ole(ile,e.__scopeMenu),o=r===a.value;return g.createElement(sB,{scope:e.__scopeMenu,checked:o},g.createElement(zR,Pe({role:"menuitemradio","aria-checked":o},n,{ref:t,"data-state":MR(o),onSelect:ft(n.onSelect,(()=>{var e;return null===(e=a.onValueChange)||void 0===e?void 0:e.call(a,r)}),{checkForDefaultPrevented:!1})})))})),oB="MenuItemIndicator",[sB,lle]=Im(oB,{checked:!1}),ule=g.forwardRef(((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,o=lle(oB,r);return g.createElement(ii,{present:n||uw(o.checked)||!0===o.checked},g.createElement(wt.span,Pe({},a,{ref:t,"data-state":MR(o.checked)})))})),fle=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return g.createElement(wt.div,Pe({role:"separator","aria-orientation":"horizontal"},n,{ref:t}))})),dle="MenuSub",[Not,iB]=Im(dle),u_="MenuSubTrigger",ple=g.forwardRef(((e,t)=>{const r=Am(u_,e.__scopeMenu),n=Qv(u_,e.__scopeMenu),a=iB(u_,e.__scopeMenu),o=PR(u_,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=g.useCallback((()=>{i.current&&window.clearTimeout(i.current),i.current=null}),[]);return g.useEffect((()=>u),[u]),g.useEffect((()=>{const e=s.current;return()=>{window.clearTimeout(e),l(null)}}),[s,l]),g.createElement(tB,Pe({asChild:!0},c),g.createElement(aB,Pe({id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":cB(r.open)},e,{ref:c2(t,a.onTriggerChange),onClick:t=>{var n;null===(n=e.onClick)||void 0===n||n.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ft(e.onPointerMove,fv((t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout((()=>{r.onOpenChange(!0),u()}),100))}))),onPointerLeave:ft(e.onPointerLeave,fv((e=>{var t;u();const n=null===(t=r.content)||void 0===t?void 0:t.getBoundingClientRect();if(n){var a;const t=null===(a=r.content)||void 0===a?void 0:a.dataset.side,i="right"===t,l=i?-5:5,c=n[i?"left":"right"],u=n[i?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:n.top},{x:u,y:n.top},{x:u,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(s.current),s.current=window.setTimeout((()=>o.onPointerGraceIntentChange(null)),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}}))),onKeyDown:ft(e.onKeyDown,(t=>{const a=""!==o.searchRef.current;var i;e.disabled||a&&" "===t.key||!Bce[n.dir].includes(t.key)||(r.onOpenChange(!0),null===(i=r.content)||void 0===i||i.focus(),t.preventDefault())}))})))})),hle="MenuSubContent",mle=g.forwardRef(((e,t)=>{const r=rB(Vc,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,o=Am(Vc,e.__scopeMenu),i=Qv(Vc,e.__scopeMenu),s=iB(hle,e.__scopeMenu),l=g.useRef(null),c=dn(t,l);return g.createElement(uv.Provider,{scope:e.__scopeMenu},g.createElement(ii,{present:n||o.open},g.createElement(uv.Slot,{scope:e.__scopeMenu},g.createElement($R,Pe({id:s.contentId,"aria-labelledby":s.triggerId},a,{ref:c,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;i.isUsingKeyboardRef.current&&(null===(t=l.current)||void 0===t||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ft(e.onFocusOutside,(e=>{e.target!==s.trigger&&o.onOpenChange(!1)})),onEscapeKeyDown:ft(e.onEscapeKeyDown,(e=>{i.onClose(),e.preventDefault()})),onKeyDown:ft(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),r=Fce[i.dir].includes(e.key);var n;t&&r&&(o.onOpenChange(!1),null===(n=s.trigger)||void 0===n||n.focus(),e.preventDefault())}))})))))}));function cB(e){return e?"open":"closed"}function uw(e){return"indeterminate"===e}function MR(e){return uw(e)?"indeterminate":e?"checked":"unchecked"}function gle(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function yle(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}function vle(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,a=r?e.indexOf(r):-1;let o=yle(e,Math.max(a,0));1===n.length&&(o=o.filter((e=>e!==r)));const i=o.find((e=>e.toLowerCase().startsWith(n.toLowerCase())));return i!==r?i:void 0}function ble(e,t){const{x:r,y:n}=e;let a=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){const i=t[e].x,s=t[e].y,l=t[o].x,c=t[o].y;s>n!=c>n&&r<(l-i)*(n-s)/(c-s)+i&&(a=!a)}return a}function _le(e,t){if(!t)return!1;return ble({x:e.clientX,y:e.clientY},t)}function fv(e){return t=>"mouse"===t.pointerType?e(t):void 0}const wle=Hce,kle=tB,xle=Yce,Sle=Xce,Ele=tle,Cle=zR,Ile=nle,Ale=sle,Rle=cle,Tle=ule,Ple=fle,$le=ple,zle=mle,lB="DropdownMenu",[Mle,Dot]=as(lB,[JV]),li=JV(),[Ole,uB]=Mle(lB),Nle=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=li(t),c=g.useRef(null),[u=!1,f]=Yl({prop:a,defaultProp:o,onChange:i});return g.createElement(Ole,{scope:t,triggerId:jc(),triggerRef:c,contentId:jc(),open:u,onOpenChange:f,onOpenToggle:g.useCallback((()=>f((e=>!e))),[f]),modal:s},g.createElement(wle,Pe({},l,{open:u,onOpenChange:f,dir:n,modal:s}),r))},Dle="DropdownMenuTrigger",jle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,o=uB(Dle,r),i=li(r);return g.createElement(kle,Pe({asChild:!0},i),g.createElement(wt.button,Pe({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},a,{ref:c2(t,o.triggerRef),onPointerDown:ft(e.onPointerDown,(e=>{!n&&0===e.button&&!1===e.ctrlKey&&(o.onOpenToggle(),o.open||e.preventDefault())})),onKeyDown:ft(e.onKeyDown,(e=>{n||(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})))})),Lle=e=>{const{__scopeDropdownMenu:t,...r}=e,n=li(t);return g.createElement(xle,Pe({},n,r))},Vle="DropdownMenuContent",Ble=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=uB(Vle,r),o=li(r),i=g.useRef(!1);return g.createElement(Sle,Pe({id:a.contentId,"aria-labelledby":a.triggerId},o,n,{ref:t,onCloseAutoFocus:ft(e.onCloseAutoFocus,(e=>{var t;i.current||null===(t=a.triggerRef.current)||void 0===t||t.focus(),i.current=!1,e.preventDefault()})),onInteractOutside:ft(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(i.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)"}}))})),Fle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ele,Pe({},a,n,{ref:t}))})),Ule=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Cle,Pe({},a,n,{ref:t}))})),Gle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ile,Pe({},a,n,{ref:t}))})),qle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ale,Pe({},a,n,{ref:t}))})),Wle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Rle,Pe({},a,n,{ref:t}))})),Hle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Tle,Pe({},a,n,{ref:t}))})),Qle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ple,Pe({},a,n,{ref:t}))})),Yle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement($le,Pe({},a,n,{ref:t}))})),Kle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(zle,Pe({},a,n,{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)"}}))})),Xle=Nle,Zle=jle,Jle=Lle,fB=Ble,dB=Fle,pB=Ule,hB=Gle,eue=qle,mB=Wle,tue=Hle,OR=Qle,gB=Yle,yB=Kle,Yv=Xle,Kv=Zle,nue=eue,rue=g.forwardRef((({className:e,inset:t,children:r,...n},a)=>E.jsxs(gB,{ref:a,className:he("flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,E.jsx(U8,{className:"ml-auto h-4 w-4"})]})));rue.displayName=gB.displayName;const aue=g.forwardRef((({className:e,...t},r)=>E.jsx(yB,{ref:r,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})));aue.displayName=yB.displayName;const HO=e=>{e.preventDefault()},q0=g.forwardRef((({className:e,sideOffset:t=4,isPortal:r,...n},a)=>{const o=E.jsx(fB,{ref:a,sideOffset:t,onOpenAutoFocus:HO,onCloseAutoFocus:HO,className:he("z-[101] flex max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] flex-col gap-xxxs overflow-y-auto rounded-lg border border-gray-200 bg-white p-xxs text-popover-foreground ","shadow-[0px_0px_12px_0px_rgba(0,0,0,0.08)] ","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in data-[state=open]:slide-in-from-top-2","data-[state=closed]:fade-out data-[state=closed]:slide-out-to-top-2","data-[state=closed]:duration-150 data-[state=open]:duration-150","data-[state=closed]:[animation-timing-function:ease-in] data-[state=open]:[animation-timing-function:ease-out]",e),...n});return r?E.jsx(Jle,{children:o}):o}));q0.displayName=fB.displayName;const dv=g.forwardRef((({className:e,inset:t,...r},n)=>E.jsx(pB,{ref:n,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs text-base font-medium text-gray-900 outline-none transition-colors hover:bg-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-xl",e),...r})));dv.displayName=pB.displayName;const oue=g.forwardRef((({className:e,children:t,checked:r,checkboxPosition:n="right",...a},o)=>{const i=E.jsx(sR,{size:"default",variant:"default",checked:r});return E.jsxs(hB,{ref:o,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs text-base font-medium text-gray-900"," outline-none transition-colors hover:bg-gray-100 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,onSelect:e=>e.preventDefault(),...a,children:["left"===n&&i,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:t}),"right"===n&&i]})}));oue.displayName=hB.displayName;const vB=g.forwardRef((({className:e,children:t,radioPosition:r="right",...n},a)=>{const o=E.jsx("div",{className:"flex h-xxs items-center justify-center",children:E.jsx(tue,{children:E.jsx(o2,{size:20})})});return E.jsxs(mB,{ref:a,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs text-base font-medium text-gray-900"," outline-none transition-colors hover:bg-gray-100 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onSelect:e=>e.preventDefault(),...n,children:["left"===r&&o,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:t}),"right"===r&&o]})}));vB.displayName=mB.displayName;const sue=g.forwardRef((({className:e,inset:t,...r},n)=>E.jsx(dB,{ref:n,className:he("text-sm font-semibold",t&&"pl-xl",e),...r})));sue.displayName=dB.displayName;const iue=g.forwardRef((({className:e,...t},r)=>E.jsx(OR,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t})));iue.displayName=OR.displayName;var Xv=e=>"checkbox"===e.type,u0=e=>e instanceof Date,Jo=e=>null==e;const bB=e=>"object"==typeof e;var pa=e=>!Jo(e)&&!Array.isArray(e)&&bB(e)&&!u0(e),_B=e=>pa(e)&&e.target?Xv(e.target)?e.target.checked:e.target.value:e,cue=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wB=(e,t)=>e.has(cue(t)),lue=e=>{const t=e.constructor&&e.constructor.prototype;return pa(t)&&t.hasOwnProperty("isPrototypeOf")},NR=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Es(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(NR&&(e instanceof Blob||e instanceof FileList)||!r&&!pa(e))return e;if(t=r?[]:{},r||lue(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Es(e[r]));else t=e}return t}var Zv=e=>Array.isArray(e)?e.filter(Boolean):[],$r=e=>void 0===e,et=(e,t,r)=>{if(!t||!pa(e))return r;const n=Zv(t.split(/[,[\].]+?/)).reduce(((e,t)=>Jo(e)?e:e[t]),e);return $r(n)||n===e?$r(e[t])?r:e[t]:n},$c=e=>"boolean"==typeof e;const fw={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Oc={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},af={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kB=be.createContext(null),N2=()=>be.useContext(kB),xB=e=>{const{children:t,...r}=e;return be.createElement(kB.Provider,{value:r},t)};var SB=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Oc.all&&(t._proxyFormState[a]=!n||Oc.all),r&&(r[a]=!0),e[a]}});return a},Fi=e=>pa(e)&&!Object.keys(e).length,EB=(e,t,r,n)=>{r(e);const{name:a,...o}=e;return Fi(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!n||Oc.all)))},F_=e=>Array.isArray(e)?e:[e],CB=(e,t,r)=>!e||!t||e===t||F_(e).some((e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))));function DR(e){const t=be.useRef(e);t.current=e,be.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}function uue(e){const t=N2(),{control:r=t.control,disabled:n,name:a,exact:o}=e,[i,s]=be.useState(r._formState),l=be.useRef(!0),c=be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=be.useRef(a);return u.current=a,DR({disabled:n,next:e=>l.current&&CB(u.current,e.name,o)&&EB(e,c.current,r._updateFormState)&&s({...r._formState,...e}),subject:r._subjects.state}),be.useEffect((()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1})),[r]),SB(i,r,c.current,!1)}var Gl=e=>"string"==typeof e,IB=(e,t,r,n,a)=>Gl(e)?(n&&t.watch.add(e),et(r,e,a)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),et(r,e)))):(n&&(t.watchAll=!0),r);function fue(e){const t=N2(),{control:r=t.control,name:n,defaultValue:a,disabled:o,exact:i}=e,s=be.useRef(n);s.current=n,DR({disabled:o,subject:r._subjects.values,next:e=>{CB(s.current,e.name,i)&&c(Es(IB(s.current,r._names,e.values||r._formValues,!1,a)))}});const[l,c]=be.useState(r._getWatch(n,a));return be.useEffect((()=>r._removeUnmounted())),l}var jR=e=>/^\w*$/.test(e),AB=e=>Zv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Tn=(e,t,r)=>{let n=-1;const a=jR(t)?[t]:AB(t),o=a.length,i=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==i){const r=e[t];o=pa(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}e[t]=o,e=e[t]}return e};function due(e){const t=N2(),{name:r,disabled:n,control:a=t.control,shouldUnregister:o}=e,i=wB(a._names.array,r),s=fue({control:a,name:r,defaultValue:et(a._formValues,r,et(a._defaultValues,r,e.defaultValue)),exact:!0}),l=uue({control:a,name:r}),c=be.useRef(a.register(r,{...e.rules,value:s,...$c(e.disabled)?{disabled:e.disabled}:{}}));return be.useEffect((()=>{const e=a._options.shouldUnregister||o,t=(e,t)=>{const r=et(a._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=Es(et(a._options.defaultValues,r));Tn(a._defaultValues,r,e),$r(et(a._formValues,r))&&Tn(a._formValues,r,e)}return()=>{(i?e&&!a._state.action:e)?a.unregister(r):t(r,!1)}}),[r,a,i,o]),be.useEffect((()=>{et(a._fields,r)&&a._updateDisabledField({disabled:n,fields:a._fields,name:r,value:et(a._fields,r)._f.value})}),[n,r,a]),{field:{name:r,value:s,...$c(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:be.useCallback((e=>c.current.onChange({target:{value:_B(e),name:r},type:fw.CHANGE})),[r]),onBlur:be.useCallback((()=>c.current.onBlur({target:{value:et(a._formValues,r),name:r},type:fw.BLUR})),[r,a]),ref:e=>{const t=et(a._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!et(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!et(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!et(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!et(l.validatingFields,r)},error:{enumerable:!0,get:()=>et(l.errors,r)}})}}const pue=e=>e.render(due(e));var RB=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},QO=e=>({isOnSubmit:!e||e===Oc.onSubmit,isOnBlur:e===Oc.onBlur,isOnChange:e===Oc.onChange,isOnAll:e===Oc.all,isOnTouch:e===Oc.onTouched}),YO=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const Vy=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=et(e,a);if(r){const{_f:e,...o}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)break;if(e.ref&&t(e.ref,e.name)&&!n)break;Vy(o,t)}else pa(o)&&Vy(o,t)}}};var hue=(e,t,r)=>{const n=Zv(et(e,r));return Tn(n,"root",t[r]),Tn(e,r,n),e},LR=e=>"file"===e.type,up=e=>"function"==typeof e,dw=e=>{if(!NR)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},U_=e=>Gl(e),VR=e=>"radio"===e.type,pw=e=>e instanceof RegExp;const KO={value:!1,isValid:!1},XO={value:!0,isValid:!0};var TB=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!$r(e[0].attributes.value)?$r(e[0].value)||""===e[0].value?XO:{value:e[0].value,isValid:!0}:XO:KO}return KO};const ZO={isValid:!1,value:null};var PB=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),ZO):ZO;function JO(e,t,r="validate"){if(U_(e)||Array.isArray(e)&&e.every(U_)||$c(e)&&!e)return{type:r,message:U_(e)?e:"",ref:t}}var n0=e=>pa(e)&&!pw(e)?e:{value:e,message:""},eN=async(e,t,r,n,a)=>{const{ref:o,refs:i,required:s,maxLength:l,minLength:c,min:u,max:f,pattern:d,validate:p,name:h,valueAsNumber:g,mount:m,disabled:y}=e._f,v=et(t,h);if(!m||y)return{};const b=i?i[0]:o,w=e=>{n&&b.reportValidity&&(b.setCustomValidity($c(e)?"":e||""),b.reportValidity())},_={},k=VR(o),x=Xv(o),E=k||x,A=(g||LR(o))&&$r(o.value)&&$r(v)||dw(o)&&""===o.value||""===v||Array.isArray(v)&&!v.length,S=RB.bind(null,h,r,_),C=(e,t,r,n=af.maxLength,a=af.minLength)=>{const i=e?t:r;_[h]={type:e?n:a,message:i,ref:o,...S(e?n:a,i)}};if(a?!Array.isArray(v)||!v.length:s&&(!E&&(A||Jo(v))||$c(v)&&!v||x&&!TB(i).isValid||k&&!PB(i).isValid)){const{value:e,message:t}=U_(s)?{value:!!s,message:s}:n0(s);if(e&&(_[h]={type:af.required,message:t,ref:b,...S(af.required,t)},!r))return w(t),_}if(!(A||Jo(u)&&Jo(f))){let e,t;const n=n0(f),a=n0(u);if(Jo(v)||isNaN(v)){const r=o.valueAsDate||new Date(v),i=e=>new Date((new Date).toDateString()+" "+e),s="time"==o.type,l="week"==o.type;Gl(n.value)&&v&&(e=s?i(v)>i(n.value):l?v>n.value:r>new Date(n.value)),Gl(a.value)&&v&&(t=s?i(v)<i(a.value):l?v<a.value:r<new Date(a.value))}else{const r=o.valueAsNumber||v&&+v;Jo(n.value)||(e=r>n.value),Jo(a.value)||(t=r<a.value)}if((e||t)&&(C(!!e,n.message,a.message,af.max,af.min),!r))return w(_[h].message),_}if((l||c)&&!A&&(Gl(v)||a&&Array.isArray(v))){const e=n0(l),t=n0(c),n=!Jo(e.value)&&v.length>+e.value,a=!Jo(t.value)&&v.length<+t.value;if((n||a)&&(C(n,e.message,t.message),!r))return w(_[h].message),_}if(d&&!A&&Gl(v)){const{value:e,message:t}=n0(d);if(pw(e)&&!v.match(e)&&(_[h]={type:af.pattern,message:t,ref:o,...S(af.pattern,t)},!r))return w(t),_}if(p)if(up(p)){const e=JO(await p(v,t),b);if(e&&(_[h]={...e,...S(af.validate,e.message)},!r))return w(e.message),_}else if(pa(p)){let e={};for(const n in p){if(!Fi(e)&&!r)break;const a=JO(await p[n](v,t),b,n);a&&(e={...a,...S(n,a.message)},w(a.message),r&&(_[h]=e))}if(!Fi(e)&&(_[h]={ref:b,...e},!r))return _}return w(!0),_};function mue(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=$r(e)?n++:e[t[n++]];return e}function gue(e){for(const t in e)if(e.hasOwnProperty(t)&&!$r(e[t]))return!1;return!0}function Fa(e,t){const r=Array.isArray(t)?t:jR(t)?[t]:AB(t),n=1===r.length?e:mue(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(pa(n)&&Fi(n)||Array.isArray(n)&&gue(n))&&Fa(e,r.slice(0,-1)),e}var eE=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},hw=e=>Jo(e)||!bB(e);function Jh(e,t){if(hw(e)||hw(t))return e===t;if(u0(e)&&u0(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const r=e[a];if(!n.includes(a))return!1;if("ref"!==a){const e=t[a];if(u0(r)&&u0(e)||pa(r)&&pa(e)||Array.isArray(r)&&Array.isArray(e)?!Jh(r,e):r!==e)return!1}}return!0}var $B=e=>"select-multiple"===e.type,yue=e=>VR(e)||Xv(e),tE=e=>dw(e)&&e.isConnected,vue=e=>pa(e)&&Object.values(e).some((e=>e)),zB=e=>{for(const t in e)if(up(e[t]))return!0;return!1};function mw(e,t={}){const r=Array.isArray(e);if(pa(e)||r)for(const r in e)Array.isArray(e[r])||pa(e[r])&&!zB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},mw(e[r],t[r])):Jo(e[r])||(t[r]=!0);return t}function MB(e,t,r){const n=Array.isArray(e);if(pa(e)||n)for(const n in e)Array.isArray(e[n])||pa(e[n])&&!zB(e[n])?$r(t)||hw(r[n])?r[n]=Array.isArray(e[n])?mw(e[n],[]):{...mw(e[n])}:MB(e[n],Jo(t)?{}:t[n],r[n]):r[n]=!Jh(e[n],t[n]);return r}var f_=(e,t)=>MB(e,t,mw(t)),OB=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>$r(e)?e:t?""===e?NaN:e&&+e:r&&Gl(e)?new Date(e):n?n(e):e;function nE(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return LR(t)?t.files:VR(t)?PB(e.refs).value:$B(t)?[...t.selectedOptions].map((({value:e})=>e)):Xv(t)?TB(e.refs).value:OB($r(t.value)?e.ref.value:t.value,e)}var bue=(e,t,r,n)=>{const a={};for(const r of e){const e=et(t,r);e&&Tn(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},ry=e=>$r(e)?e:pw(e)?e.source:pa(e)?pw(e.value)?e.value.source:e.value:e,_ue=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function tN(e,t,r){const n=et(e,r);if(n||jR(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=et(t,n),i=et(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};a.pop()}return{name:r}}var wue=(e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e),kue=(e,t)=>!Zv(et(e,t)).length&&Fa(e,t);const xue={mode:Oc.onSubmit,reValidateMode:Oc.onChange,shouldFocusError:!0};function Sue(e={}){let t,r={...xue,...e},n={submitCount:0,isDirty:!1,isLoading:up(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(pa(r.defaultValues)||pa(r.values))&&Es(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Es(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:eE(),array:eE(),state:eE()},d=QO(r.mode),p=QO(r.reValidateMode),h=r.criteriaMode===Oc.all,g=async e=>{if(u.isValid||e){const e=r.resolver?Fi((await w()).errors):await _(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},m=(e,t)=>{(u.isValidating||u.validatingFields)&&(t.forEach((t=>{Tn(n.validatingFields,t,e)})),n.isValidating=vue(n.validatingFields),f.state.next({validatingFields:n.validatingFields,isValidating:n.isValidating}))},y=(e,t,r,n)=>{const l=et(a,e);if(l){const a=et(i,e,$r(r)?et(o,e):r);$r(a)||n&&n.defaultChecked||t?Tn(i,e,t?a:nE(l._f)):E(e,a),s.mount&&g()}},v=(e,t,r,i,s)=>{let l=!1,c=!1;const d={name:e},p=!(!et(a,e)||!et(a,e)._f.disabled);if(!r||i){u.isDirty&&(c=n.isDirty,n.isDirty=d.isDirty=k(),l=c!==d.isDirty);const r=p||Jh(et(o,e),t);c=!(p||!et(n.dirtyFields,e)),r||p?Fa(n.dirtyFields,e):Tn(n.dirtyFields,e,!0),d.dirtyFields=n.dirtyFields,l=l||u.dirtyFields&&c!==!r}if(r){const t=et(n.touchedFields,e);t||(Tn(n.touchedFields,e,r),d.touchedFields=n.touchedFields,l=l||u.touchedFields&&t!==r)}return l&&s&&f.state.next(d),l?d:{}},b=(r,a,o,i)=>{const s=et(n.errors,r),l=u.isValid&&$c(a)&&n.isValid!==a;if(e.delayError&&o?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})((()=>((e,t)=>{Tn(n.errors,e,t),f.state.next({errors:n.errors})})(r,o))),t(e.delayError)):(clearTimeout(c),t=null,o?Tn(n.errors,r,o):Fa(n.errors,r)),(o?!Jh(s,o):s)||!Fi(i)||l){const e={...i,...l&&$c(a)?{isValid:a}:{},errors:n.errors,name:r};n={...n,...e},f.state.next(e)}m(!1,Object.keys(n.validatingFields).filter((e=>e===r)))},w=async e=>r.resolver(i,r.context,bue(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation)),_=async(e,t,a={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...o}=s;if(e){const o=l.array.has(e.name),c=await eN(s,i,h,r.shouldUseNativeValidation&&!t,o);if(c[e.name]&&(a.valid=!1,t))break;!t&&(et(c,e.name)?o?hue(n.errors,c,e.name):Tn(n.errors,e.name,c[e.name]):Fa(n.errors,e.name))}o&&await _(o,t,a)}}return a.valid},k=(e,t)=>(e&&t&&Tn(i,e,t),!Jh(j(),o)),x=(e,t,r)=>IB(e,l,{...s.mount?i:$r(t)?o:Gl(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=et(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&Tn(i,e,OB(t,r)),o=dw(r.ref)&&Jo(t)?"":t,$B(r.ref)?[...r.ref.options].forEach((e=>e.selected=o.includes(e.value))):r.refs?Xv(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):r.refs[0]&&(r.refs[0].checked=!!o):r.refs.forEach((e=>e.checked=e.value===o)):LR(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.values.next({name:e,values:{...i}})))}(r.shouldDirty||r.shouldTouch)&&v(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&I(e)},A=(e,t,r)=>{for(const n in t){const o=t[n],i=`${e}.${n}`,s=et(a,i);!l.array.has(e)&&hw(o)&&(!s||s._f)||u0(o)?E(i,o,r):A(i,o,r)}},S=(e,t,r={})=>{const c=et(a,e),d=l.array.has(e),p=Es(t);Tn(i,e,p),d?(f.array.next({name:e,values:{...i}}),(u.isDirty||u.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:f_(o,i),isDirty:k(e,p)})):!c||c._f||Jo(p)?E(e,p,r):A(e,p,r),YO(e,l)&&f.state.next({...n}),f.values.next({name:s.mount?e:void 0,values:{...i}})},C=async e=>{const o=e.target;let s=o.name,c=!0;const y=et(a,s),k=e=>{c=Number.isNaN(e)||e===et(i,s,e)};if(y){let x,E;const A=o.type?nE(y._f):_B(e),S=e.type===fw.BLUR||e.type===fw.FOCUS_OUT,C=!_ue(y._f)&&!r.resolver&&!et(n.errors,s)&&!y._f.deps||wue(S,et(n.touchedFields,s),n.isSubmitted,p,d),z=YO(s,l,S);Tn(i,s,A),S?(y._f.onBlur&&y._f.onBlur(e),t&&t(0)):y._f.onChange&&y._f.onChange(e);const j=v(s,A,S,!1),P=!Fi(j)||z;if(!S&&f.values.next({name:s,type:e.type,values:{...i}}),C)return u.isValid&&g(),P&&f.state.next({name:s,...z?{}:j});if(!S&&z&&f.state.next({...n}),m(!0,[s]),r.resolver){const{errors:e}=await w([s]);if(k(A),c){const t=tN(n.errors,a,s),r=tN(e,a,t.name||s);x=r.error,s=r.name,E=Fi(e)}}else x=(await eN(y,i,h,r.shouldUseNativeValidation))[s],k(A),c&&(x?E=!1:u.isValid&&(E=await _(a,!0)));c&&(y._f.deps&&I(y._f.deps),b(s,E,x,j))}},z=(e,t)=>{if(et(n.errors,t)&&e.focus)return e.focus(),1},I=async(e,t={})=>{let o,i;const s=F_(e);if(m(!0,s),r.resolver){const t=await(async e=>{const{errors:t}=await w(e);if(e)for(const r of e){const e=et(t,r);e?Tn(n.errors,r,e):Fa(n.errors,r)}else n.errors=t;return t})($r(e)?e:s);o=Fi(t),i=e?!s.some((e=>et(t,e))):o}else e?(i=(await Promise.all(s.map((async e=>{const t=et(a,e);return await _(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||n.isValid)&&g()):i=o=await _(a);return f.state.next({...!Gl(e)||u.isValid&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors,isValidating:!1}),t.shouldFocus&&!i&&Vy(a,z,e?s:l.mount),i},j=e=>{const t={...o,...s.mount?i:{}};return $r(e)?t:Gl(e)?et(t,e):e.map((e=>et(t,e)))},P=(e,t)=>({invalid:!!et((t||n).errors,e),isDirty:!!et((t||n).dirtyFields,e),isTouched:!!et((t||n).touchedFields,e),isValidating:!!et((t||n).validatingFields,e),error:et((t||n).errors,e)}),T=(e,t,r)=>{const o=(et(a,e,{_f:{}})._f||{}).ref;Tn(n.errors,e,{...t,ref:o}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&o&&o.focus&&o.focus()},R=(e,t={})=>{for(const s of e?F_(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(Fa(a,s),Fa(i,s)),!t.keepError&&Fa(n.errors,s),!t.keepDirty&&Fa(n.dirtyFields,s),!t.keepTouched&&Fa(n.touchedFields,s),!t.keepIsValidating&&Fa(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&Fa(o,s);f.values.next({values:{...i}}),f.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&g()},N=({disabled:e,name:t,field:r,fields:n,value:a})=>{if($c(e)){const o=e?void 0:$r(a)?nE(r?r._f:et(n,t)._f):a;Tn(i,t,o),v(t,o,!1,!1,!0)}},O=(e,t={})=>{let n=et(a,e);const i=$c(t.disabled);return Tn(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?N({field:n,disabled:t.disabled,name:e,value:t.value}):y(e,!0,t.value),{...i?{disabled:t.disabled}:{},...r.progressive?{required:!!t.required,min:ry(t.min),max:ry(t.max),minLength:ry(t.minLength),maxLength:ry(t.maxLength),pattern:ry(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:i=>{if(i){O(e,t),n=et(a,e);const r=$r(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=yue(r),l=n._f.refs||[];if(s?l.find((e=>e===r)):r===n._f.ref)return;Tn(a,e,{_f:{...n._f,...s?{refs:[...l.filter(tE),r,...Array.isArray(et(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),y(e,!1,void 0,r)}else n=et(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!wB(l.array,e)||!s.action)&&l.unMount.add(e)}}},M=()=>r.shouldFocusError&&Vy(a,z,l.mount),D=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=Es(i);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await w();n.errors=e,l=t}else await _(a);if(Fa(n.errors,"root"),Fi(n.errors)){f.state.next({errors:{}});try{await e(l,o)}catch(e){s=e}}else t&&await t({...n.errors},o),M(),setTimeout(M);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fi(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(t,r={})=>{const c=t?Es(t):o,d=Es(c),p=Fi(t),h=p?o:d;if(r.keepDefaultValues||(o=c),!r.keepValues){if(r.keepDirtyValues)for(const e of l.mount)et(n.dirtyFields,e)?Tn(h,e,et(i,e)):S(e,et(h,e));else{if(NR&&$r(t))for(const e of l.mount){const t=et(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(dw(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}i=e.shouldUnregister?r.keepDefaultValues?Es(o):{}:Es(h),f.array.next({values:{...h}}),f.values.next({values:{...h}})}l={mount:r.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!r.keepIsValid||!!r.keepDirtyValues,s.watch=!!e.shouldUnregister,f.state.next({submitCount:r.keepSubmitCount?n.submitCount:0,isDirty:!p&&(r.keepDirty?n.isDirty:!(!r.keepDefaultValues||Jh(t,o))),isSubmitted:!!r.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?[]:r.keepDirtyValues?r.keepDefaultValues&&i?f_(o,i):n.dirtyFields:r.keepDefaultValues&&t?f_(o,t):{},touchedFields:r.keepTouched?n.touchedFields:{},errors:r.keepErrors?n.errors:{},isSubmitSuccessful:!!r.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},q=(e,t)=>L(up(e)?e(i):e,t);return{control:{register:O,unregister:R,getFieldState:P,handleSubmit:D,setError:T,_executeSchema:w,_getWatch:x,_getDirty:k,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=et(a,e);t&&(t._f.refs?t._f.refs.every((e=>!tE(e))):!tE(t._f.ref))&&R(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],r,l,c=!0,d=!0)=>{if(l&&r){if(s.action=!0,d&&Array.isArray(et(a,e))){const t=r(et(a,e),l.argA,l.argB);c&&Tn(a,e,t)}if(d&&Array.isArray(et(n.errors,e))){const t=r(et(n.errors,e),l.argA,l.argB);c&&Tn(n.errors,e,t),kue(n.errors,e)}if(u.touchedFields&&d&&Array.isArray(et(n.touchedFields,e))){const t=r(et(n.touchedFields,e),l.argA,l.argB);c&&Tn(n.touchedFields,e,t)}u.dirtyFields&&(n.dirtyFields=f_(o,i)),f.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Tn(i,e,t)},_updateDisabledField:N,_getFieldArray:t=>Zv(et(s.mount?i:o,t,e.shouldUnregister?et(o,t,[]):[])),_reset:L,_resetDefaultValues:()=>up(r.defaultValues)&&r.defaultValues().then((e=>{q(e,r.resetOptions),f.state.next({isLoading:!1})})),_updateFormState:e=>{n={...n,...e}},_disableForm:e=>{$c(e)&&(f.state.next({disabled:e}),Vy(a,((t,r)=>{let n=e;const o=et(a,r);o&&$c(o._f.disabled)&&(n||(n=o._f.disabled)),t.disabled=n}),0,!1))},_subjects:f,_proxyFormState:u,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return n},set _formState(e){n=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:I,register:O,handleSubmit:D,watch:(e,t)=>up(e)?f.values.subscribe({next:r=>e(x(void 0,t),r)}):x(e,t,!0),setValue:S,getValues:j,reset:q,resetField:(e,t={})=>{et(a,e)&&($r(t.defaultValue)?S(e,Es(et(o,e))):(S(e,t.defaultValue),Tn(o,e,Es(t.defaultValue))),t.keepTouched||Fa(n.touchedFields,e),t.keepDirty||(Fa(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,Es(et(o,e))):k()),t.keepError||(Fa(n.errors,e),u.isValid&&g()),f.state.next({...n}))},clearErrors:e=>{e&&F_(e).forEach((e=>Fa(n.errors,e))),f.state.next({errors:e?n.errors:{}})},unregister:R,setError:T,setFocus:(e,t={})=>{const r=et(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:P}}function BR(e={}){const t=be.useRef(),r=be.useRef(),[n,a]=be.useState({isDirty:!1,isValidating:!1,isLoading:up(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:up(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Sue(e),formState:n});const o=t.current.control;return o._options=e,DR({subject:o._subjects.state,next:e=>{EB(e,o._proxyFormState,o._updateFormState,!0)&&a({...o._formState})}}),be.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),be.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==n.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,n.isDirty]),be.useEffect((()=>{e.values&&!Jh(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,a((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),be.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),be.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),be.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=SB(n,o),t.current}const Eue=g.forwardRef(((e,t)=>g.createElement(wt.label,Pe({},e,{ref:t,onMouseDown:t=>{var r;null===(r=e.onMouseDown)||void 0===r||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}})))),NB=Eue,Cue=Yi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),DB=g.forwardRef((({className:e,...t},r)=>E.jsx(NB,{ref:r,className:he(Cue(),e),...t})));function nN(e,[t,r]){return Math.min(r,Math.max(t,e))}DB.displayName=NB.displayName;const jB=g.forwardRef(((e,t)=>g.createElement(wt.span,Pe({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))),Iue=jB,Aue=[" ","Enter","ArrowUp","ArrowDown"],Rue=[" ","Enter"],D2="Select",[j2,L2,Tue]=yR(D2),[W0,jot]=as(D2,[Tue,U0]),FR=U0(),[Pue,Rm]=W0(D2),[$ue,zue]=W0(D2),Mue=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:o,value:i,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:d,required:p}=e,h=FR(t),[m,y]=g.useState(null),[v,b]=g.useState(null),[w,_]=g.useState(!1),k=Wv(c),[x=!1,E]=Yl({prop:n,defaultProp:a,onChange:o}),[A,S]=Yl({prop:i,defaultProp:s,onChange:l}),C=g.useRef(null),z=!m||!!m.closest("form"),[I,j]=g.useState(new Set),P=Array.from(I).map((e=>e.props.value)).join(";");return g.createElement(SR,h,g.createElement(Pue,{required:p,scope:t,trigger:m,onTriggerChange:y,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:_,contentId:jc(),value:A,onValueChange:S,open:x,onOpenChange:E,dir:k,triggerPointerDownPosRef:C,disabled:d},g.createElement(j2.Provider,{scope:t},g.createElement($ue,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback((e=>{j((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:g.useCallback((e=>{j((t=>{const r=new Set(t);return r.delete(e),r}))}),[])},r)),z?g.createElement(UB,{key:P,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:A,onChange:e=>S(e.target.value),disabled:d},void 0===A?g.createElement("option",{value:""}):null,Array.from(I)):null))},Oue="SelectTrigger",Nue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,o=FR(r),i=Rm(Oue,r),s=i.disabled||n,l=dn(t,i.onTriggerChange),c=L2(r),[u,f,d]=GB((e=>{const t=c().filter((e=>!e.disabled)),r=t.find((e=>e.value===i.value)),n=qB(t,e,r);void 0!==n&&i.onValueChange(n.value)})),p=()=>{s||(i.onOpenChange(!0),d())};return g.createElement(ER,Pe({asChild:!0},o),g.createElement(wt.button,Pe({type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":FB(i.value)?"":void 0},a,{ref:l,onClick:ft(a.onClick,(e=>{e.currentTarget.focus()})),onPointerDown:ft(a.onPointerDown,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&(p(),i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)},e.preventDefault())})),onKeyDown:ft(a.onKeyDown,(e=>{const t=""!==u.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&Aue.includes(e.key)&&(p(),e.preventDefault())}))})))})),Due="SelectValue",jue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:o,placeholder:i="",...s}=e,l=Rm(Due,r),{onValueNodeHasChildrenChange:c}=l,u=void 0!==o,f=dn(t,l.onValueNodeChange);return zo((()=>{c(u)}),[c,u]),g.createElement(wt.span,Pe({},s,{ref:f,style:{pointerEvents:"none"}}),FB(l.value)?g.createElement(g.Fragment,null,i):o)})),Lue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return g.createElement(wt.span,Pe({"aria-hidden":!0},a,{ref:t}),n||"▼")})),Vue=e=>g.createElement(u2,Pe({asChild:!0},e)),C0="SelectContent",Bue=g.forwardRef(((e,t)=>{const r=Rm(C0,e.__scopeSelect),[n,a]=g.useState();if(zo((()=>{a(new DocumentFragment)}),[]),!r.open){const t=n;return t?Qc.createPortal(g.createElement(LB,{scope:e.__scopeSelect},g.createElement(j2.Slot,{scope:e.__scopeSelect},g.createElement("div",null,e.children))),t):null}return g.createElement(Fue,Pe({},e,{ref:t}))})),ff=10,[LB,Tm]=W0(C0),Fue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y,...v}=e,b=Rm(C0,r),[w,_]=g.useState(null),[k,x]=g.useState(null),E=dn(t,(e=>_(e))),[A,S]=g.useState(null),[C,z]=g.useState(null),I=L2(r),[j,P]=g.useState(!1),T=g.useRef(!1);g.useEffect((()=>{if(w)return p2(w)}),[w]),AA();const R=g.useCallback((e=>{const[t,...r]=I().map((e=>e.ref.current)),[n]=r.slice(-1),a=document.activeElement;for(const r of e)if(r===a||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),null==r||r.focus(),document.activeElement!==a))return}),[I,k]),N=g.useCallback((()=>R([A,w])),[R,A,w]);g.useEffect((()=>{j&&N()}),[j,N]);const{onOpenChange:O,triggerPointerDownPosRef:M}=b;g.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{var r,n,a,o;e={x:Math.abs(Math.round(t.pageX)-(null!==(r=null===(n=M.current)||void 0===n?void 0:n.x)&&void 0!==r?r:0)),y:Math.abs(Math.round(t.pageY)-(null!==(a=null===(o=M.current)||void 0===o?void 0:o.y)&&void 0!==a?a:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||O(!1),document.removeEventListener("pointermove",t),M.current=null};return null!==M.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}}),[w,O,M]),g.useEffect((()=>{const e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[O]);const[D,L]=GB((e=>{const t=I().filter((e=>!e.disabled)),r=t.find((e=>e.ref.current===document.activeElement)),n=qB(t,e,r);n&&setTimeout((()=>n.ref.current.focus()))})),q=g.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&(S(e),n&&(T.current=!0))}),[b.value]),V=g.useCallback((()=>null==w?void 0:w.focus()),[w]),B=g.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&z(e)}),[b.value]),U="popper"===n?rN:Uue,F=U===rN?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y}:{};return g.createElement(LB,{scope:r,content:w,viewport:k,onViewportChange:x,itemRefCallback:q,selectedItem:A,onItemLeave:V,itemTextRefCallback:B,focusSelectedItem:N,selectedItemText:C,position:n,isPositioned:j,searchRef:D},g.createElement(d2,{as:lm,allowPinchZoom:!0},g.createElement(IA,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ft(a,(e=>{var t;null===(t=b.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}))},g.createElement(l2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},g.createElement(U,Pe({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault()},v,F,{onPlaced:()=>P(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ft(v.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=I().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout((()=>R(t))),e.preventDefault()}}))}))))))})),Uue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,o=Rm(C0,r),i=Tm(C0,r),[s,l]=g.useState(null),[c,u]=g.useState(null),f=dn(t,(e=>u(e))),d=L2(r),p=g.useRef(!1),h=g.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=i,w=g.useCallback((()=>{if(o.trigger&&o.valueNode&&s&&c&&m&&y&&v){const e=o.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),a=v.getBoundingClientRect();if("rtl"!==o.dir){const n=a.left-t.left,o=r.left-n,i=e.left-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-ff,f=nN(o,[ff,u-c]);s.style.minWidth=l+"px",s.style.left=f+"px"}else{const n=t.right-a.right,o=window.innerWidth-r.right-n,i=window.innerWidth-e.right-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-ff,f=nN(o,[ff,u-c]);s.style.minWidth=l+"px",s.style.right=f+"px"}const i=d(),l=window.innerHeight-2*ff,u=m.scrollHeight,f=window.getComputedStyle(c),h=parseInt(f.borderTopWidth,10),g=parseInt(f.paddingTop,10),b=parseInt(f.borderBottomWidth,10),w=h+g+u+parseInt(f.paddingBottom,10)+b,_=Math.min(5*y.offsetHeight,w),k=window.getComputedStyle(m),x=parseInt(k.paddingTop,10),E=parseInt(k.paddingBottom,10),A=e.top+e.height/2-ff,S=l-A,C=y.offsetHeight/2,z=h+g+(y.offsetTop+C),I=w-z;if(z<=A){const e=y===i[i.length-1].ref.current;s.style.bottom="0px";const t=c.clientHeight-m.offsetTop-m.offsetHeight,r=z+Math.max(S,C+(e?E:0)+t+b);s.style.height=r+"px"}else{const e=y===i[0].ref.current;s.style.top="0px";const t=Math.max(A,h+m.offsetTop+(e?x:0)+C)+I;s.style.height=t+"px",m.scrollTop=z-A+m.offsetTop}s.style.margin=`${ff}px 0`,s.style.minHeight=_+"px",s.style.maxHeight=l+"px",null==n||n(),requestAnimationFrame((()=>p.current=!0))}}),[d,o.trigger,o.valueNode,s,c,m,y,v,o.dir,n]);zo((()=>w()),[w]);const[_,k]=g.useState();zo((()=>{c&&k(window.getComputedStyle(c).zIndex)}),[c]);const x=g.useCallback((e=>{e&&!0===h.current&&(w(),null==b||b(),h.current=!1)}),[w,b]);return g.createElement(Gue,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:x},g.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_}},g.createElement(wt.div,Pe({},a,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}}))))})),rN=g.forwardRef(((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=ff,...o}=e,i=FR(r);return g.createElement(CR,Pe({},i,o,{ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))})),[Gue,UR]=W0(C0,{}),aN="SelectViewport",que=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,a=Tm(aN,r),o=UR(aN,r),i=dn(t,a.onViewportChange),s=g.useRef(0);return g.createElement(g.Fragment,null,g.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),g.createElement(j2.Slot,{scope:r},g.createElement(wt.div,Pe({"data-radix-select-viewport":"",role:"presentation"},n,{ref:i,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:ft(n.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=o;if(null!=n&&n.current&&r){const e=Math.abs(s.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*ff,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),i=Math.max(a,o);if(i<n){const a=i+e,o=Math.min(n,a),s=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}s.current=t.scrollTop}))}))))})),Wue="SelectGroup",[Hue,Que]=W0(Wue),Yue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,a=jc();return g.createElement(Hue,{scope:r,id:a},g.createElement(wt.div,Pe({role:"group","aria-labelledby":a},n,{ref:t})))})),Kue="SelectLabel",Xue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,a=Que(Kue,r);return g.createElement(wt.div,Pe({id:a.id},n,{ref:t}))})),sI="SelectItem",[Zue,VB]=W0(sI),Jue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:o,...i}=e,s=Rm(sI,r),l=Tm(sI,r),c=s.value===n,[u,f]=g.useState(o??""),[d,p]=g.useState(!1),h=dn(t,(e=>{var t;return null===(t=l.itemRefCallback)||void 0===t?void 0:t.call(l,e,n,a)})),m=jc(),y=()=>{a||(s.onValueChange(n),s.onOpenChange(!1))};if(""===n)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.createElement(Zue,{scope:r,value:n,disabled:a,textId:m,isSelected:c,onItemTextChange:g.useCallback((e=>{f((t=>{var r;return t||(null!==(r=null==e?void 0:e.textContent)&&void 0!==r?r:"").trim()}))}),[])},g.createElement(j2.ItemSlot,{scope:r,value:n,disabled:a,textValue:u},g.createElement(wt.div,Pe({role:"option","aria-labelledby":m,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1},i,{ref:h,onFocus:ft(i.onFocus,(()=>p(!0))),onBlur:ft(i.onBlur,(()=>p(!1))),onPointerUp:ft(i.onPointerUp,y),onPointerMove:ft(i.onPointerMove,(e=>{var t;a?null===(t=l.onItemLeave)||void 0===t||t.call(l):e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:ft(i.onPointerLeave,(e=>{var t;e.currentTarget===document.activeElement&&(null===(t=l.onItemLeave)||void 0===t||t.call(l))})),onKeyDown:ft(i.onKeyDown,(e=>{var t;""!==(null===(t=l.searchRef)||void 0===t?void 0:t.current)&&" "===e.key||(Rue.includes(e.key)&&y()," "===e.key&&e.preventDefault())}))}))))})),d_="SelectItemText",efe=g.forwardRef(((e,t)=>{const{__scopeSelect:r,className:n,style:a,...o}=e,i=Rm(d_,r),s=Tm(d_,r),l=VB(d_,r),c=zue(d_,r),[u,f]=g.useState(null),d=dn(t,(e=>f(e)),l.onItemTextChange,(e=>{var t;return null===(t=s.itemTextRefCallback)||void 0===t?void 0:t.call(s,e,l.value,l.disabled)})),p=null==u?void 0:u.textContent,h=g.useMemo((()=>g.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p)),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return zo((()=>(m(h),()=>y(h))),[m,y,h]),g.createElement(g.Fragment,null,g.createElement(wt.span,Pe({id:l.textId},o,{ref:d})),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Qc.createPortal(o.children,i.valueNode):null)})),tfe="SelectItemIndicator",nfe=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return VB(tfe,r).isSelected?g.createElement(wt.span,Pe({"aria-hidden":!0},n,{ref:t})):null})),oN="SelectScrollUpButton",rfe=g.forwardRef(((e,t)=>{const r=Tm(oN,e.__scopeSelect),n=UR(oN,e.__scopeSelect),[a,o]=g.useState(!1),i=dn(t,n.onScrollButtonChange);return zo((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),a?g.createElement(BB,Pe({},e,{ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}})):null})),sN="SelectScrollDownButton",afe=g.forwardRef(((e,t)=>{const r=Tm(sN,e.__scopeSelect),n=UR(sN,e.__scopeSelect),[a,o]=g.useState(!1),i=dn(t,n.onScrollButtonChange);return zo((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),a?g.createElement(BB,Pe({},e,{ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}})):null})),BB=g.forwardRef(((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,o=Tm("SelectScrollButton",r),i=g.useRef(null),s=L2(r),l=g.useCallback((()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)}),[]);return g.useEffect((()=>()=>l()),[l]),zo((()=>{var e;const t=s().find((e=>e.ref.current===document.activeElement));null==t||null===(e=t.ref.current)||void 0===e||e.scrollIntoView({block:"nearest"})}),[s]),g.createElement(wt.div,Pe({"aria-hidden":!0},a,{ref:t,style:{flexShrink:0,...a.style},onPointerDown:ft(a.onPointerDown,(()=>{null===i.current&&(i.current=window.setInterval(n,50))})),onPointerMove:ft(a.onPointerMove,(()=>{var e;null===(e=o.onItemLeave)||void 0===e||e.call(o),null===i.current&&(i.current=window.setInterval(n,50))})),onPointerLeave:ft(a.onPointerLeave,(()=>{l()}))}))})),ofe=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return g.createElement(wt.div,Pe({"aria-hidden":!0},n,{ref:t}))}));function FB(e){return""===e||void 0===e}const UB=g.forwardRef(((e,t)=>{const{value:r,...n}=e,a=g.useRef(null),o=dn(t,a),i=I2(r);return g.useEffect((()=>{const e=a.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(i!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[i,r]),g.createElement(jB,{asChild:!0},g.createElement("select",Pe({},n,{ref:o,defaultValue:r})))}));function GB(e){const t=si(e),r=g.useRef(""),n=g.useRef(0),a=g.useCallback((e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout((()=>e("")),1e3))}(a)}),[t]),o=g.useCallback((()=>{r.current="",window.clearTimeout(n.current)}),[]);return g.useEffect((()=>()=>window.clearTimeout(n.current)),[]),[r,a,o]}function qB(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,a=r?e.indexOf(r):-1;let o=sfe(e,Math.max(a,0));1===n.length&&(o=o.filter((e=>e!==r)));const i=o.find((e=>e.textValue.toLowerCase().startsWith(n.toLowerCase())));return i!==r?i:void 0}function sfe(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}UB.displayName="BubbleSelect";const WB=Mue,GR=Nue,HB=jue,ife=Lue,cfe=Vue,QB=Bue,lfe=que,YB=Yue,KB=Xue,XB=Jue,ufe=efe,ffe=nfe,ZB=rfe,JB=afe,eF=ofe,dfe=WB,qR=g.forwardRef((({...e},t)=>E.jsx(dfe,{ref:t,...e})));qR.displayName=WB.displayName;const tF=g.forwardRef(((e,t)=>E.jsx(YB,{ref:t,...e})));tF.displayName=YB.displayName;const nF=g.forwardRef(((e,t)=>E.jsx(HB,{ref:t,...e})));nF.displayName=HB.displayName;const WR=g.forwardRef((({className:e,children:t,caption:r,error:n,icon:a,renderCaret:o,...i},s)=>{const l=o?o():o?null:E.jsx(s2,{size:20,className:"transition-transform duration-200 group-data-[state=open]/select:rotate-180"});return E.jsxs("div",{className:"w-full",children:[E.jsxs(GR,{ref:s,className:he("group/select flex h-l w-full items-center justify-between rounded-m border bg-background p-xxs text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus-visible:ring-gray-700 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",n?"border-red-500":"border-input",e),...i,children:[E.jsxs("div",{className:he("flex flex-1 items-center gap-xxs",{"max-w-[calc(100%-20px)]":l}),children:[a&&E.jsx("span",{className:he("text-muted-foreground",{"text-red-dark":n}),children:a}),t]}),E.jsx(ife,{asChild:!0,children:l})]}),r||n?n?E.jsxs("div",{className:"mt-xxs flex items-center gap-xxxs text-sm text-red-600",children:[E.jsx(i2,{size:16}),n]}):E.jsxs("div",{className:"mt-xxs flex items-center gap-xxxs text-sm text-muted-foreground",children:[E.jsx(tZ,{size:16}),r]}):null]})}));WR.displayName="SelectTriggerWrapper";const rF=g.forwardRef((({className:e,children:t,caption:r,error:n,icon:a,...o},i)=>E.jsx(WR,{ref:i,className:he("[&>span]:line-clamp-1 [&>span]:text-left",e),caption:r,error:n,icon:a,...o,children:t})));rF.displayName=GR.displayName;const HR=g.forwardRef((({className:e,children:t,position:r="popper",...n},a)=>{const o=g.useMemo((()=>{const e=t=>{var r,n;if(!t)return!1;if(Array.isArray(t))return t.some(e);if(g.isValidElement(t)){const a=null==(r=t.type)?void 0:r.displayName;return"SelectActions"===a||"SelectFooter"===a||e(null==(n=t.props)?void 0:n.children)}return!1};return e(t)}),[t]);return E.jsx(cfe,{children:E.jsx(QB,{ref:a,className:he("z-[101] flex max-h-[var(--radix-select-content-available-height)] min-w-[8rem] flex-col rounded-lg border border-gray-200 bg-white text-popover-foreground","shadow-[0px_0px_12px_0px_rgba(0,0,0,0.08)]","data-[state=open]:animate-in data-[state=closed]:animate-out ","data-[state=open]:fade-in data-[state=open]:slide-in-from-top-2 ","data-[state=closed]:fade-out data-[state=closed]:slide-out-to-top-2 ","data-[state=closed]:duration-150 data-[state=open]:duration-150 ","data-[state=closed]:[animation-timing-function:ease-in] data-[state=open]:[animation-timing-function:ease-out]","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:E.jsx(lfe,{className:he("flex flex-col gap-xxxs overflow-y-auto px-xxs",{"py-xxs":!o},"popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})})}));HR.displayName=QB.displayName;const aF=g.forwardRef((({className:e,...t},r)=>E.jsx(KB,{ref:r,className:he("text-sm font-medium text-gray-900",e),...t})));aF.displayName=KB.displayName;const oF=g.forwardRef((({className:e,showCheck:t=!0,checkPosition:r="right",children:n,...a},o)=>{const i=E.jsx(ffe,{children:E.jsx(o2,{size:20})});return E.jsxs(XB,{ref:o,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs","text-base font-medium text-gray-900 outline-none transition-colors hover:bg-gray-100","focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[t&&"left"===r&&i,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:E.jsx(ufe,{children:n})}),t&&"right"===r&&i]})}));oF.displayName=XB.displayName;const sF=g.forwardRef((({className:e,...t},r)=>E.jsx(eF,{ref:r,className:he("-mx-1 my-1 h-px bg-gray-200",e),...t})));sF.displayName=eF.displayName;const pfe=({selectedValues:e=[],onRemoveValue:t})=>{const r=g.useRef(null),[n,a]=g.useState(e.length);return g.useLayoutEffect((()=>{if(!r.current||0===e.length)return void a(e.length);const n=r.current.offsetWidth-60,o=document.createElement("div");Object.assign(o.style,{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",display:"flex",gap:"4px",top:"-9999px",left:"-9999px"}),document.body.appendChild(o);let i=0,s=0;for(const r of e){const e=document.createElement("div");e.className="gap-xxxs p-xxs flex cursor-pointer items-center rounded-sm bg-gray-100 text-sm font-medium text-gray-900";const a=document.createElement("span");if(a.textContent="string"==typeof r?r:r.value,e.appendChild(a),"string"!=typeof r&&r.avatar){const t=document.createElement("div");t.className="w-6 h-6 rounded-full bg-gray-300 flex-shrink-0",e.insertBefore(t,a)}if(t){const t=document.createElement("button");t.innerHTML="×",t.className="ml-1 rounded-full outline-none",e.appendChild(t)}o.appendChild(e);const l=e.offsetWidth+4;if(!(i+l<=n))break;i+=l,s++}document.body.removeChild(o),a(Math.max(1,s))}),[e,t]),{containerRef:r,visibleCount:n}},iF=({hiddenCount:e,selectedValues:t=[],onRemoveValue:r})=>{const n=e=>{e.stopPropagation(),e.preventDefault()};return E.jsx("div",{onPointerDown:n,onMouseDown:n,onClick:n,children:E.jsxs(qR,{name:"hidden-chips-counter",children:[E.jsx(GR,{asChild:!0,children:E.jsx("div",{children:E.jsx(TL,{text:`+${e}`})})}),E.jsx(HR,{align:"end",className:"max-h-[250px] w-screen max-w-[300px] gap-xxxs overflow-y-auto",children:t.map((e=>{const t="string"==typeof e?e:e.value;return E.jsxs("div",{className:"flex justify-between p-xxs",onClick:e=>e.stopPropagation(),children:[E.jsx("span",{children:t}),E.jsx(jv,{size:16,className:"cursor-pointer",onClick:()=>null==r?void 0:r(t)})]},t)}))})]})})};iF.displayName="SelectHiddenChipsCounter";const hfe=g.forwardRef(((e,t)=>{const{className:r,selectedValues:n=[],placeholder:a,onRemoveValue:o,icon:i,caption:s,error:l,...c}=e,{containerRef:u,visibleCount:f}=pfe({selectedValues:n,onRemoveValue:o}),d=n.length-f;return E.jsx(WR,{ref:t,className:r,caption:s,error:l,icon:i,...c,children:E.jsx("div",{ref:u,className:"flex w-full flex-1 flex-nowrap overflow-hidden",children:0===n.length?E.jsx("span",{children:a||"Select options..."}):E.jsxs(Gae,{children:[n.slice(0,f).map((e=>{const t="string"==typeof e?e:e.value;return E.jsx(TL,{avatarSrc:"string"==typeof e?void 0:e.avatar,text:t,onRemove:()=>null==o?void 0:o(t)},t)})),d>0&&E.jsx(iF,{hiddenCount:d,onRemoveValue:o,selectedValues:n})]})})})}));hfe.displayName="SelectMultiTrigger";const cF=g.forwardRef((({value:e,isSelected:t=!1,isLoading:r=!1,checkboxPosition:n="right",onSelect:a,className:o,children:i,...s},l)=>{const c=r?E.jsx(yf,{size:24,className:"flex-shrink-0 animate-spin text-blue_100"}):E.jsx(sR,{size:"default",variant:"default",checked:t}),u=()=>{null==a||a(e)};return E.jsxs("div",{ref:l,className:he("relative flex cursor-pointer select-none items-center gap-xxs rounded-m","p-xxs text-base font-medium text-gray-900 outline-none transition-colors hover:bg-gray-100","focus:bg-accent focus:text-accent-foreground",{"pointer-events-none":r},o),onClick:u,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),u())},...s,children:["left"===n&&c,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:i}),"right"===n&&c]})}));cF.displayName="SelectCheckboxItem";const mfe=g.forwardRef((({className:e,...t},r)=>E.jsx(ZB,{ref:r,className:he("flex cursor-default items-center justify-center py-xxs",e),...t,children:E.jsx(RX,{size:16})})));mfe.displayName=ZB.displayName;const gfe=g.forwardRef((({className:e,...t},r)=>E.jsx(JB,{ref:r,className:he("flex cursor-default items-center justify-center p-xxs",e),...t,children:E.jsx(s2,{size:16})})));gfe.displayName=JB.displayName;const lF=g.forwardRef((({className:e,children:t,...r},n)=>E.jsx("div",{ref:n,className:he("sticky top-0 z-20 bg-white p-xxs",e),...r,children:t})));lF.displayName="SelectActions";const uF=g.forwardRef((({className:e,children:t,...r},n)=>E.jsx("div",{ref:n,className:he("sticky bottom-0 z-20 bg-white p-xxs",e),...r,children:t})));uF.displayName="SelectFooter";const fF=xB,dF=g.createContext({}),pF=({...e})=>E.jsx(dF.Provider,{value:{name:e.name},children:E.jsx(pue,{...e})}),Sf=()=>{const e=g.useContext(dF),t=g.useContext(hF),r=N2();e||console.error("useFormContext must be used within a FormProvider");const{getFieldState:n,formState:a}=r,o=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},hF=g.createContext({}),Jv=g.forwardRef((({className:e,...t},r)=>{const n=g.useId();return E.jsx(hF.Provider,{value:{id:n},children:E.jsx("div",{ref:r,className:he("mt-[8px]",e),...t})})}));Jv.displayName="FormItem";const V2=g.forwardRef((({className:e,isRequired:t,...r},n)=>{const{formItemId:a}=Sf();return E.jsxs(DB,{ref:n,className:he("mb-2 text-sm font-medium",e),htmlFor:a,...r,children:[t&&"*",r.children]})}));V2.displayName="FormLabel";const QR=g.forwardRef((({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:a,formMessageId:o}=Sf();return E.jsx(Ip,{ref:t,id:n,"aria-describedby":r?`${a} ${o}`:`${a}`,"aria-invalid":!!r,...e})}));QR.displayName="FormControl";const yfe=g.forwardRef((({className:e,...t},r)=>{const{formDescriptionId:n}=Sf();return E.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})}));yfe.displayName="FormDescription";const eb=g.forwardRef((({className:e,children:t,...r},n)=>{const{error:a,formMessageId:o}=Sf(),i=a?String(null==a?void 0:a.message):t;return i?E.jsxs("p",{ref:n,id:o,className:he("flex items-start gap-1 pt-xxs text-sm text-red-dark",e),...r,children:[E.jsx(i2,{size:16,className:"text-red-dark"})," ",i]}):null}));eb.displayName="FormMessage";const YR=g.forwardRef((({...e},t)=>{const{name:r}=Sf();return E.jsx(qR,{ref:t,name:r,...e})}));YR.displayName="FormSelect";const KR=g.forwardRef((({className:e,children:t,...r},n)=>{const{formItemId:a}=Sf();return E.jsx(rF,{ref:n,id:a,className:e,...r,children:t})}));KR.displayName="FormSelectTrigger";const XR=g.forwardRef(((e,t)=>E.jsx(HR,{ref:t,...e})));XR.displayName="FormSelectContent";const mF=g.forwardRef(((e,t)=>E.jsx(oF,{ref:t,...e})));mF.displayName="FormSelectItem";const gF=g.forwardRef(((e,t)=>E.jsx(tF,{ref:t,...e})));gF.displayName="FormSelectGroup";const vfe=g.forwardRef(((e,t)=>E.jsx(aF,{ref:t,...e})));vfe.displayName="FormSelectLabel";const bfe=g.forwardRef(((e,t)=>E.jsx(sF,{ref:t,...e})));bfe.displayName="FormSelectSeparator";const yF=g.forwardRef(((e,t)=>E.jsx(nF,{ref:t,...e})));function Gi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function vF(e,t=[]){let r=[];const n=()=>{const t=r.map((e=>g.createContext(e)));return function(r){const n=(null==r?void 0:r[e])||t;return g.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const a=g.createContext(n),o=r.length;function i(t){const{scope:r,children:n,...i}=t,s=(null==r?void 0:r[e][o])||a,l=g.useMemo((()=>i),Object.values(i));return g.createElement(s.Provider,{value:l},n)}return r=[...r,n],i.displayName=t+"Provider",[i,function(r,i){const s=(null==i?void 0:i[e][o])||a,l=g.useContext(s);if(l)return l;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},_fe(n,...t)]}function _fe(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return g.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}function H0(e){const t=g.useRef(e);return g.useEffect((()=>{t.current=e})),g.useMemo((()=>(...e)=>{var r;return null===(r=t.current)||void 0===r?void 0:r.call(t,...e)}),[])}function wfe({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=kfe({defaultProp:t,onChange:r}),o=void 0!==e,i=o?e:n,s=H0(r);return[i,g.useCallback((t=>{if(o){const r="function"==typeof t?t(e):t;r!==e&&s(r)}else a(t)}),[o,e,a,s])]}function kfe({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,a=g.useRef(n),o=H0(t);return g.useEffect((()=>{a.current!==n&&(o(n),a.current=n)}),[n,a,o]),r}function xfe(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Sfe(...e){return t=>e.forEach((e=>xfe(e,t)))}function Efe(...e){return g.useCallback(Sfe(...e),e)}function Pm(e){return e.split("-")[0]}function tb(e){return e.split("-")[1]}function Q0(e){return["top","bottom"].includes(Pm(e))?"x":"y"}function ZR(e){return"y"===e?"height":"width"}function iN(e,t,r){let{reference:n,floating:a}=e;const o=n.x+n.width/2-a.width/2,i=n.y+n.height/2-a.height/2,s=Q0(t),l=ZR(s),c=n[l]/2-a[l]/2,u="x"===s;let f;switch(Pm(t)){case"top":f={x:o,y:n.y-a.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:i};break;case"left":f={x:n.x-a.width,y:i};break;default:f={x:n.x,y:n.y}}switch(tb(t)){case"start":f[s]-=c*(r&&u?-1:1);break;case"end":f[s]+=c*(r&&u?-1:1)}return f}yF.displayName="FormSelectValue";const Cfe=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:c,y:u}=iN(l,n,s),f=n,d={},p=0;for(let r=0;r<o.length;r++){const{name:h,fn:g}=o[r],{x:m,y:y,data:v,reset:b}=await g({x:c,y:u,initialPlacement:n,placement:f,strategy:a,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});c=m??c,u=y??u,d={...d,[h]:{...d[h],...v}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(l=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:c,y:u}=iN(l,f,s))),r=-1)}return{x:c,y:u,placement:f,strategy:a,middlewareData:d}};function bF(e){return"number"!=typeof e?(t=e,{top:0,right:0,bottom:0,left:0,...t}):{top:e,right:e,bottom:e,left:e};var t}function gw(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function pv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=bF(p),g=s[d?"floating"===f?"reference":"floating":f],m=gw(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y=gw(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...i.floating,x:n,y:a}:i.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),strategy:l}):i[f]);return{top:m.top-y.top+h.top,bottom:y.bottom-m.bottom+h.bottom,left:m.left-y.left+h.left,right:y.right-m.right+h.right}}const Ife=Math.min,Hh=Math.max;function iI(e,t,r){return Hh(e,Ife(t,r))}const cN=e=>({name:"arrow",options:e,async fn(t){const{element:r,padding:n=0}=e??{},{x:a,y:o,placement:i,rects:s,platform:l}=t;if(null==r)return{};const c=bF(n),u={x:a,y:o},f=Q0(i),d=tb(i),p=ZR(f),h=await l.getDimensions(r),g="y"===f?"top":"left",m="y"===f?"bottom":"right",y=s.reference[p]+s.reference[f]-u[f]-s.floating[p],v=u[f]-s.reference[f],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(r));let w=b?"y"===f?b.clientHeight||0:b.clientWidth||0:0;0===w&&(w=s.floating[p]);const _=y/2-v/2,k=c[g],x=w-h[p]-c[m],E=w/2-h[p]/2+_,A=iI(k,E,x),S=("start"===d?c[g]:c[m])>0&&E!==A&&s.reference[p]<=s.floating[p];return{[f]:u[f]-(S?E<k?k-E:x-E:0),data:{[f]:A,centerOffset:E-A}}}}),Afe={left:"right",right:"left",bottom:"top",top:"bottom"};function yw(e){return e.replace(/left|right|bottom|top/g,(e=>Afe[e]))}function Rfe(e,t,r){void 0===r&&(r=!1);const n=tb(e),a=Q0(e),o=ZR(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=yw(i)),{main:i,cross:yw(i)}}const Tfe={start:"end",end:"start"};function lN(e){return e.replace(/start|end/g,(e=>Tfe[e]))}const _F=["top","right","bottom","left"];_F.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]);const Pfe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:a,rects:o,initialPlacement:i,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:p=!0,...h}=e,g=Pm(n),m=[i,...f||(g!==i&&p?function(e){const t=yw(e);return[lN(e),t,lN(t)]}(i):[yw(i)])],y=await pv(t,h),v=[];let b=(null==(r=a.flip)?void 0:r.overflows)||[];if(c&&v.push(y[g]),u){const{main:e,cross:t}=Rfe(n,o,await(null==s.isRTL?void 0:s.isRTL(l.floating)));v.push(y[e],y[t])}if(b=[...b,{placement:n,overflows:v}],!v.every((e=>e<=0))){var w,_;const e=(null!=(w=null==(_=a.flip)?void 0:_.index)?w:0)+1,t=m[e];if(t)return{data:{index:e,overflows:b},reset:{placement:t}};let r="bottom";switch(d){case"bestFit":{var k;const e=null==(k=b.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0].placement;e&&(r=e);break}case"initialPlacement":r=i}if(n!==r)return{reset:{placement:r}}}return{}}}};function uN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fN(e){return _F.some((t=>e[t]>=0))}const $fe=function(e){let{strategy:t="referenceHidden",...r}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:n}=e;switch(t){case"referenceHidden":{const t=uN(await pv(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:fN(t)}}}case"escaped":{const t=uN(await pv(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:fN(t)}}}default:return{}}}}},zfe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,a=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=Pm(r),s=tb(r),l="x"===Q0(r),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,e);return{x:r+a.x,y:n+a.y,data:a}}}};function wF(e){return"x"===e?"y":"x"}const Mfe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=e,c={x:r,y:n},u=await pv(t,l),f=Q0(Pm(a)),d=wF(f);let p=c[f],h=c[d];if(o){const e="y"===f?"bottom":"right";p=iI(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=iI(h+u["y"===d?"top":"left"],h,h-u[e])}const g=s.fn({...t,[f]:p,[d]:h});return{...g,data:{x:g.x-r,y:g.y-n}}}}},Ofe=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:r,y:n},f=Q0(a),d=wF(f);let p=u[f],h=u[d];const g="function"==typeof s?s({...o,placement:a}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+m.mainAxis,r=o.reference[f]+o.reference[e]-m.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var y,v,b,w;const e="y"===f?"width":"height",t=["top","left"].includes(Pm(a)),r=o.reference[d]-o.floating[e]+(t&&null!=(y=null==(v=i.offset)?void 0:v[d])?y:0)+(t?0:m.crossAxis),n=o.reference[d]+o.reference[e]+(t?0:null!=(b=null==(w=i.offset)?void 0:w[d])?b:0)-(t?m.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[f]:p,[d]:h}}}},Nfe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:a,elements:o}=t,{apply:i,...s}=e,l=await pv(t,s),c=Pm(r),u=tb(r);let f,d;"top"===c||"bottom"===c?(f=c,d=u===(await(null==a.isRTL?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(d=c,f="end"===u?"top":"bottom");const p=Hh(l.left,0),h=Hh(l.right,0),g=Hh(l.top,0),m=Hh(l.bottom,0),y={availableHeight:n.floating.height-(["left","right"].includes(r)?2*(0!==g||0!==m?g+m:Hh(l.top,l.bottom)):l[f]),availableWidth:n.floating.width-(["top","bottom"].includes(r)?2*(0!==p||0!==h?p+h:Hh(l.left,l.right)):l[d])},v=await a.getDimensions(o.floating);null==i||i({...t,...y});const b=await a.getDimensions(o.floating);return v.width!==b.width||v.height!==b.height?{reset:{rects:!0}}:{}}}};function kF(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Ef(e){if(null==e)return window;if(!kF(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function nb(e){return Ef(e).getComputedStyle(e)}function hf(e){return kF(e)?"":e?(e.nodeName||"").toLowerCase():""}function xF(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function Zl(e){return e instanceof Ef(e).HTMLElement}function wp(e){return e instanceof Ef(e).Element}function JR(e){return!(typeof ShadowRoot>"u")&&(e instanceof Ef(e).ShadowRoot||e instanceof ShadowRoot)}function B2(e){const{overflow:t,overflowX:r,overflowY:n}=nb(e);return/auto|scroll|overlay|hidden/.test(t+n+r)}function Dfe(e){return["table","td","th"].includes(hf(e))}function dN(e){const t=/firefox/i.test(xF()),r=nb(e);return"none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||["transform","perspective"].includes(r.willChange)||t&&"filter"===r.willChange||t&&!!r.filter&&"none"!==r.filter}function SF(){return!/^((?!chrome|android).)*safari/i.test(xF())}const pN=Math.min,By=Math.max,vw=Math.round;function mf(e,t,r){var n,a,o,i;void 0===t&&(t=!1),void 0===r&&(r=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&Zl(e)&&(l=e.offsetWidth>0&&vw(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&vw(s.height)/e.offsetHeight||1);const u=wp(e)?Ef(e):window,f=!SF()&&r,d=(s.left+(f&&null!=(n=null==(a=u.visualViewport)?void 0:a.offsetLeft)?n:0))/l,p=(s.top+(f&&null!=(o=null==(i=u.visualViewport)?void 0:i.offsetTop)?o:0))/c,h=s.width/l,g=s.height/c;return{width:h,height:g,top:p,right:d+h,bottom:p+g,left:d,x:d,y:p}}function dp(e){return(t=e,(t instanceof Ef(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function F2(e){return wp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function EF(e){return mf(dp(e)).left+F2(e).scrollLeft}function jfe(e,t,r){const n=Zl(t),a=dp(t),o=mf(e,n&&function(e){const t=mf(e);return vw(t.width)!==e.offsetWidth||vw(t.height)!==e.offsetHeight}(t),"fixed"===r);let i={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(n||!n&&"fixed"!==r)if(("body"!==hf(t)||B2(a))&&(i=F2(t)),Zl(t)){const e=mf(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else a&&(s.x=EF(a));return{x:o.left+i.scrollLeft-s.x,y:o.top+i.scrollTop-s.y,width:o.width,height:o.height}}function CF(e){return"html"===hf(e)?e:e.assignedSlot||e.parentNode||(JR(e)?e.host:null)||dp(e)}function hN(e){return Zl(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function cI(e){const t=Ef(e);let r=hN(e);for(;r&&Dfe(r)&&"static"===getComputedStyle(r).position;)r=hN(r);return r&&("html"===hf(r)||"body"===hf(r)&&"static"===getComputedStyle(r).position&&!dN(r))?t:r||function(e){let t=CF(e);for(JR(t)&&(t=t.host);Zl(t)&&!["html","body"].includes(hf(t));){if(dN(t))return t;t=t.parentNode}return null}(e)||t}function mN(e){if(Zl(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=mf(e);return{width:t.width,height:t.height}}function IF(e){const t=CF(e);return["html","body","#document"].includes(hf(t))?e.ownerDocument.body:Zl(t)&&B2(t)?t:IF(t)}function bw(e,t){var r;void 0===t&&(t=[]);const n=IF(e),a=n===(null==(r=e.ownerDocument)?void 0:r.body),o=Ef(n),i=a?[o].concat(o.visualViewport||[],B2(n)?n:[]):n,s=t.concat(i);return a?s:s.concat(bw(i))}function gN(e,t,r){return"viewport"===t?gw(function(e,t){const r=Ef(e),n=dp(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=SF();(e||!e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}(e,r)):wp(t)?function(e,t){const r=mf(e,!1,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft;return{top:n,left:a,x:a,y:n,right:a+e.clientWidth,bottom:n+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,r):gw(function(e){var t;const r=dp(e),n=F2(e),a=null==(t=e.ownerDocument)?void 0:t.body,o=By(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=By(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let s=-n.scrollLeft+EF(e);const l=-n.scrollTop;return"rtl"===nb(a||r).direction&&(s+=By(r.clientWidth,a?a.clientWidth:0)-o),{width:o,height:i,x:s,y:l}}(dp(e)))}function Lfe(e){const t=bw(e),r=["absolute","fixed"].includes(nb(e).position)&&Zl(e)?cI(e):e;return wp(r)?t.filter((e=>wp(e)&&function(e,t){const r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&JR(r)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}(e,r)&&"body"!==hf(e))):[]}const Vfe={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[..."clippingAncestors"===r?Lfe(t):[].concat(r),n],i=o[0],s=o.reduce(((e,r)=>{const n=gN(t,r,a);return e.top=By(n.top,e.top),e.right=pN(n.right,e.right),e.bottom=pN(n.bottom,e.bottom),e.left=By(n.left,e.left),e}),gN(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const a=Zl(r),o=dp(r);if(r===o)return t;let i={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((a||!a&&"fixed"!==n)&&(("body"!==hf(r)||B2(o))&&(i=F2(r)),Zl(r))){const e=mf(r,!0);s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}return{...t,x:t.x-i.scrollLeft+s.x,y:t.y-i.scrollTop+s.y}},isElement:wp,getDimensions:mN,getOffsetParent:cI,getDocumentElement:dp,getElementRects:e=>{let{reference:t,floating:r,strategy:n}=e;return{reference:jfe(t,cI(r),n),floating:{...mN(r),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===nb(e).direction};function Bfe(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=!0,animationFrame:s=!1}=n,l=a&&!s,c=o&&!s,u=l||c?[...wp(e)?bw(e):[],...bw(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",r,{passive:!0}),c&&e.addEventListener("resize",r)}));let f,d=null;if(i){let n=!0;d=new ResizeObserver((()=>{n||r(),n=!1})),wp(e)&&!s&&d.observe(e),d.observe(t)}let p=s?mf(e):null;return s&&function t(){const n=mf(e);!p||n.x===p.x&&n.y===p.y&&n.width===p.width&&n.height===p.height||r(),p=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",r),c&&e.removeEventListener("resize",r)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(f)}}const Ffe=(e,t,r)=>Cfe(e,t,{platform:Vfe,...r});var lI=typeof document<"u"?g.useLayoutEffect:g.useEffect;function uI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;0!=n--;)if(!uI(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){const r=a[n];if(!("_owner"===r&&e.$$typeof||uI(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function Ufe(e){const t=g.useRef(e);return lI((()=>{t.current=e})),t}function Gfe(e){let{middleware:t,placement:r="bottom",strategy:n="absolute",whileElementsMounted:a}=void 0===e?{}:e;const o=g.useRef(null),i=g.useRef(null),s=Ufe(a),l=g.useRef(null),[c,u]=g.useState({x:null,y:null,strategy:n,placement:r,middlewareData:{}}),[f,d]=g.useState(t);uI(null==f?void 0:f.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||d(t);const p=g.useCallback((()=>{!o.current||!i.current||Ffe(o.current,i.current,{middleware:f,placement:r,strategy:n}).then((e=>{h.current&&Qc.flushSync((()=>{u(e)}))}))}),[f,r,n]);lI((()=>{h.current&&p()}),[p]);const h=g.useRef(!1);lI((()=>(h.current=!0,()=>{h.current=!1})),[]);const m=g.useCallback((()=>{if("function"==typeof l.current&&(l.current(),l.current=null),o.current&&i.current)if(s.current){const e=s.current(o.current,i.current,p);l.current=e}else p()}),[p,s]),y=g.useCallback((e=>{o.current=e,m()}),[m]),v=g.useCallback((e=>{i.current=e,m()}),[m]),b=g.useMemo((()=>({reference:o,floating:i})),[]);return g.useMemo((()=>({...c,update:p,refs:b,reference:y,floating:v})),[c,p,b,y,v])}const qfe=e=>{const{element:t,padding:r}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?cN({element:t.current,padding:r}).fn(e):{}:t?cN({element:t,padding:r}).fn(e):{}}};function Wfe(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Hfe(...e){return t=>e.forEach((e=>Wfe(e,t)))}const AF=g.forwardRef(((e,t)=>{const{children:r,...n}=e,a=g.Children.toArray(r),o=a.find(Yfe);if(o){const e=o.props.children,r=a.map((t=>t===o?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t));return g.createElement(fI,Pe({},n,{ref:t}),g.isValidElement(e)?g.cloneElement(e,void 0,r):null)}return g.createElement(fI,Pe({},n,{ref:t}),r)}));AF.displayName="Slot";const fI=g.forwardRef(((e,t)=>{const{children:r,...n}=e;return g.isValidElement(r)?g.cloneElement(r,{...Kfe(n,r.props),ref:Hfe(t,r.ref)}):g.Children.count(r)>1?g.Children.only(null):null}));fI.displayName="SlotClone";const Qfe=({children:e})=>g.createElement(g.Fragment,null,e);function Yfe(e){return g.isValidElement(e)&&e.type===Qfe}function Kfe(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{o(...e),a(...e)}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}const Xfe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],I0=Xfe.reduce(((e,t)=>{const r=g.forwardRef(((e,r)=>{const{asChild:n,...a}=e,o=n?AF:t;return g.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),g.createElement(o,Pe({},a,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function Zfe(e,t){e&&Qc.flushSync((()=>e.dispatchEvent(t)))}function Jfe(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function ede(...e){return t=>e.forEach((e=>Jfe(e,t)))}function RF(...e){return g.useCallback(ede(...e),e)}const em=null!=globalThis&&globalThis.document?g.useLayoutEffect:()=>{};function tde(e){const[t,r]=g.useState(void 0);return em((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),t}const TF="Popper",[eT,PF]=vF(TF),[nde,$F]=eT(TF),rde=e=>{const{__scopePopper:t,children:r}=e,[n,a]=g.useState(null);return g.createElement(nde,{scope:t,anchor:n,onAnchorChange:a},r)},ade="PopperAnchor",ode=g.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,o=$F(ade,r),i=g.useRef(null),s=RF(t,i);return g.useEffect((()=>{o.onAnchorChange((null==n?void 0:n.current)||i.current)})),n?null:g.createElement(I0.div,Pe({},a,{ref:s}))})),_w="PopperContent",[sde,Lot]=eT(_w),[ide,cde]=eT(_w,{hasParent:!1,positionUpdateFns:new Set}),lde=g.forwardRef(((e,t)=>{var r,n,a,o,i,s,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:h=0,arrowPadding:m=0,collisionBoundary:y=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:w=!1,avoidCollisions:_=!0,onPlaced:k,...x}=e,E=$F(_w,u),[A,S]=g.useState(null),C=RF(t,(e=>S(e))),[z,I]=g.useState(null),j=tde(z),P=null!==(r=null==j?void 0:j.width)&&void 0!==r?r:0,T=null!==(n=null==j?void 0:j.height)&&void 0!==n?n:0,R=f+("center"!==p?"-"+p:""),N="number"==typeof v?v:{top:0,right:0,bottom:0,left:0,...v},O=Array.isArray(y)?y:[y],M=O.length>0,D={padding:N,boundary:O.filter(fde),altBoundary:M},{reference:L,floating:q,strategy:V,x:B,y:U,placement:F,middlewareData:$,update:G}=Gfe({strategy:"fixed",placement:R,whileElementsMounted:Bfe,middleware:[dde(),zfe({mainAxis:d+T,alignmentAxis:h}),_?Mfe({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?Ofe():void 0,...D}):void 0,z?qfe({element:z,padding:m}):void 0,_?Pfe({...D}):void 0,Nfe({...D,apply:({elements:e,availableWidth:t,availableHeight:r})=>{e.floating.style.setProperty("--radix-popper-available-width",`${t}px`),e.floating.style.setProperty("--radix-popper-available-height",`${r}px`)}}),pde({arrowWidth:P,arrowHeight:T}),w?$fe({strategy:"referenceHidden"}):void 0].filter(ude)});em((()=>{L(E.anchor)}),[L,E.anchor]);const Q=null!==B&&null!==U,[W,H]=zF(F),K=H0(k);em((()=>{Q&&(null==K||K())}),[Q,K]);const Y=null===(a=$.arrow)||void 0===a?void 0:a.x,Z=null===(o=$.arrow)||void 0===o?void 0:o.y,X=0!==(null===(i=$.arrow)||void 0===i?void 0:i.centerOffset),[J,ee]=g.useState();em((()=>{A&&ee(window.getComputedStyle(A).zIndex)}),[A]);const{hasParent:te,positionUpdateFns:re}=cde(_w,u),ne=!te;g.useLayoutEffect((()=>{if(!ne)return re.add(G),()=>{re.delete(G)}}),[ne,re,G]),em((()=>{ne&&Q&&Array.from(re).reverse().forEach((e=>requestAnimationFrame(e)))}),[ne,Q,re]);const ae={"data-side":W,"data-align":H,...x,ref:C,style:{...x.style,animation:Q?void 0:"none",opacity:null!==(s=$.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return g.createElement("div",{ref:q,"data-radix-popper-content-wrapper":"",style:{position:V,left:0,top:0,transform:Q?`translate3d(${Math.round(B)}px, ${Math.round(U)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[null===(l=$.transformOrigin)||void 0===l?void 0:l.x,null===(c=$.transformOrigin)||void 0===c?void 0:c.y].join(" ")},dir:e.dir},g.createElement(sde,{scope:u,placedSide:W,onArrowChange:I,arrowX:Y,arrowY:Z,shouldHideArrow:X},ne?g.createElement(ide,{scope:u,hasParent:!0,positionUpdateFns:re},g.createElement(I0.div,ae)):g.createElement(I0.div,ae)))}));function ude(e){return void 0!==e}function fde(e){return null!==e}const dde=()=>({name:"anchorCssProperties",fn(e){const{rects:t,elements:r}=e,{width:n,height:a}=t.reference;return r.floating.style.setProperty("--radix-popper-anchor-width",`${n}px`),r.floating.style.setProperty("--radix-popper-anchor-height",`${a}px`),{}}}),pde=e=>({name:"transformOrigin",options:e,fn(t){var r,n,a,o,i;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(r=c.arrow)||void 0===r?void 0:r.centerOffset),f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[p,h]=zF(s),g={start:"0%",center:"50%",end:"100%"}[h],m=(null!==(n=null===(a=c.arrow)||void 0===a?void 0:a.x)&&void 0!==n?n:0)+f/2,y=(null!==(o=null===(i=c.arrow)||void 0===i?void 0:i.y)&&void 0!==o?o:0)+d/2;let v="",b="";return"bottom"===p?(v=u?g:`${m}px`,b=-d+"px"):"top"===p?(v=u?g:`${m}px`,b=`${l.floating.height+d}px`):"right"===p?(v=-d+"px",b=u?g:`${y}px`):"left"===p&&(v=`${l.floating.width+d}px`,b=u?g:`${y}px`),{data:{x:v,y:b}}}});function zF(e){const[t,r="center"]=e.split("-");return[t,r]}const hde=rde,mde=ode,gde=lde,yde=g.forwardRef(((e,t)=>{var r;const{container:n=(null==globalThis||null===(r=globalThis.document)||void 0===r?void 0:r.body),...a}=e;return n?xA.createPortal(g.createElement(I0.div,Pe({},a,{ref:t})),n):null}));function vde(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function bde(...e){return t=>e.forEach((e=>vde(e,t)))}function _de(...e){return g.useCallback(bde(...e),e)}function wde(e,t){return g.useReducer(((e,r)=>t[e][r]??e),e)}const tT=e=>{const{present:t,children:r}=e,n=kde(t),a="function"==typeof r?r({present:n.isPresent}):g.Children.only(r),o=_de(n.ref,a.ref);return"function"==typeof r||n.isPresent?g.cloneElement(a,{ref:o}):null};function kde(e){const[t,r]=g.useState(),n=g.useRef({}),a=g.useRef(e),o=g.useRef("none"),i=e?"mounted":"unmounted",[s,l]=wde(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect((()=>{const e=p_(n.current);o.current="mounted"===s?e:"none"}),[s]),em((()=>{const t=n.current,r=a.current;if(r!==e){const n=o.current,i=p_(t);e?l("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?l("UNMOUNT"):l(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),a.current=e}}),[e,l]),em((()=>{if(t){const e=e=>{const r=p_(n.current).includes(e.animationName);e.target===t&&r&&Qc.flushSync((()=>l("ANIMATION_END")))},r=e=>{e.target===t&&(o.current=p_(n.current))};return t.addEventListener("animationstart",r),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",r),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback((e=>{e&&(n.current=getComputedStyle(e)),r(e)}),[])}}function p_(e){return(null==e?void 0:e.animationName)||"none"}function xde(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Sde(...e){return t=>e.forEach((e=>xde(e,t)))}function Ede(...e){return g.useCallback(Sde(...e),e)}function Cde(e,t=(null==globalThis?void 0:globalThis.document)){const r=H0(e);g.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}tT.displayName="Presence";const dI="dismissableLayer.update",Ide="dismissableLayer.pointerDownOutside",Ade="dismissableLayer.focusOutside";let yN;const Rde=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tde=g.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,u=g.useContext(Rde),[f,d]=g.useState(null),p=null!==(r=null==f?void 0:f.ownerDocument)&&void 0!==r?r:null==globalThis?void 0:globalThis.document,[,h]=g.useState({}),m=Ede(t,(e=>d(e))),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,k=w>=b,x=Pde((e=>{const t=e.target,r=[...u.branches].some((e=>e.contains(t)));!k||r||(null==o||o(e),null==s||s(e),e.defaultPrevented||null==l||l())}),p),E=$de((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==l||l())}),p);return Cde((e=>{w===u.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),p),g.useEffect((()=>{if(f)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(yN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),vN(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=yN)}}),[f,p,n,u]),g.useEffect((()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),vN())}),[f,u]),g.useEffect((()=>{const e=()=>h({});return document.addEventListener(dI,e),()=>document.removeEventListener(dI,e)}),[]),g.createElement(I0.div,Pe({},c,{ref:m,style:{pointerEvents:_?k?"auto":"none":void 0,...e.style},onFocusCapture:Gi(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Gi(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Gi(e.onPointerDownCapture,x.onPointerDownCapture)}))}));function Pde(e,t=(null==globalThis?void 0:globalThis.document)){const r=H0(e),n=g.useRef(!1),a=g.useRef((()=>{}));return g.useEffect((()=>{const e=e=>{if(e.target&&!n.current){let n=function(){MF(Ide,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}n.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,r]),{onPointerDownCapture:()=>n.current=!0}}function $de(e,t=(null==globalThis?void 0:globalThis.document)){const r=H0(e),n=g.useRef(!1);return g.useEffect((()=>{const e=e=>{e.target&&!n.current&&MF(Ade,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function vN(){const e=new CustomEvent(dI);document.dispatchEvent(e)}function MF(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Zfe(a,o):a.dispatchEvent(o)}let rE;const OF="HoverCard",[NF,Vot]=vF(OF,[PF]),nT=PF(),[zde,U2]=NF(OF),Mde=e=>{const{__scopeHoverCard:t,children:r,open:n,defaultOpen:a,onOpenChange:o,openDelay:i=700,closeDelay:s=300}=e,l=nT(t),c=g.useRef(0),u=g.useRef(0),f=g.useRef(!1),d=g.useRef(!1),[p=!1,h]=wfe({prop:n,defaultProp:a,onChange:o}),m=g.useCallback((()=>{clearTimeout(u.current),c.current=window.setTimeout((()=>h(!0)),i)}),[i,h]),y=g.useCallback((()=>{clearTimeout(c.current),!f.current&&!d.current&&(u.current=window.setTimeout((()=>h(!1)),s))}),[s,h]),v=g.useCallback((()=>h(!1)),[h]);return g.useEffect((()=>()=>{clearTimeout(c.current),clearTimeout(u.current)}),[]),g.createElement(zde,{scope:t,open:p,onOpenChange:h,onOpen:m,onClose:y,onDismiss:v,hasSelectionRef:f,isPointerDownOnContentRef:d},g.createElement(hde,l,r))},Ode="HoverCardTrigger",Nde=g.forwardRef(((e,t)=>{const{__scopeHoverCard:r,...n}=e,a=U2(Ode,r),o=nT(r);return g.createElement(mde,Pe({asChild:!0},o),g.createElement(I0.a,Pe({"data-state":a.open?"open":"closed"},n,{ref:t,onPointerEnter:Gi(e.onPointerEnter,ww(a.onOpen)),onPointerLeave:Gi(e.onPointerLeave,ww(a.onClose)),onFocus:Gi(e.onFocus,a.onOpen),onBlur:Gi(e.onBlur,a.onClose),onTouchStart:Gi(e.onTouchStart,(e=>e.preventDefault()))})))})),DF="HoverCardPortal",[Dde,jde]=NF(DF,{forceMount:void 0}),Lde=e=>{const{__scopeHoverCard:t,forceMount:r,children:n,container:a}=e,o=U2(DF,t);return g.createElement(Dde,{scope:t,forceMount:r},g.createElement(tT,{present:r||o.open},g.createElement(yde,{asChild:!0,container:a},n)))},pI="HoverCardContent",Vde=g.forwardRef(((e,t)=>{const r=jde(pI,e.__scopeHoverCard),{forceMount:n=r.forceMount,...a}=e,o=U2(pI,e.__scopeHoverCard);return g.createElement(tT,{present:n||o.open},g.createElement(Bde,Pe({"data-state":o.open?"open":"closed"},a,{onPointerEnter:Gi(e.onPointerEnter,ww(o.onOpen)),onPointerLeave:Gi(e.onPointerLeave,ww(o.onClose)),ref:t})))})),Bde=g.forwardRef(((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,...s}=e,l=U2(pI,r),c=nT(r),u=g.useRef(null),f=Efe(t,u),[d,p]=g.useState(!1);return g.useEffect((()=>{if(d){const e=document.body;return rE=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect="none",e.style.webkitUserSelect="none",()=>{e.style.userSelect=rE,e.style.webkitUserSelect=rE}}}),[d]),g.useEffect((()=>{if(u.current){const e=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout((()=>{var e;""!==(null===(e=document.getSelection())||void 0===e?void 0:e.toString())&&(l.hasSelectionRef.current=!0)}))};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}}),[l.isPointerDownOnContentRef,l.hasSelectionRef]),g.useEffect((()=>{u.current&&Fde(u.current).forEach((e=>e.setAttribute("tabindex","-1")))})),g.createElement(Tde,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:Gi(o,(e=>{e.preventDefault()})),onDismiss:l.onDismiss},g.createElement(gde,Pe({},c,s,{onPointerDown:Gi(s.onPointerDown,(e=>{e.currentTarget.contains(e.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0})),ref:f,style:{...s.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))}));function ww(e){return t=>"touch"===t.pointerType?void 0:e()}function Fde(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}const Ude=Mde,Gde=Nde,qde=Lde,jF=Vde,LF=Ude,VF=Gde,Wde=qde,rT=g.forwardRef((({className:e,align:t="center",sideOffset:r=4,...n},a)=>E.jsx(jF,{ref:a,align:t,sideOffset:r,className:he("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})));rT.displayName=jF.displayName;const Y0=g.forwardRef((({className:e,type:t,...r},n)=>{const{error:a}=Sf();return E.jsx("input",{type:t,title:r.disabled?"Disabled":"",className:he("flex w-full rounded-m px-s py-3.5 text-base text-gray-900 outline outline-1 outline-input ring-offset-background transition-all duration-200 ease-in-out file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-base placeholder:text-gray-400 placeholder:text-muted-foreground focus-visible:bg-gray-50 focus-visible:text-gray-900 focus-visible:outline-2 focus-visible:outline-blue_120 enabled:hover:outline-2 enabled:hover:outline-gray-400 disabled:bg-transparent disabled:text-gray-300 disabled:outline-gray-200 disabled:ring-0 disabled:ring-transparent disabled:placeholder:text-gray-300",{"bg-red_30_17 outline-red-dark":!!a},e),ref:n,...r})}));function Hde(e,t=[]){let r=[];const n=()=>{const t=r.map((e=>g.createContext(e)));return function(r){const n=(null==r?void 0:r[e])||t;return g.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const a=g.createContext(n),o=r.length;r=[...r,n];const i=t=>{var r;const{scope:n,children:i,...s}=t,l=(null==(r=null==n?void 0:n[e])?void 0:r[o])||a,c=g.useMemo((()=>s),Object.values(s));return E.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(r,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=g.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},Qde(n,...t)]}function Qde(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return g.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}function bN(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Yde(...e){return t=>{let r=!1;const n=e.map((e=>{const n=bN(e,t);return!r&&"function"==typeof n&&(r=!0),n}));if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():bN(e[t],null)}}}}function Kde(e){const t=Xde(e),r=g.forwardRef(((e,r)=>{const{children:n,...a}=e,o=g.Children.toArray(n),i=o.find(Jde);if(i){const e=i.props.children,n=o.map((t=>t===i?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t));return E.jsx(t,{...a,ref:r,children:g.isValidElement(e)?g.cloneElement(e,void 0,n):null})}return E.jsx(t,{...a,ref:r,children:n})}));return r.displayName=`${e}.Slot`,r}function Xde(e){const t=g.forwardRef(((e,t)=>{const{children:r,...n}=e;if(g.isValidElement(r)){const e=tpe(r),a=epe(n,r.props);return r.type!==g.Fragment&&(a.ref=t?Yde(t,e):e),g.cloneElement(r,a)}return g.Children.count(r)>1?g.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}Y0.displayName="Input";var Zde=Symbol("radix.slottable");function Jde(e){return g.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Zde}function epe(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}function tpe(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var npe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],BF=npe.reduce(((e,t)=>{const r=Kde(`Primitive.${t}`),n=g.forwardRef(((e,n)=>{const{asChild:a,...o}=e,i=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{}),aT="Progress",oT=100,[rpe,Bot]=Hde(aT),[ape,ope]=rpe(aT),FF=g.forwardRef(((e,t)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:o=spe,...i}=e;(a||0===a)&&!_N(a)&&console.error(ipe(`${a}`,"Progress"));const s=_N(a)?a:oT;null!==n&&!wN(n,s)&&console.error(cpe(`${n}`,"Progress"));const l=wN(n,s)?n:null,c=kw(l)?o(l,s):void 0;return E.jsx(ape,{scope:r,value:l,max:s,children:E.jsx(BF.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":kw(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":qF(l,s),"data-value":l??void 0,"data-max":s,...i,ref:t})})}));FF.displayName=aT;var UF="ProgressIndicator",GF=g.forwardRef(((e,t)=>{const{__scopeProgress:r,...n}=e,a=ope(UF,r);return E.jsx(BF.div,{"data-state":qF(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})}));function spe(e,t){return`${Math.round(e/t*100)}%`}function qF(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function kw(e){return"number"==typeof e}function _N(e){return kw(e)&&!isNaN(e)&&e>0}function wN(e,t){return kw(e)&&!isNaN(e)&&e<=t&&e>=0}function ipe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${oT}\`.`}function cpe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or ${oT} if no \`max\` prop is set)\n - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}GF.displayName=UF;var WF=FF,lpe=GF;const upe=g.forwardRef((({className:e,value:t,indicatorClassName:r,...n},a)=>E.jsx(WF,{ref:a,className:he("relative h-[7px] w-full overflow-hidden rounded-full bg-blue_10",e),...n,children:E.jsx(lpe,{className:he("h-full w-full flex-1 rounded-full bg-blue_100 transition-all",r),style:{transform:`translateX(-${100-(t||0)}%)`}})})));upe.displayName=WF.displayName;const HF="Radio",[fpe,QF]=as(HF),[dpe,ppe]=fpe(HF),hpe=g.forwardRef(((e,t)=>{const{__scopeRadio:r,name:n,checked:a=!1,required:o,disabled:i,value:s="on",onCheck:l,...c}=e,[u,f]=g.useState(null),d=dn(t,(e=>f(e))),p=g.useRef(!1),h=!u||!!u.closest("form");return g.createElement(dpe,{scope:r,checked:a,disabled:i},g.createElement(wt.button,Pe({type:"button",role:"radio","aria-checked":a,"data-state":YF(a),"data-disabled":i?"":void 0,disabled:i,value:s},c,{ref:d,onClick:ft(e.onClick,(e=>{a||null==l||l(),h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())}))})),h&&g.createElement(ype,{control:u,bubbles:!p.current,name:n,value:s,checked:a,required:o,disabled:i,style:{transform:"translateX(-100%)"}}))})),mpe="RadioIndicator",gpe=g.forwardRef(((e,t)=>{const{__scopeRadio:r,forceMount:n,...a}=e,o=ppe(mpe,r);return g.createElement(ii,{present:n||o.checked},g.createElement(wt.span,Pe({"data-state":YF(o.checked),"data-disabled":o.disabled?"":void 0},a,{ref:t})))})),ype=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,o=g.useRef(null),i=I2(r),s=A2(t);return g.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&a){const t=new Event("click",{bubbles:n});a.call(e,r),e.dispatchEvent(t)}}),[i,r,n]),g.createElement("input",Pe({type:"radio","aria-hidden":!0,defaultChecked:r},a,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function YF(e){return e?"checked":"unchecked"}const vpe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],KF="RadioGroup",[bpe,Fot]=as(KF,[G0,QF]),XF=G0(),ZF=QF(),[_pe,wpe]=bpe(KF),kpe=g.forwardRef(((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:a,value:o,required:i=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...d}=e,p=XF(r),h=Wv(c),[m,y]=Yl({prop:o,defaultProp:a,onChange:f});return g.createElement(_pe,{scope:r,name:n,required:i,disabled:s,value:m,onValueChange:y},g.createElement(AR,Pe({asChild:!0},p,{orientation:l,dir:h,loop:u}),g.createElement(wt.div,Pe({role:"radiogroup","aria-required":i,"aria-orientation":l,"data-disabled":s?"":void 0,dir:h},d,{ref:t}))))})),xpe="RadioGroupItem",Spe=g.forwardRef(((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...a}=e,o=wpe(xpe,r),i=o.disabled||n,s=XF(r),l=ZF(r),c=g.useRef(null),u=dn(t,c),f=o.value===a.value,d=g.useRef(!1);return g.useEffect((()=>{const e=e=>{vpe.includes(e.key)&&(d.current=!0)},t=()=>d.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}}),[]),g.createElement(RR,Pe({asChild:!0},s,{focusable:!i,active:f}),g.createElement(hpe,Pe({disabled:i,required:o.required,checked:f},l,a,{name:o.name,ref:u,onCheck:()=>o.onValueChange(a.value),onKeyDown:ft((e=>{"Enter"===e.key&&e.preventDefault()})),onFocus:ft(a.onFocus,(()=>{var e;d.current&&(null===(e=c.current)||void 0===e||e.click())}))})))})),Epe=g.forwardRef(((e,t)=>{const{__scopeRadioGroup:r,...n}=e,a=ZF(r);return g.createElement(gpe,Pe({},a,n,{ref:t}))})),JF=kpe,eU=Spe,Cpe=Epe,Ipe=g.forwardRef((({className:e,...t},r)=>E.jsx(JF,{className:he("grid gap-2",e),...t,ref:r})));Ipe.displayName=JF.displayName;const Ape=g.forwardRef((({className:e,...t},r)=>E.jsx(eU,{ref:r,className:he("aspect-square size-6 rounded-full border border-gray-300 disabled:cursor-not-allowed disabled:border-gray-100 disabled:bg-gray-100","data-[state=checked]:border-blue_100 data-[state=checked]:bg-blue_100 hover:data-[state=checked]:border-blue_120","disabled:data-[state=checked]:border-gray-100 disabled:data-[state=checked]:bg-gray-100","transition-[border] duration-200 hover:data-[state=checked]:bg-blue_120 md:hover:border-2",e),...t,children:E.jsx(Cpe,{className:"flex items-center justify-center",children:E.jsx(VX,{className:"stack-animate size-2 border-none",style:{fill:t.disabled?"var(--gray-300)":"white",color:t.disabled?"var(--gray-300)":"white"}})})})));Ape.displayName=eU.displayName;const Rpe=PA,Tpe=h2,tU=g.forwardRef((({className:e,...t},r)=>E.jsx(j0,{className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r})));tU.displayName=j0.displayName;const Ppe=Yi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),nU=g.forwardRef((({side:e="right",className:t,overlayClassName:r,children:n,...a},o)=>E.jsxs(Tpe,{children:[E.jsx(tU,{className:he("bg-gray-900/70",r)}),E.jsxs(L0,{ref:o,className:he(Ppe({side:e}),t),...a,children:[n,E.jsxs(m2,{className:"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[E.jsx(jv,{className:"h-4 w-4"}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));nU.displayName=L0.displayName;const rU=({className:e,...t})=>E.jsx("div",{className:he("flex flex-col space-y-2 text-center sm:text-left",e),...t});rU.displayName="SheetHeader";const aU=g.forwardRef((({className:e,...t},r)=>E.jsx(Lv,{ref:r,className:he("text-lg font-semibold text-foreground",e),...t})));aU.displayName=Lv.displayName;const oU=g.forwardRef((({className:e,...t},r)=>E.jsx(Vv,{ref:r,className:he("text-sm text-muted-foreground",e),...t})));oU.displayName=Vv.displayName;const[G2,Uot]=as("Tooltip",[U0]),sT=U0(),$pe="TooltipProvider",zpe=700,hI="tooltip.open",[Mpe,iT]=G2($pe),Ope=e=>{const{__scopeTooltip:t,delayDuration:r=zpe,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:o}=e,[i,s]=g.useState(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect((()=>{const e=c.current;return()=>window.clearTimeout(e)}),[]),g.createElement(Mpe,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:g.useCallback((()=>{window.clearTimeout(c.current),s(!1)}),[]),onClose:g.useCallback((()=>{window.clearTimeout(c.current),c.current=window.setTimeout((()=>s(!0)),n)}),[n]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback((e=>{l.current=e}),[]),disableHoverableContent:a},o)},cT="Tooltip",[Npe,rb]=G2(cT),sU=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:s}=e,l=iT(cT,e.__scopeTooltip),c=sT(t),[u,f]=g.useState(null),d=jc(),p=g.useRef(0),h=i??l.disableHoverableContent,m=s??l.delayDuration,y=g.useRef(!1),[v=!1,b]=Yl({prop:n,defaultProp:a,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(hI))):l.onClose(),null==o||o(e)}}),w=g.useMemo((()=>v?y.current?"delayed-open":"instant-open":"closed"),[v]),_=g.useCallback((()=>{window.clearTimeout(p.current),y.current=!1,b(!0)}),[b]),k=g.useCallback((()=>{window.clearTimeout(p.current),b(!1)}),[b]),x=g.useCallback((()=>{window.clearTimeout(p.current),p.current=window.setTimeout((()=>{y.current=!0,b(!0)}),m)}),[m,b]);return g.useEffect((()=>()=>window.clearTimeout(p.current)),[]),g.createElement(SR,c,g.createElement(Npe,{scope:t,contentId:d,open:v,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:g.useCallback((()=>{l.isOpenDelayed?x():_()}),[l.isOpenDelayed,x,_]),onTriggerLeave:g.useCallback((()=>{h?k():window.clearTimeout(p.current)}),[k,h]),onOpen:_,onClose:k,disableHoverableContent:h},r))},kN="TooltipTrigger",iU=g.forwardRef(((e,t)=>{const{__scopeTooltip:r,...n}=e,a=rb(kN,r),o=iT(kN,r),i=sT(r),s=dn(t,g.useRef(null),a.onTriggerChange),l=g.useRef(!1),c=g.useRef(!1),u=g.useCallback((()=>l.current=!1),[]);return g.useEffect((()=>()=>document.removeEventListener("pointerup",u)),[u]),g.createElement(ER,Pe({asChild:!0},i),g.createElement(wt.button,Pe({"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute},n,{ref:s,onPointerMove:ft(e.onPointerMove,(e=>{"touch"!==e.pointerType&&!c.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),c.current=!0)})),onPointerLeave:ft(e.onPointerLeave,(()=>{a.onTriggerLeave(),c.current=!1})),onPointerDown:ft(e.onPointerDown,(()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:ft(e.onFocus,(()=>{l.current||a.onOpen()})),onBlur:ft(e.onBlur,a.onClose),onClick:ft(e.onClick,a.onClose)})))})),cU="TooltipPortal",[Dpe,jpe]=G2(cU,{forceMount:void 0}),Lpe=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,o=rb(cU,t);return g.createElement(Dpe,{scope:t,forceMount:r},g.createElement(ii,{present:r||o.open},g.createElement(u2,{asChild:!0,container:a},n)))},hv="TooltipContent",lU=g.forwardRef(((e,t)=>{const r=jpe(hv,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...o}=e,i=rb(hv,e.__scopeTooltip);return g.createElement(ii,{present:n||i.open},i.disableHoverableContent?g.createElement(uU,Pe({side:a},o,{ref:t})):g.createElement(Vpe,Pe({side:a},o,{ref:t})))})),Vpe=g.forwardRef(((e,t)=>{const r=rb(hv,e.__scopeTooltip),n=iT(hv,e.__scopeTooltip),a=g.useRef(null),o=dn(t,a),[i,s]=g.useState(null),{trigger:l,onClose:c}=r,u=a.current,{onPointerInTransitChange:f}=n,d=g.useCallback((()=>{s(null),f(!1)}),[f]),p=g.useCallback(((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=Wpe([...Upe(n,Fpe(n,r.getBoundingClientRect())),...Gpe(t.getBoundingClientRect())]);s(a),f(!0)}),[f]);return g.useEffect((()=>()=>d()),[d]),g.useEffect((()=>{if(l&&u){const e=e=>p(e,u),t=e=>p(e,l);return l.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[l,u,p,d]),g.useEffect((()=>{if(i){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==l?void 0:l.contains(t))||(null==u?void 0:u.contains(t)),a=!qpe(r,i);n?d():a&&(d(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[l,u,i,c,d]),g.createElement(uU,Pe({},e,{ref:o}))})),[Bpe,Got]=G2(cT,{isInside:!1}),uU=g.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...s}=e,l=rb(hv,r),c=sT(r),{onClose:u}=l;return g.useEffect((()=>(document.addEventListener(hI,u),()=>document.removeEventListener(hI,u))),[u]),g.useEffect((()=>{if(l.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(l.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[l.trigger,u]),g.createElement(l2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:u},g.createElement(CR,Pe({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),g.createElement(CA,null,n),g.createElement(Bpe,{scope:r,isInside:!0},g.createElement(Iue,{id:l.contentId,role:"tooltip"},a||n))))}));function Fpe(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,a,o)){case o:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Upe(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}function Gpe(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function qpe(e,t){const{x:r,y:n}=e;let a=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){const i=t[e].x,s=t[e].y,l=t[o].x,c=t[o].y;s>n!=c>n&&r<(l-i)*(n-s)/(c-s)+i&&(a=!a)}return a}function Wpe(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),Hpe(t)}function Hpe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}const Qpe=sU,Ype=iU,Kpe=Lpe,fU=lU,Xpe=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Zpe={deviceType:Xpe(),deviceWidth:window.innerWidth},dU=ur({name:"ui",initialState:Zpe,reducers:{},extraReducers:e=>{e.addCase(UY,((e,{payload:t})=>{e.deviceType=t})),e.addCase(GY,((e,{payload:t})=>{e.deviceWidth=t}))},selectors:{selectDeviceType:e=>e.deviceType,selectDeviceWidth:e=>e.deviceWidth,selectIsMobile:e=>"mobile"===e.deviceType,selectIsTablet:e=>"tablet"===e.deviceType,selectIsDesktop:e=>"desktop"===e.deviceType}});var aE,xN,oE,SN,sE,EN,iE,CN,cE,IN,lE,AN,uE,RN,fE,TN,dE,PN,pE,$N,hE,zN,mE,MN,gE,ON,yE,NN,vE,DN,bE,jN,_E,LN,wE,VN,kE,BN,xE,FN,SE,UN,EE,GN,CE,qN,IE,WN,AE,HN,RE,QN,TE,YN,PE,KN,$E,XN,zE,ZN,ME,JN,OE,e5,NE,t5,DE,n5,jE,r5,LE,a5,VE,o5,BE,s5,FE,i5,UE,c5,GE,l5;function pU(){if(xN)return aE;xN=1;var e=dL(),t=e&&new e;return aE=t}function hU(){if(SN)return oE;SN=1;var e=eR(),t=pU();return oE=t?function(e,r){return t.set(e,r),e}:e}function q2(){if(EN)return sE;EN=1;var e=C2(),t=Yc();return sE=function(r){return function(){var n=arguments;switch(n.length){case 0:return new r;case 1:return new r(n[0]);case 2:return new r(n[0],n[1]);case 3:return new r(n[0],n[1],n[2]);case 4:return new r(n[0],n[1],n[2],n[3]);case 5:return new r(n[0],n[1],n[2],n[3],n[4]);case 6:return new r(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new r(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var a=e(r.prototype),o=r.apply(a,n);return t(o)?o:a}},sE}function Jpe(){if(CN)return iE;CN=1;var e=q2(),t=os();return iE=function(r,n,a){var o=1&n,i=e(r);return function e(){return(this&&this!==t&&this instanceof e?i:r).apply(o?a:this,arguments)}},iE}function mU(){if(IN)return cE;IN=1;var e=Math.max;return cE=function(t,r,n,a){for(var o=-1,i=t.length,s=n.length,l=-1,c=r.length,u=e(i-s,0),f=Array(c+u),d=!a;++l<c;)f[l]=r[l];for(;++o<s;)(d||o<i)&&(f[n[o]]=t[o]);for(;u--;)f[l++]=t[o++];return f}}function gU(){if(AN)return lE;AN=1;var e=Math.max;return lE=function(t,r,n,a){for(var o=-1,i=t.length,s=-1,l=n.length,c=-1,u=r.length,f=e(i-l,0),d=Array(f+u),p=!a;++o<f;)d[o]=t[o];for(var h=o;++c<u;)d[h+c]=r[c];for(;++s<l;)(p||o<i)&&(d[h+n[s]]=t[o++]);return d}}function ehe(){if(RN)return uE;return RN=1,uE=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}}function lT(){if(TN)return fE;return TN=1,fE=function(){}}function uT(){if(PN)return dE;PN=1;var e=C2(),t=lT();function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}return r.prototype=e(t.prototype),r.prototype.constructor=r,dE=r}function yU(){if($N)return pE;$N=1;var e=pU(),t=gL();return pE=e?function(t){return e.get(t)}:t}function the(){if(zN)return hE;zN=1;return hE={}}function nhe(){if(MN)return mE;MN=1;var e=the(),t=Object.prototype.hasOwnProperty;return mE=function(r){for(var n=r.name+"",a=e[n],o=t.call(e,n)?a.length:0;o--;){var i=a[o],s=i.func;if(null==s||s==r)return i.name}return n}}function vU(){if(ON)return gE;ON=1;var e=C2(),t=lT();function r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}return r.prototype=e(t.prototype),r.prototype.constructor=r,gE=r}function rhe(){if(NN)return yE;NN=1;var e=uT(),t=vU(),r=E2();return yE=function(n){if(n instanceof e)return n.clone();var a=new t(n.__wrapped__,n.__chain__);return a.__actions__=r(n.__actions__),a.__index__=n.__index__,a.__values__=n.__values__,a}}function ahe(){if(DN)return vE;DN=1;var e=uT(),t=vU(),r=lT(),n=As(),a=ci(),o=rhe(),i=Object.prototype.hasOwnProperty;function s(r){if(a(r)&&!n(r)&&!(r instanceof e)){if(r instanceof t)return r;if(i.call(r,"__wrapped__"))return o(r)}return new t(r)}return s.prototype=r.prototype,s.prototype.constructor=s,vE=s}function ohe(){if(jN)return bE;jN=1;var e=uT(),t=yU(),r=nhe(),n=ahe();return bE=function(a){var o=r(a),i=n[o];if("function"!=typeof i||!(o in e.prototype))return!1;if(a===i)return!0;var s=t(i);return!!s&&a===s[0]}}function bU(){if(LN)return _E;LN=1;var e=hU(),t=vL()(e);return _E=t}function she(){if(VN)return wE;VN=1;var e=/\{\n\/\* \[wrapped with (.+)\] \*/,t=/,? & /;return wE=function(r){var n=r.match(e);return n?n[1].split(t):[]}}function ihe(){if(BN)return kE;BN=1;var e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;return kE=function(t,r){var n=r.length;if(!n)return t;var a=n-1;return r[a]=(n>1?"& ":"")+r[a],r=r.join(n>2?", ":" "),t.replace(e,"{\n/* [wrapped with "+r+"] */\n")}}function che(){if(FN)return xE;FN=1;var e=rR(),t=Yre(),r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];return xE=function(n,a){return e(r,(function(e){var r="_."+e[0];a&e[1]&&!t(n,r)&&n.push(r)})),n.sort()}}function _U(){if(UN)return SE;UN=1;var e=she(),t=ihe(),r=bL(),n=che();return SE=function(a,o,i){var s=o+"";return r(a,t(s,n(e(s),i)))}}function wU(){if(GN)return EE;GN=1;var e=ohe(),t=bU(),r=_U();return EE=function(n,a,o,i,s,l,c,u,f,d){var p=8&a;a|=p?32:64,4&(a&=~(p?64:32))||(a&=-4);var h=[n,a,s,p?l:void 0,p?c:void 0,p?void 0:l,p?void 0:c,u,f,d],g=o.apply(void 0,h);return e(n)&&t(g,h),g.placeholder=i,r(g,n,a)}}function kU(){if(qN)return CE;return qN=1,CE=function(e){return e.placeholder}}function lhe(){if(WN)return IE;WN=1;var e=E2(),t=YA(),r=Math.min;return IE=function(n,a){for(var o=n.length,i=r(a.length,o),s=e(n);i--;){var l=a[i];n[i]=t(l,o)?s[l]:void 0}return n}}function fT(){if(HN)return AE;HN=1;var e="__lodash_placeholder__";return AE=function(t,r){for(var n=-1,a=t.length,o=0,i=[];++n<a;){var s=t[n];(s===r||s===e)&&(t[n]=e,i[o++]=n)}return i}}function xU(){if(QN)return RE;QN=1;var e=mU(),t=gU(),r=ehe(),n=q2(),a=wU(),o=kU(),i=lhe(),s=fT(),l=os();return RE=function c(u,f,d,p,h,g,m,y,v,b){var w=128&f,_=1&f,k=2&f,x=24&f,E=512&f,A=k?void 0:n(u);return function S(){for(var C=arguments.length,z=Array(C),I=C;I--;)z[I]=arguments[I];if(x)var j=o(S),P=r(z,j);if(p&&(z=e(z,p,h,x)),g&&(z=t(z,g,m,x)),C-=P,x&&C<b){var T=s(z,j);return a(u,f,c,S.placeholder,d,z,T,y,v,b-C)}var R=_?d:this,N=k?R[u]:u;return C=z.length,y?z=i(z,y):E&&C>1&&z.reverse(),w&&v<C&&(z.length=v),this&&this!==l&&this instanceof S&&(N=A||n(N)),N.apply(R,z)}},RE}function uhe(){if(YN)return TE;YN=1;var e=tR(),t=q2(),r=xU(),n=wU(),a=kU(),o=fT(),i=os();return TE=function(s,l,c){var u=t(s);return function t(){for(var f=arguments.length,d=Array(f),p=f,h=a(t);p--;)d[p]=arguments[p];var g=f<3&&d[0]!==h&&d[f-1]!==h?[]:o(d,h);return(f-=g.length)<c?n(s,l,r,t.placeholder,void 0,d,g,void 0,void 0,c-f):e(this&&this!==i&&this instanceof t?u:s,this,d)}},TE}function fhe(){if(KN)return PE;KN=1;var e=tR(),t=q2(),r=os();return PE=function(n,a,o,i){var s=1&a,l=t(n);return function t(){for(var a=-1,c=arguments.length,u=-1,f=i.length,d=Array(f+c),p=this&&this!==r&&this instanceof t?l:n;++u<f;)d[u]=i[u];for(;c--;)d[u++]=arguments[++a];return e(p,s?o:this,d)}},PE}function dhe(){if(XN)return $E;XN=1;var e=mU(),t=gU(),r=fT(),n="__lodash_placeholder__",a=128,o=Math.min;return $E=function(i,s){var l=i[1],c=s[1],u=l|c,f=u<131,d=c==a&&8==l||c==a&&256==l&&i[7].length<=s[8]||384==c&&s[7].length<=s[8]&&8==l;if(!f&&!d)return i;1&c&&(i[2]=s[2],u|=1&l?0:4);var p=s[3];if(p){var h=i[3];i[3]=h?e(h,p,s[4]):p,i[4]=h?r(i[3],n):s[4]}return(p=s[5])&&(h=i[5],i[5]=h?t(h,p,s[6]):p,i[6]=h?r(i[5],n):s[6]),(p=s[7])&&(i[7]=p),c&a&&(i[8]=null==i[8]?s[8]:o(i[8],s[8])),null==i[9]&&(i[9]=s[9]),i[0]=s[0],i[1]=u,i}}function dT(){if(ZN)return zE;ZN=1;var e=hU(),t=Jpe(),r=uhe(),n=xU(),a=fhe(),o=yU(),i=dhe(),s=bU(),l=_U(),c=xL(),u=Math.max;return zE=function(f,d,p,h,g,m,y,v){var b=2&d;if(!b&&"function"!=typeof f)throw new TypeError("Expected a function");var w=h?h.length:0;if(w||(d&=-97,h=g=void 0),y=void 0===y?y:u(c(y),0),v=void 0===v?v:c(v),w-=g?g.length:0,64&d){var _=h,k=g;h=g=void 0}var x=b?void 0:o(f),E=[f,d,p,h,g,_,k,m,y,v];if(x&&i(E,x),f=E[0],d=E[1],p=E[2],h=E[3],g=E[4],!(v=E[9]=void 0===E[9]?b?0:f.length:u(E[9]-w,0))&&24&d&&(d&=-25),d&&1!=d)A=8==d||16==d?r(f,d,v):32!=d&&33!=d||g.length?n.apply(void 0,E):a(f,d,p,h);else var A=t(f,d,p);return l((x?e:s)(A,E),f,d)}}function phe(){if(JN)return ME;JN=1;var e=dT();return ME=function(t,r,n){return r=n?void 0:r,r=t&&null==r?t.length:r,e(t,128,void 0,void 0,void 0,void 0,r)}}function hhe(){if(e5)return OE;e5=1;var e=IL();return OE=function(t){return e(t,4)}}function mhe(){if(t5)return NE;t5=1;var e=dT();function t(r,n,a){var o=e(r,8,void 0,void 0,void 0,void 0,void 0,n=a?void 0:n);return o.placeholder=t.placeholder,o}return t.placeholder={},NE=t}function ghe(){if(n5)return DE;n5=1;var e=wf(),t=ci(),r=yae();return DE=function(n){if(!t(n))return!1;var a=e(n);return"[object Error]"==a||"[object DOMException]"==a||"string"==typeof n.message&&"string"==typeof n.name&&!r(n)}}function yhe(){if(r5)return jE;r5=1;var e=Gv(),t=ci();return jE=function(r){return t(r)&&"[object WeakMap]"==e(r)}}function vhe(){if(a5)return LE;a5=1;var e=IL(),t=Gre();return LE=function(r){return t("function"==typeof r?r:e(r,1))}}function bhe(){if(o5)return VE;o5=1;var e=dT(),t=jae(),r=t((function(t,r){return e(t,256,void 0,void 0,void 0,r)}));return VE=r}function _he(){if(s5)return BE;s5=1;var e=K7(),t=E2(),r=As(),n=Fv(),a=Y7(),o=Uv(),i=k2();return BE=function(s){return r(s)?e(s,o):n(s)?[s]:t(a(i(s)))}}function whe(){return i5||(i5=1,FE={ary:phe(),assign:EL(),clone:hhe(),curry:mhe(),forEach:rR(),isArray:As(),isError:ghe(),isFunction:y2(),isWeakMap:yhe(),iteratee:vhe(),keys:lL(),rearg:bhe(),toInteger:xL(),toPath:_he()}),FE}function SU(){if(c5)return UE;c5=1;var e=L8(),t=whe();return UE=function(r,n,a){return e(t,r,n,a)}}function khe(){if(l5)return GE;l5=1;var e=SU()("debounce",wL());return e.placeholder=wA(),GE=e}var xhe=khe();const She=tu(xhe);function EU(e,t,r=window){const n=g.useRef(t);g.useEffect((()=>{n.current=t}),[t]),g.useEffect((()=>{if(!r)return;const t=e=>n.current(e);return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}}),[e,r])}const CU=()=>en(dU.selectors.selectIsMobile);function y0({className:e,...t}){return E.jsx("div",{className:he("animate-pulse rounded-md bg-muted",e),...t})}const Ehe="sidebar_state",Che=604800,Ihe="12rem",Ahe="18rem",Rhe="2rem",The="b",IU=g.createContext(null);function W2(){const e=g.useContext(IU);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Phe=g.forwardRef((({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:o,...i},s)=>{const l=CU(),[c,u]=g.useState(!1),[f,d]=g.useState(e),p=t??f,h=g.useCallback((e=>{const t="function"==typeof e?e(p):e;r?r(t):d(t),document.cookie=`${Ehe}=${t}; path=/; max-age=604800`}),[r,p]),m=g.useCallback((()=>l?u((e=>!e)):h((e=>!e))),[l,h,u]);g.useEffect((()=>{const e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[m]);const y=p?"expanded":"collapsed",v=g.useMemo((()=>({state:y,open:p,setOpen:h,isMobile:l,openMobile:c,setOpenMobile:u,toggleSidebar:m})),[y,p,h,l,c,u,m]);return E.jsx(IU.Provider,{value:v,children:E.jsx(Ope,{delayDuration:0,children:E.jsx("div",{style:{"--sidebar-width":Ihe,"--sidebar-width-icon":Rhe,...a},className:he("group/sidebar-wrapper flex min-h-svh w-full bg-gray-100 has-[[data-variant=inset]]:bg-sidebar",n),ref:s,...i,children:o})})})}));Phe.displayName="SidebarProvider";const $he=g.forwardRef((({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...o},i)=>{const{isMobile:s,state:l,openMobile:c,setOpenMobile:u}=W2();return"none"===r?E.jsx("div",{className:he("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:i,...o,children:a}):s?E.jsx(Rpe,{open:c,onOpenChange:u,children:E.jsxs(nU,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ahe},side:e,children:[E.jsxs(rU,{className:"sr-only",children:[E.jsx(aU,{children:"Sidebar"}),E.jsx(oU,{children:"Displays the mobile sidebar."})]}),E.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):E.jsxs("div",{ref:i,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":"collapsed"===l?r:"","data-variant":t,"data-side":e,children:[E.jsx("div",{className:he("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===t||"inset"===t?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),E.jsx("div",{className:he("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===t||"inset"===t?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:E.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-sm group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})}));$he.displayName="Sidebar";const zhe=g.forwardRef((({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a,open:o}=W2();return E.jsx(Gn,{ref:n,"data-sidebar":"trigger",variant:"tertiary",size:"icon_m",className:he("size-6 text-gray-900",e),onClick:e=>{null==t||t(e),a()},...r,children:o?E.jsx(gZ,{size:16}):E.jsx(hZ,{size:16})})}));zhe.displayName="SidebarTrigger";const Mhe=g.forwardRef((({className:e,...t},r)=>{const{toggleSidebar:n}=W2();return E.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:he("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}));Mhe.displayName="SidebarRail";const Ohe=g.forwardRef((({className:e,...t},r)=>E.jsx("main",{ref:r,className:he("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-m md:peer-data-[variant=inset]:shadow",e),...t})));Ohe.displayName="SidebarInset";const Nhe=g.forwardRef((({className:e,...t},r)=>E.jsx(Y0,{ref:r,"data-sidebar":"input",className:he("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t})));Nhe.displayName="SidebarInput";const Dhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"header",className:he("flex flex-col gap-xxs p-xs",e),...t})));Dhe.displayName="SidebarHeader";const jhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"footer",className:he("flex flex-col gap-2 p-2",e),...t})));jhe.displayName="SidebarFooter";const Lhe=g.forwardRef((({className:e,...t},r)=>E.jsx(OR,{ref:r,"data-sidebar":"separator",className:he("mx-2 w-auto bg-sidebar-border",e),...t})));Lhe.displayName="SidebarSeparator";const Vhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"content",className:he("flex min-h-0 flex-1 flex-col gap-xxxs overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})));Vhe.displayName="SidebarContent";const Bhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"group",className:he("relative flex w-full min-w-0 flex-col pt-xs",e),...t})));Bhe.displayName="SidebarGroup";const Fhe=g.forwardRef((({className:e,asChild:t=!1,...r},n)=>{const a=t?Ip:"div";return E.jsx(a,{ref:n,"data-sidebar":"group-label",className:he("flex h-s shrink-0 items-center rounded-md px-xxs py-xxs text-xs font-semibold text-gray-700 opacity-60 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-xl group-data-[collapsible=icon]:opacity-0",e),...r})}));Fhe.displayName="SidebarGroupLabel";const Uhe=g.forwardRef((({className:e,asChild:t=!1,...r},n)=>{const a=t?Ip:"button";return E.jsx(a,{ref:n,"data-sidebar":"group-action",className:he("absolute right-xs top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})}));Uhe.displayName="SidebarGroupAction";const Ghe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"group-content",className:he("w-full text-sm",e),...t})));Ghe.displayName="SidebarGroupContent";const qhe=g.forwardRef((({className:e,...t},r)=>E.jsx("ul",{ref:r,"data-sidebar":"menu",className:he("flex w-full min-w-0 flex-col p-xs font-semibold text-gray-700 [&_svg]:size-4",e),...t})));qhe.displayName="SidebarMenu";const Whe=g.forwardRef((({className:e,...t},r)=>E.jsx("li",{ref:r,"data-sidebar":"menu-item",className:he("group/menu-item relative",e),...t})));Whe.displayName="SidebarMenuItem";const Hhe=Yi("peer/menu-button flex w-full items-center gap-xxs overflow-hidden rounded-sm p-xxs text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:text-blue_100 hover:bg-white focus-visible:ring-2 active:bg-white active:text-blue_100 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-white data-[active=true]:font-medium data-[active=true]:text-blue_100 data-[state=open]:hover:bg-white data-[state=open]:hover:text-blue_100 group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:text-blue_100 hover:bg-white",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-white hover:text-blue_100 hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-s text-sm",sm:"h-m text-xs",lg:"h-l text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Qhe=g.forwardRef((({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:o,...i},s)=>{const l=e?Ip:"button",{isMobile:c,state:u}=W2(),f=E.jsx(l,{ref:s,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:he(Hhe({variant:r,size:n}),o),...i});return a?("string"==typeof a&&(a={children:a}),E.jsxs(sU,{children:[E.jsx(iU,{asChild:!0,children:f}),E.jsx(lU,{side:"right",align:"center",hidden:"collapsed"!==u||c,...a})]})):f}));Qhe.displayName="SidebarMenuButton";const Yhe=g.forwardRef((({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const o=t?Ip:"button";return E.jsx(o,{ref:a,"data-sidebar":"menu-action",className:he("absolute right-xxxs top-xxs flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-xxxs","peer-data-[size=default]/menu-button:top-xxs","peer-data-[size=lg]/menu-button:top-xs","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})}));Yhe.displayName="SidebarMenuAction";const Khe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:he("pointer-events-none absolute right-xxxs flex h-m min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-xxxs","peer-data-[size=default]/menu-button:top-xxs","peer-data-[size=lg]/menu-button:top-xs","group-data-[collapsible=icon]:hidden",e),...t})));Khe.displayName="SidebarMenuBadge";const Xhe=g.forwardRef((({className:e,showIcon:t=!1,...r},n)=>{const a=g.useMemo((()=>`${Math.floor(40*Math.random())+50}%`),[]);return E.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:he("flex h-8 items-center gap-xxs rounded-md px-xxs",e),...r,children:[t&&E.jsx(y0,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),E.jsx(y0,{className:"h-xxxs max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})}));Xhe.displayName="SidebarMenuSkeleton";const Zhe=g.forwardRef((({className:e,...t},r)=>E.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:he("flex min-w-0 translate-x-px flex-col gap-xxxs border-l border-sidebar-border","group-data-[collapsible=icon]:hidden",e),...t})));Zhe.displayName="SidebarMenuSub";const Jhe=g.forwardRef((({...e},t)=>E.jsx("li",{ref:t,...e})));Jhe.displayName="SidebarMenuSubItem";const eme=g.forwardRef((({asChild:e=!1,size:t="md",isActive:r,className:n,...a},o)=>{const i=e?Ip:"a";return E.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:he("flex h-s min-w-0 -translate-x-px items-center gap-xxs overflow-hidden rounded-sm px-xxs text-sm text-gray-700 outline-none ring-sidebar-ring hover:bg-white hover:text-blue_100 focus-visible:ring-2 active:bg-white active:text-blue_100 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-blue_100","data-[active=true]:bg-white data-[active=true]:text-blue_100","sm"===t&&"text-xs","md"===t&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})}));eme.displayName="SidebarMenuSubButton";const AU="Switch",[tme,qot]=as(AU),[nme,rme]=tme(AU),ame=g.forwardRef(((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:o,required:i,disabled:s,value:l="on",onCheckedChange:c,...u}=e,[f,d]=g.useState(null),p=dn(t,(e=>d(e))),h=g.useRef(!1),m=!f||!!f.closest("form"),[y=!1,v]=Yl({prop:a,defaultProp:o,onChange:c});return g.createElement(nme,{scope:r,checked:y,disabled:s},g.createElement(wt.button,Pe({type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":RU(y),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onClick:ft(e.onClick,(e=>{v((e=>!e)),m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())}))})),m&&g.createElement(ime,{control:f,bubbles:!h.current,name:n,value:l,checked:y,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))})),ome="SwitchThumb",sme=g.forwardRef(((e,t)=>{const{__scopeSwitch:r,...n}=e,a=rme(ome,r);return g.createElement(wt.span,Pe({"data-state":RU(a.checked),"data-disabled":a.disabled?"":void 0},n,{ref:t}))})),ime=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,o=g.useRef(null),i=I2(r),s=A2(t);return g.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&a){const t=new Event("click",{bubbles:n});a.call(e,r),e.dispatchEvent(t)}}),[i,r,n]),g.createElement("input",Pe({type:"checkbox","aria-hidden":!0,defaultChecked:r},a,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function RU(e){return e?"checked":"unchecked"}const TU=ame,cme=sme,lme=g.forwardRef((({className:e,...t},r)=>E.jsx(TU,{className:he("group peer inline-flex h-xs w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:bg-blue_100 data-[state=unchecked]:bg-gray-200","disabled:cursor-not-allowed disabled:!bg-gray-100 md:hover:data-[state=checked]:bg-blue_120 md:hover:data-[state=unchecked]:!bg-gray-300",e),...t,ref:r,children:E.jsx(cme,{className:he("pointer-events-none block size-xxs rounded-full bg-background shadow-lg ring-0 transition-[transform,width] data-[state=checked]:translate-x-[20px] data-[state=unchecked]:translate-x-0",{"md:group-hover:w-[26px] md:group-hover:data-[state=checked]:translate-x-[14px]":!t.disabled,"bg-gray-300":t.disabled})})})));lme.displayName=TU.displayName;const PU=(e,t,{skipParams:r=!1}={})=>{const{props:n,params:a}=Object.keys(t).reduce(((r,n)=>(e.includes(`:${n}`)?r.props[n]=t[n]:r.params.set(n,t[n]),r)),{props:{},params:new URLSearchParams}),o=Object.keys(n).reduce(((e,t)=>{const r=new RegExp(`/:${t}\\?`,"g");return(e=e.replace(r,`/${n[t]}`)).replace(new RegExp(`:${t}`,"g"),n[t])}),e).replace(/\/:[^/]+?\?/g,"");return a.toString()&&!r?`${o}?${a.toString()}`:o},ume=e=>e&&da.values(e).length?"?"+new URLSearchParams(e).toString():"",u5={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!n2.getToken(),isAuthenticated:!1,isAskLoginOpen:!1},Hi=ur({name:"auth",initialState:u5,reducers:{setAskLoginOpen:(e,t)=>{e.isAskLoginOpen=t.payload},login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload||null,e.isPending=!1},logout:()=>({...u5,isPending:!1}),setNewEmail:(e,t)=>{e.newEmail=t.payload},setForgotPasswordStep:(e,t)=>{e.forgotPasswordStep=t.payload},updateForgotPasswordFields:(e,t)=>{e.forgotPasswordFields={...e.forgotPasswordFields,...t.payload}},resetForgotPasswordFields:e=>{e.forgotPasswordFields=null},setSignupStep:(e,t)=>{e.signupStep=t.payload},updateSignupFields:(e,t)=>{e.signupFields={...e.signupFields,...t.payload}},resetSignupFields:e=>{e.signupFields=null},setPending:(e,t)=>{e.isPending=t.payload}},selectors:{selectAskLoginOpen:e=>e.isAskLoginOpen,selectToken:e=>e.token,selectNewEmail:e=>e.newEmail,selectForgotPasswordStep:e=>e.forgotPasswordStep,selectForgotPasswordFields:e=>e.forgotPasswordFields,selectSignupStep:e=>e.signupStep,selectSignupFields:e=>e.signupFields,selectPending:e=>e.isPending,selectIsAuthenticated:e=>e.isAuthenticated}}),fme={data:null,isPending:!1,isSuccess:!1},Xo=ur({name:"userNoHTML",initialState:fme,reducers:{setUser:(e,t)=>{e.data=t.payload},setPending:(e,t)=>{e.isPending=t.payload},setSuccess:(e,{payload:t})=>{e.isSuccess=t},setError:(e,{payload:t})=>{e.error=t}},selectors:{selectUser:e=>e.data,selectPending:e=>e.isPending,selectError:e=>e.error,selectSuccess:e=>e.isSuccess}}),f5={data:null,isError:!1,isPending:!1,isSuccess:!1},Hl=ur({name:"user",initialState:f5,reducers:{reset:e=>{Object.assign(e,f5)}},extraReducers:e=>{e.addCase(m8,((e,{payload:t})=>{e.data=t})).addCase(g8,((e,{payload:t})=>{e.data&&Object.assign(e.data,t||{})})).addCase(TC,((e,{payload:t})=>{e.isSuccess=t})).addCase(RC,((e,{payload:t})=>{e.isPending=t})).addCase(h8,((e,{payload:t})=>{e.isError=t})).addCase(p8,((e,{payload:t})=>{e.error=t})).addCase(qY,((e,{payload:t})=>{var r;null!=(r=e.data)&&r.users&&(e.data.users=e.data.users.map((e=>t.id===e.id?t:e)))}))},selectors:{selectIsError:e=>e.isError,selectError:e=>e.error,selectPending:e=>e.isPending,selectData:e=>e.data,selectAccount:e=>{var t;return null==(t=e.data)?void 0:t.account},selectAccountId:e=>{var t;return null==(t=e.data)?void 0:t.account.id},selectUsers:e=>{var t;return null==(t=e.data)?void 0:t.users},selectUserById:(e,t)=>{var r;return null==(r=e.data)?void 0:r.users.find((({id:e})=>e===t))},selectCurrentUser:e=>{var t;return null==(t=e.data)?void 0:t.users.find((({id:t})=>{var r;return t===(null==(r=e.data)?void 0:r.selectedUserId)}))},selectSelectedUserId:e=>{var t;return null==(t=e.data)?void 0:t.selectedUserId},selectSuccess:e=>e.isSuccess}});var Oj;const dme={value:(null==(Oj=bA())?void 0:Oj.initialState)??null},pme=ur({name:"initialState",initialState:dme,reducers:{setInitialState:(e,t)=>{e.value=t.payload},clearInitialState:e=>{e.value=null}},selectors:{selectInitialState:e=>e.value}}),pT=e=>e,H2=zr(pT,(e=>e.data)),hme=zr(pT,(e=>e.error)),mme=zr(pT,(e=>e.isPending)),gme=zr(H2,(e=>null==e?void 0:e.rules)),yme=zr(H2,(e=>null==e?void 0:e.contact_account)),vme=zr(H2,(e=>(null==e?void 0:e.stats)&&Object.fromEntries(Object.entries(e.stats).map((([e,t])=>[e,t??0]))))),bme={data:null,isPending:!1},_me=ur({name:"instanceInfo",initialState:bme,reducers:{},extraReducers:e=>{e.addCase(S8,((e,{payload:t})=>{e.data=t})).addCase(zC,((e,{payload:t})=>{e.isPending=t})).addCase(E8,((e,{payload:t})=>{e.error=t}))},selectors:{selectInstanceInfo:H2,selectInstanceInfoError:hme,selectInstanceInfoPending:mme,selectPlatformRules:gme,selectInstanceContacts:yme,selectInstanceStats:vme,selectDescription:e=>{var t;return null==(t=e.data)?void 0:t.description},selectStats:e=>{var t;return null==(t=e.data)?void 0:t.stats},selectRegistrations:e=>{var t;return null==(t=e.data)?void 0:t.configuration.registrations}}}),wme={data:null,isPending:!1,isSuccess:!1},kme=ur({name:"profileSettings",initialState:wme,reducers:{setPending:(e,t)=>{e.isPending=t.payload},setSuccess:(e,{payload:t})=>{e.isSuccess=t},setError:(e,{payload:t})=>{e.error=t}},extraReducers:e=>{e.addCase(D_,((e,{payload:t})=>{e.data=t}))},selectors:{selectProfileSettings:e=>e.data,selectPending:e=>e.isPending,selectError:e=>e.error,selectSuccess:e=>e.isSuccess}}),xme={sms:"wellesley.admin.sms",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},xw={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},ql=e=>(null==e?void 0:e.map((e=>e.value||e)))||[],Sme={data:null,isPending:!1},{posts:qE,uploadsPolicyDoc:d5,uploadsPolicyAudio:WE,uploadsPolicyImage:h_,uploadsPolicyVideo:ay,registration:$U,captcha:Eme,instanceAdmin:Cme,branding:Ime,translation:Ame,domainBlocks:Rme,access:Tme}=xw,{captcha:Pme,language:$me,translation:zme,openai:Mme,link_service:Ome}=xme,$m=e=>e.data,Nme=zr($m,(e=>{var t,r,n;return{max_characters:(null==(t=null==e?void 0:e[qE])?void 0:t.max_characters)||0,max_media_attachments:(null==(r=null==e?void 0:e[qE])?void 0:r.max_media_attachments)||0,max_pins:(null==(n=null==e?void 0:e[qE])?void 0:n.max_pins)||0}})),hT=zr($m,(e=>{var t,r,n;return{...null==e?void 0:e[h_],maxSize:(null==(t=null==e?void 0:e[h_])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[h_])?void 0:r.maxMatrix)||0,maxResolution:(null==(n=null==e?void 0:e[h_])?void 0:n.maxResolution)||0}})),Dme=zr(hT,(e=>ql(e.extensions))),mT=zr($m,(e=>{var t,r,n,a;return{...null==e?void 0:e[ay],maxSize:(null==(t=null==e?void 0:e[ay])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[ay])?void 0:r.maxMatrix)||0,maxDuration:(null==(n=null==e?void 0:e[ay])?void 0:n.maxDuration)||0,maxResolution:(null==(a=null==e?void 0:e[ay])?void 0:a.maxResolution)||0}})),jme=zr(mT,(e=>ql(e.extensions))),zU=zr($m,(e=>{var t,r;return{...null==e?void 0:e[WE],maxSize:null==(t=null==e?void 0:e[WE])?void 0:t.maxSize,keepOriginal:(null==(r=null==e?void 0:e[WE])?void 0:r.keepOriginal)||0}})),MU=zr($m,(e=>{var t;return{...null==e?void 0:e[d5],maxSize:(null==(t=null==e?void 0:e[d5])?void 0:t.maxSize)||0}})),OU=zr([hT,mT,zU,MU],((e,t,r,n)=>({IMAGE:ql(null==e?void 0:e.extensions),VIDEO:ql(null==t?void 0:t.extensions),AUDIO:ql(null==r?void 0:r.extensions),DOCUMENT:ql(null==n?void 0:n.extensions)}))),Lme=zr(OU,(e=>Object.keys(e).reduce(((t,r)=>[...t,...e[r]||[]]),[]))),Vme=zr($m,(e=>{var t;return null==(t=null==e?void 0:e[$U])?void 0:t.invites})),Nc=ur({name:"platformSettings",initialState:Sme,reducers:{setError:(e,t)=>{e.error=t.payload},setPending:(e,t)=>{e.isPending=t.payload}},extraReducers:e=>{e.addCase(MC,((e,{payload:t})=>{e.data={...e.data,...t}}))},selectors:{selectSettings:$m,selectPostConfig:Nme,selectDocPolicy:MU,selectImagePolicy:hT,selectVideoPolicy:mT,selectAudioPolicy:zU,selectInvitesEnabled:Vme,selectImageExtensions:Dme,selectVideoExtensions:jme,selectSupportedExtensions:OU,selectFullExtensionsList:Lme,selectRegistration:e=>{var t;return null==(t=e.data)?void 0:t[$U]},selectLanguageDetection:e=>{var t;return null==(t=e.data)?void 0:t[$me]},selectLanguageTranslation:e=>{var t;return null==(t=e.data)?void 0:t[zme]},selectOpenai:e=>{var t;return null==(t=e.data)?void 0:t[Mme]},selectCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[Eme]},selectAdminCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[Pme]},selectPlatformTranslation:e=>{var t;return null==(t=e.data)?void 0:t[Ame]},selectAccess:e=>{var t;return null==(t=e.data)?void 0:t[Tme]},selectBranding:e=>{var t;return null==(t=e.data)?void 0:t[Ime]},selectLinkService:e=>{var t;return null==(t=e.data)?void 0:t[Ome]},selectInstanceAdmin:e=>{var t;return null==(t=e.data)?void 0:t[Cme]},selectLegal:e=>{var t;return null==(t=e.data)?void 0:t[xw.legal]},selectDomainBlocks:e=>{var t;return null==(t=e.data)?void 0:t[Rme]},selectContacts:e=>{var t;return null==(t=e.data)?void 0:t[xw.contacts]}}}),p5={data:{userId:"",list:[]},count:{},isPending:!1},Bme=e=>e,Fme=e=>e.error,Ume=e=>e.isPending,Gme=e=>{var t;return null==(t=e.count)?void 0:t.total},qme=e=>{var t;return null==(t=e.count)?void 0:t.unread},Wme=e=>e.data.userId,gT=zr(Bme,(e=>e.data.list)),Hme=zr(gT,(e=>null==e?void 0:e.filter((e=>"UNREAD"===e.status)))),Qme=zr(gT,(e=>null==e?void 0:e.at(-1))),A0=ur({name:"notifications",initialState:p5,reducers:{updateNotification:(e,t)=>{var r;if(!e.data.list)return;const n=t.payload;e.data.list=null==(r=e.data.list)?void 0:r.map((e=>e.id===n.id?{...e,...n}:e))},readAll:e=>{var t;e.data.list&&(e.data.list=null==(t=e.data.list)?void 0:t.map((e=>({...e,status:"READ"}))))}},extraReducers:e=>{e.addCase(PC,((e,t)=>{e.isPending=t.payload})).addCase(b8,((e,t)=>{e.error=t.payload})).addCase(_8,((e,t)=>{const r=t.payload.userId,n=t.payload.list;e.data={userId:r,list:[...e.data.list||[],...n.filter((t=>{var r;return!(null!=(r=e.data.list)&&r.some((e=>e.id===t.id)))}))]}})).addCase(y8,((e,t)=>{e.count.unread=(e.count.unread||0)+1,e.data.list&&(e.data.list=[t.payload,...e.data.list||[]])})).addCase(v8,((e,t)=>{e.data.list&&(e.data.list=e.data.list.map((e=>e.id===t.payload.id?{...e,status:t.payload.status}:e)))})).addCase(w8,((e,t)=>{e.count.total=t.payload})).addCase($C,((e,t)=>{e.count.unread=t.payload})).addCase(k8,(()=>p5)).addCase(x8,((e,t)=>{var r,n,a;const o=t.payload;"UNREAD"===(null==(n=null==(r=e.data.list)?void 0:r.find((e=>e.id===o)))?void 0:n.status)&&e.count.unread&&(e.count.unread-=1),e.data.list=(null==(a=e.data.list)?void 0:a.filter((e=>e.id!==o)))||[]})).addCase(WY,(e=>{e.data.list&&(e.data.list=e.data.list.map((e=>"FOLLOW_REQUEST"===e.type?{...e,followResponse:"Accepted"}:e)))}))},selectors:{selectError:Fme,selectIsPending:Ume,selectTotalCount:Gme,selectUnreadCount:qme,selectNotifications:gT,selectUnreadNotifications:Hme,selectLastNotification:Qme,selectNotificationsOwner:Wme}});function Yme(){return!(typeof navigator<"u"&&"boolean"==typeof navigator.onLine)||navigator.onLine}const Kme={isOnline:Yme()},Xme=ur({name:"network",initialState:Kme,reducers:{setOnline:(e,{payload:t})=>{e.isOnline=t}},selectors:{selectOnline:e=>e.isOnline}}),Rp=RQ(lr,Xme,dU,Hi,Hl,Xo,pme,_me,A0,kme,Nc);kr("app/hydrate");const yT=()=>window._wlsy_store,NU=(e,t)=>(null!=t&&t.props&&!da.isNumber(e)?PU(e,null==t?void 0:t.props):e)+ume(null==t?void 0:t.queryParams),Zme=e=>!(null==e||!e.target);function mI(e,t){const r=NU(e,t);if(Zme(t)&&"_blank"===t.target){const{origin:e}=new URL(document.referrer||window.location.origin),t=r.includes("://")?r:e+r;window.open(t,"_blank")}else yT().dispatch(u8(r))}const vT=()=>mI,Bc=({to:e,props:t,children:r,target:n,queryParams:a,className:o,disabled:i,onClick:s,...l})=>{const c=vT(),u=NU(e,{queryParams:a,props:t}),{baseUrl:f}=a2.get(),d=n?u:`${f}${u}`;return E.jsx("a",{href:d,target:n,onClick:r=>{r.preventDefault(),!i&&(null==s||s(r),c(e,{queryParams:a,props:t,target:r.ctrlKey||r.metaKey?"_blank":n}))},className:o,...l,children:r})};
87
+ */function Jne(){if(K$)return Rn;K$=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case n:case o:case a:case u:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case c:case p:case d:case i:return e;default:return h}}case r:return h}}}return e=Symbol.for("react.module.reference"),Rn.ContextConsumer=s,Rn.ContextProvider=i,Rn.Element=t,Rn.ForwardRef=c,Rn.Fragment=n,Rn.Lazy=p,Rn.Memo=d,Rn.Portal=r,Rn.Profiler=o,Rn.StrictMode=a,Rn.Suspense=u,Rn.SuspenseList=f,Rn.isAsyncMode=function(){return!1},Rn.isConcurrentMode=function(){return!1},Rn.isContextConsumer=function(e){return g(e)===s},Rn.isContextProvider=function(e){return g(e)===i},Rn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Rn.isForwardRef=function(e){return g(e)===c},Rn.isFragment=function(e){return g(e)===n},Rn.isLazy=function(e){return g(e)===p},Rn.isMemo=function(e){return g(e)===d},Rn.isPortal=function(e){return g(e)===r},Rn.isProfiler=function(e){return g(e)===o},Rn.isStrictMode=function(e){return g(e)===a},Rn.isSuspense=function(e){return g(e)===u},Rn.isSuspenseList=function(e){return g(e)===f},Rn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===o||t===a||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===i||t.$$typeof===s||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},Rn.typeOf=g,Rn}function ere(){return X$||(X$=1,w6.exports=Jne()),w6.exports}function eL(){if(Z$)return k6;Z$=1;var e=wf(),t=ci();return k6=function(r){return"number"==typeof r||t(r)&&"[object Number]"==e(r)}}function tre(){if(J$)return x6;J$=1;var e=eL();return x6=function(t){return e(t)&&t!=+t}}ere(),tre(),eL();var E6,ez,C6,tz,I6,nz,A6,rz,R6,az,T6,oz,P6,sz,$6,iz,z6,cz,M6,lz,O6,uz,N6,fz,D6,dz,j6,pz,L6,hz,V6,mz,B6,gz,F6,yz,U6,vz,G6,bz,q6,_z,W6,wz,H6,kz,Q6,xz,Y6,Sz,K6,Ez,X6,Cz,Z6,Iz,J6,Az,eS,Rz,tS,Tz,nS,Pz,n_=function(e){return Zne(e)&&e.indexOf("%")===e.length-1},nre=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},S6=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a]};function rre(){if(ez)return E6;return ez=1,E6=function(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(a);++n<a;)o[n]=e[n+t];return o}}function are(){if(tz)return C6;tz=1;var e=rre();return C6=function(t,r,n){var a=t.length;return n=void 0===n?a:n,!r&&n>=a?t:e(t,r,n)}}function tL(){if(nz)return I6;nz=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return I6=function(t){return e.test(t)}}function ore(){if(rz)return A6;return rz=1,A6=function(e){return e.split("")}}function sre(){if(az)return R6;az=1;var e="\\ud800-\\udfff",t="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",a="[^"+e+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",i="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+r+"|"+n+")"+"?",l="[\\ufe0e\\ufe0f]?",c=l+s+("(?:\\u200d(?:"+[a,o,i].join("|")+")"+l+s+")*"),u="(?:"+[a+r+"?",r,o,i,t].join("|")+")",f=RegExp(n+"(?="+n+")|"+u+c,"g");return R6=function(e){return e.match(f)||[]}}function ire(){if(oz)return T6;oz=1;var e=ore(),t=tL(),r=sre();return T6=function(n){return t(n)?r(n):e(n)}}function cre(){if(sz)return P6;sz=1;var e=are(),t=tL(),r=ire(),n=k2();return P6=function(a){return function(o){o=n(o);var i=t(o)?r(o):void 0,s=i?i[0]:o.charAt(0),l=i?e(i,1).join(""):o.slice(1);return s[a]()+l}}}function lre(){if(iz)return $6;iz=1;var e=cre()("toUpperCase");return $6=e}function ure(){if(cz)return z6;cz=1;var e=_2();return z6=function(){this.__data__=new e,this.size=0}}function fre(){if(lz)return M6;return lz=1,M6=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}}function dre(){if(uz)return O6;return uz=1,O6=function(e){return this.__data__.get(e)}}function pre(){if(fz)return N6;return fz=1,N6=function(e){return this.__data__.has(e)}}function hre(){if(dz)return D6;dz=1;var e=_2(),t=FA(),r=UA();return D6=function(n,a){var o=this.__data__;if(o instanceof e){var i=o.__data__;if(!t||i.length<199)return i.push([n,a]),this.size=++o.size,this;o=this.__data__=new r(i)}return o.set(n,a),this.size=o.size,this}}function GA(){if(pz)return j6;pz=1;var e=_2(),t=ure(),r=fre(),n=dre(),a=pre(),o=hre();function i(t){var r=this.__data__=new e(t);this.size=r.size}return i.prototype.clear=t,i.prototype.delete=r,i.prototype.get=n,i.prototype.has=a,i.prototype.set=o,j6=i}function mre(){if(hz)return L6;hz=1;return L6=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}function gre(){if(mz)return V6;return mz=1,V6=function(e){return this.__data__.has(e)}}function yre(){if(gz)return B6;gz=1;var e=UA(),t=mre(),r=gre();function n(t){var r=-1,n=null==t?0:t.length;for(this.__data__=new e;++r<n;)this.add(t[r])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,B6=n}function vre(){if(yz)return F6;return yz=1,F6=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}}function bre(){if(vz)return U6;return vz=1,U6=function(e,t){return e.has(t)}}function nL(){if(bz)return G6;bz=1;var e=yre(),t=vre(),r=bre();return G6=function(n,a,o,i,s,l){var c=1&o,u=n.length,f=a.length;if(u!=f&&!(c&&f>u))return!1;var d=l.get(n),p=l.get(a);if(d&&p)return d==a&&p==n;var h=-1,g=!0,m=2&o?new e:void 0;for(l.set(n,a),l.set(a,n);++h<u;){var y=n[h],v=a[h];if(i)var b=c?i(v,y,h,a,n,l):i(y,v,h,n,a,l);if(void 0!==b){if(b)continue;g=!1;break}if(m){if(!t(a,(function(e,t){if(!r(m,t)&&(y===e||s(y,e,o,i,l)))return m.push(t)}))){g=!1;break}}else if(y!==v&&!s(y,v,o,i,l)){g=!1;break}}return l.delete(n),l.delete(a),g}}function rL(){if(_z)return q6;_z=1;var e=os().Uint8Array;return q6=e}function _re(){if(wz)return W6;return wz=1,W6=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}}function wre(){if(kz)return H6;return kz=1,H6=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}}function kre(){if(xz)return Q6;xz=1;var e=V0(),t=rL(),r=BA(),n=nL(),a=_re(),o=wre(),i=e?e.prototype:void 0,s=i?i.valueOf:void 0;return Q6=function(e,i,l,c,u,f,d){switch(l){case"[object DataView]":if(e.byteLength!=i.byteLength||e.byteOffset!=i.byteOffset)return!1;e=e.buffer,i=i.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=i.byteLength||!f(new t(e),new t(i)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+i);case"[object Error]":return e.name==i.name&&e.message==i.message;case"[object RegExp]":case"[object String]":return e==i+"";case"[object Map]":var p=a;case"[object Set]":var h=1&c;if(p||(p=o),e.size!=i.size&&!h)return!1;var g=d.get(e);if(g)return g==i;c|=2,d.set(e,i);var m=n(p(e),p(i),c,u,f,d);return d.delete(e),m;case"[object Symbol]":if(s)return s.call(e)==s.call(i)}return!1}}function qA(){if(Sz)return Y6;return Sz=1,Y6=function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}}function aL(){if(Ez)return K6;Ez=1;var e=qA(),t=As();return K6=function(r,n,a){var o=n(r);return t(r)?o:e(o,a(r))}}function xre(){if(Cz)return X6;return Cz=1,X6=function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,o=[];++r<n;){var i=e[r];t(i,r,e)&&(o[a++]=i)}return o}}function oL(){if(Iz)return Z6;return Iz=1,Z6=function(){return[]}}function WA(){if(Az)return J6;Az=1;var e=xre(),t=oL(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return J6=n?function(t){return null==t?[]:(t=Object(t),e(n(t),(function(e){return r.call(t,e)})))}:t}function Sre(){if(Rz)return eS;return Rz=1,eS=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}}function Ere(){if(Tz)return tS;Tz=1;var e=wf(),t=ci();return tS=function(r){return t(r)&&"[object Arguments]"==e(r)}}function HA(){if(Pz)return nS;Pz=1;var e=Ere(),t=ci(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(e){return t(e)&&n.call(e,"callee")&&!a.call(e,"callee")};return nS=o}var rS,$z,zz,aS,Mz,oS,Oz,sS,Nz,iS,Dz,ky={exports:{}};function Cre(){if($z)return rS;return $z=1,rS=function(){return!1}}function QA(){return zz||(zz=1,e=ky,t=ky.exports,r=os(),n=Cre(),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,i=o&&o.exports===a?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||n,e.exports=s),ky.exports;var e,t,r,n,a,o,i,s}function YA(){if(Mz)return aS;Mz=1;var e=/^(?:0|[1-9]\d*)$/;return aS=function(t,r){var n=typeof t;return!!(r=r??9007199254740991)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}}function KA(){if(Oz)return oS;Oz=1;return oS=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}function Ire(){if(Nz)return sS;Nz=1;var e=wf(),t=KA(),r=ci(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,sS=function(a){return r(a)&&t(a.length)&&!!n[e(a)]}}function XA(){if(Dz)return iS;return Dz=1,iS=function(e){return function(t){return e(t)}}}ky.exports;var jz,cS,Lz,lS,Vz,uS,Bz,fS,Fz,dS,Uz,pS,Gz,hS,qz,mS,Wz,gS,Hz,yS,Qz,vS,Yz,bS,Kz,_S,Xz,wS,Zz,kS,Jz,xS,eM,SS,tM,ES,nM,CS,rM,IS,aM,AS,oM,RS,sM,TS,iM,PS,cM,$S,lM,zS,uM,MS,fM,OS,dM,NS,pM,DS,hM,jS,mM,LS,gM,VS,yM,BS,vM,FS,bM,US,_M,GS,wM,qS,kM,WS,xM,HS,SM,QS,EM,YS,CM,KS,IM,XS,AM,ZS,RM,JS,TM,e4,PM,t4,$M,n4,zM,r4,MM,a4,OM,o4,NM,xy={exports:{}};function ZA(){return jz||(jz=1,e=xy,t=xy.exports,r=H7(),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,o=a&&a.exports===n&&r.process,i=function(){try{return a&&a.require&&a.require("util").types||o&&o.binding&&o.binding("util")}catch{}}(),e.exports=i),xy.exports;var e,t,r,n,a,o,i}function sL(){if(Lz)return cS;Lz=1;var e=Ire(),t=XA(),r=ZA(),n=r&&r.isTypedArray,a=n?t(n):e;return cS=a}function iL(){if(Vz)return lS;Vz=1;var e=Sre(),t=HA(),r=As(),n=QA(),a=YA(),o=sL(),i=Object.prototype.hasOwnProperty;return lS=function(s,l){var c=r(s),u=!c&&t(s),f=!c&&!u&&n(s),d=!c&&!u&&!f&&o(s),p=c||u||f||d,h=p?e(s.length,String):[],g=h.length;for(var m in s)(l||i.call(s,m))&&(!p||!("length"==m||f&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&h.push(m);return h}}function JA(){if(Bz)return uS;Bz=1;var e=Object.prototype;return uS=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}}function cL(){if(Fz)return fS;return Fz=1,fS=function(e,t){return function(r){return e(t(r))}}}function Are(){if(Uz)return dS;Uz=1;var e=cL()(Object.keys,Object);return dS=e}function lL(){if(Gz)return pS;Gz=1;var e=JA(),t=Are(),r=Object.prototype.hasOwnProperty;return pS=function(n){if(!e(n))return t(n);var a=[];for(var o in Object(n))r.call(n,o)&&"constructor"!=o&&a.push(o);return a}}function uL(){if(qz)return hS;qz=1;var e=y2(),t=KA();return hS=function(r){return null!=r&&t(r.length)&&!e(r)}}function x2(){if(Wz)return mS;Wz=1;var e=iL(),t=lL(),r=uL();return mS=function(n){return r(n)?e(n):t(n)}}function fL(){if(Hz)return gS;Hz=1;var e=aL(),t=WA(),r=x2();return gS=function(n){return e(n,r,t)}}function Rre(){if(Qz)return yS;Qz=1;var e=fL(),t=Object.prototype.hasOwnProperty;return yS=function(r,n,a,o,i,s){var l=1&a,c=e(r),u=c.length;if(u!=e(n).length&&!l)return!1;for(var f=u;f--;){var d=c[f];if(!(l?d in n:t.call(n,d)))return!1}var p=s.get(r),h=s.get(n);if(p&&h)return p==n&&h==r;var g=!0;s.set(r,n),s.set(n,r);for(var m=l;++f<u;){var y=r[d=c[f]],v=n[d];if(o)var b=l?o(v,y,d,n,r,s):o(y,v,d,r,n,s);if(!(void 0===b?y===v||i(y,v,a,o,s):b)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var w=r.constructor,_=n.constructor;w!=_&&"constructor"in r&&"constructor"in n&&!("function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _)&&(g=!1)}return s.delete(r),s.delete(n),g}}function Tre(){if(Yz)return vS;Yz=1;var e=Em()(os(),"DataView");return vS=e}function Pre(){if(Kz)return bS;Kz=1;var e=Em()(os(),"Promise");return bS=e}function $re(){if(Xz)return _S;Xz=1;var e=Em()(os(),"Set");return _S=e}function dL(){if(Zz)return wS;Zz=1;var e=Em()(os(),"WeakMap");return wS=e}function Gv(){if(Jz)return kS;Jz=1;var e=Tre(),t=FA(),r=Pre(),n=$re(),a=dL(),o=wf(),i=Q7(),s="[object Map]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",f="[object DataView]",d=i(e),p=i(t),h=i(r),g=i(n),m=i(a),y=o;return(e&&y(new e(new ArrayBuffer(1)))!=f||t&&y(new t)!=s||r&&y(r.resolve())!=l||n&&y(new n)!=c||a&&y(new a)!=u)&&(y=function(e){var t=o(e),r="[object Object]"==t?e.constructor:void 0,n=r?i(r):"";if(n)switch(n){case d:return f;case p:return s;case h:return l;case g:return c;case m:return u}return t}),kS=y}function zre(){if(eM)return xS;eM=1;var e=GA(),t=nL(),r=kre(),n=Rre(),a=Gv(),o=As(),i=QA(),s=sL(),l="[object Arguments]",c="[object Array]",u="[object Object]",f=Object.prototype.hasOwnProperty;return xS=function(d,p,h,g,m,y){var v=o(d),b=o(p),w=v?c:a(d),_=b?c:a(p),k=(w=w==l?u:w)==u,x=(_=_==l?u:_)==u,E=w==_;if(E&&i(d)){if(!i(p))return!1;v=!0,k=!1}if(E&&!k)return y||(y=new e),v||s(d)?t(d,p,h,g,m,y):r(d,p,w,h,g,m,y);if(!(1&h)){var A=k&&f.call(d,"__wrapped__"),S=x&&f.call(p,"__wrapped__");if(A||S){var C=A?d.value():d,z=S?p.value():p;return y||(y=new e),m(C,z,h,g,y)}}return!!E&&(y||(y=new e),n(d,p,h,g,m,y))}}function pL(){if(tM)return SS;tM=1;var e=zre(),t=ci();return SS=function r(n,a,o,i,s){return n===a||(null==n||null==a||!t(n)&&!t(a)?n!=n&&a!=a:e(n,a,o,i,r,s))},SS}function Mre(){if(nM)return ES;nM=1;var e=GA(),t=pL();return ES=function(r,n,a,o){var i=a.length,s=i,l=!o;if(null==r)return!s;for(r=Object(r);i--;){var c=a[i];if(l&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++i<s;){var u=(c=a[i])[0],f=r[u],d=c[1];if(l&&c[2]){if(void 0===f&&!(u in r))return!1}else{var p=new e;if(o)var h=o(f,d,u,r,n,p);if(!(void 0===h?t(d,f,3,o,p):h))return!1}}return!0}}function hL(){if(rM)return CS;rM=1;var e=Yc();return CS=function(t){return t==t&&!e(t)}}function Ore(){if(aM)return IS;aM=1;var e=hL(),t=x2();return IS=function(r){for(var n=t(r),a=n.length;a--;){var o=n[a],i=r[o];n[a]=[o,i,e(i)]}return n}}function mL(){if(oM)return AS;return oM=1,AS=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}}function Nre(){if(sM)return RS;sM=1;var e=Mre(),t=Ore(),r=mL();return RS=function(n){var a=t(n);return 1==a.length&&a[0][2]?r(a[0][0],a[0][1]):function(t){return t===n||e(t,n,a)}}}function Dre(){if(iM)return TS;return iM=1,TS=function(e,t){return null!=e&&t in Object(e)}}function jre(){if(cM)return PS;cM=1;var e=X7(),t=HA(),r=As(),n=YA(),a=KA(),o=Uv();return PS=function(i,s,l){for(var c=-1,u=(s=e(s,i)).length,f=!1;++c<u;){var d=o(s[c]);if(!(f=null!=i&&l(i,d)))break;i=i[d]}return f||++c!=u?f:!!(u=null==i?0:i.length)&&a(u)&&n(d,u)&&(r(i)||t(i))}}function Lre(){if(lM)return $S;lM=1;var e=Dre(),t=jre();return $S=function(r,n){return null!=r&&t(r,n,e)}}function Vre(){if(uM)return zS;uM=1;var e=pL(),t=J7(),r=Lre(),n=VA(),a=hL(),o=mL(),i=Uv();return zS=function(s,l){return n(s)&&a(l)?o(i(s),l):function(n){var a=t(n,s);return void 0===a&&a===l?r(n,s):e(l,a,3)}}}function eR(){if(fM)return MS;return fM=1,MS=function(e){return e}}function Bre(){if(dM)return OS;return dM=1,OS=function(e){return function(t){return null==t?void 0:t[e]}}}function Fre(){if(pM)return NS;pM=1;var e=Z7();return NS=function(t){return function(r){return e(r,t)}}}function Ure(){if(hM)return DS;hM=1;var e=Bre(),t=Fre(),r=VA(),n=Uv();return DS=function(a){return r(a)?e(n(a)):t(a)}}function Gre(){if(mM)return jS;mM=1;var e=Nre(),t=Vre(),r=eR(),n=As(),a=Ure();return jS=function(o){return"function"==typeof o?o:null==o?r:"object"==typeof o?n(o)?t(o[0],o[1]):e(o):a(o)}}function qre(){if(gM)return LS;return gM=1,LS=function(e,t,r,n){for(var a=e.length,o=r+(n?1:-1);n?o--:++o<a;)if(t(e[o],o,e))return o;return-1}}function Wre(){if(yM)return VS;return yM=1,VS=function(e){return e!=e}}function Hre(){if(vM)return BS;return vM=1,BS=function(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}}function Qre(){if(bM)return FS;bM=1;var e=qre(),t=Wre(),r=Hre();return FS=function(n,a,o){return a==a?r(n,a,o):e(n,t,o)}}function Yre(){if(_M)return US;_M=1;var e=Qre();return US=function(t,r){return!!(null==t?0:t.length)&&e(t,r,0)>-1}}function gL(){if(wM)return GS;return wM=1,GS=function(){}}function Kre(){if(kM)return qS;kM=1;var e=V0(),t=HA(),r=As(),n=e?e.isConcatSpreadable:void 0;return qS=function(e){return r(e)||t(e)||!!(n&&e&&e[n])}}function Xre(){if(xM)return WS;xM=1;var e=qA(),t=Kre();return WS=function r(n,a,o,i,s){var l=-1,c=n.length;for(o||(o=t),s||(s=[]);++l<c;){var u=n[l];a>0&&o(u)?a>1?r(u,a-1,o,i,s):e(s,u):i||(s[s.length]=u)}return s},WS}function tR(){if(SM)return HS;return SM=1,HS=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}}function Zre(){if(EM)return QS;EM=1;var e=tR(),t=Math.max;return QS=function(r,n,a){return n=t(void 0===n?r.length-1:n,0),function(){for(var o=arguments,i=-1,s=t(o.length-n,0),l=Array(s);++i<s;)l[i]=o[n+i];i=-1;for(var c=Array(n+1);++i<n;)c[i]=o[i];return c[n]=a(l),e(r,this,c)}},QS}function Jre(){if(CM)return YS;return CM=1,YS=function(e){return function(){return e}}}function yL(){if(IM)return KS;IM=1;var e=Em(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch{}}();return KS=t}function eae(){if(AM)return XS;AM=1;var e=Jre(),t=yL(),r=eR();return XS=t?function(r,n){return t(r,"toString",{configurable:!0,enumerable:!1,value:e(n),writable:!0})}:r}function vL(){if(RM)return ZS;RM=1;var e=Date.now;return ZS=function(t){var r=0,n=0;return function(){var a=e(),o=16-(a-n);if(n=a,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}},ZS}function bL(){if(TM)return JS;TM=1;var e=eae(),t=vL()(e);return JS=t}function tae(){if(PM)return e4;PM=1;var e=os();return e4=function(){return e.Date.now()}}function nae(){if($M)return t4;$M=1;var e=/\s/;return t4=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}}function rae(){if(zM)return n4;zM=1;var e=nae(),t=/^\s+/;return n4=function(r){return r&&r.slice(0,e(r)+1).replace(t,"")}}function _L(){if(MM)return r4;MM=1;var e=rae(),t=Yc(),r=Fv(),n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt;return r4=function(s){if("number"==typeof s)return s;if(r(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var c=a.test(s);return c||o.test(s)?i(s.slice(2),c?2:8):n.test(s)?NaN:+s}}function wL(){if(OM)return a4;OM=1;var e=Yc(),t=tae(),r=_L(),n=Math.max,a=Math.min;return a4=function(o,i,s){var l,c,u,f,d,p,h=0,g=!1,m=!1,y=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function v(e){var t=l,r=c;return l=c=void 0,h=e,f=o.apply(r,t)}function b(e){var t=e-p;return void 0===p||t>=i||t<0||m&&e-h>=u}function w(){var e=t();if(b(e))return _(e);d=setTimeout(w,function(e){var t=i-(e-p);return m?a(t,u-(e-h)):t}(e))}function _(e){return d=void 0,y&&l?v(e):(l=c=void 0,f)}function k(){var e=t(),r=b(e);if(l=arguments,c=this,p=e,r){if(void 0===d)return function(e){return h=e,d=setTimeout(w,i),g?v(e):f}(p);if(m)return clearTimeout(d),d=setTimeout(w,i),v(p)}return void 0===d&&(d=setTimeout(w,i)),f}return i=r(i)||0,e(s)&&(g=!!s.leading,u=(m="maxWait"in s)?n(r(s.maxWait)||0,i):u,y="trailing"in s?!!s.trailing:y),k.cancel=function(){void 0!==d&&clearTimeout(d),h=0,l=p=c=d=void 0},k.flush=function(){return void 0===d?f:_(t())},k},a4}function aae(){if(NM)return o4;NM=1;var e=wL(),t=Yc();return o4=function(r,n,a){var o=!0,i=!0;if("function"!=typeof r)throw new TypeError("Expected a function");return t(a)&&(o="leading"in a?!!a.leading:o,i="trailing"in a?!!a.trailing:i),e(r,n,{leading:o,maxWait:n,trailing:i})}}xy.exports;var oae=aae();const sae=tu(oae);function sv(e){return(sv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?DM(Object(r),!0).forEach((function(t){iae(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function iae(e,t,r){return(t=cae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cae(e){var t=lae(e,"string");return"symbol"==sv(t)?t:t+""}function lae(e,t){if("object"!=sv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=sv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function uae(e,t){return hae(e)||pae(e,t)||dae(e,t)||fae()}function fae(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function dae(e,t){if(e){if("string"==typeof e)return jM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jM(e,t)}}function jM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pae(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0!==t)for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}function hae(e){if(Array.isArray(e))return e}var s4,LM,i4,VM,c4,BM,l4,FM,u4,UM,f4,GM,d4,qM,p4,WM,h4,HM,m4,QM,g4,YM,y4,KM,v4,XM,mae=g.forwardRef((function(e,t){var r=e.aspect,n=e.initialDimension,a=void 0===n?{width:-1,height:-1}:n,o=e.width,i=void 0===o?"100%":o,s=e.height,l=void 0===s?"100%":s,c=e.minWidth,u=void 0===c?0:c,f=e.minHeight,d=e.maxHeight,p=e.children,h=e.debounce,m=void 0===h?0:h,y=e.id,v=e.className,b=e.onResize,w=e.style,_=void 0===w?{}:w,k=g.useRef(null),x=g.useRef();x.current=b,g.useImperativeHandle(t,(function(){return Object.defineProperty(k.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),k.current},configurable:!0})}));var E=uae(g.useState({containerWidth:a.width,containerHeight:a.height}),2),A=E[0],S=E[1],C=g.useCallback((function(e,t){S((function(r){var n=Math.round(e),a=Math.round(t);return r.containerWidth===n&&r.containerHeight===a?r:{containerWidth:n,containerHeight:a}}))}),[]);g.useEffect((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,a=r.height;C(n,a),null===(t=x.current)||void 0===t||t.call(x,n,a)};m>0&&(e=sae(e,m,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=k.current.getBoundingClientRect(),n=r.width,a=r.height;return C(n,a),t.observe(k.current),function(){t.disconnect()}}),[C,m]);var z=g.useMemo((function(){var e=A.containerWidth,t=A.containerHeight;if(e<0||t<0)return null;S6(n_(i)||n_(l),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",i,l),S6(!r||r>0,"The aspect(%s) must be greater than zero.",r);var n=n_(i)?e:i,a=n_(l)?t:l;r&&r>0&&(n?a=n/r:a&&(n=a*r),d&&a>d&&(a=d)),S6(n>0||a>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,a,i,l,u,f,r);var o=!Array.isArray(p)&&nre(p.type).endsWith("Chart");return be.Children.map(p,(function(e){return be.isValidElement(e)?g.cloneElement(e,r_({width:n,height:a},o?{style:r_({height:"100%",width:"100%",maxHeight:a,maxWidth:n},e.props.style)}:{})):e}))}),[r,p,l,d,f,u,A,i]);return be.createElement("div",{id:y?"".concat(y):void 0,className:Ul("recharts-responsive-container",v),style:r_(r_({},_),{},{width:i,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:k},z)}));function gae(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}function nR(){if(LM)return s4;LM=1;var e=cL()(Object.getPrototypeOf,Object);return s4=e}function yae(){if(VM)return i4;VM=1;var e=wf(),t=nR(),r=ci(),n=Function.prototype,a=Object.prototype,o=n.toString,i=a.hasOwnProperty,s=o.call(Object);return i4=function(n){if(!r(n)||"[object Object]"!=e(n))return!1;var a=t(n);if(null===a)return!0;var l=i.call(a,"constructor")&&a.constructor;return"function"==typeof l&&l instanceof l&&o.call(l)==s}}function vae(){if(BM)return c4;BM=1;var e=_L(),t=1/0;return c4=function(r){return r?(r=e(r))===t||r===-t?17976931348623157e292*(r<0?-1:1):r==r?r:0:0===r?r:0}}function kL(){if(FM)return l4;FM=1;var e=yL();return l4=function(t,r,n){"__proto__"==r&&e?e(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}}function xL(){if(UM)return u4;UM=1;var e=vae();return u4=function(t){var r=e(t),n=r%1;return r==r?n?r-n:r:0}}function rR(){if(GM)return f4;return GM=1,f4=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}}function SL(){if(qM)return d4;qM=1;var e=kL(),t=BA(),r=Object.prototype.hasOwnProperty;return d4=function(n,a,o){var i=n[a];(!r.call(n,a)||!t(i,o)||void 0===o&&!(a in n))&&e(n,a,o)}}function S2(){if(WM)return p4;WM=1;var e=SL(),t=kL();return p4=function(r,n,a,o){var i=!a;a||(a={});for(var s=-1,l=n.length;++s<l;){var c=n[s],u=o?o(a[c],r[c],c,a,r):void 0;void 0===u&&(u=r[c]),i?t(a,c,u):e(a,c,u)}return a}}function EL(){if(HM)return h4;HM=1;var e=S2(),t=x2();return h4=function(r,n){return r&&e(n,t(n),r)}}function bae(){if(QM)return m4;return QM=1,m4=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}}function _ae(){if(YM)return g4;YM=1;var e=Yc(),t=JA(),r=bae(),n=Object.prototype.hasOwnProperty;return g4=function(a){if(!e(a))return r(a);var o=t(a),i=[];for(var s in a)"constructor"==s&&(o||!n.call(a,s))||i.push(s);return i}}function aR(){if(KM)return y4;KM=1;var e=iL(),t=_ae(),r=uL();return y4=function(n){return r(n)?e(n,!0):t(n)}}function wae(){if(XM)return v4;XM=1;var e=S2(),t=aR();return v4=function(r,n){return r&&e(n,t(n),r)}}var ZM,b4,JM,_4,eO,w4,tO,k4,nO,x4,rO,S4,aO,E4,oO,C4,sO,I4,iO,A4,cO,R4,lO,T4,uO,P4,fO,$4,dO,z4,pO,M4,hO,O4,mO,N4,gO,D4,yO,j4,vO,L4,bO,Sy={exports:{}};function kae(){return ZM||(ZM=1,e=Sy,t=Sy.exports,r=os(),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,o=a&&a.exports===n?r.Buffer:void 0,i=o?o.allocUnsafe:void 0,e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}),Sy.exports;var e,t,r,n,a,o,i}function E2(){if(JM)return b4;return JM=1,b4=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}}function xae(){if(eO)return _4;eO=1;var e=S2(),t=WA();return _4=function(r,n){return e(r,t(r),n)}}function CL(){if(tO)return w4;tO=1;var e=qA(),t=nR(),r=WA(),n=oL(),a=Object.getOwnPropertySymbols;return w4=a?function(n){for(var a=[];n;)e(a,r(n)),n=t(n);return a}:n}function Sae(){if(nO)return k4;nO=1;var e=S2(),t=CL();return k4=function(r,n){return e(r,t(r),n)}}function Eae(){if(rO)return x4;rO=1;var e=aL(),t=CL(),r=aR();return x4=function(n){return e(n,r,t)}}function Cae(){if(aO)return S4;aO=1;var e=Object.prototype.hasOwnProperty;return S4=function(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}}function oR(){if(oO)return E4;oO=1;var e=rL();return E4=function(t){var r=new t.constructor(t.byteLength);return new e(r).set(new e(t)),r}}function Iae(){if(sO)return C4;sO=1;var e=oR();return C4=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}}function Aae(){if(iO)return I4;iO=1;var e=/\w*$/;return I4=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}}function Rae(){if(cO)return A4;cO=1;var e=V0(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;return A4=function(e){return r?Object(r.call(e)):{}}}function Tae(){if(lO)return R4;lO=1;var e=oR();return R4=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}}function Pae(){if(uO)return T4;uO=1;var e=oR(),t=Iae(),r=Aae(),n=Rae(),a=Tae();return T4=function(o,i,s){var l=o.constructor;switch(i){case"[object ArrayBuffer]":return e(o);case"[object Boolean]":case"[object Date]":return new l(+o);case"[object DataView]":return t(o,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(o,s);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(o);case"[object RegExp]":return r(o);case"[object Symbol]":return n(o)}}}function C2(){if(fO)return P4;fO=1;var e=Yc(),t=Object.create;return P4=function(){function r(){}return function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var a=new r;return r.prototype=void 0,a}}()}function $ae(){if(dO)return $4;dO=1;var e=C2(),t=nR(),r=JA();return $4=function(n){return"function"!=typeof n.constructor||r(n)?{}:e(t(n))}}function zae(){if(pO)return z4;pO=1;var e=Gv(),t=ci();return z4=function(r){return t(r)&&"[object Map]"==e(r)}}function Mae(){if(hO)return M4;hO=1;var e=zae(),t=XA(),r=ZA(),n=r&&r.isMap,a=n?t(n):e;return M4=a}function Oae(){if(mO)return O4;mO=1;var e=Gv(),t=ci();return O4=function(r){return t(r)&&"[object Set]"==e(r)}}function Nae(){if(gO)return N4;gO=1;var e=Oae(),t=XA(),r=ZA(),n=r&&r.isSet,a=n?t(n):e;return N4=a}function IL(){if(yO)return D4;yO=1;var e=GA(),t=rR(),r=SL(),n=EL(),a=wae(),o=kae(),i=E2(),s=xae(),l=Sae(),c=fL(),u=Eae(),f=Gv(),d=Cae(),p=Pae(),h=$ae(),g=As(),m=QA(),y=Mae(),v=Yc(),b=Nae(),w=x2(),_=aR(),k="[object Arguments]",x="[object Function]",E="[object Object]",A={};return A[k]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[E]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[x]=A["[object WeakMap]"]=!1,D4=function S(C,z,I,j,P,T){var R,N=1&z,O=2&z,M=4&z;if(I&&(R=P?I(C,j,P,T):I(C)),void 0!==R)return R;if(!v(C))return C;var D=g(C);if(D){if(R=d(C),!N)return i(C,R)}else{var L=f(C),q=L==x||"[object GeneratorFunction]"==L;if(m(C))return o(C,N);if(L==E||L==k||q&&!P){if(R=O||q?{}:h(C),!N)return O?l(C,a(R,C)):s(C,n(R,C))}else{if(!A[L])return P?C:{};R=p(C,L,N)}}T||(T=new e);var V=T.get(C);if(V)return V;T.set(C,R),b(C)?C.forEach((function(e){R.add(S(e,z,I,e,C,T))})):y(C)&&C.forEach((function(e,t){R.set(t,S(e,z,I,t,C,T))}));var B=D?void 0:(M?O?u:c:O?_:w)(C);return t(B||C,(function(e,t){B&&(e=C[t=e]),r(R,t,S(e,z,I,t,C,T))})),R},D4}function Dae(){if(vO)return j4;vO=1;var e=Xre();return j4=function(t){return(null==t?0:t.length)?e(t,1):[]}}function jae(){if(bO)return L4;bO=1;var e=Dae(),t=Zre(),r=bL();return L4=function(n){return r(t(n,void 0,e),n+"")}}Sy.exports;const Lae={light:"",dark:".dark"},AL=g.createContext(null);function RL(){const e=g.useContext(AL);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const Vae=g.forwardRef((({id:e,className:t,children:r,config:n,...a},o)=>{const i=g.useId(),s=`chart-${e||i.replace(/:/g,"")}`;return E.jsx(AL.Provider,{value:{config:n},children:E.jsxs("div",{"data-chart":s,ref:o,className:he("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[E.jsx(Bae,{id:s,config:n}),E.jsx(mae,{children:r})]})})}));Vae.displayName="Chart";const Bae=({id:e,config:t})=>{const r=Object.entries(t).filter((([,e])=>e.theme||e.color));return r.length?E.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Lae).map((([t,n])=>`\n${n} [data-chart=${e}] {\n${r.map((([e,r])=>{var n;const a=(null==(n=r.theme)?void 0:n[t])||r.color;return a?` --color-${e}: ${a};`:null})).join("\n")}\n}\n`)).join("\n")}}):null},Fae=g.forwardRef((({active:e,payload:t,className:r,indicator:n="dot",hideLabel:a=!1,hideIndicator:o=!1,label:i,labelFormatter:s,labelClassName:l,formatter:c,color:u,nameKey:f,labelKey:d,hoveredItem:p,onItemHover:h},m)=>{const{config:y}=RL(),v=g.useMemo((()=>{var e;if(a||null==t||!t.length)return null;const[r]=t,n=`${d||(null==r?void 0:r.dataKey)||(null==r?void 0:r.name)||"value"}`,o=QC(y,r,n),c=d||"string"!=typeof i?null==o?void 0:o.label:(null==(e=y[i])?void 0:e.label)||i;return s?E.jsx("div",{className:he("font-medium",l),children:s(c,t)}):c?E.jsx("div",{className:he("font-medium",l),children:c}):null}),[i,s,t,a,l,y,d]);if(!e||null==t||!t.length)return null;const b=1===t.length&&"dot"!==n,w=t.length>10;return E.jsxs("div",{ref:m,className:he("grid min-w-[8rem] items-start gap-xxs rounded-sm border border-border/50 bg-background px-xs py-xxs text-xs shadow-xl",w&&"min-w-[16rem]",r),children:[b?null:v,E.jsx("div",{className:he("grid gap-xxs",w&&"grid-cols-2 gap-x-s"),children:t.map(((e,t)=>{var r;const a=`${f||e.name||e.dataKey||"value"}`,i=QC(y,e,a),s=u||(null==(r=e.payload)?void 0:r.fill)||e.color||"",l=a===p;return E.jsx("div",{className:he("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground","dot"===n&&"items-center",l?"":p?"opacity-40":""),onMouseEnter:()=>null==h?void 0:h(a),onMouseLeave:()=>null==h?void 0:h(null),children:c&&void 0!==(null==e?void 0:e.value)&&void 0!==(null==e?void 0:e.payload)&&e.name?c(e.value,e.name,e,t,[e.payload]):E.jsxs(E.Fragment,{children:[null!=i&&i.icon?E.jsx(i.icon,{}):!o&&E.jsx("div",{className:he("shrink-0 rounded-full border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":"dot"===n,"w-1":"line"===n,"w-0 border border-dashed bg-transparent":"dashed"===n,"my-0.5":b&&"dashed"===n}),style:{"--color-bg":s,"--color-border":s}}),E.jsxs("div",{className:he("flex flex-1 justify-between leading-none",b?"items-end":"items-center"),children:[E.jsxs("div",{className:"grid gap-xxs",children:[b?v:null,E.jsx("span",{className:he("text-muted-foreground",l&&"font-medium text-foreground"),children:(null==i?void 0:i.label)||e.name})]}),e.value&&E.jsx("span",{className:he("font-mono font-medium tabular-nums text-foreground",l&&"font-bold"),children:e.value.toLocaleString()})]})]})},e.dataKey)}))})]})}));Fae.displayName="ChartTooltip";const Uae=g.forwardRef((({className:e,hideIcon:t=!1,payload:r,nameKey:n,onItemHover:a,hoveredItem:o},i)=>{const{config:s}=RL(),l=g.useRef({});return g.useEffect((()=>{if(o&&l.current[o]){const e=l.current[o];e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})}}),[o]),null!=r&&r.length?E.jsx("div",{ref:i,className:he("flex h-[150px] w-full flex-wrap items-center justify-center gap-l overflow-y-auto pb-xl",e),children:r.map((e=>{var r;const i=`${n||e.dataKey||"value"}`,c=QC(s,e,i),u=!!a&&i===o;return E.jsxs("div",{ref:e=>{e?l.current[i]=e:delete l.current[i]},className:he("group flex cursor-pointer select-none items-center gap-xs text-base transition-all duration-150",u?"scale-105 text-black":o?"text-gray-700 opacity-40":"text-gray-700"),onMouseEnter:()=>null==a?void 0:a(e.dataKey),onMouseLeave:()=>null==a?void 0:a(null),children:[null!=c&&c.icon&&!t?E.jsx(c.icon,{}):E.jsx("div",{className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.color||""}}),E.jsx("span",{className:"min-w-[max-content]",children:(null==c?void 0:c.label)||e.name})]},(null==(r=e.value)?void 0:r.toString())||i)}))}):null}));function QC(e,t,r){if("object"!=typeof t||null===t)return;const n="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0;let a=r;return r in t&&"string"==typeof t[r]?a=t[r]:n&&r in n&&"string"==typeof n[r]&&(a=n[r]),a in e?e[a]:e[r]}Uae.displayName="ChartLegend";const Gae=({children:e,className:t})=>E.jsx("div",{className:he("flex flex-wrap gap-xxxs",t),children:e}),TL=({text:e,icon:t,disabled:r,isLoading:n,avatarSrc:a,onClick:o,onRemove:i,className:s})=>E.jsxs("div",{onClick:r?void 0:o,className:he("flex cursor-pointer items-center gap-xxxs rounded-sm bg-gray-100 p-xxs text-sm font-medium text-gray-900 transition-all hover:bg-gray-200 [&_svg]:size-4",r&&"cursor-not-allowed bg-gray-100 text-gray-300",s),children:[a&&E.jsxs($A,{className:he("size-6 text-[10px]"),children:[E.jsx(zA,{src:a,alt:e}),E.jsx(V7,{className:"text-xs",children:e.charAt(0).toUpperCase()})]}),t,E.jsx("span",{children:e}),i&&!n&&E.jsx("span",{role:"button",tabIndex:-1,onClick:e=>{e.stopPropagation(),e.preventDefault(),!r&&(null==i||i())},onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},className:he("pointer-events-auto cursor-pointer",r&&"pointer-events-none cursor-not-allowed opacity-50"),children:E.jsx(jv,{size:16})}),n&&E.jsx(yf,{size:16,className:"animate-spin"})]});function I2(e){const t=g.useRef({value:e,previous:e});return g.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}function A2(e){const[t,r]=g.useState(void 0);return zo((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),t}const PL="Checkbox",[qae,$ot]=as(PL),[Wae,Hae]=qae(PL),Qae=g.forwardRef(((e,t)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:o,required:i,disabled:s,value:l="on",onCheckedChange:c,...u}=e,[f,d]=g.useState(null),p=dn(t,(e=>d(e))),h=g.useRef(!1),m=!f||!!f.closest("form"),[y=!1,v]=Yl({prop:a,defaultProp:o,onChange:c}),b=g.useRef(y);return g.useEffect((()=>{const e=null==f?void 0:f.form;if(e){const t=()=>v(b.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[f,v]),g.createElement(Wae,{scope:r,state:y,disabled:s},g.createElement(wt.button,Pe({type:"button",role:"checkbox","aria-checked":tm(y)?"mixed":y,"aria-required":i,"data-state":$L(y),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onKeyDown:ft(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:ft(e.onClick,(e=>{v((e=>!!tm(e)||!e)),m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())}))})),m&&g.createElement(Xae,{control:f,bubbles:!h.current,name:n,value:l,checked:y,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))})),Yae="CheckboxIndicator",Kae=g.forwardRef(((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,o=Hae(Yae,r);return g.createElement(ii,{present:n||tm(o.state)||!0===o.state},g.createElement(wt.span,Pe({"data-state":$L(o.state),"data-disabled":o.disabled?"":void 0},a,{ref:t,style:{pointerEvents:"none",...e.style}})))})),Xae=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,o=g.useRef(null),i=I2(r),s=A2(t);return g.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&a){const t=new Event("click",{bubbles:n});e.indeterminate=tm(r),a.call(e,!tm(r)&&r),e.dispatchEvent(t)}}),[i,r,n]),g.createElement("input",Pe({type:"checkbox","aria-hidden":!0,defaultChecked:!tm(r)&&r},a,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function tm(e){return"indeterminate"===e}function $L(e){return tm(e)?"indeterminate":e?"checked":"unchecked"}const zL=Qae,Zae=Kae,Jae=Yi("relative overflow-hidden ",{variants:{size:{default:"size-xs"},variant:{default:"peer shrink-0 rounded-sm border disabled:cursor-not-allowed disabled:!border-0 disabled:!bg-gray-100"}},defaultVariants:{size:"default",variant:"default"}}),sR=g.forwardRef((({className:e,size:t,variant:r,iconType:n,...a},o)=>{const i=a.checked,[s]=g.useState(i),[l,c]=g.useState(!1);g.useEffect((()=>{s!==i&&c(!0)}),[i]);const u=e=>"minus"===n?E.jsx(W8,{...e}):E.jsx(o2,{...e});return E.jsxs(zL,{ref:o,className:he(Jae({size:t,variant:r}),"transition-[border] duration-100 ease-linear",i?"border-0":"border-gray-300 hover:border-2",e),...a,children:[E.jsx("div",{className:he("transform-origin-center absolute left-0 top-0 size-full rounded-full bg-blue_100",i?"scale-[1.2]":"scale-0",{"animate-fill-in":i&&l,"animate-fill-out":!i&&l})}),E.jsx(Zae,{className:"relative flex items-center justify-center text-current",children:E.jsx(u,{className:"size-xxxs",color:a.disabled?"var(--gray-300)":"white"})})]})}));sR.displayName=zL.displayName;var _O=1,eoe=.9,toe=.8,noe=.17,V4=.1,B4=.999,roe=.9999,aoe=.99,ooe=/[\\\/_+.#"@\[\(\{&]/,soe=/[\\\/_+.#"@\[\(\{&]/g,ioe=/[\s-]/,ML=/[\s-]/g;function YC(e,t,r,n,a,o,i){if(o===t.length)return a===e.length?_O:aoe;var s=`${a},${o}`;if(void 0!==i[s])return i[s];for(var l,c,u,f,d=n.charAt(o),p=r.indexOf(d,a),h=0;p>=0;)(l=YC(e,t,r,n,p+1,o+1,i))>h&&(p===a?l*=_O:ooe.test(e.charAt(p-1))?(l*=toe,(u=e.slice(a,p-1).match(soe))&&a>0&&(l*=Math.pow(B4,u.length))):ioe.test(e.charAt(p-1))?(l*=eoe,(f=e.slice(a,p-1).match(ML))&&a>0&&(l*=Math.pow(B4,f.length))):(l*=noe,a>0&&(l*=Math.pow(B4,p-a))),e.charAt(p)!==t.charAt(o)&&(l*=roe)),(l<V4&&r.charAt(p-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(p-1)!==n.charAt(o))&&((c=YC(e,t,r,n,p+1,o+2,i))*V4>l&&(l=c*V4)),l>h&&(h=l),p=r.indexOf(d,p+1);return i[s]=h,h}function wO(e){return e.toLowerCase().replace(ML," ")}function coe(e,t,r){return YC(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,wO(e),wO(t),0,0,{})}var ey='[cmdk-group=""]',F4='[cmdk-group-items=""]',loe='[cmdk-group-heading=""]',iR='[cmdk-item=""]',kO=`${iR}:not([aria-disabled="true"])`,KC="cmdk-item-select",Kh="data-value",uoe=(e,t,r)=>coe(e,t,r),OL=g.createContext(void 0),qv=()=>g.useContext(OL),NL=g.createContext(void 0),cR=()=>g.useContext(NL),DL=g.createContext(void 0),jL=g.forwardRef(((e,t)=>{let r=i0((()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}})),n=i0((()=>new Set)),a=i0((()=>new Map)),o=i0((()=>new Map)),i=i0((()=>new Set)),s=LL(e),{label:l,children:c,value:u,onValueChange:f,filter:d,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:y=!0,...v}=e,b=g.useId(),w=g.useId(),_=g.useId(),k=g.useRef(null),x=woe();fm((()=>{if(void 0!==u){let e=u.trim();r.current.value=e,E.emit()}}),[u]),fm((()=>{x(6,j)}),[]);let E=g.useMemo((()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)I(),C(),x(1,z);else if("value"===e&&(n||x(5,j),void 0!==(null==(a=s.current)?void 0:a.value))){let e=t??"";return void(null==(i=(o=s.current).onValueChange)||i.call(o,e))}E.emit()}},emit:()=>{i.current.forEach((e=>e()))}})),[]),A=g.useMemo((()=>({value:(e,t,n)=>{var a;t!==(null==(a=o.current.get(e))?void 0:a.value)&&(o.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),x(2,(()=>{C(),E.emit()})))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),x(3,(()=>{I(),C(),r.current.value||z(),E.emit()})),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=P();x(4,(()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&z(),E.emit()}))}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],disablePointerSelection:m,listId:b,inputId:_,labelId:w,listInnerRef:k})),[]);function S(e,t){var n,a;let o=null!=(a=null==(n=s.current)?void 0:n.filter)?a:uoe;return e?o(e,r.current.search,t):0}function C(){if(!r.current.search||!1===s.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach((r=>{let n=a.current.get(r),o=0;n.forEach((t=>{let r=e.get(t);o=Math.max(r,o)})),t.push([r,o])}));let n=k.current;T().sort(((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)})).forEach((e=>{let t=e.closest(F4);t?t.appendChild(e.parentElement===t?e:e.closest(`${F4} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${F4} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=k.current.querySelector(`${ey}[${Kh}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function z(){let e=T().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(Kh);E.setState("value",t||void 0)}function I(){var e,t,i,l;if(!r.current.search||!1===s.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let a of n.current){let n=S(null!=(t=null==(e=o.current.get(a))?void 0:e.value)?t:"",null!=(l=null==(i=o.current.get(a))?void 0:i.keywords)?l:[]);r.current.filtered.items.set(a,n),n>0&&c++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function j(){var e,t,r;let n=P();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(ey))?void 0:t.querySelector(loe))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function P(){var e;return null==(e=k.current)?void 0:e.querySelector(`${iR}[aria-selected="true"]`)}function T(){var e;return Array.from(null==(e=k.current)?void 0:e.querySelectorAll(kO))}function R(e){let t=T()[e];t&&E.setState("value",t.getAttribute(Kh))}function N(e){var t;let r=P(),n=T(),a=n.findIndex((e=>e===r)),o=n[a+e];null!=(t=s.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&E.setState("value",o.getAttribute(Kh))}function O(e){let t,r=P(),n=null==r?void 0:r.closest(ey);for(;n&&!t;)n=e>0?boe(n,ey):_oe(n,ey),t=null==n?void 0:n.querySelector(kO);t?E.setState("value",t.getAttribute(Kh)):N(e)}let M=()=>R(T().length-1),D=e=>{e.preventDefault(),e.metaKey?M():e.altKey?O(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?R(0):e.altKey?O(-1):N(-1)};return g.createElement(wt.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=v.onKeyDown)||t.call(v,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&D(e);break;case"ArrowDown":D(e);break;case"p":case"k":y&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),R(0);break;case"End":e.preventDefault(),M();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=P();if(t){let e=new Event(KC);t.dispatchEvent(e)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:xoe},l),R2(e,(e=>g.createElement(NL.Provider,{value:E},g.createElement(OL.Provider,{value:A},e)))))})),foe=g.forwardRef(((e,t)=>{var r,n;let a=g.useId(),o=g.useRef(null),i=g.useContext(DL),s=qv(),l=LL(e),c=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;fm((()=>{if(!c)return s.item(a,null==i?void 0:i.id)}),[c]);let u=VL(a,o,[e.value,e.children,o],e.keywords),f=cR(),d=dm((e=>e.value&&e.value===u.current)),p=dm((e=>!(!c&&!1!==s.filter())||(!e.search||e.filtered.items.get(a)>0)));function h(){var e,t;m(),null==(t=(e=l.current).onSelect)||t.call(e,u.current)}function m(){f.setState("value",u.current,!0)}if(g.useEffect((()=>{let t=o.current;if(t&&!e.disabled)return t.addEventListener(KC,h),()=>t.removeEventListener(KC,h)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:y,value:v,onSelect:b,forceMount:w,keywords:_,...k}=e;return g.createElement(wt.div,{ref:iv([o,t]),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||s.disablePointerSelection?void 0:m,onClick:y?void 0:h},e.children)})),doe=g.forwardRef(((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,i=g.useId(),s=g.useRef(null),l=g.useRef(null),c=g.useId(),u=qv(),f=dm((e=>!(!a&&!1!==u.filter())||(!e.search||e.filtered.groups.has(i))));fm((()=>u.group(i)),[]),VL(i,s,[e.value,e.heading,l]);let d=g.useMemo((()=>({id:i,forceMount:a})),[a]);return g.createElement(wt.div,{ref:iv([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&g.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),R2(e,(e=>g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},g.createElement(DL.Provider,{value:d},e)))))})),poe=g.forwardRef(((e,t)=>{let{alwaysRender:r,...n}=e,a=g.useRef(null),o=dm((e=>!e.search));return r||o?g.createElement(wt.div,{ref:iv([a,t]),...n,"cmdk-separator":"",role:"separator"}):null})),hoe=g.forwardRef(((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,o=cR(),i=dm((e=>e.search)),s=dm((e=>e.value)),l=qv(),c=g.useMemo((()=>{var e;let t=null==(e=l.listInnerRef.current)?void 0:e.querySelector(`${iR}[${Kh}="${encodeURIComponent(s)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return g.useEffect((()=>{null!=e.value&&o.setState("search",e.value)}),[e.value]),g.createElement(wt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:a?e.value:i,onChange:e=>{a||o.setState("search",e.target.value),null==r||r(e.target.value)}})})),moe=g.forwardRef(((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=g.useRef(null),i=g.useRef(null),s=qv();return g.useEffect((()=>{if(i.current&&o.current){let e,t=i.current,r=o.current,n=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")}))}));return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}}),[]),g.createElement(wt.div,{ref:iv([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":n,id:s.listId},R2(e,(e=>g.createElement("div",{ref:iv([i,s.listInnerRef]),"cmdk-list-sizer":""},e))))})),goe=g.forwardRef(((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:i,...s}=e;return g.createElement(PA,{open:r,onOpenChange:n},g.createElement(h2,{container:i},g.createElement(j0,{"cmdk-overlay":"",className:a}),g.createElement(L0,{"aria-label":e.label,"cmdk-dialog":"",className:o},g.createElement(jL,{ref:t,...s}))))})),yoe=g.forwardRef(((e,t)=>dm((e=>0===e.filtered.count))?g.createElement(wt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),voe=g.forwardRef(((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return g.createElement(wt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},R2(e,(e=>g.createElement("div",{"aria-hidden":!0},e))))})),Rs=Object.assign(jL,{List:moe,Item:foe,Input:hoe,Group:doe,Separator:poe,Dialog:goe,Empty:yoe,Loading:voe});function boe(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function _oe(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function LL(e){let t=g.useRef(e);return fm((()=>{t.current=e})),t}var fm=typeof window>"u"?g.useEffect:g.useLayoutEffect;function i0(e){let t=g.useRef();return void 0===t.current&&(t.current=e()),t}function iv(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function dm(e){let t=cR(),r=()=>e(t.snapshot());return g.useSyncExternalStore(t.subscribe,r,r)}function VL(e,t,r,n=[]){let a=g.useRef(),o=qv();return fm((()=>{var i;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=n.map((e=>e.trim()));o.value(e,s,l),null==(i=t.current)||i.setAttribute(Kh,s),a.current=s})),a}var woe=()=>{let[e,t]=g.useState(),r=i0((()=>new Map));return fm((()=>{r.current.forEach((e=>e())),r.current=new Map}),[e]),(e,n)=>{r.current.set(e,n),t({})}};function koe(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}function R2({asChild:e,children:t},r){return e&&g.isValidElement(t)?g.cloneElement(koe(t),{ref:t.ref},r(t.props.children)):r(t)}var xoe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Soe=PA,Eoe=h2,BL=g.forwardRef((({className:e,...t},r)=>(g.useEffect((()=>{const e=document.querySelectorAll(".blured-modal-overlay");return e.forEach((e=>e&&(e.style.filter="blur(5px)"))),()=>{0===Array.from(document.querySelectorAll('[role="dialog"]')).length&&e.forEach((e=>e&&(e.style.filter="none")))}}),[]),E.jsx(j0,{ref:r,"data-testid":"dialog_overlay",className:he("fixed inset-0 z-dialog bg-black opacity-[0.8] data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}))));BL.displayName=j0.displayName;const Coe=Yi("",{variants:{closeVariant:{none:"",insideCard:"absolute right-m top-m rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-gray-400",outsideCard:"fixed right-[30px] top-[30px] z-100 text-gray-400",mobileGallery:"fixed right-m top-[62px] text-white z-[110]"}},defaultVariants:{closeVariant:"outsideCard"}}),Ioe=Yi("",{variants:{closeSize:{small:"size-6",big:"size-[42px]","18x18":"size-[18px]"}},defaultVariants:{closeSize:"small"}}),FL=g.forwardRef((({title:e,titleIcon:t,className:r,dialogName:n,showClose:a=!0,closeVariant:o="outsideCard",closeSize:i="big",children:s,titleClassName:l,overlayClassName:c,childrenClassName:u,footerClassName:f,onBack:d,onCloseModal:p,renderFooter:h,onScroll:g,...m},y)=>{const v=E.jsxs(m2,{className:he(Coe({closeVariant:o})),children:[E.jsx(jv,{onClick:p,fill:"currentColor",className:he(Ioe({closeSize:i}))}),E.jsx("span",{className:"sr-only",children:"Close"})]});return E.jsxs(Eoe,{children:[E.jsx(BL,{className:c,onClick:p}),a&&"insideCard"!==o&&v,E.jsxs(L0,{ref:y,className:he("fixed left-[50%] top-[50%] z-[101] grid max-w-[600px] translate-x-[-50%] translate-y-[-50%] !overflow-visible rounded-sm bg-background shadow-lg outline-none duration-200 data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] max-md:w-[calc(100vw-32px)] md:w-full [&>div]:min-w-0",r),...m,children:[e&&E.jsxs("h3",{className:he("flex items-center justify-center gap-xxs border-b border-gray-200 p-m text-center text-lg font-semibold text-gray-700",l),children:[t,e]}),E.jsx("div",{id:n||"dialog-content",className:he("p-m",u),onScroll:g,children:s}),a&&"insideCard"===o&&v,d&&E.jsx("button",{"data-testid":"dialog-back-button","aria-label":"Back",onClick:d,className:"absolute left-m top-m",children:E.jsx(F8,{color:"var(--gray-400)",size:24})}),E.jsx(UL,{className:he("empty:hidden",f),children:null==h?void 0:h()})]})]})}));FL.displayName=L0.displayName;const UL=({className:e,...t})=>E.jsx("div",{className:he("flex border-t border-gray-200 p-m",e),...t});UL.displayName="DialogFooter";const Aoe=g.forwardRef((({className:e,...t},r)=>E.jsx(Lv,{ref:r,className:he("text-lg font-semibold leading-none tracking-tight",e),...t})));Aoe.displayName=Lv.displayName;const Roe=g.forwardRef((({className:e,...t},r)=>E.jsx(Vv,{ref:r,className:he("text-sm text-muted-foreground",e),...t})));Roe.displayName=Vv.displayName;const lR=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs,{ref:r,className:he("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})));lR.displayName=Rs.displayName;const Toe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:E.jsx(Rs.Input,{ref:r,className:he("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})})));Toe.displayName=Rs.Input.displayName;const uR=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.List,{ref:r,className:he("mt-2 max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t})));uR.displayName=Rs.List.displayName;const GL=g.forwardRef(((e,t)=>E.jsx(Rs.Empty,{ref:t,className:"py-6 text-center text-sm",...e})));GL.displayName=Rs.Empty.displayName;const Poe=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.Group,{ref:r,className:he("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})));Poe.displayName=Rs.Group.displayName;const $oe=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.Separator,{ref:r,className:he("-mx-1 h-px bg-border",e),...t})));$oe.displayName=Rs.Separator.displayName;const fR=g.forwardRef((({className:e,...t},r)=>E.jsx(Rs.Item,{ref:r,className:he("relative flex max-w-[215px] cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t})));function fp(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function xO(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function qL(...e){return t=>{let r=!1;const n=e.map((e=>{const n=xO(e,t);return!r&&"function"==typeof n&&(r=!0),n}));if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():xO(e[t],null)}}}}function Cm(...e){return g.useCallback(qL(...e),e)}function zoe(e,t){const r=g.createContext(t),n=e=>{const{children:t,...n}=e,a=g.useMemo((()=>n),Object.values(n));return E.jsx(r.Provider,{value:a,children:t})};return n.displayName=e+"Provider",[n,function(n){const a=g.useContext(r);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}function Moe(e,t=[]){let r=[];const n=()=>{const t=r.map((e=>g.createContext(e)));return function(r){const n=(null==r?void 0:r[e])||t;return g.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const a=g.createContext(n),o=r.length;r=[...r,n];const i=t=>{var r;const{scope:n,children:i,...s}=t,l=(null==(r=null==n?void 0:n[e])?void 0:r[o])||a,c=g.useMemo((()=>s),Object.values(s));return E.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(r,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=g.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},Ooe(n,...t)]}function Ooe(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return g.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}fR.displayName=Rs.Item.displayName;var aw=null!=globalThis&&globalThis.document?g.useLayoutEffect:()=>{},Noe=ew[" useId ".trim().toString()]||(()=>{}),Doe=0;function U4(e){const[t,r]=g.useState(Noe());return aw((()=>{e||r((e=>e??String(Doe++)))}),[e]),e||(t?`radix-${t}`:"")}function pm(e){const t=g.useRef(e);return g.useEffect((()=>{t.current=e})),g.useMemo((()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)}),[])}function joe({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=Loe({defaultProp:t,onChange:r}),o=void 0!==e,i=o?e:n,s=pm(r);return[i,g.useCallback((t=>{if(o){const r="function"==typeof t?t(e):t;r!==e&&s(r)}else a(t)}),[o,e,a,s])]}function Loe({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,a=g.useRef(n),o=pm(t);return g.useEffect((()=>{a.current!==n&&(o(n),a.current=n)}),[n,a,o]),r}function WL(e){const t=Voe(e),r=g.forwardRef(((e,r)=>{const{children:n,...a}=e,o=g.Children.toArray(n),i=o.find(Foe);if(i){const e=i.props.children,n=o.map((t=>t===i?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t));return E.jsx(t,{...a,ref:r,children:g.isValidElement(e)?g.cloneElement(e,void 0,n):null})}return E.jsx(t,{...a,ref:r,children:n})}));return r.displayName=`${e}.Slot`,r}function Voe(e){const t=g.forwardRef(((e,t)=>{const{children:r,...n}=e;if(g.isValidElement(r)){const e=Goe(r),a=Uoe(n,r.props);return r.type!==g.Fragment&&(a.ref=t?qL(t,e):e),g.cloneElement(r,a)}return g.Children.count(r)>1?g.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var Boe=Symbol("radix.slottable");function Foe(e){return g.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Boe}function Uoe(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{o(...e),a(...e)}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}function Goe(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var qoe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],kf=qoe.reduce(((e,t)=>{const r=WL(`Primitive.${t}`),n=g.forwardRef(((e,n)=>{const{asChild:a,...o}=e,i=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function Woe(e,t){e&&Qc.flushSync((()=>e.dispatchEvent(t)))}function Hoe(e,t=(null==globalThis?void 0:globalThis.document)){const r=pm(e);g.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[r,t])}var SO,Qoe="DismissableLayer",XC="dismissableLayer.update",Yoe="dismissableLayer.pointerDownOutside",Koe="dismissableLayer.focusOutside",HL=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QL=g.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=g.useContext(HL),[u,f]=g.useState(null),d=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=g.useState({}),h=Cm(t,(e=>f(e))),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(y),b=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,_=b>=v,k=Joe((e=>{const t=e.target,r=[...c.branches].some((e=>e.contains(t)));!_||r||(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),d),x=ese((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),d);return Hoe((e=>{b===c.layers.size-1&&(null==n||n(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),d),g.useEffect((()=>{if(u)return r&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(SO=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),EO(),()=>{r&&1===c.layersWithOutsidePointerEventsDisabled.size&&(d.body.style.pointerEvents=SO)}}),[u,d,r,c]),g.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),EO())}),[u,c]),g.useEffect((()=>{const e=()=>p({});return document.addEventListener(XC,e),()=>document.removeEventListener(XC,e)}),[]),E.jsx(kf.div,{...l,ref:h,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:fp(e.onFocusCapture,x.onFocusCapture),onBlurCapture:fp(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:fp(e.onPointerDownCapture,k.onPointerDownCapture)})}));QL.displayName=Qoe;var Xoe="DismissableLayerBranch",Zoe=g.forwardRef(((e,t)=>{const r=g.useContext(HL),n=g.useRef(null),a=Cm(t,n);return g.useEffect((()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E.jsx(kf.div,{...e,ref:a})}));function Joe(e,t=(null==globalThis?void 0:globalThis.document)){const r=pm(e),n=g.useRef(!1),a=g.useRef((()=>{}));return g.useEffect((()=>{const e=e=>{if(e.target&&!n.current){let n=function(){YL(Yoe,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ese(e,t=(null==globalThis?void 0:globalThis.document)){const r=pm(e),n=g.useRef(!1);return g.useEffect((()=>{const e=e=>{e.target&&!n.current&&YL(Koe,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function EO(){const e=new CustomEvent(XC);document.dispatchEvent(e)}function YL(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Woe(a,o):a.dispatchEvent(o)}Zoe.displayName=Xoe;var G4="focusScope.autoFocusOnMount",q4="focusScope.autoFocusOnUnmount",CO={bubbles:!1,cancelable:!0},tse="FocusScope",KL=g.forwardRef(((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[s,l]=g.useState(null),c=pm(a),u=pm(o),f=g.useRef(null),d=Cm(t,(e=>l(e))),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect((()=>{if(n){let e=function(e){if(p.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:op(f.current,{select:!0})},t=function(e){if(p.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||op(f.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&op(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return s&&n.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}}),[n,s,p.paused]),g.useEffect((()=>{if(s){AO.add(p);const e=document.activeElement;if(!s.contains(e)){const t=new CustomEvent(G4,CO);s.addEventListener(G4,c),s.dispatchEvent(t),t.defaultPrevented||(nse(ise(XL(s)),{select:!0}),document.activeElement===e&&op(s))}return()=>{s.removeEventListener(G4,c),setTimeout((()=>{const t=new CustomEvent(q4,CO);s.addEventListener(q4,u),s.dispatchEvent(t),t.defaultPrevented||op(e??document.body,{select:!0}),s.removeEventListener(q4,u),AO.remove(p)}),0)}}}),[s,c,u,p]);const h=g.useCallback((e=>{if(!r&&!n||p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[n,o]=rse(t);n&&o?e.shiftKey||a!==o?e.shiftKey&&a===n&&(e.preventDefault(),r&&op(o,{select:!0})):(e.preventDefault(),r&&op(n,{select:!0})):a===t&&e.preventDefault()}}),[r,n,p.paused]);return E.jsx(kf.div,{tabIndex:-1,...i,ref:d,onKeyDown:h})}));function nse(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(op(n,{select:t}),document.activeElement!==r)return}function rse(e){const t=XL(e);return[IO(t,e),IO(t.reverse(),e)]}function XL(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function IO(e,t){for(const r of e)if(!ase(r,{upTo:t}))return r}function ase(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ose(e){return e instanceof HTMLInputElement&&"select"in e}function op(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ose(e)&&t&&e.select()}}KL.displayName=tse;var AO=sse();function sse(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=RO(e,t),e.unshift(t)},remove(t){var r;e=RO(e,t),null==(r=e[0])||r.resume()}}}function RO(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}function ise(e){return e.filter((e=>"A"!==e.tagName))}var cse="Portal",ZL=g.forwardRef(((e,t)=>{var r;const{container:n,...a}=e,[o,i]=g.useState(!1);aw((()=>i(!0)),[]);const s=n||o&&(null==(r=null==globalThis?void 0:globalThis.document)?void 0:r.body);return s?xA.createPortal(E.jsx(kf.div,{...a,ref:t}),s):null}));function lse(e,t){return g.useReducer(((e,r)=>t[e][r]??e),e)}ZL.displayName=cse;var T2=e=>{const{present:t,children:r}=e,n=use(t),a="function"==typeof r?r({present:n.isPresent}):g.Children.only(r),o=Cm(n.ref,fse(a));return"function"==typeof r||n.isPresent?g.cloneElement(a,{ref:o}):null};function use(e){const[t,r]=g.useState(),n=g.useRef({}),a=g.useRef(e),o=g.useRef("none"),i=e?"mounted":"unmounted",[s,l]=lse(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect((()=>{const e=a_(n.current);o.current="mounted"===s?e:"none"}),[s]),aw((()=>{const t=n.current,r=a.current;if(r!==e){const n=o.current,i=a_(t);e?l("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?l("UNMOUNT"):l(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),a.current=e}}),[e,l]),aw((()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=o=>{const i=a_(n.current).includes(o.animationName);if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)}))}},s=e=>{e.target===t&&(o.current=a_(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback((e=>{e&&(n.current=getComputedStyle(e)),r(e)}),[])}}function a_(e){return(null==e?void 0:e.animationName)||"none"}function fse(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}T2.displayName="Presence";var W4=0;function dse(){g.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??TO()),document.body.insertAdjacentElement("beforeend",e[1]??TO()),W4++,()=>{1===W4&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),W4--}}),[])}function TO(){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 JL=u7(),H4=function(){},P2=g.forwardRef((function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:H4,onWheelCapture:H4,onTouchMoveCapture:H4}),a=n[0],o=n[1],i=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,p=e.noIsolation,h=e.inert,m=e.allowPinchZoom,y=e.as,v=void 0===y?"div":y,b=e.gapMode,w=RA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=d,k=l7([r,t]),x=To(To({},w),a);return g.createElement(g.Fragment,null,u&&g.createElement(_,{sideCar:JL,removeScrollBar:c,shards:f,noIsolation:p,inert:h,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:b}),i?g.cloneElement(g.Children.only(s),To(To({},x),{ref:k})):g.createElement(v,To({},x,{className:l,ref:k}),s))}));P2.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},P2.classNames={fullWidth:jy,zeroRight:Dy};var ZC=!1;if(typeof window<"u")try{var o_=Object.defineProperty({},"passive",{get:function(){return ZC=!0,!0}});window.addEventListener("test",o_,o_),window.removeEventListener("test",o_,o_)}catch{ZC=!1}var e0=!!ZC&&{passive:!1},pse=function(e){return"TEXTAREA"===e.tagName},eV=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!pse(e)&&"visible"===r[t])},hse=function(e){return eV(e,"overflowY")},mse=function(e){return eV(e,"overflowX")},PO=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),tV(e,n)){var a=nV(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gse=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},yse=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},tV=function(e,t){return"v"===e?hse(t):mse(t)},nV=function(e,t){return"v"===e?gse(t):yse(t)},vse=function(e,t){return"h"===e&&"rtl"===t?-1:1},bse=function(e,t,r,n,a){var o=vse(e,window.getComputedStyle(t).direction),i=o*n,s=r.target,l=t.contains(s),c=!1,u=i>0,f=0,d=0;do{var p=nV(e,s),h=p[0],g=p[1]-p[2]-o*h;(h||g)&&tV(e,s)&&(f+=g,d+=h),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(Math.abs(f)<1||!a)||!u&&(Math.abs(d)<1||!a))&&(c=!0),c},s_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$O=function(e){return[e.deltaX,e.deltaY]},zO=function(e){return e&&"current"in e?e.current:e},_se=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wse=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},kse=0,t0=[];function xse(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),a=g.useState(kse++)[0],o=g.useState(TA)[0],i=g.useRef(e);g.useEffect((function(){i.current=e}),[e]),g.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=c7([e.lockRef.current],(e.shards||[]).map(zO),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=s_(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],u=e.target,f=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===f&&"range"===u.type)return!1;var d=PO(f,u);if(!d)return!0;if(d?a=f:(a="v"===f?"h":"v",d=PO(f,u)),!d)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var p=n.current||a;return bse(p,t,e,"h"===p?l:c,!0)}),[]),l=g.useCallback((function(e){var r=e;if(t0.length&&t0[t0.length-1]===o){var n="deltaY"in r?$O(r):s_(r),a=t.current.filter((function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&_se(e.delta,n)}))[0];if(a&&a.should)return void(r.cancelable&&r.preventDefault());if(!a){var l=(i.current.shards||[]).map(zO).filter(Boolean).filter((function(e){return e.contains(r.target)}));(l.length>0?s(r,l[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}}),[]),c=g.useCallback((function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:Sse(n)};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),u=g.useCallback((function(e){r.current=s_(e),n.current=void 0}),[]),f=g.useCallback((function(t){c(t.type,$O(t),t.target,s(t,e.lockRef.current))}),[]),d=g.useCallback((function(t){c(t.type,s_(t),t.target,s(t,e.lockRef.current))}),[]);g.useEffect((function(){return t0.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,e0),document.addEventListener("touchmove",l,e0),document.addEventListener("touchstart",u,e0),function(){t0=t0.filter((function(e){return e!==o})),document.removeEventListener("wheel",l,e0),document.removeEventListener("touchmove",l,e0),document.removeEventListener("touchstart",u,e0)}}),[]);var p=e.removeScrollBar,h=e.inert;return g.createElement(g.Fragment,null,h?g.createElement(o,{styles:wse(a)}):null,p?g.createElement(h7,{gapMode:e.gapMode}):null)}function Sse(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ese=d7(JL,xse);var rV=g.forwardRef((function(e,t){return g.createElement(P2,To({},e,{ref:t,sideCar:Ese}))}));rV.classNames=P2.classNames;var dR="Dialog",[aV,zot]=Moe(dR),[Cse,Kc]=aV(dR),oV=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,s=g.useRef(null),l=g.useRef(null),[c=!1,u]=joe({prop:n,defaultProp:a,onChange:o});return E.jsx(Cse,{scope:t,triggerRef:s,contentRef:l,contentId:U4(),titleId:U4(),descriptionId:U4(),open:c,onOpenChange:u,onOpenToggle:g.useCallback((()=>u((e=>!e))),[u]),modal:i,children:r})};oV.displayName=dR;var sV="DialogTrigger",iV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(sV,r),o=Cm(t,a.triggerRef);return E.jsx(kf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":mR(a.open),...n,ref:o,onClick:fp(e.onClick,a.onOpenToggle)})}));iV.displayName=sV;var pR="DialogPortal",[Ise,cV]=aV(pR,{forceMount:void 0}),lV=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=Kc(pR,t);return E.jsx(Ise,{scope:t,forceMount:r,children:g.Children.map(n,(e=>E.jsx(T2,{present:r||o.open,children:E.jsx(ZL,{asChild:!0,container:a,children:e})})))})};lV.displayName=pR;var ow="DialogOverlay",uV=g.forwardRef(((e,t)=>{const r=cV(ow,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=Kc(ow,e.__scopeDialog);return o.modal?E.jsx(T2,{present:n||o.open,children:E.jsx(Rse,{...a,ref:t})}):null}));uV.displayName=ow;var Ase=WL("DialogOverlay.RemoveScroll"),Rse=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(ow,r);return E.jsx(rV,{as:Ase,allowPinchZoom:!0,shards:[a.contentRef],children:E.jsx(kf.div,{"data-state":mR(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})})),hm="DialogContent",fV=g.forwardRef(((e,t)=>{const r=cV(hm,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=Kc(hm,e.__scopeDialog);return E.jsx(T2,{present:n||o.open,children:o.modal?E.jsx(Tse,{...a,ref:t}):E.jsx(Pse,{...a,ref:t})})}));fV.displayName=hm;var Tse=g.forwardRef(((e,t)=>{const r=Kc(hm,e.__scopeDialog),n=g.useRef(null),a=Cm(t,r.contentRef,n);return g.useEffect((()=>{const e=n.current;if(e)return p2(e)}),[]),E.jsx(dV,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fp(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null==(t=r.triggerRef.current)||t.focus()})),onPointerDownOutside:fp(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()})),onFocusOutside:fp(e.onFocusOutside,(e=>e.preventDefault()))})})),Pse=g.forwardRef(((e,t)=>{const r=Kc(hm,e.__scopeDialog),n=g.useRef(!1),a=g.useRef(!1);return E.jsx(dV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,i;null==(o=e.onCloseAutoFocus)||o.call(e,t),t.defaultPrevented||(n.current||null==(i=r.triggerRef.current)||i.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{var o,i;null==(o=e.onInteractOutside)||o.call(e,t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=r.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})})),dV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,s=Kc(hm,r),l=g.useRef(null),c=Cm(t,l);return dse(),E.jsxs(E.Fragment,{children:[E.jsx(KL,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:E.jsx(QL,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":mR(s.open),...i,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),E.jsxs(E.Fragment,{children:[E.jsx($se,{titleId:s.titleId}),E.jsx(Mse,{contentRef:l,descriptionId:s.descriptionId})]})]})})),hR="DialogTitle",pV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(hR,r);return E.jsx(kf.h2,{id:a.titleId,...n,ref:t})}));pV.displayName=hR;var hV="DialogDescription",mV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(hV,r);return E.jsx(kf.p,{id:a.descriptionId,...n,ref:t})}));mV.displayName=hV;var gV="DialogClose",yV=g.forwardRef(((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kc(gV,r);return E.jsx(kf.button,{type:"button",...n,ref:t,onClick:fp(e.onClick,(()=>a.onOpenChange(!1)))})}));function mR(e){return e?"open":"closed"}yV.displayName=gV;var vV="DialogTitleWarning",[Mot,bV]=zoe(vV,{contentName:hm,titleName:hR,docsSlug:"dialog"}),$se=({titleId:e})=>{const t=bV(vV),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect((()=>{e&&(document.getElementById(e)||console.error(r))}),[r,e]),null},zse="DialogDescriptionWarning",Mse=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bV(zse).contentName}}.`;return g.useEffect((()=>{var n;const a=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))}),[r,e,t]),null},Ose=oV,Nse=iV,Dse=lV,jse=uV,Lse=fV,Vse=pV,Bse=mV,Fse=yV;function Use(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const _V=be.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),B0=()=>{const e=be.useContext(_V);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Use("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}");const Gse=24,qse=typeof window<"u"?g.useLayoutEffect:g.useEffect;function MO(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function Wse(){return gR(/^Mac/)}function Hse(){return gR(/^iPhone/)}function OO(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Qse(){return gR(/^iPad/)||Wse()&&navigator.maxTouchPoints>1}function wV(){return Hse()||Qse()}function gR(e){return typeof window<"u"&&null!=window.navigator?e.test(window.navigator.platform):void 0}const Q4=typeof document<"u"&&window.visualViewport;function NO(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function kV(e){for(NO(e)&&(e=e.parentElement);e&&!NO(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Yse=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Y4,i_=0;function Kse(e={}){let{isDisabled:t}=e;qse((()=>{if(!t)return i_++,1===i_&&wV()&&(Y4=Xse()),()=>{i_--,0===i_&&(null==Y4||Y4())}}),[t])}function Xse(){let e,t=0,r=window.pageXOffset,n=window.pageYOffset,a=MO(Zse(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let o=MO(ty(document,"touchstart",(r=>{e=kV(r.target),(e!==document.documentElement||e!==document.body)&&(t=r.changedTouches[0].pageY)}),{passive:!1,capture:!0}),ty(document,"touchmove",(r=>{if(!e||e===document.documentElement||e===document.body)return void r.preventDefault();let n=r.changedTouches[0].pageY,a=e.scrollTop,o=e.scrollHeight-e.clientHeight;0!==o&&((a<=0&&n>t||a>=o&&n<t)&&r.preventDefault(),t=n)}),{passive:!1,capture:!0}),ty(document,"touchend",(e=>{let t=e.target;JC(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame((()=>{t.style.transform=""})))}),{passive:!1,capture:!0}),ty(document,"focus",(e=>{let t=e.target;JC(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame((()=>{t.style.transform="",Q4&&(Q4.height<window.innerHeight?requestAnimationFrame((()=>{DO(t)})):Q4.addEventListener("resize",(()=>DO(t)),{once:!0}))})))}),!0),ty(window,"scroll",(()=>{window.scrollTo(0,0)})));return()=>{a(),o(),window.scrollTo(r,n)}}function Zse(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function ty(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function DO(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=kV(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=n-r)}e=t.parentElement}}function JC(e){return e instanceof HTMLInputElement&&!Yse.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Jse(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function eie(...e){return t=>e.forEach((e=>Jse(e,t)))}function xV(...e){return g.useCallback(eie(...e),e)}const SV=new WeakMap;function Ea(e,t,r=!1){if(!(e&&e instanceof HTMLElement))return;let n={};Object.entries(t).forEach((([t,r])=>{t.startsWith("--")?e.style.setProperty(t,r):(n[t]=e.style[t],e.style[t]=r)})),!r&&SV.set(e,n)}function tie(e,t){if(!(e&&e instanceof HTMLElement))return;let r=SV.get(e);r&&(e.style[t]=r[t])}const Ca=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function c_(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let a=n.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[Ca(t)?13:12]):(a=n.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[Ca(t)?5:4]):null)}function nie(e){return 8*(Math.log(e+1)-2)}function K4(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function rie(...e){return(...t)=>{for(const r of e)"function"==typeof r&&r(...t)}}const br={DURATION:.5,EASE:[.32,.72,0,1]},EV=.4,aie=.25,oie=100,CV=8,Fh=16,eI=26,X4="vaul-dragging";function IV(e){const t=be.useRef(e);return be.useEffect((()=>{t.current=e})),be.useMemo((()=>(...e)=>null==t.current?void 0:t.current.call(t,...e)),[])}function sie({defaultProp:e,onChange:t}){const r=be.useState(e),[n]=r,a=be.useRef(n),o=IV(t);return be.useEffect((()=>{a.current!==n&&(o(n),a.current=n)}),[n,a,o]),r}function AV({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=sie({defaultProp:t,onChange:r}),o=void 0!==e,i=o?e:n,s=IV(r);return[i,be.useCallback((t=>{if(o){const r="function"==typeof t?t(e):t;r!==e&&s(r)}else a(t)}),[o,e,a,s])]}function iie({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:a,fadeFromIndex:o,onSnapPointChange:i,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,f]=AV({prop:e,defaultProp:null==r?void 0:r[0],onChange:t}),[d,p]=be.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);be.useEffect((()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const h=be.useMemo((()=>u===(null==r?void 0:r[r.length-1])||null),[r,u]),g=be.useMemo((()=>null==r?void 0:r.findIndex((e=>e===u))),[r,u]),m=r&&r.length>0&&(o||0===o)&&!Number.isNaN(o)&&r[o]===u||!r,y=be.useMemo((()=>{const e=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==r?void 0:r.map((t=>{const r="string"==typeof t;let n=0;if(r&&(n=parseInt(t,10)),Ca(s)){const a=r?n:d?t*e.height:0;return d?"bottom"===s?e.height-a:-e.height+a:a}const a=r?n:d?t*e.width:0;return d?"right"===s?e.width-a:-e.width+a:a})))?t:[]}),[r,d,l]),v=be.useMemo((()=>null!==g?null==y?void 0:y[g]:null),[y,g]),b=be.useCallback((e=>{var t;const l=null!=(t=null==y?void 0:y.findIndex((t=>t===e)))?t:null;i(l),Ea(n.current,{transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,transform:Ca(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),y&&l!==y.length-1&&l!==o&&l<o?Ea(a.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,opacity:"0"}):Ea(a.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(l,0)])}),[n.current,r,y,o,a,f]);return be.useEffect((()=>{if(u||e){var t;const n=null!=(t=null==r?void 0:r.findIndex((t=>t===e||t===u)))?t:-1;y&&-1!==n&&"number"==typeof y[n]&&b(y[n])}}),[u,e,r,y,b]),{isLastSnapPoint:h,activeSnapPoint:u,shouldFade:m,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!y||void 0===o)return null;const n=g===o-1;if(g>=o&&t)return 0;if(n&&!t)return 1;if(!m&&!n)return null;const a=n?g+1:g-1,i=n?y[a]-y[a-1]:y[a+1]-y[a],s=e/Math.abs(i);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:i}){if(void 0===o)return;const l="bottom"===s||"right"===s?(v??0)-e:(v??0)+e,u=0===g,f=e>0;if(g===o-1&&Ea(a.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`}),!c&&n>2&&!f)return void(i?t():b(y[0]));if(!c&&n>2&&f&&y&&r)return void b(y[r.length-1]);const d=null==y?void 0:y.reduce(((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-l)<Math.abs(e-l)?t:e)),p=Ca(s)?window.innerHeight:window.innerWidth;if(n>EV&&Math.abs(e)<.4*p){const e=f?1:-1;if(e>0&&h)return void b(y[r.length-1]);if(u&&e<0&&i&&t(),null===g)return;b(y[g+e])}else b(d)},onDrag:function({draggedDistance:e}){if(null===v)return;const t="bottom"===s||"right"===s?v-e:v+e;("bottom"===s||"right"===s)&&t<y[y.length-1]||("top"===s||"left"===s)&&t>y[y.length-1]||Ea(n.current,{transform:Ca(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:y}}const cie=()=>()=>{};function lie(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:a}=B0(),o=be.useRef(null),i=g.useMemo((()=>document.body.style.backgroundColor),[]);function s(){return(window.innerWidth-26)/window.innerWidth}be.useEffect((()=>{if(t&&r){o.current&&clearTimeout(o.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;rie(n&&!a?K4(document.body,{background:"black"}):cie,K4(t,{transformOrigin:Ca(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${br.DURATION}s`,transitionTimingFunction:`cubic-bezier(${br.EASE.join(",")})`}));const r=K4(t,{borderRadius:"8px",overflow:"hidden",...Ca(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{r(),o.current=window.setTimeout((()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")}),1e3*br.DURATION)}}}),[t,r,i])}let ny=null;function uie({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:a,noBodyStyles:o}){const[i,s]=be.useState((()=>typeof window<"u"?window.location.href:"")),l=be.useRef(0),c=be.useCallback((()=>{if(OO()&&null===ny&&e&&!o){ny={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-l.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout((()=>window.requestAnimationFrame((()=>{const e=t-window.innerHeight;e&&l.current>=t&&(document.body.style.top=-(l.current+e)+"px")}))),300)}}),[e]),u=be.useCallback((()=>{if(OO()&&null!==ny&&!o){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,ny),window.requestAnimationFrame((()=>{a&&i!==window.location.href?s(window.location.href):window.scrollTo(t,e)})),ny=null}}),[i]);return be.useEffect((()=>{function e(){l.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]),be.useEffect((()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout((()=>{u()}),500)):u())}),[e,n,i,t,r,c,u]),{restorePositionSetting:u}}function RV({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:a,snapPoints:o,shouldScaleBackground:i=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=aie,scrollLockTimeout:c=100,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:d=o&&o.length-1,activeSnapPoint:p,setActiveSnapPoint:h,fixed:g,modal:m=!0,onClose:y,nested:v,noBodyStyles:b,direction:w="bottom",defaultOpen:_=!1,disablePreventScroll:k=!0,snapToSequentialPoint:x=!1,preventScrollRestoration:E=!1,repositionInputs:A=!0,onAnimationEnd:S,container:C,autoFocus:z=!1}){var I,j;const[P=!1,T]=AV({defaultProp:_,prop:e,onChange:e=>{null==t||t(e),!e&&!v&&le(),setTimeout((()=>{null==S||S(e)}),1e3*br.DURATION),e&&!m&&typeof window<"u"&&window.requestAnimationFrame((()=>{document.body.style.pointerEvents="auto"})),e||(document.body.style.pointerEvents="auto")}}),[R,N]=be.useState(!1),[O,M]=be.useState(!1),[D,L]=be.useState(!1),q=be.useRef(null),V=be.useRef(null),B=be.useRef(null),U=be.useRef(null),F=be.useRef(null),$=be.useRef(!1),G=be.useRef(null),Q=be.useRef(0),W=be.useRef(!1),H=be.useRef(0),K=be.useRef(null),Y=be.useRef((null==(I=K.current)?void 0:I.getBoundingClientRect().height)||0),Z=be.useRef((null==(j=K.current)?void 0:j.getBoundingClientRect().width)||0),X=be.useRef(0),J=be.useCallback((e=>{o&&e===ae.length-1&&(V.current=new Date)}),[]),{activeSnapPoint:ee,activeSnapPointIndex:te,setActiveSnapPoint:re,onRelease:ne,snapPointsOffset:ae,onDrag:oe,shouldFade:ie,getPercentageDragged:se}=iie({snapPoints:o,activeSnapPointProp:p,setActiveSnapPointProp:h,drawerRef:K,fadeFromIndex:d,overlayRef:q,onSnapPointChange:J,direction:w,container:C,snapToSequentialPoint:x});Kse({isDisabled:!P||O||!m||D||!R||!A||!k});const{restorePositionSetting:le}=uie({isOpen:P,modal:m,nested:v,hasBeenOpened:R,preventScrollRestoration:E,noBodyStyles:b});function ce(){return(window.innerWidth-26)/window.innerWidth}function ue(e,t){var r,n;let a=e;const o=null==(r=window.getSelection())?void 0:r.toString(),i=K.current?c_(K.current,w):null,s=new Date;if(a.hasAttribute("data-vaul-no-drag")||a.closest("[data-vaul-no-drag]"))return!1;if("right"===w||"left"===w)return!0;if(V.current&&s.getTime()-V.current.getTime()<500)return!1;if(null!==i&&("bottom"===w?i>0:i<0))return!0;if(o&&o.length>0)return!1;if(s.getTime()-(null==(n=F.current)?void 0:n.getTime())<c&&0===i||t)return F.current=s,!1;for(;a;){if(a.scrollHeight>a.clientHeight){if(0!==a.scrollTop)return F.current=new Date,!1;if("dialog"===a.getAttribute("role"))return!0}a=a.parentNode}return!0}function fe(e){!O||!K.current||(K.current.classList.remove(X4),$.current=!1,M(!1),U.current=new Date),null==y||y(),e||T(!1),setTimeout((()=>{o&&re(o[0])}),1e3*br.DURATION)}function de(){if(!K.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=c_(K.current,w);Ea(K.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`}),Ea(q.current,{transition:`opacity ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,opacity:"1"}),i&&t&&t>0&&P&&Ea(e,{borderRadius:"8px",overflow:"hidden",...Ca(w)?{transform:`scale(${ce()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ce()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${br.DURATION}s`,transitionTimingFunction:`cubic-bezier(${br.EASE.join(",")})`},!0)}return be.useEffect((()=>{var e;function t(){if(!K.current||!A)return;if(JC(document.activeElement)||W.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,r=window.innerHeight;let n=r-t;const a=K.current.getBoundingClientRect().height||0,i=a>.8*r;X.current||(X.current=a);const s=K.current.getBoundingClientRect().top;if(Math.abs(H.current-n)>60&&(W.current=!W.current),o&&o.length>0&&ae&&te){n+=ae[te]||0}if(H.current=n,a>t||W.current){const e=K.current.getBoundingClientRect().height;let r=e;e>t&&(r=t-(i?s:26)),K.current.style.height=g?e-Math.max(n,0)+"px":`${Math.max(r,t-s)}px`}else K.current.style.height=`${X.current}px`;o&&o.length>0&&!W.current?K.current.style.bottom="0px":K.current.style.bottom=`${Math.max(n,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}}),[te,o,ae]),be.useEffect((()=>(P&&(Ea(document.documentElement,{scrollBehavior:"auto"}),V.current=new Date),()=>{tie(document.documentElement,"scrollBehavior")})),[P]),be.createElement(Ose,{defaultOpen:_,onOpenChange:e=>{!u&&!e||(e?N(!0):fe(!0),T(e))},open:P},be.createElement(_V.Provider,{value:{activeSnapPoint:ee,snapPoints:o,setActiveSnapPoint:re,drawerRef:K,overlayRef:q,onOpenChange:t,onPress:function(e){var t,r;!u&&!o||K.current&&!K.current.contains(e.target)||(Y.current=(null==(t=K.current)?void 0:t.getBoundingClientRect().height)||0,Z.current=(null==(r=K.current)?void 0:r.getBoundingClientRect().width)||0,M(!0),B.current=new Date,wV()&&window.addEventListener("touchend",(()=>$.current=!1),{once:!0}),e.target.setPointerCapture(e.pointerId),Q.current=Ca(w)?e.pageY:e.pageX)},onRelease:function(e){if(!O||!K.current)return;K.current.classList.remove(X4),$.current=!1,M(!1),U.current=new Date;const t=c_(K.current,w);if(!ue(e.target,!1)||!t||Number.isNaN(t)||null===B.current)return;const r=U.current.getTime()-B.current.getTime(),n=Q.current-(Ca(w)?e.pageY:e.pageX),i=Math.abs(n)/r;if(i>.05&&(L(!0),setTimeout((()=>{L(!1)}),200)),o)return ne({draggedDistance:n*("bottom"===w||"right"===w?1:-1),closeDrawer:fe,velocity:i,dismissible:u}),void(null==a||a(e,!0));if("bottom"===w||"right"===w?n>0:n<0)return de(),void(null==a||a(e,!0));if(i>EV)return fe(),void(null==a||a(e,!1));var s;const c=Math.min(null!=(s=K.current.getBoundingClientRect().height)?s:0,window.innerHeight);var f;const d=Math.min(null!=(f=K.current.getBoundingClientRect().width)?f:0,window.innerWidth),p="left"===w||"right"===w;if(Math.abs(t)>=(p?d:c)*l)return fe(),void(null==a||a(e,!1));null==a||a(e,!0),de()},onDrag:function(e){if(K.current&&O){const t="bottom"===w||"right"===w?1:-1,r=(Q.current-(Ca(w)?e.pageY:e.pageX))*t,a=r>0,s=o&&!u&&!a;if(s&&0===te)return;const l=Math.abs(r),c=document.querySelector("[data-vaul-drawer-wrapper]");let f=l/("bottom"===w||"top"===w?Y.current:Z.current);const p=se(l,a);if(null!==p&&(f=p),s&&f>=1||!$.current&&!ue(e.target,a))return;if(K.current.classList.add(X4),$.current=!0,Ea(K.current,{transition:"none"}),Ea(q.current,{transition:"none"}),o&&oe({draggedDistance:r}),a&&!o){const e=nie(r),n=Math.min(-1*e,0)*t;return void Ea(K.current,{transform:Ca(w)?`translate3d(0, ${n}px, 0)`:`translate3d(${n}px, 0, 0)`})}const h=1-f;if((ie||d&&te===d-1)&&(null==n||n(e,f),Ea(q.current,{opacity:`${h}`,transition:"none"},!0)),c&&q.current&&i){const e=Math.min(ce()+f*(1-ce()),1),t=8-8*f,r=Math.max(0,14-14*f);Ea(c,{borderRadius:`${t}px`,transform:Ca(w)?`scale(${e}) translate3d(0, ${r}px, 0)`:`scale(${e}) translate3d(${r}px, 0, 0)`,transition:"none"},!0)}if(!o){const e=l*t;Ea(K.current,{transform:Ca(w)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:u,handleOnly:f,isOpen:P,isDragging:O,shouldFade:ie,closeDrawer:fe,onNestedDrag:function(e,t){if(t<0)return;const r=(window.innerWidth-16)/window.innerWidth,n=r+t*(1-r),a=16*t-16;Ea(K.current,{transform:Ca(w)?`scale(${n}) translate3d(0, ${a}px, 0)`:`scale(${n}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-16)/window.innerWidth:1,r=e?-16:0;G.current&&window.clearTimeout(G.current),Ea(K.current,{transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,transform:`scale(${t}) translate3d(0, ${r}px, 0)`}),!e&&K.current&&(G.current=setTimeout((()=>{const e=c_(K.current,w);Ea(K.current,{transition:"none",transform:Ca(w)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}),500))},onNestedRelease:function(e,t){const r=Ca(w)?window.innerHeight:window.innerWidth,n=t?(r-16)/r:1,a=t?-16:0;t&&Ea(K.current,{transition:`transform ${br.DURATION}s cubic-bezier(${br.EASE.join(",")})`,transform:Ca(w)?`scale(${n}) translate3d(0, ${a}px, 0)`:`scale(${n}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:W,modal:m,snapPointsOffset:ae,direction:w,shouldScaleBackground:i,setBackgroundColorOnScale:s,noBodyStyles:b,container:C,autoFocus:z}},r))}const TV=be.forwardRef((function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:a,shouldFade:o,isOpen:i,modal:s}=B0(),l=xV(t,r),c=n&&n.length>0;return s?be.createElement(jse,{onMouseUp:a,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":i&&c?"true":"false","data-vaul-snap-points-overlay":i&&o?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame((()=>{document.body.style.pointerEvents="auto"})),null)}));TV.displayName="Drawer.Overlay";const PV=be.forwardRef((function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},a){const{drawerRef:o,onPress:i,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,modal:f,isOpen:d,direction:p,snapPoints:h,container:g,handleOnly:m,autoFocus:y}=B0(),[v,b]=be.useState(!1),w=xV(a,o),_=be.useRef(null),k=be.useRef(null),x=be.useRef(!1),E=h&&h.length>0;lie();function A(e){_.current=null,x.current=!1,s(e)}return be.useEffect((()=>{E&&window.requestAnimationFrame((()=>{b(!0)}))}),[]),be.createElement(Lse,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":v?"true":"false","data-vaul-snap-points":d&&E?"true":"false","data-vaul-custom-container":g?"true":"false",...n,ref:w,style:u&&u.length>0?{"--snap-point-height":`${u[0]}px`,...t}:t,onPointerDown:e=>{m||(null==n.onPointerDown||n.onPointerDown.call(n,e),_.current={x:e.pageX,y:e.pageY},i(e))},onOpenAutoFocus:e=>{null==r||r(e),y||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),f&&!t.defaultPrevented?c.current&&(c.current=!1):t.preventDefault()},onFocusOutside:e=>{f||e.preventDefault()},onPointerMove:e=>{if(k.current=e,m||(null==n.onPointerMove||n.onPointerMove.call(n,e),!_.current))return;const t=e.pageY-_.current.y,r=e.pageX-_.current.x,a="touch"===e.pointerType?10:2;((e,t,r=0)=>{if(x.current)return!0;const n=Math.abs(e.y),a=Math.abs(e.x),o=a>n,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&a>=0&&a<=r)return o}else if(!(e.y*i<0)&&n>=0&&n<=r)return!o;return x.current=!0,!0})({x:r,y:t},p,a)?l(e):(Math.abs(r)>a||Math.abs(t)>a)&&(_.current=null)},onPointerUp:e=>{null==n.onPointerUp||n.onPointerUp.call(n,e),_.current=null,x.current=!1,s(e)},onPointerOut:e=>{null==n.onPointerOut||n.onPointerOut.call(n,e),A(k.current)},onContextMenu:e=>{null==n.onContextMenu||n.onContextMenu.call(n,e),A(k.current)}})}));PV.displayName="Drawer.Content";const fie=250,die=120,$V=be.forwardRef((function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:a,isDragging:o,snapPoints:i,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:f,onPress:d,onDrag:p}=B0(),h=be.useRef(null),g=be.useRef(!1);function m(){window.clearTimeout(h.current),g.current=!1}return be.createElement("div",{onClick:function(){g.current?m():window.setTimeout((()=>{!function(){if(o||e||g.current)return void m();if(m(),(!i||0===i.length)&&c)return void a();if(s===i[i.length-1]&&c)return void a();const t=i.findIndex((e=>e===s));if(-1===t)return;const r=i[t+1];l(r)}()}),120)},onPointerCancel:m,onPointerDown:e=>{u&&d(e),h.current=window.setTimeout((()=>{g.current=!0}),250)},onPointerMove:e=>{u&&p(e)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},be.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))}));function pie({onDrag:e,onOpenChange:t,...r}){const{onNestedDrag:n,onNestedOpenChange:a,onNestedRelease:o}=B0();if(!n)throw new Error("Drawer.NestedRoot must be placed in another drawer");return be.createElement(RV,{nested:!0,onClose:()=>{a(!1)},onDrag:(t,r)=>{n(t,r),null==e||e(t,r)},onOpenChange:e=>{e&&a(e)},onRelease:o,...r})}function hie(e){const t=B0(),{container:r=t.container,...n}=e;return be.createElement(Dse,{container:r,...n})}$V.displayName="Drawer.Handle";const Ap={Root:RV,NestedRoot:pie,Content:PV,Overlay:TV,Trigger:Nse,Portal:hie,Handle:$V,Close:Fse,Title:Vse,Description:Bse},mie=Ap.Portal,zV=g.forwardRef((({className:e,...t},r)=>E.jsx(Ap.Overlay,{ref:r,className:he("fixed inset-0 z-50 bg-black/5",e),...t})));zV.displayName=Ap.Overlay.displayName;const gie=g.forwardRef((({className:e,children:t,direction:r="bottom",...n},a)=>E.jsxs(mie,{children:[E.jsx(zV,{}),E.jsxs(Ap.Content,{ref:a,className:he("fixed z-50 border bg-background shadow-lg","bottom"===r&&"inset-x-0 bottom-0 mt-24 flex h-auto flex-col rounded-t-sm","top"===r&&"inset-x-0 top-0 mb-24 flex h-auto flex-col rounded-b-sm","left"===r&&"inset-y-0 left-0 flex h-full flex-col","right"===r&&"inset-y-0 right-0 flex h-full w-[346px] flex-col sm:w-[435px]",e),...n,children:["bottom"===r&&E.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]})));gie.displayName="DrawerContent";const yie=g.forwardRef((({className:e,...t},r)=>E.jsx(Ap.Title,{ref:r,className:he("text-lg font-semibold leading-none tracking-tight",e),...t})));yie.displayName=Ap.Title.displayName;const vie=g.forwardRef((({className:e,...t},r)=>E.jsx(Ap.Description,{ref:r,className:he("text-sm text-muted-foreground",e),...t})));function yR(e){const t=e+"CollectionProvider",[r,n]=as(t),[a,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:r}=e,n=be.useRef(null),o=be.useRef(new Map).current;return be.createElement(a,{scope:t,itemMap:o,collectionRef:n},r)},Slot:be.forwardRef(((e,t)=>{const{scope:r,children:n}=e,a=dn(t,o(i,r).collectionRef);return be.createElement(lm,{ref:a},n)})),ItemSlot:be.forwardRef(((e,t)=>{const{scope:r,children:n,...a}=e,i=be.useRef(null),c=dn(t,i),u=o(s,r);return be.useEffect((()=>(u.itemMap.set(i,{ref:i,...a}),()=>{u.itemMap.delete(i)}))),be.createElement(lm,{[l]:"",ref:c},n)}))},function(t){const r=o(e+"CollectionConsumer",t);return be.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`));return Array.from(r.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)))}),[r.collectionRef,r.itemMap])},n]}vie.displayName=Ap.Description.displayName;const bie=g.createContext(void 0);function Wv(e){const t=g.useContext(bie);return e||t||"ltr"}const _ie=["top","right","bottom","left"],yp=Math.min,ei=Math.max,sw=Math.round,l_=Math.floor,vp=e=>({x:e,y:e}),wie={left:"right",right:"left",bottom:"top",top:"bottom"},kie={start:"end",end:"start"};function tI(e,t,r){return ei(e,yp(t,r))}function vf(e,t){return"function"==typeof e?e(t):e}function bf(e){return e.split("-")[0]}function F0(e){return e.split("-")[1]}function vR(e){return"x"===e?"y":"x"}function bR(e){return"y"===e?"height":"width"}function bp(e){return["top","bottom"].includes(bf(e))?"y":"x"}function _R(e){return vR(bp(e))}function xie(e,t,r){void 0===r&&(r=!1);const n=F0(e),a=_R(e),o=bR(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=iw(i)),[i,iw(i)]}function Sie(e){const t=iw(e);return[nI(e),t,nI(t)]}function nI(e){return e.replace(/start|end/g,(e=>kie[e]))}function Eie(e,t,r){const n=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?o:i;default:return[]}}function Cie(e,t,r,n){const a=F0(e);let o=Eie(bf(e),"start"===r,n);return a&&(o=o.map((e=>e+"-"+a)),t&&(o=o.concat(o.map(nI)))),o}function iw(e){return e.replace(/left|right|bottom|top/g,(e=>wie[e]))}function Iie(e){return{top:0,right:0,bottom:0,left:0,...e}}function MV(e){return"number"!=typeof e?Iie(e):{top:e,right:e,bottom:e,left:e}}function cw(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function jO(e,t,r){let{reference:n,floating:a}=e;const o=bp(t),i=_R(t),s=bR(i),l=bf(t),c="y"===o,u=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,d=n[s]/2-a[s]/2;let p;switch(l){case"top":p={x:u,y:n.y-a.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-a.width,y:f};break;default:p={x:n.x,y:n.y}}switch(F0(t)){case"start":p[i]-=d*(r&&c?-1:1);break;case"end":p[i]+=d*(r&&c?-1:1)}return p}const Aie=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:f}=jO(c,n,l),d=n,p={},h=0;for(let r=0;r<s.length;r++){const{name:o,fn:g}=s[r],{x:m,y:y,data:v,reset:b}=await g({x:u,y:f,initialPlacement:n,placement:d,strategy:a,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=m??u,f=y??f,p={...p,[o]:{...p[o],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:u,y:f}=jO(c,d,l))),r=-1)}return{x:u,y:f,placement:d,strategy:a,middlewareData:p}};async function cv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=vf(t,e),h=MV(p),g=s[d?"floating"===f?"reference":"floating":f],m=cw(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===f?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},w=cw(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const Rie=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=vf(e,t)||{};if(null==c)return{};const f=MV(u),d={x:r,y:n},p=_R(a),h=bR(p),g=await i.getDimensions(c),m="y"===p,y=m?"top":"left",v=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[p]-d[p]-o.floating[h],_=d[p]-o.reference[p],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let x=k?k[b]:0;(!x||!await(null==i.isElement?void 0:i.isElement(k)))&&(x=s.floating[b]||o.floating[h]);const E=w/2-_/2,A=x/2-g[h]/2-1,S=yp(f[y],A),C=yp(f[v],A),z=S,I=x-g[h]-C,j=x/2-g[h]/2+E,P=tI(z,j,I),T=!l.arrow&&null!=F0(a)&&j!==P&&o.reference[h]/2-(j<z?S:C)-g[h]/2<0,R=T?j<z?j-z:j-I:0;return{[p]:d[p]+R,data:{[p]:P,centerOffset:j-P-R,...T&&{alignmentOffset:R}},reset:T}}}),Tie=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=vf(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const y=bf(a),v=bp(s),b=bf(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=d||(b||!g?[iw(s)]:Sie(s)),k="none"!==h;!d&&k&&_.push(...Cie(s,g,h,w));const x=[s,..._],E=await cv(t,m),A=[];let S=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&A.push(E[y]),f){const e=xie(a,i,w);A.push(E[e[0]],E[e[1]])}if(S=[...S,{placement:a,overflows:A}],!A.every((e=>e<=0))){var C,z;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let r=null==(z=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:z.placement;if(!r)switch(p){case"bestFit":{var I;const e=null==(I=S.filter((e=>{if(k){const t=bp(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(r=e);break}case"initialPlacement":r=s}if(a!==r)return{reset:{placement:r}}}return{}}}};function LO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function VO(e){return _ie.some((t=>e[t]>=0))}const Pie=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=vf(e,t);switch(n){case"referenceHidden":{const e=LO(await cv(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:VO(e)}}}case"escaped":{const e=LO(await cv(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:VO(e)}}}default:return{}}}}};async function $ie(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=bf(r),s=F0(r),l="y"===bp(r),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,f=vf(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}const zie=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await $ie(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},Mie=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=vf(e,t),c={x:r,y:n},u=await cv(t,l),f=bp(bf(a)),d=vR(f);let p=c[d],h=c[f];if(o){const e="y"===d?"bottom":"right";p=tI(p+u["y"===d?"top":"left"],p,p-u[e])}if(i){const e="y"===f?"bottom":"right";h=tI(h+u["y"===f?"top":"left"],h,h-u[e])}const g=s.fn({...t,[d]:p,[f]:h});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[d]:o,[f]:i}}}}}},Oie=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=vf(e,t),u={x:r,y:n},f=bp(a),d=vR(f);let p=u[d],h=u[f];const g=vf(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+m.mainAxis,r=o.reference[d]+o.reference[e]-m.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var y,v;const e="y"===d?"width":"height",t=["top","left"].includes(bf(a)),r=o.reference[f]-o.floating[e]+(t&&(null==(y=i.offset)?void 0:y[f])||0)+(t?0:m.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[f])||0)-(t?m.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[d]:p,[f]:h}}}},Nie=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=vf(e,t),u=await cv(t,c),f=bf(a),d=F0(a),p="y"===bp(a),{width:h,height:g}=o.floating;let m,y;"top"===f||"bottom"===f?(m=f,y=d===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,m="end"===d?"top":"bottom");const v=g-u.top-u.bottom,b=h-u.left-u.right,w=yp(g-u[m],v),_=yp(h-u[y],b),k=!t.middlewareData.shift;let x=w,E=_;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(x=v),k&&!d){const e=ei(u.left,0),t=ei(u.right,0),r=ei(u.top,0),n=ei(u.bottom,0);p?E=h-2*(0!==e||0!==t?e+t:ei(u.left,u.right)):x=g-2*(0!==r||0!==n?r+n:ei(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:x});const A=await i.getDimensions(s.floating);return h!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function $2(){return typeof window<"u"}function _p(e){return OV(e)?(e.nodeName||"").toLowerCase():"#document"}function ri(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function xf(e){var t;return null==(t=(OV(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function OV(e){return!!$2()&&(e instanceof Node||e instanceof ri(e).Node)}function Kl(e){return!!$2()&&(e instanceof Element||e instanceof ri(e).Element)}function Xl(e){return!!$2()&&(e instanceof HTMLElement||e instanceof ri(e).HTMLElement)}function BO(e){return!(!$2()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof ri(e).ShadowRoot)}function Hv(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Wi(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function Die(e){return["table","td","th"].includes(_p(e))}function jie(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch{return!1}}))}function wR(e){const t=kR(),r=Kl(e)?Wi(e):e;return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some((e=>(r.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(r.contain||"").includes(e)))}function NV(e){let t=E0(e);for(;Xl(t)&&!z2(t);){if(wR(t))return t;if(jie(t))return null;t=E0(t)}return null}function kR(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function z2(e){return["html","body","#document"].includes(_p(e))}function Wi(e){return ri(e).getComputedStyle(e)}function M2(e){return Kl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function E0(e){if("html"===_p(e))return e;const t=e.assignedSlot||e.parentNode||BO(e)&&e.host||xf(e);return BO(t)?t.host:t}function DV(e){const t=E0(e);return z2(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xl(t)&&Hv(t)?t:DV(t)}function lv(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=DV(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),i=ri(a);if(o){const e=Lie(i);return t.concat(i,i.visualViewport||[],Hv(a)?a:[],e&&r?lv(e):[])}return t.concat(a,lv(a,[],r))}function Lie(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jV(e){const t=Wi(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Xl(e),o=a?e.offsetWidth:r,i=a?e.offsetHeight:n,s=sw(r)!==o||sw(n)!==i;return s&&(r=o,n=i),{width:r,height:n,$:s}}function xR(e){return Kl(e)?e:e.contextElement}function g0(e){const t=xR(e);if(!Xl(t))return vp(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=jV(t);let i=(o?sw(r.width):r.width)/n,s=(o?sw(r.height):r.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const Vie=vp(0);function LV(e){const t=ri(e);return kR()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Vie}function Bie(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ri(e))&&t}function mm(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=xR(e);let i=vp(1);t&&(n?Kl(n)&&(i=g0(n)):i=g0(e));const s=Bie(o,r,n)?LV(o):vp(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(o){const e=ri(o),t=n&&Kl(n)?ri(n):n;let r=e.frameElement;for(;r&&n&&t!==e;){const e=g0(r),t=r.getBoundingClientRect(),n=Wi(r),a=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,f*=e.y,l+=a,c+=o,r=ri(r).frameElement}}return cw({width:u,height:f,x:l,y:c})}const Fie=[":popover-open",":modal"];function VV(e){let t=!1,r=0,n=0;if(Fie.forEach((r=>{!function(r){try{t=t||e.matches(r)}catch{}}(r)})),t){const t=NV(e);if(t){const e=t.getBoundingClientRect();r=e.x,n=e.y}}return[t,r,n]}function Uie(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o=xf(n),[i]=t?VV(t.floating):[!1];if(n===o||i)return r;let s={scrollLeft:0,scrollTop:0},l=vp(1);const c=vp(0),u=Xl(n);if((u||!u&&"fixed"!==a)&&(("body"!==_p(n)||Hv(o))&&(s=M2(n)),Xl(n))){const e=mm(n);l=g0(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-s.scrollLeft*l.x+c.x,y:r.y*l.y-s.scrollTop*l.y+c.y}}function Gie(e){return Array.from(e.getClientRects())}function BV(e){return mm(xf(e)).left+M2(e).scrollLeft}function qie(e){const t=xf(e),r=M2(e),n=e.ownerDocument.body,a=ei(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=ei(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+BV(e);const s=-r.scrollTop;return"rtl"===Wi(n).direction&&(i+=ei(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:i,y:s}}function Wie(e,t){const r=ri(e),n=xf(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=kR();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}function Hie(e,t){const r=mm(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=Xl(e)?g0(e):vp(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}function FO(e,t,r){let n;if("viewport"===t)n=Wie(e,r);else if("document"===t)n=qie(xf(e));else if(Kl(t))n=Hie(t,r);else{const r=LV(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return cw(n)}function FV(e,t){const r=E0(e);return!(r===t||!Kl(r)||z2(r))&&("fixed"===Wi(r).position||FV(r,t))}function Qie(e,t){const r=t.get(e);if(r)return r;let n=lv(e,[],!1).filter((e=>Kl(e)&&"body"!==_p(e))),a=null;const o="fixed"===Wi(e).position;let i=o?E0(e):e;for(;Kl(i)&&!z2(i);){const t=Wi(i),r=wR(i);!r&&"fixed"===t.position&&(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&["absolute","fixed"].includes(a.position)||Hv(i)&&!r&&FV(e,i))?n=n.filter((e=>e!==i)):a=t,i=E0(i)}return t.set(e,n),n}function Yie(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[..."clippingAncestors"===r?Qie(t,this._c):[].concat(r),n],i=o[0],s=o.reduce(((e,r)=>{const n=FO(t,r,a);return e.top=ei(n.top,e.top),e.right=yp(n.right,e.right),e.bottom=yp(n.bottom,e.bottom),e.left=ei(n.left,e.left),e}),FO(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Kie(e){const{width:t,height:r}=jV(e);return{width:t,height:r}}function Xie(e,t,r,n){const a=Xl(t),o=xf(t),i="fixed"===r,s=mm(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=vp(0);if(a||!a&&!i)if(("body"!==_p(t)||Hv(o))&&(l=M2(t)),a){const e=mm(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=BV(o));let u=s.left+l.scrollLeft-c.x,f=s.top+l.scrollTop-c.y;const[d,p,h]=VV(n);return d&&(u+=p,f+=h,a&&(u+=t.clientLeft,f+=t.clientTop)),{x:u,y:f,width:s.width,height:s.height}}function UO(e,t){return Xl(e)&&"fixed"!==Wi(e).position?t?t(e):e.offsetParent:null}function UV(e,t){const r=ri(e);if(!Xl(e))return r;let n=UO(e,t);for(;n&&Die(n)&&"static"===Wi(n).position;)n=UO(n,t);return n&&("html"===_p(n)||"body"===_p(n)&&"static"===Wi(n).position&&!wR(n))?r:n||NV(e)||r}const Zie=async function(e){const t=this.getOffsetParent||UV,r=this.getDimensions;return{reference:Xie(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await r(e.floating)}}};function Jie(e){return"rtl"===Wi(e).direction}const ece={convertOffsetParentRelativeRectToViewportRelativeRect:Uie,getDocumentElement:xf,getClippingRect:Yie,getOffsetParent:UV,getElementRects:Zie,getClientRects:Gie,getDimensions:Kie,getScale:g0,isElement:Kl,isRTL:Jie};function tce(e,t){let r,n=null;const a=xf(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p={rootMargin:-l_(u)+"px "+-l_(a.clientWidth-(c+f))+"px "+-l_(a.clientHeight-(u+d))+"px "+-l_(c)+"px",threshold:ei(0,yp(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):r=setTimeout((()=>{i(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(g,{...p,root:a.ownerDocument})}catch{n=new IntersectionObserver(g,p)}n.observe(e)}(!0),o}function nce(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=xR(e),u=a||o?[...c?lv(c):[],...lv(t)]:[];u.forEach((e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)}));const f=c&&s?tce(c,r):null;let d=-1,p=null;i&&(p=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),r()})),c&&!l&&p.observe(c),p.observe(t));let h,g=l?mm(e):null;return l&&function t(){const n=mm(e);g&&(n.x!==g.x||n.y!==g.y||n.width!==g.width||n.height!==g.height)&&r(),g=n,h=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)})),null==f||f(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const rce=Mie,ace=Tie,oce=Nie,sce=Pie,GO=Rie,ice=Oie,cce=(e,t,r)=>{const n=new Map,a={platform:ece,...r},o={...a.platform,_c:n};return Aie(e,t,{...a,platform:o})};var B_=typeof document<"u"?g.useLayoutEffect:g.useEffect;function lw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!=n--;)if(!lw(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){const r=a[n];if(!("_owner"===r&&e.$$typeof||lw(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function GV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qO(e,t){const r=GV(e);return Math.round(t*r)/r}function Z4(e){const t=g.useRef(e);return B_((()=>{t.current=e})),t}function lce(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:o,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=g.useState(n);lw(d,n)||p(n);const[h,m]=g.useState(null),[y,v]=g.useState(null),b=g.useCallback((e=>{e!==x.current&&(x.current=e,m(e))}),[]),w=g.useCallback((e=>{e!==E.current&&(E.current=e,v(e))}),[]),_=o||h,k=i||y,x=g.useRef(null),E=g.useRef(null),A=g.useRef(u),S=null!=l,C=Z4(l),z=Z4(a),I=Z4(c),j=g.useCallback((()=>{if(!x.current||!E.current)return;const e={placement:t,strategy:r,middleware:d};z.current&&(e.platform=z.current),cce(x.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==I.current};P.current&&!lw(A.current,t)&&(A.current=t,Qc.flushSync((()=>{f(t)})))}))}),[d,t,r,z,I]);B_((()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const P=g.useRef(!1);B_((()=>(P.current=!0,()=>{P.current=!1})),[]),B_((()=>{if(_&&(x.current=_),k&&(E.current=k),_&&k){if(C.current)return C.current(_,k,j);j()}}),[_,k,j,C,S]);const T=g.useMemo((()=>({reference:x,floating:E,setReference:b,setFloating:w})),[b,w]),R=g.useMemo((()=>({reference:_,floating:k})),[_,k]),N=g.useMemo((()=>{const e={position:r,left:0,top:0};if(!R.floating)return e;const t=qO(R.floating,u.x),n=qO(R.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...GV(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,R.floating,u.x,u.y]);return g.useMemo((()=>({...u,update:j,refs:T,elements:R,floatingStyles:N})),[u,j,T,R,N])}const uce=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?GO({element:r.current,padding:n}).fn(t):{}:r?GO({element:r,padding:n}).fn(t):{}}}),fce=(e,t)=>({...zie(e),options:[e,t]}),dce=(e,t)=>({...rce(e),options:[e,t]}),pce=(e,t)=>({...ice(e),options:[e,t]}),hce=(e,t)=>({...ace(e),options:[e,t]}),mce=(e,t)=>({...oce(e),options:[e,t]}),gce=(e,t)=>({...sce(e),options:[e,t]}),yce=(e,t)=>({...uce(e),options:[e,t]}),qV="Popper",[WV,U0]=as(qV),[vce,HV]=WV(qV),bce=e=>{const{__scopePopper:t,children:r}=e,[n,a]=g.useState(null);return g.createElement(vce,{scope:t,anchor:n,onAnchorChange:a},r)},_ce="PopperAnchor",wce=g.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,o=HV(_ce,r),i=g.useRef(null),s=dn(t,i);return g.useEffect((()=>{o.onAnchorChange((null==n?void 0:n.current)||i.current)})),n?null:g.createElement(wt.div,Pe({},a,{ref:s}))})),QV="PopperContent",[kce,Oot]=WV(QV),xce=g.forwardRef(((e,t)=>{var r,n,a,o,i,s,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:y=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:w="partial",hideWhenDetached:_=!1,updatePositionStrategy:k="optimized",onPlaced:x,...E}=e,A=HV(QV,u),[S,C]=g.useState(null),z=dn(t,(e=>C(e))),[I,j]=g.useState(null),P=A2(I),T=null!==(r=null==P?void 0:P.width)&&void 0!==r?r:0,R=null!==(n=null==P?void 0:P.height)&&void 0!==n?n:0,N=f+("center"!==p?"-"+p:""),O="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},M=Array.isArray(v)?v:[v],D=M.length>0,L={padding:O,boundary:M.filter(Sce),altBoundary:D},{refs:q,floatingStyles:V,placement:B,isPositioned:U,middlewareData:F}=lce({strategy:"fixed",placement:N,whileElementsMounted:(...e)=>nce(...e,{animationFrame:"always"===k}),elements:{reference:A.anchor},middleware:[fce({mainAxis:d+R,alignmentAxis:h}),y&&dce({mainAxis:!0,crossAxis:!1,limiter:"partial"===w?pce():void 0,...L}),y&&hce({...L}),mce({...L,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),I&&yce({element:I,padding:m}),Ece({arrowWidth:T,arrowHeight:R}),_&&gce({strategy:"referenceHidden",...L})]}),[$,G]=YV(B),Q=si(x);zo((()=>{U&&(null==Q||Q())}),[U,Q]);const W=null===(a=F.arrow)||void 0===a?void 0:a.x,H=null===(o=F.arrow)||void 0===o?void 0:o.y,K=0!==(null===(i=F.arrow)||void 0===i?void 0:i.centerOffset),[Y,Z]=g.useState();return zo((()=>{S&&Z(window.getComputedStyle(S).zIndex)}),[S]),g.createElement("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[null===(s=F.transformOrigin)||void 0===s?void 0:s.x,null===(l=F.transformOrigin)||void 0===l?void 0:l.y].join(" ")},dir:e.dir},g.createElement(kce,{scope:u,placedSide:$,onArrowChange:j,arrowX:W,arrowY:H,shouldHideArrow:K},g.createElement(wt.div,Pe({"data-side":$,"data-align":G},E,{ref:z,style:{...E.style,animation:U?void 0:"none",opacity:null!==(c=F.hide)&&void 0!==c&&c.referenceHidden?0:void 0}}))))}));function Sce(e){return null!==e}const Ece=e=>({name:"transformOrigin",options:e,fn(t){var r,n,a,o,i;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(r=c.arrow)||void 0===r?void 0:r.centerOffset),f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[p,h]=YV(s),g={start:"0%",center:"50%",end:"100%"}[h],m=(null!==(n=null===(a=c.arrow)||void 0===a?void 0:a.x)&&void 0!==n?n:0)+f/2,y=(null!==(o=null===(i=c.arrow)||void 0===i?void 0:i.y)&&void 0!==o?o:0)+d/2;let v="",b="";return"bottom"===p?(v=u?g:`${m}px`,b=-d+"px"):"top"===p?(v=u?g:`${m}px`,b=`${l.floating.height+d}px`):"right"===p?(v=-d+"px",b=u?g:`${y}px`):"left"===p&&(v=`${l.floating.width+d}px`,b=u?g:`${y}px`),{data:{x:v,y:b}}}});function YV(e){const[t,r="center"]=e.split("-");return[t,r]}const SR=bce,ER=wce,CR=xce,J4="rovingFocusGroup.onEntryFocus",Cce={bubbles:!1,cancelable:!0},IR="RovingFocusGroup",[rI,KV,Ice]=yR(IR),[Ace,G0]=as(IR,[Ice]),[Rce,Tce]=Ace(IR),Pce=g.forwardRef(((e,t)=>g.createElement(rI.Provider,{scope:e.__scopeRovingFocusGroup},g.createElement(rI.Slot,{scope:e.__scopeRovingFocusGroup},g.createElement($ce,Pe({},e,{ref:t})))))),$ce=g.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=g.useRef(null),d=dn(t,f),p=Wv(o),[h=null,m]=Yl({prop:i,defaultProp:s,onChange:l}),[y,v]=g.useState(!1),b=si(c),w=KV(r),_=g.useRef(!1),[k,x]=g.useState(0);return g.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(J4,b),()=>e.removeEventListener(J4,b)}),[b]),g.createElement(Rce,{scope:r,orientation:n,dir:p,loop:a,currentTabStopId:h,onItemFocus:g.useCallback((e=>m(e)),[m]),onItemShiftTab:g.useCallback((()=>v(!0)),[]),onFocusableItemAdd:g.useCallback((()=>x((e=>e+1))),[]),onFocusableItemRemove:g.useCallback((()=>x((e=>e-1))),[])},g.createElement(wt.div,Pe({tabIndex:y||0===k?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...e.style},onMouseDown:ft(e.onMouseDown,(()=>{_.current=!0})),onFocus:ft(e.onFocus,(e=>{const t=!_.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(J4,Cce);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));XV([e.find((e=>e.active)),e.find((e=>e.id===h)),...e].filter(Boolean).map((e=>e.ref.current)))}}_.current=!1})),onBlur:ft(e.onBlur,(()=>v(!1)))})))})),zce="RovingFocusGroupItem",Mce=g.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:o,...i}=e,s=jc(),l=o||s,c=Tce(zce,r),u=c.currentTabStopId===l,f=KV(r),{onFocusableItemAdd:d,onFocusableItemRemove:p}=c;return g.useEffect((()=>{if(n)return d(),()=>p()}),[n,d,p]),g.createElement(rI.ItemSlot,{scope:r,id:l,focusable:n,active:a},g.createElement(wt.span,Pe({tabIndex:u?0:-1,"data-orientation":c.orientation},i,{ref:t,onMouseDown:ft(e.onMouseDown,(e=>{n?c.onItemFocus(l):e.preventDefault()})),onFocus:ft(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:ft(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=Dce(e,c.orientation,c.dir);if(void 0!==t){e.preventDefault();let r=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=c.loop?jce(r,n+1):r.slice(n+1)}setTimeout((()=>XV(r)))}}))})))})),Oce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nce(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function Dce(e,t,r){const n=Nce(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return Oce[n]}function XV(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function jce(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}const AR=Pce,RR=Mce,aI=["Enter"," "],Lce=["ArrowDown","PageUp","Home"],ZV=["ArrowUp","PageDown","End"],Vce=[...Lce,...ZV],Bce={ltr:[...aI,"ArrowRight"],rtl:[...aI,"ArrowLeft"]},Fce={ltr:["ArrowLeft"],rtl:["ArrowRight"]},O2="Menu",[uv,Uce,Gce]=yR(O2),[Im,JV]=as(O2,[Gce,U0,G0]),TR=U0(),eB=G0(),[qce,Am]=Im(O2),[Wce,Qv]=Im(O2),Hce=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:o,modal:i=!0}=e,s=TR(t),[l,c]=g.useState(null),u=g.useRef(!1),f=si(o),d=Wv(a);return g.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),g.createElement(SR,s,g.createElement(qce,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:c},g.createElement(Wce,{scope:t,onClose:g.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:u,dir:d,modal:i},n)))},tB=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e,a=TR(r);return g.createElement(ER,Pe({},a,n,{ref:t}))})),nB="MenuPortal",[Qce,rB]=Im(nB,{forceMount:void 0}),Yce=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,o=Am(nB,t);return g.createElement(Qce,{scope:t,forceMount:r},g.createElement(ii,{present:r||o.open},g.createElement(u2,{asChild:!0,container:a},n)))},Vc="MenuContent",[Kce,PR]=Im(Vc),Xce=g.forwardRef(((e,t)=>{const r=rB(Vc,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,o=Am(Vc,e.__scopeMenu),i=Qv(Vc,e.__scopeMenu);return g.createElement(uv.Provider,{scope:e.__scopeMenu},g.createElement(ii,{present:n||o.open},g.createElement(uv.Slot,{scope:e.__scopeMenu},i.modal?g.createElement(Zce,Pe({},a,{ref:t})):g.createElement(Jce,Pe({},a,{ref:t})))))})),Zce=g.forwardRef(((e,t)=>{const r=Am(Vc,e.__scopeMenu),n=g.useRef(null),a=dn(t,n);return g.useEffect((()=>{const e=n.current;if(e)return p2(e)}),[]),g.createElement($R,Pe({},e,{ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ft(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))})),Jce=g.forwardRef(((e,t)=>{const r=Am(Vc,e.__scopeMenu);return g.createElement($R,Pe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))})),$R=g.forwardRef(((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:p,disableOutsideScroll:h,...m}=e,y=Am(Vc,r),v=Qv(Vc,r),b=TR(r),w=eB(r),_=Uce(r),[k,x]=g.useState(null),E=g.useRef(null),A=dn(t,E,y.onContentChange),S=g.useRef(0),C=g.useRef(""),z=g.useRef(0),I=g.useRef(null),j=g.useRef("right"),P=g.useRef(0),T=h?d2:g.Fragment,R=h?{as:lm,allowPinchZoom:!0}:void 0;g.useEffect((()=>()=>window.clearTimeout(S.current)),[]),AA();const N=g.useCallback((e=>{var t,r;return j.current===(null===(t=I.current)||void 0===t?void 0:t.side)&&_le(e,null===(r=I.current)||void 0===r?void 0:r.area)}),[]);return g.createElement(Kce,{scope:r,searchRef:C,onItemEnter:g.useCallback((e=>{N(e)&&e.preventDefault()}),[N]),onItemLeave:g.useCallback((e=>{var t;N(e)||(null===(t=E.current)||void 0===t||t.focus(),x(null))}),[N]),onTriggerLeave:g.useCallback((e=>{N(e)&&e.preventDefault()}),[N]),pointerGraceTimerRef:z,onPointerGraceIntentChange:g.useCallback((e=>{I.current=e}),[])},g.createElement(T,R,g.createElement(IA,{asChild:!0,trapped:a,onMountAutoFocus:ft(o,(e=>{var t;e.preventDefault(),null===(t=E.current)||void 0===t||t.focus()})),onUnmountAutoFocus:i},g.createElement(l2,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:p},g.createElement(AR,Pe({asChild:!0},w,{dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:k,onCurrentTabStopIdChange:x,onEntryFocus:ft(l,(e=>{v.isUsingKeyboardRef.current||e.preventDefault()}))}),g.createElement(CR,Pe({role:"menu","aria-orientation":"vertical","data-state":cB(y.open),"data-radix-menu-content":"",dir:v.dir},b,m,{ref:A,style:{outline:"none",...m.style},onKeyDown:ft(m.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&(e=>{var t,r;const n=C.current+e,a=_().filter((e=>!e.disabled)),o=document.activeElement,i=null===(t=a.find((e=>e.ref.current===o)))||void 0===t?void 0:t.textValue,s=vle(a.map((e=>e.textValue)),n,i),l=null===(r=a.find((e=>e.textValue===s)))||void 0===r?void 0:r.ref.current;(function e(t){C.current=t,window.clearTimeout(S.current),""!==t&&(S.current=window.setTimeout((()=>e("")),1e3))})(n),l&&setTimeout((()=>l.focus()))})(e.key));const a=E.current;if(e.target!==a||!Vce.includes(e.key))return;e.preventDefault();const o=_().filter((e=>!e.disabled)).map((e=>e.ref.current));ZV.includes(e.key)&&o.reverse(),gle(o)})),onBlur:ft(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(S.current),C.current="")})),onPointerMove:ft(e.onPointerMove,fv((e=>{const t=e.target,r=P.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>P.current?"right":"left";j.current=t,P.current=e.clientX}})))})))))))})),ele=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return g.createElement(wt.div,Pe({role:"group"},n,{ref:t}))})),tle=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return g.createElement(wt.div,Pe({},n,{ref:t}))})),oI="MenuItem",WO="menu.itemSelect",zR=g.forwardRef(((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,o=g.useRef(null),i=Qv(oI,e.__scopeMenu),s=PR(oI,e.__scopeMenu),l=dn(t,o),c=g.useRef(!1);return g.createElement(aB,Pe({},a,{ref:l,disabled:r,onClick:ft(e.onClick,(()=>{const e=o.current;if(!r&&e){const t=new CustomEvent(WO,{bubbles:!0,cancelable:!0});e.addEventListener(WO,(e=>null==n?void 0:n(e)),{once:!0}),o7(e,t),t.defaultPrevented?c.current=!1:i.onClose()}})),onPointerDown:t=>{var r;null===(r=e.onPointerDown)||void 0===r||r.call(e,t),c.current=!0},onPointerUp:ft(e.onPointerUp,(e=>{var t;c.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:ft(e.onKeyDown,(e=>{const t=""!==s.searchRef.current;r||t&&" "===e.key||aI.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),aB=g.forwardRef(((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...o}=e,i=PR(oI,r),s=eB(r),l=g.useRef(null),c=dn(t,l),[u,f]=g.useState(!1),[d,p]=g.useState("");return g.useEffect((()=>{const e=l.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[o.children]),g.createElement(uv.ItemSlot,{scope:r,disabled:n,textValue:a??d},g.createElement(RR,Pe({asChild:!0},s,{focusable:!n}),g.createElement(wt.div,Pe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:c,onPointerMove:ft(e.onPointerMove,fv((e=>{n?i.onItemLeave(e):(i.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus())}))),onPointerLeave:ft(e.onPointerLeave,fv((e=>i.onItemLeave(e)))),onFocus:ft(e.onFocus,(()=>f(!0))),onBlur:ft(e.onBlur,(()=>f(!1)))}))))})),nle=g.forwardRef(((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return g.createElement(sB,{scope:e.__scopeMenu,checked:r},g.createElement(zR,Pe({role:"menuitemcheckbox","aria-checked":uw(r)?"mixed":r},a,{ref:t,"data-state":MR(r),onSelect:ft(a.onSelect,(()=>null==n?void 0:n(!!uw(r)||!r)),{checkForDefaultPrevented:!1})})))})),rle="MenuRadioGroup",[ale,ole]=Im(rle,{value:void 0,onValueChange:()=>{}}),sle=g.forwardRef(((e,t)=>{const{value:r,onValueChange:n,...a}=e,o=si(n);return g.createElement(ale,{scope:e.__scopeMenu,value:r,onValueChange:o},g.createElement(ele,Pe({},a,{ref:t})))})),ile="MenuRadioItem",cle=g.forwardRef(((e,t)=>{const{value:r,...n}=e,a=ole(ile,e.__scopeMenu),o=r===a.value;return g.createElement(sB,{scope:e.__scopeMenu,checked:o},g.createElement(zR,Pe({role:"menuitemradio","aria-checked":o},n,{ref:t,"data-state":MR(o),onSelect:ft(n.onSelect,(()=>{var e;return null===(e=a.onValueChange)||void 0===e?void 0:e.call(a,r)}),{checkForDefaultPrevented:!1})})))})),oB="MenuItemIndicator",[sB,lle]=Im(oB,{checked:!1}),ule=g.forwardRef(((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,o=lle(oB,r);return g.createElement(ii,{present:n||uw(o.checked)||!0===o.checked},g.createElement(wt.span,Pe({},a,{ref:t,"data-state":MR(o.checked)})))})),fle=g.forwardRef(((e,t)=>{const{__scopeMenu:r,...n}=e;return g.createElement(wt.div,Pe({role:"separator","aria-orientation":"horizontal"},n,{ref:t}))})),dle="MenuSub",[Not,iB]=Im(dle),u_="MenuSubTrigger",ple=g.forwardRef(((e,t)=>{const r=Am(u_,e.__scopeMenu),n=Qv(u_,e.__scopeMenu),a=iB(u_,e.__scopeMenu),o=PR(u_,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=g.useCallback((()=>{i.current&&window.clearTimeout(i.current),i.current=null}),[]);return g.useEffect((()=>u),[u]),g.useEffect((()=>{const e=s.current;return()=>{window.clearTimeout(e),l(null)}}),[s,l]),g.createElement(tB,Pe({asChild:!0},c),g.createElement(aB,Pe({id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":cB(r.open)},e,{ref:c2(t,a.onTriggerChange),onClick:t=>{var n;null===(n=e.onClick)||void 0===n||n.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ft(e.onPointerMove,fv((t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout((()=>{r.onOpenChange(!0),u()}),100))}))),onPointerLeave:ft(e.onPointerLeave,fv((e=>{var t;u();const n=null===(t=r.content)||void 0===t?void 0:t.getBoundingClientRect();if(n){var a;const t=null===(a=r.content)||void 0===a?void 0:a.dataset.side,i="right"===t,l=i?-5:5,c=n[i?"left":"right"],u=n[i?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:n.top},{x:u,y:n.top},{x:u,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(s.current),s.current=window.setTimeout((()=>o.onPointerGraceIntentChange(null)),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}}))),onKeyDown:ft(e.onKeyDown,(t=>{const a=""!==o.searchRef.current;var i;e.disabled||a&&" "===t.key||!Bce[n.dir].includes(t.key)||(r.onOpenChange(!0),null===(i=r.content)||void 0===i||i.focus(),t.preventDefault())}))})))})),hle="MenuSubContent",mle=g.forwardRef(((e,t)=>{const r=rB(Vc,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,o=Am(Vc,e.__scopeMenu),i=Qv(Vc,e.__scopeMenu),s=iB(hle,e.__scopeMenu),l=g.useRef(null),c=dn(t,l);return g.createElement(uv.Provider,{scope:e.__scopeMenu},g.createElement(ii,{present:n||o.open},g.createElement(uv.Slot,{scope:e.__scopeMenu},g.createElement($R,Pe({id:s.contentId,"aria-labelledby":s.triggerId},a,{ref:c,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;i.isUsingKeyboardRef.current&&(null===(t=l.current)||void 0===t||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ft(e.onFocusOutside,(e=>{e.target!==s.trigger&&o.onOpenChange(!1)})),onEscapeKeyDown:ft(e.onEscapeKeyDown,(e=>{i.onClose(),e.preventDefault()})),onKeyDown:ft(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),r=Fce[i.dir].includes(e.key);var n;t&&r&&(o.onOpenChange(!1),null===(n=s.trigger)||void 0===n||n.focus(),e.preventDefault())}))})))))}));function cB(e){return e?"open":"closed"}function uw(e){return"indeterminate"===e}function MR(e){return uw(e)?"indeterminate":e?"checked":"unchecked"}function gle(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function yle(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}function vle(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,a=r?e.indexOf(r):-1;let o=yle(e,Math.max(a,0));1===n.length&&(o=o.filter((e=>e!==r)));const i=o.find((e=>e.toLowerCase().startsWith(n.toLowerCase())));return i!==r?i:void 0}function ble(e,t){const{x:r,y:n}=e;let a=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){const i=t[e].x,s=t[e].y,l=t[o].x,c=t[o].y;s>n!=c>n&&r<(l-i)*(n-s)/(c-s)+i&&(a=!a)}return a}function _le(e,t){if(!t)return!1;return ble({x:e.clientX,y:e.clientY},t)}function fv(e){return t=>"mouse"===t.pointerType?e(t):void 0}const wle=Hce,kle=tB,xle=Yce,Sle=Xce,Ele=tle,Cle=zR,Ile=nle,Ale=sle,Rle=cle,Tle=ule,Ple=fle,$le=ple,zle=mle,lB="DropdownMenu",[Mle,Dot]=as(lB,[JV]),li=JV(),[Ole,uB]=Mle(lB),Nle=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=li(t),c=g.useRef(null),[u=!1,f]=Yl({prop:a,defaultProp:o,onChange:i});return g.createElement(Ole,{scope:t,triggerId:jc(),triggerRef:c,contentId:jc(),open:u,onOpenChange:f,onOpenToggle:g.useCallback((()=>f((e=>!e))),[f]),modal:s},g.createElement(wle,Pe({},l,{open:u,onOpenChange:f,dir:n,modal:s}),r))},Dle="DropdownMenuTrigger",jle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,o=uB(Dle,r),i=li(r);return g.createElement(kle,Pe({asChild:!0},i),g.createElement(wt.button,Pe({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},a,{ref:c2(t,o.triggerRef),onPointerDown:ft(e.onPointerDown,(e=>{!n&&0===e.button&&!1===e.ctrlKey&&(o.onOpenToggle(),o.open||e.preventDefault())})),onKeyDown:ft(e.onKeyDown,(e=>{n||(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})))})),Lle=e=>{const{__scopeDropdownMenu:t,...r}=e,n=li(t);return g.createElement(xle,Pe({},n,r))},Vle="DropdownMenuContent",Ble=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=uB(Vle,r),o=li(r),i=g.useRef(!1);return g.createElement(Sle,Pe({id:a.contentId,"aria-labelledby":a.triggerId},o,n,{ref:t,onCloseAutoFocus:ft(e.onCloseAutoFocus,(e=>{var t;i.current||null===(t=a.triggerRef.current)||void 0===t||t.focus(),i.current=!1,e.preventDefault()})),onInteractOutside:ft(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(i.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)"}}))})),Fle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ele,Pe({},a,n,{ref:t}))})),Ule=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Cle,Pe({},a,n,{ref:t}))})),Gle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ile,Pe({},a,n,{ref:t}))})),qle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ale,Pe({},a,n,{ref:t}))})),Wle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Rle,Pe({},a,n,{ref:t}))})),Hle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Tle,Pe({},a,n,{ref:t}))})),Qle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(Ple,Pe({},a,n,{ref:t}))})),Yle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement($le,Pe({},a,n,{ref:t}))})),Kle=g.forwardRef(((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=li(r);return g.createElement(zle,Pe({},a,n,{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)"}}))})),Xle=Nle,Zle=jle,Jle=Lle,fB=Ble,dB=Fle,pB=Ule,hB=Gle,eue=qle,mB=Wle,tue=Hle,OR=Qle,gB=Yle,yB=Kle,Yv=Xle,Kv=Zle,nue=eue,rue=g.forwardRef((({className:e,inset:t,children:r,...n},a)=>E.jsxs(gB,{ref:a,className:he("flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,E.jsx(U8,{className:"ml-auto h-4 w-4"})]})));rue.displayName=gB.displayName;const aue=g.forwardRef((({className:e,...t},r)=>E.jsx(yB,{ref:r,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})));aue.displayName=yB.displayName;const HO=e=>{e.preventDefault()},q0=g.forwardRef((({className:e,sideOffset:t=4,isPortal:r,...n},a)=>{const o=E.jsx(fB,{ref:a,sideOffset:t,onOpenAutoFocus:HO,onCloseAutoFocus:HO,className:he("z-[101] flex max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] flex-col gap-xxxs overflow-y-auto rounded-lg border border-gray-200 bg-white p-xxs text-popover-foreground ","shadow-[0px_0px_12px_0px_rgba(0,0,0,0.08)] ","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in data-[state=open]:slide-in-from-top-2","data-[state=closed]:fade-out data-[state=closed]:slide-out-to-top-2","data-[state=closed]:duration-150 data-[state=open]:duration-150","data-[state=closed]:[animation-timing-function:ease-in] data-[state=open]:[animation-timing-function:ease-out]",e),...n});return r?E.jsx(Jle,{children:o}):o}));q0.displayName=fB.displayName;const dv=g.forwardRef((({className:e,inset:t,...r},n)=>E.jsx(pB,{ref:n,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs text-base font-medium text-gray-900 outline-none transition-colors hover:bg-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-xl",e),...r})));dv.displayName=pB.displayName;const oue=g.forwardRef((({className:e,children:t,checked:r,checkboxPosition:n="right",...a},o)=>{const i=E.jsx(sR,{size:"default",variant:"default",checked:r});return E.jsxs(hB,{ref:o,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs text-base font-medium text-gray-900"," outline-none transition-colors hover:bg-gray-100 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,onSelect:e=>e.preventDefault(),...a,children:["left"===n&&i,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:t}),"right"===n&&i]})}));oue.displayName=hB.displayName;const vB=g.forwardRef((({className:e,children:t,radioPosition:r="right",...n},a)=>{const o=E.jsx("div",{className:"flex h-xxs items-center justify-center",children:E.jsx(tue,{children:E.jsx(o2,{size:20})})});return E.jsxs(mB,{ref:a,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs text-base font-medium text-gray-900"," outline-none transition-colors hover:bg-gray-100 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onSelect:e=>e.preventDefault(),...n,children:["left"===r&&o,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:t}),"right"===r&&o]})}));vB.displayName=mB.displayName;const sue=g.forwardRef((({className:e,inset:t,...r},n)=>E.jsx(dB,{ref:n,className:he("text-sm font-semibold",t&&"pl-xl",e),...r})));sue.displayName=dB.displayName;const iue=g.forwardRef((({className:e,...t},r)=>E.jsx(OR,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t})));iue.displayName=OR.displayName;var Xv=e=>"checkbox"===e.type,u0=e=>e instanceof Date,Jo=e=>null==e;const bB=e=>"object"==typeof e;var pa=e=>!Jo(e)&&!Array.isArray(e)&&bB(e)&&!u0(e),_B=e=>pa(e)&&e.target?Xv(e.target)?e.target.checked:e.target.value:e,cue=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wB=(e,t)=>e.has(cue(t)),lue=e=>{const t=e.constructor&&e.constructor.prototype;return pa(t)&&t.hasOwnProperty("isPrototypeOf")},NR=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Es(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(NR&&(e instanceof Blob||e instanceof FileList)||!r&&!pa(e))return e;if(t=r?[]:{},r||lue(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Es(e[r]));else t=e}return t}var Zv=e=>Array.isArray(e)?e.filter(Boolean):[],$r=e=>void 0===e,et=(e,t,r)=>{if(!t||!pa(e))return r;const n=Zv(t.split(/[,[\].]+?/)).reduce(((e,t)=>Jo(e)?e:e[t]),e);return $r(n)||n===e?$r(e[t])?r:e[t]:n},$c=e=>"boolean"==typeof e;const fw={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Oc={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},af={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kB=be.createContext(null),N2=()=>be.useContext(kB),xB=e=>{const{children:t,...r}=e;return be.createElement(kB.Provider,{value:r},t)};var SB=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Oc.all&&(t._proxyFormState[a]=!n||Oc.all),r&&(r[a]=!0),e[a]}});return a},Fi=e=>pa(e)&&!Object.keys(e).length,EB=(e,t,r,n)=>{r(e);const{name:a,...o}=e;return Fi(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!n||Oc.all)))},F_=e=>Array.isArray(e)?e:[e],CB=(e,t,r)=>!e||!t||e===t||F_(e).some((e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))));function DR(e){const t=be.useRef(e);t.current=e,be.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}function uue(e){const t=N2(),{control:r=t.control,disabled:n,name:a,exact:o}=e,[i,s]=be.useState(r._formState),l=be.useRef(!0),c=be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=be.useRef(a);return u.current=a,DR({disabled:n,next:e=>l.current&&CB(u.current,e.name,o)&&EB(e,c.current,r._updateFormState)&&s({...r._formState,...e}),subject:r._subjects.state}),be.useEffect((()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1})),[r]),SB(i,r,c.current,!1)}var Gl=e=>"string"==typeof e,IB=(e,t,r,n,a)=>Gl(e)?(n&&t.watch.add(e),et(r,e,a)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),et(r,e)))):(n&&(t.watchAll=!0),r);function fue(e){const t=N2(),{control:r=t.control,name:n,defaultValue:a,disabled:o,exact:i}=e,s=be.useRef(n);s.current=n,DR({disabled:o,subject:r._subjects.values,next:e=>{CB(s.current,e.name,i)&&c(Es(IB(s.current,r._names,e.values||r._formValues,!1,a)))}});const[l,c]=be.useState(r._getWatch(n,a));return be.useEffect((()=>r._removeUnmounted())),l}var jR=e=>/^\w*$/.test(e),AB=e=>Zv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Tn=(e,t,r)=>{let n=-1;const a=jR(t)?[t]:AB(t),o=a.length,i=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==i){const r=e[t];o=pa(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}e[t]=o,e=e[t]}return e};function due(e){const t=N2(),{name:r,disabled:n,control:a=t.control,shouldUnregister:o}=e,i=wB(a._names.array,r),s=fue({control:a,name:r,defaultValue:et(a._formValues,r,et(a._defaultValues,r,e.defaultValue)),exact:!0}),l=uue({control:a,name:r}),c=be.useRef(a.register(r,{...e.rules,value:s,...$c(e.disabled)?{disabled:e.disabled}:{}}));return be.useEffect((()=>{const e=a._options.shouldUnregister||o,t=(e,t)=>{const r=et(a._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=Es(et(a._options.defaultValues,r));Tn(a._defaultValues,r,e),$r(et(a._formValues,r))&&Tn(a._formValues,r,e)}return()=>{(i?e&&!a._state.action:e)?a.unregister(r):t(r,!1)}}),[r,a,i,o]),be.useEffect((()=>{et(a._fields,r)&&a._updateDisabledField({disabled:n,fields:a._fields,name:r,value:et(a._fields,r)._f.value})}),[n,r,a]),{field:{name:r,value:s,...$c(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:be.useCallback((e=>c.current.onChange({target:{value:_B(e),name:r},type:fw.CHANGE})),[r]),onBlur:be.useCallback((()=>c.current.onBlur({target:{value:et(a._formValues,r),name:r},type:fw.BLUR})),[r,a]),ref:e=>{const t=et(a._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!et(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!et(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!et(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!et(l.validatingFields,r)},error:{enumerable:!0,get:()=>et(l.errors,r)}})}}const pue=e=>e.render(due(e));var RB=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},QO=e=>({isOnSubmit:!e||e===Oc.onSubmit,isOnBlur:e===Oc.onBlur,isOnChange:e===Oc.onChange,isOnAll:e===Oc.all,isOnTouch:e===Oc.onTouched}),YO=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const Vy=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=et(e,a);if(r){const{_f:e,...o}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)break;if(e.ref&&t(e.ref,e.name)&&!n)break;Vy(o,t)}else pa(o)&&Vy(o,t)}}};var hue=(e,t,r)=>{const n=Zv(et(e,r));return Tn(n,"root",t[r]),Tn(e,r,n),e},LR=e=>"file"===e.type,up=e=>"function"==typeof e,dw=e=>{if(!NR)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},U_=e=>Gl(e),VR=e=>"radio"===e.type,pw=e=>e instanceof RegExp;const KO={value:!1,isValid:!1},XO={value:!0,isValid:!0};var TB=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!$r(e[0].attributes.value)?$r(e[0].value)||""===e[0].value?XO:{value:e[0].value,isValid:!0}:XO:KO}return KO};const ZO={isValid:!1,value:null};var PB=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),ZO):ZO;function JO(e,t,r="validate"){if(U_(e)||Array.isArray(e)&&e.every(U_)||$c(e)&&!e)return{type:r,message:U_(e)?e:"",ref:t}}var n0=e=>pa(e)&&!pw(e)?e:{value:e,message:""},eN=async(e,t,r,n,a)=>{const{ref:o,refs:i,required:s,maxLength:l,minLength:c,min:u,max:f,pattern:d,validate:p,name:h,valueAsNumber:g,mount:m,disabled:y}=e._f,v=et(t,h);if(!m||y)return{};const b=i?i[0]:o,w=e=>{n&&b.reportValidity&&(b.setCustomValidity($c(e)?"":e||""),b.reportValidity())},_={},k=VR(o),x=Xv(o),E=k||x,A=(g||LR(o))&&$r(o.value)&&$r(v)||dw(o)&&""===o.value||""===v||Array.isArray(v)&&!v.length,S=RB.bind(null,h,r,_),C=(e,t,r,n=af.maxLength,a=af.minLength)=>{const i=e?t:r;_[h]={type:e?n:a,message:i,ref:o,...S(e?n:a,i)}};if(a?!Array.isArray(v)||!v.length:s&&(!E&&(A||Jo(v))||$c(v)&&!v||x&&!TB(i).isValid||k&&!PB(i).isValid)){const{value:e,message:t}=U_(s)?{value:!!s,message:s}:n0(s);if(e&&(_[h]={type:af.required,message:t,ref:b,...S(af.required,t)},!r))return w(t),_}if(!(A||Jo(u)&&Jo(f))){let e,t;const n=n0(f),a=n0(u);if(Jo(v)||isNaN(v)){const r=o.valueAsDate||new Date(v),i=e=>new Date((new Date).toDateString()+" "+e),s="time"==o.type,l="week"==o.type;Gl(n.value)&&v&&(e=s?i(v)>i(n.value):l?v>n.value:r>new Date(n.value)),Gl(a.value)&&v&&(t=s?i(v)<i(a.value):l?v<a.value:r<new Date(a.value))}else{const r=o.valueAsNumber||v&&+v;Jo(n.value)||(e=r>n.value),Jo(a.value)||(t=r<a.value)}if((e||t)&&(C(!!e,n.message,a.message,af.max,af.min),!r))return w(_[h].message),_}if((l||c)&&!A&&(Gl(v)||a&&Array.isArray(v))){const e=n0(l),t=n0(c),n=!Jo(e.value)&&v.length>+e.value,a=!Jo(t.value)&&v.length<+t.value;if((n||a)&&(C(n,e.message,t.message),!r))return w(_[h].message),_}if(d&&!A&&Gl(v)){const{value:e,message:t}=n0(d);if(pw(e)&&!v.match(e)&&(_[h]={type:af.pattern,message:t,ref:o,...S(af.pattern,t)},!r))return w(t),_}if(p)if(up(p)){const e=JO(await p(v,t),b);if(e&&(_[h]={...e,...S(af.validate,e.message)},!r))return w(e.message),_}else if(pa(p)){let e={};for(const n in p){if(!Fi(e)&&!r)break;const a=JO(await p[n](v,t),b,n);a&&(e={...a,...S(n,a.message)},w(a.message),r&&(_[h]=e))}if(!Fi(e)&&(_[h]={ref:b,...e},!r))return _}return w(!0),_};function mue(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=$r(e)?n++:e[t[n++]];return e}function gue(e){for(const t in e)if(e.hasOwnProperty(t)&&!$r(e[t]))return!1;return!0}function Fa(e,t){const r=Array.isArray(t)?t:jR(t)?[t]:AB(t),n=1===r.length?e:mue(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(pa(n)&&Fi(n)||Array.isArray(n)&&gue(n))&&Fa(e,r.slice(0,-1)),e}var eE=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},hw=e=>Jo(e)||!bB(e);function Jh(e,t){if(hw(e)||hw(t))return e===t;if(u0(e)&&u0(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const r=e[a];if(!n.includes(a))return!1;if("ref"!==a){const e=t[a];if(u0(r)&&u0(e)||pa(r)&&pa(e)||Array.isArray(r)&&Array.isArray(e)?!Jh(r,e):r!==e)return!1}}return!0}var $B=e=>"select-multiple"===e.type,yue=e=>VR(e)||Xv(e),tE=e=>dw(e)&&e.isConnected,vue=e=>pa(e)&&Object.values(e).some((e=>e)),zB=e=>{for(const t in e)if(up(e[t]))return!0;return!1};function mw(e,t={}){const r=Array.isArray(e);if(pa(e)||r)for(const r in e)Array.isArray(e[r])||pa(e[r])&&!zB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},mw(e[r],t[r])):Jo(e[r])||(t[r]=!0);return t}function MB(e,t,r){const n=Array.isArray(e);if(pa(e)||n)for(const n in e)Array.isArray(e[n])||pa(e[n])&&!zB(e[n])?$r(t)||hw(r[n])?r[n]=Array.isArray(e[n])?mw(e[n],[]):{...mw(e[n])}:MB(e[n],Jo(t)?{}:t[n],r[n]):r[n]=!Jh(e[n],t[n]);return r}var f_=(e,t)=>MB(e,t,mw(t)),OB=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>$r(e)?e:t?""===e?NaN:e&&+e:r&&Gl(e)?new Date(e):n?n(e):e;function nE(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return LR(t)?t.files:VR(t)?PB(e.refs).value:$B(t)?[...t.selectedOptions].map((({value:e})=>e)):Xv(t)?TB(e.refs).value:OB($r(t.value)?e.ref.value:t.value,e)}var bue=(e,t,r,n)=>{const a={};for(const r of e){const e=et(t,r);e&&Tn(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},ry=e=>$r(e)?e:pw(e)?e.source:pa(e)?pw(e.value)?e.value.source:e.value:e,_ue=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function tN(e,t,r){const n=et(e,r);if(n||jR(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=et(t,n),i=et(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};a.pop()}return{name:r}}var wue=(e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e),kue=(e,t)=>!Zv(et(e,t)).length&&Fa(e,t);const xue={mode:Oc.onSubmit,reValidateMode:Oc.onChange,shouldFocusError:!0};function Sue(e={}){let t,r={...xue,...e},n={submitCount:0,isDirty:!1,isLoading:up(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(pa(r.defaultValues)||pa(r.values))&&Es(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Es(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:eE(),array:eE(),state:eE()},d=QO(r.mode),p=QO(r.reValidateMode),h=r.criteriaMode===Oc.all,g=async e=>{if(u.isValid||e){const e=r.resolver?Fi((await w()).errors):await _(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},m=(e,t)=>{(u.isValidating||u.validatingFields)&&(t.forEach((t=>{Tn(n.validatingFields,t,e)})),n.isValidating=vue(n.validatingFields),f.state.next({validatingFields:n.validatingFields,isValidating:n.isValidating}))},y=(e,t,r,n)=>{const l=et(a,e);if(l){const a=et(i,e,$r(r)?et(o,e):r);$r(a)||n&&n.defaultChecked||t?Tn(i,e,t?a:nE(l._f)):E(e,a),s.mount&&g()}},v=(e,t,r,i,s)=>{let l=!1,c=!1;const d={name:e},p=!(!et(a,e)||!et(a,e)._f.disabled);if(!r||i){u.isDirty&&(c=n.isDirty,n.isDirty=d.isDirty=k(),l=c!==d.isDirty);const r=p||Jh(et(o,e),t);c=!(p||!et(n.dirtyFields,e)),r||p?Fa(n.dirtyFields,e):Tn(n.dirtyFields,e,!0),d.dirtyFields=n.dirtyFields,l=l||u.dirtyFields&&c!==!r}if(r){const t=et(n.touchedFields,e);t||(Tn(n.touchedFields,e,r),d.touchedFields=n.touchedFields,l=l||u.touchedFields&&t!==r)}return l&&s&&f.state.next(d),l?d:{}},b=(r,a,o,i)=>{const s=et(n.errors,r),l=u.isValid&&$c(a)&&n.isValid!==a;if(e.delayError&&o?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})((()=>((e,t)=>{Tn(n.errors,e,t),f.state.next({errors:n.errors})})(r,o))),t(e.delayError)):(clearTimeout(c),t=null,o?Tn(n.errors,r,o):Fa(n.errors,r)),(o?!Jh(s,o):s)||!Fi(i)||l){const e={...i,...l&&$c(a)?{isValid:a}:{},errors:n.errors,name:r};n={...n,...e},f.state.next(e)}m(!1,Object.keys(n.validatingFields).filter((e=>e===r)))},w=async e=>r.resolver(i,r.context,bue(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation)),_=async(e,t,a={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...o}=s;if(e){const o=l.array.has(e.name),c=await eN(s,i,h,r.shouldUseNativeValidation&&!t,o);if(c[e.name]&&(a.valid=!1,t))break;!t&&(et(c,e.name)?o?hue(n.errors,c,e.name):Tn(n.errors,e.name,c[e.name]):Fa(n.errors,e.name))}o&&await _(o,t,a)}}return a.valid},k=(e,t)=>(e&&t&&Tn(i,e,t),!Jh(j(),o)),x=(e,t,r)=>IB(e,l,{...s.mount?i:$r(t)?o:Gl(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=et(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&Tn(i,e,OB(t,r)),o=dw(r.ref)&&Jo(t)?"":t,$B(r.ref)?[...r.ref.options].forEach((e=>e.selected=o.includes(e.value))):r.refs?Xv(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):r.refs[0]&&(r.refs[0].checked=!!o):r.refs.forEach((e=>e.checked=e.value===o)):LR(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.values.next({name:e,values:{...i}})))}(r.shouldDirty||r.shouldTouch)&&v(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&I(e)},A=(e,t,r)=>{for(const n in t){const o=t[n],i=`${e}.${n}`,s=et(a,i);!l.array.has(e)&&hw(o)&&(!s||s._f)||u0(o)?E(i,o,r):A(i,o,r)}},S=(e,t,r={})=>{const c=et(a,e),d=l.array.has(e),p=Es(t);Tn(i,e,p),d?(f.array.next({name:e,values:{...i}}),(u.isDirty||u.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:f_(o,i),isDirty:k(e,p)})):!c||c._f||Jo(p)?E(e,p,r):A(e,p,r),YO(e,l)&&f.state.next({...n}),f.values.next({name:s.mount?e:void 0,values:{...i}})},C=async e=>{const o=e.target;let s=o.name,c=!0;const y=et(a,s),k=e=>{c=Number.isNaN(e)||e===et(i,s,e)};if(y){let x,E;const A=o.type?nE(y._f):_B(e),S=e.type===fw.BLUR||e.type===fw.FOCUS_OUT,C=!_ue(y._f)&&!r.resolver&&!et(n.errors,s)&&!y._f.deps||wue(S,et(n.touchedFields,s),n.isSubmitted,p,d),z=YO(s,l,S);Tn(i,s,A),S?(y._f.onBlur&&y._f.onBlur(e),t&&t(0)):y._f.onChange&&y._f.onChange(e);const j=v(s,A,S,!1),P=!Fi(j)||z;if(!S&&f.values.next({name:s,type:e.type,values:{...i}}),C)return u.isValid&&g(),P&&f.state.next({name:s,...z?{}:j});if(!S&&z&&f.state.next({...n}),m(!0,[s]),r.resolver){const{errors:e}=await w([s]);if(k(A),c){const t=tN(n.errors,a,s),r=tN(e,a,t.name||s);x=r.error,s=r.name,E=Fi(e)}}else x=(await eN(y,i,h,r.shouldUseNativeValidation))[s],k(A),c&&(x?E=!1:u.isValid&&(E=await _(a,!0)));c&&(y._f.deps&&I(y._f.deps),b(s,E,x,j))}},z=(e,t)=>{if(et(n.errors,t)&&e.focus)return e.focus(),1},I=async(e,t={})=>{let o,i;const s=F_(e);if(m(!0,s),r.resolver){const t=await(async e=>{const{errors:t}=await w(e);if(e)for(const r of e){const e=et(t,r);e?Tn(n.errors,r,e):Fa(n.errors,r)}else n.errors=t;return t})($r(e)?e:s);o=Fi(t),i=e?!s.some((e=>et(t,e))):o}else e?(i=(await Promise.all(s.map((async e=>{const t=et(a,e);return await _(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||n.isValid)&&g()):i=o=await _(a);return f.state.next({...!Gl(e)||u.isValid&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors,isValidating:!1}),t.shouldFocus&&!i&&Vy(a,z,e?s:l.mount),i},j=e=>{const t={...o,...s.mount?i:{}};return $r(e)?t:Gl(e)?et(t,e):e.map((e=>et(t,e)))},P=(e,t)=>({invalid:!!et((t||n).errors,e),isDirty:!!et((t||n).dirtyFields,e),isTouched:!!et((t||n).touchedFields,e),isValidating:!!et((t||n).validatingFields,e),error:et((t||n).errors,e)}),T=(e,t,r)=>{const o=(et(a,e,{_f:{}})._f||{}).ref;Tn(n.errors,e,{...t,ref:o}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&o&&o.focus&&o.focus()},R=(e,t={})=>{for(const s of e?F_(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(Fa(a,s),Fa(i,s)),!t.keepError&&Fa(n.errors,s),!t.keepDirty&&Fa(n.dirtyFields,s),!t.keepTouched&&Fa(n.touchedFields,s),!t.keepIsValidating&&Fa(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&Fa(o,s);f.values.next({values:{...i}}),f.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&g()},N=({disabled:e,name:t,field:r,fields:n,value:a})=>{if($c(e)){const o=e?void 0:$r(a)?nE(r?r._f:et(n,t)._f):a;Tn(i,t,o),v(t,o,!1,!1,!0)}},O=(e,t={})=>{let n=et(a,e);const i=$c(t.disabled);return Tn(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?N({field:n,disabled:t.disabled,name:e,value:t.value}):y(e,!0,t.value),{...i?{disabled:t.disabled}:{},...r.progressive?{required:!!t.required,min:ry(t.min),max:ry(t.max),minLength:ry(t.minLength),maxLength:ry(t.maxLength),pattern:ry(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:i=>{if(i){O(e,t),n=et(a,e);const r=$r(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=yue(r),l=n._f.refs||[];if(s?l.find((e=>e===r)):r===n._f.ref)return;Tn(a,e,{_f:{...n._f,...s?{refs:[...l.filter(tE),r,...Array.isArray(et(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),y(e,!1,void 0,r)}else n=et(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!wB(l.array,e)||!s.action)&&l.unMount.add(e)}}},M=()=>r.shouldFocusError&&Vy(a,z,l.mount),D=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let l=Es(i);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await w();n.errors=e,l=t}else await _(a);if(Fa(n.errors,"root"),Fi(n.errors)){f.state.next({errors:{}});try{await e(l,o)}catch(e){s=e}}else t&&await t({...n.errors},o),M(),setTimeout(M);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fi(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(t,r={})=>{const c=t?Es(t):o,d=Es(c),p=Fi(t),h=p?o:d;if(r.keepDefaultValues||(o=c),!r.keepValues){if(r.keepDirtyValues)for(const e of l.mount)et(n.dirtyFields,e)?Tn(h,e,et(i,e)):S(e,et(h,e));else{if(NR&&$r(t))for(const e of l.mount){const t=et(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(dw(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}i=e.shouldUnregister?r.keepDefaultValues?Es(o):{}:Es(h),f.array.next({values:{...h}}),f.values.next({values:{...h}})}l={mount:r.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!r.keepIsValid||!!r.keepDirtyValues,s.watch=!!e.shouldUnregister,f.state.next({submitCount:r.keepSubmitCount?n.submitCount:0,isDirty:!p&&(r.keepDirty?n.isDirty:!(!r.keepDefaultValues||Jh(t,o))),isSubmitted:!!r.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?[]:r.keepDirtyValues?r.keepDefaultValues&&i?f_(o,i):n.dirtyFields:r.keepDefaultValues&&t?f_(o,t):{},touchedFields:r.keepTouched?n.touchedFields:{},errors:r.keepErrors?n.errors:{},isSubmitSuccessful:!!r.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},q=(e,t)=>L(up(e)?e(i):e,t);return{control:{register:O,unregister:R,getFieldState:P,handleSubmit:D,setError:T,_executeSchema:w,_getWatch:x,_getDirty:k,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=et(a,e);t&&(t._f.refs?t._f.refs.every((e=>!tE(e))):!tE(t._f.ref))&&R(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],r,l,c=!0,d=!0)=>{if(l&&r){if(s.action=!0,d&&Array.isArray(et(a,e))){const t=r(et(a,e),l.argA,l.argB);c&&Tn(a,e,t)}if(d&&Array.isArray(et(n.errors,e))){const t=r(et(n.errors,e),l.argA,l.argB);c&&Tn(n.errors,e,t),kue(n.errors,e)}if(u.touchedFields&&d&&Array.isArray(et(n.touchedFields,e))){const t=r(et(n.touchedFields,e),l.argA,l.argB);c&&Tn(n.touchedFields,e,t)}u.dirtyFields&&(n.dirtyFields=f_(o,i)),f.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Tn(i,e,t)},_updateDisabledField:N,_getFieldArray:t=>Zv(et(s.mount?i:o,t,e.shouldUnregister?et(o,t,[]):[])),_reset:L,_resetDefaultValues:()=>up(r.defaultValues)&&r.defaultValues().then((e=>{q(e,r.resetOptions),f.state.next({isLoading:!1})})),_updateFormState:e=>{n={...n,...e}},_disableForm:e=>{$c(e)&&(f.state.next({disabled:e}),Vy(a,((t,r)=>{let n=e;const o=et(a,r);o&&$c(o._f.disabled)&&(n||(n=o._f.disabled)),t.disabled=n}),0,!1))},_subjects:f,_proxyFormState:u,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return n},set _formState(e){n=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:I,register:O,handleSubmit:D,watch:(e,t)=>up(e)?f.values.subscribe({next:r=>e(x(void 0,t),r)}):x(e,t,!0),setValue:S,getValues:j,reset:q,resetField:(e,t={})=>{et(a,e)&&($r(t.defaultValue)?S(e,Es(et(o,e))):(S(e,t.defaultValue),Tn(o,e,Es(t.defaultValue))),t.keepTouched||Fa(n.touchedFields,e),t.keepDirty||(Fa(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,Es(et(o,e))):k()),t.keepError||(Fa(n.errors,e),u.isValid&&g()),f.state.next({...n}))},clearErrors:e=>{e&&F_(e).forEach((e=>Fa(n.errors,e))),f.state.next({errors:e?n.errors:{}})},unregister:R,setError:T,setFocus:(e,t={})=>{const r=et(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:P}}function BR(e={}){const t=be.useRef(),r=be.useRef(),[n,a]=be.useState({isDirty:!1,isValidating:!1,isLoading:up(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:up(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Sue(e),formState:n});const o=t.current.control;return o._options=e,DR({subject:o._subjects.state,next:e=>{EB(e,o._proxyFormState,o._updateFormState,!0)&&a({...o._formState})}}),be.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),be.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==n.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,n.isDirty]),be.useEffect((()=>{e.values&&!Jh(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,a((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),be.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),be.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),be.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=SB(n,o),t.current}const Eue=g.forwardRef(((e,t)=>g.createElement(wt.label,Pe({},e,{ref:t,onMouseDown:t=>{var r;null===(r=e.onMouseDown)||void 0===r||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}})))),NB=Eue,Cue=Yi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),DB=g.forwardRef((({className:e,...t},r)=>E.jsx(NB,{ref:r,className:he(Cue(),e),...t})));function nN(e,[t,r]){return Math.min(r,Math.max(t,e))}DB.displayName=NB.displayName;const jB=g.forwardRef(((e,t)=>g.createElement(wt.span,Pe({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))),Iue=jB,Aue=[" ","Enter","ArrowUp","ArrowDown"],Rue=[" ","Enter"],D2="Select",[j2,L2,Tue]=yR(D2),[W0,jot]=as(D2,[Tue,U0]),FR=U0(),[Pue,Rm]=W0(D2),[$ue,zue]=W0(D2),Mue=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:o,value:i,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:d,required:p}=e,h=FR(t),[m,y]=g.useState(null),[v,b]=g.useState(null),[w,_]=g.useState(!1),k=Wv(c),[x=!1,E]=Yl({prop:n,defaultProp:a,onChange:o}),[A,S]=Yl({prop:i,defaultProp:s,onChange:l}),C=g.useRef(null),z=!m||!!m.closest("form"),[I,j]=g.useState(new Set),P=Array.from(I).map((e=>e.props.value)).join(";");return g.createElement(SR,h,g.createElement(Pue,{required:p,scope:t,trigger:m,onTriggerChange:y,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:_,contentId:jc(),value:A,onValueChange:S,open:x,onOpenChange:E,dir:k,triggerPointerDownPosRef:C,disabled:d},g.createElement(j2.Provider,{scope:t},g.createElement($ue,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback((e=>{j((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:g.useCallback((e=>{j((t=>{const r=new Set(t);return r.delete(e),r}))}),[])},r)),z?g.createElement(UB,{key:P,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:A,onChange:e=>S(e.target.value),disabled:d},void 0===A?g.createElement("option",{value:""}):null,Array.from(I)):null))},Oue="SelectTrigger",Nue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,o=FR(r),i=Rm(Oue,r),s=i.disabled||n,l=dn(t,i.onTriggerChange),c=L2(r),[u,f,d]=GB((e=>{const t=c().filter((e=>!e.disabled)),r=t.find((e=>e.value===i.value)),n=qB(t,e,r);void 0!==n&&i.onValueChange(n.value)})),p=()=>{s||(i.onOpenChange(!0),d())};return g.createElement(ER,Pe({asChild:!0},o),g.createElement(wt.button,Pe({type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":FB(i.value)?"":void 0},a,{ref:l,onClick:ft(a.onClick,(e=>{e.currentTarget.focus()})),onPointerDown:ft(a.onPointerDown,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&(p(),i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)},e.preventDefault())})),onKeyDown:ft(a.onKeyDown,(e=>{const t=""!==u.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&Aue.includes(e.key)&&(p(),e.preventDefault())}))})))})),Due="SelectValue",jue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:o,placeholder:i="",...s}=e,l=Rm(Due,r),{onValueNodeHasChildrenChange:c}=l,u=void 0!==o,f=dn(t,l.onValueNodeChange);return zo((()=>{c(u)}),[c,u]),g.createElement(wt.span,Pe({},s,{ref:f,style:{pointerEvents:"none"}}),FB(l.value)?g.createElement(g.Fragment,null,i):o)})),Lue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return g.createElement(wt.span,Pe({"aria-hidden":!0},a,{ref:t}),n||"▼")})),Vue=e=>g.createElement(u2,Pe({asChild:!0},e)),C0="SelectContent",Bue=g.forwardRef(((e,t)=>{const r=Rm(C0,e.__scopeSelect),[n,a]=g.useState();if(zo((()=>{a(new DocumentFragment)}),[]),!r.open){const t=n;return t?Qc.createPortal(g.createElement(LB,{scope:e.__scopeSelect},g.createElement(j2.Slot,{scope:e.__scopeSelect},g.createElement("div",null,e.children))),t):null}return g.createElement(Fue,Pe({},e,{ref:t}))})),ff=10,[LB,Tm]=W0(C0),Fue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y,...v}=e,b=Rm(C0,r),[w,_]=g.useState(null),[k,x]=g.useState(null),E=dn(t,(e=>_(e))),[A,S]=g.useState(null),[C,z]=g.useState(null),I=L2(r),[j,P]=g.useState(!1),T=g.useRef(!1);g.useEffect((()=>{if(w)return p2(w)}),[w]),AA();const R=g.useCallback((e=>{const[t,...r]=I().map((e=>e.ref.current)),[n]=r.slice(-1),a=document.activeElement;for(const r of e)if(r===a||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),null==r||r.focus(),document.activeElement!==a))return}),[I,k]),N=g.useCallback((()=>R([A,w])),[R,A,w]);g.useEffect((()=>{j&&N()}),[j,N]);const{onOpenChange:O,triggerPointerDownPosRef:M}=b;g.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{var r,n,a,o;e={x:Math.abs(Math.round(t.pageX)-(null!==(r=null===(n=M.current)||void 0===n?void 0:n.x)&&void 0!==r?r:0)),y:Math.abs(Math.round(t.pageY)-(null!==(a=null===(o=M.current)||void 0===o?void 0:o.y)&&void 0!==a?a:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||O(!1),document.removeEventListener("pointermove",t),M.current=null};return null!==M.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}}),[w,O,M]),g.useEffect((()=>{const e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[O]);const[D,L]=GB((e=>{const t=I().filter((e=>!e.disabled)),r=t.find((e=>e.ref.current===document.activeElement)),n=qB(t,e,r);n&&setTimeout((()=>n.ref.current.focus()))})),q=g.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&(S(e),n&&(T.current=!0))}),[b.value]),V=g.useCallback((()=>null==w?void 0:w.focus()),[w]),B=g.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&z(e)}),[b.value]),U="popper"===n?rN:Uue,F=U===rN?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:y}:{};return g.createElement(LB,{scope:r,content:w,viewport:k,onViewportChange:x,itemRefCallback:q,selectedItem:A,onItemLeave:V,itemTextRefCallback:B,focusSelectedItem:N,selectedItemText:C,position:n,isPositioned:j,searchRef:D},g.createElement(d2,{as:lm,allowPinchZoom:!0},g.createElement(IA,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ft(a,(e=>{var t;null===(t=b.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}))},g.createElement(l2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},g.createElement(U,Pe({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault()},v,F,{onPlaced:()=>P(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ft(v.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=I().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout((()=>R(t))),e.preventDefault()}}))}))))))})),Uue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,o=Rm(C0,r),i=Tm(C0,r),[s,l]=g.useState(null),[c,u]=g.useState(null),f=dn(t,(e=>u(e))),d=L2(r),p=g.useRef(!1),h=g.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=i,w=g.useCallback((()=>{if(o.trigger&&o.valueNode&&s&&c&&m&&y&&v){const e=o.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),a=v.getBoundingClientRect();if("rtl"!==o.dir){const n=a.left-t.left,o=r.left-n,i=e.left-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-ff,f=nN(o,[ff,u-c]);s.style.minWidth=l+"px",s.style.left=f+"px"}else{const n=t.right-a.right,o=window.innerWidth-r.right-n,i=window.innerWidth-e.right-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-ff,f=nN(o,[ff,u-c]);s.style.minWidth=l+"px",s.style.right=f+"px"}const i=d(),l=window.innerHeight-2*ff,u=m.scrollHeight,f=window.getComputedStyle(c),h=parseInt(f.borderTopWidth,10),g=parseInt(f.paddingTop,10),b=parseInt(f.borderBottomWidth,10),w=h+g+u+parseInt(f.paddingBottom,10)+b,_=Math.min(5*y.offsetHeight,w),k=window.getComputedStyle(m),x=parseInt(k.paddingTop,10),E=parseInt(k.paddingBottom,10),A=e.top+e.height/2-ff,S=l-A,C=y.offsetHeight/2,z=h+g+(y.offsetTop+C),I=w-z;if(z<=A){const e=y===i[i.length-1].ref.current;s.style.bottom="0px";const t=c.clientHeight-m.offsetTop-m.offsetHeight,r=z+Math.max(S,C+(e?E:0)+t+b);s.style.height=r+"px"}else{const e=y===i[0].ref.current;s.style.top="0px";const t=Math.max(A,h+m.offsetTop+(e?x:0)+C)+I;s.style.height=t+"px",m.scrollTop=z-A+m.offsetTop}s.style.margin=`${ff}px 0`,s.style.minHeight=_+"px",s.style.maxHeight=l+"px",null==n||n(),requestAnimationFrame((()=>p.current=!0))}}),[d,o.trigger,o.valueNode,s,c,m,y,v,o.dir,n]);zo((()=>w()),[w]);const[_,k]=g.useState();zo((()=>{c&&k(window.getComputedStyle(c).zIndex)}),[c]);const x=g.useCallback((e=>{e&&!0===h.current&&(w(),null==b||b(),h.current=!1)}),[w,b]);return g.createElement(Gue,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:x},g.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_}},g.createElement(wt.div,Pe({},a,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}}))))})),rN=g.forwardRef(((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=ff,...o}=e,i=FR(r);return g.createElement(CR,Pe({},i,o,{ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))})),[Gue,UR]=W0(C0,{}),aN="SelectViewport",que=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,a=Tm(aN,r),o=UR(aN,r),i=dn(t,a.onViewportChange),s=g.useRef(0);return g.createElement(g.Fragment,null,g.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),g.createElement(j2.Slot,{scope:r},g.createElement(wt.div,Pe({"data-radix-select-viewport":"",role:"presentation"},n,{ref:i,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:ft(n.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=o;if(null!=n&&n.current&&r){const e=Math.abs(s.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*ff,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),i=Math.max(a,o);if(i<n){const a=i+e,o=Math.min(n,a),s=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}s.current=t.scrollTop}))}))))})),Wue="SelectGroup",[Hue,Que]=W0(Wue),Yue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,a=jc();return g.createElement(Hue,{scope:r,id:a},g.createElement(wt.div,Pe({role:"group","aria-labelledby":a},n,{ref:t})))})),Kue="SelectLabel",Xue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,a=Que(Kue,r);return g.createElement(wt.div,Pe({id:a.id},n,{ref:t}))})),sI="SelectItem",[Zue,VB]=W0(sI),Jue=g.forwardRef(((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:o,...i}=e,s=Rm(sI,r),l=Tm(sI,r),c=s.value===n,[u,f]=g.useState(o??""),[d,p]=g.useState(!1),h=dn(t,(e=>{var t;return null===(t=l.itemRefCallback)||void 0===t?void 0:t.call(l,e,n,a)})),m=jc(),y=()=>{a||(s.onValueChange(n),s.onOpenChange(!1))};if(""===n)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.createElement(Zue,{scope:r,value:n,disabled:a,textId:m,isSelected:c,onItemTextChange:g.useCallback((e=>{f((t=>{var r;return t||(null!==(r=null==e?void 0:e.textContent)&&void 0!==r?r:"").trim()}))}),[])},g.createElement(j2.ItemSlot,{scope:r,value:n,disabled:a,textValue:u},g.createElement(wt.div,Pe({role:"option","aria-labelledby":m,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1},i,{ref:h,onFocus:ft(i.onFocus,(()=>p(!0))),onBlur:ft(i.onBlur,(()=>p(!1))),onPointerUp:ft(i.onPointerUp,y),onPointerMove:ft(i.onPointerMove,(e=>{var t;a?null===(t=l.onItemLeave)||void 0===t||t.call(l):e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:ft(i.onPointerLeave,(e=>{var t;e.currentTarget===document.activeElement&&(null===(t=l.onItemLeave)||void 0===t||t.call(l))})),onKeyDown:ft(i.onKeyDown,(e=>{var t;""!==(null===(t=l.searchRef)||void 0===t?void 0:t.current)&&" "===e.key||(Rue.includes(e.key)&&y()," "===e.key&&e.preventDefault())}))}))))})),d_="SelectItemText",efe=g.forwardRef(((e,t)=>{const{__scopeSelect:r,className:n,style:a,...o}=e,i=Rm(d_,r),s=Tm(d_,r),l=VB(d_,r),c=zue(d_,r),[u,f]=g.useState(null),d=dn(t,(e=>f(e)),l.onItemTextChange,(e=>{var t;return null===(t=s.itemTextRefCallback)||void 0===t?void 0:t.call(s,e,l.value,l.disabled)})),p=null==u?void 0:u.textContent,h=g.useMemo((()=>g.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p)),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return zo((()=>(m(h),()=>y(h))),[m,y,h]),g.createElement(g.Fragment,null,g.createElement(wt.span,Pe({id:l.textId},o,{ref:d})),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Qc.createPortal(o.children,i.valueNode):null)})),tfe="SelectItemIndicator",nfe=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return VB(tfe,r).isSelected?g.createElement(wt.span,Pe({"aria-hidden":!0},n,{ref:t})):null})),oN="SelectScrollUpButton",rfe=g.forwardRef(((e,t)=>{const r=Tm(oN,e.__scopeSelect),n=UR(oN,e.__scopeSelect),[a,o]=g.useState(!1),i=dn(t,n.onScrollButtonChange);return zo((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),a?g.createElement(BB,Pe({},e,{ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}})):null})),sN="SelectScrollDownButton",afe=g.forwardRef(((e,t)=>{const r=Tm(sN,e.__scopeSelect),n=UR(sN,e.__scopeSelect),[a,o]=g.useState(!1),i=dn(t,n.onScrollButtonChange);return zo((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),a?g.createElement(BB,Pe({},e,{ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}})):null})),BB=g.forwardRef(((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,o=Tm("SelectScrollButton",r),i=g.useRef(null),s=L2(r),l=g.useCallback((()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)}),[]);return g.useEffect((()=>()=>l()),[l]),zo((()=>{var e;const t=s().find((e=>e.ref.current===document.activeElement));null==t||null===(e=t.ref.current)||void 0===e||e.scrollIntoView({block:"nearest"})}),[s]),g.createElement(wt.div,Pe({"aria-hidden":!0},a,{ref:t,style:{flexShrink:0,...a.style},onPointerDown:ft(a.onPointerDown,(()=>{null===i.current&&(i.current=window.setInterval(n,50))})),onPointerMove:ft(a.onPointerMove,(()=>{var e;null===(e=o.onItemLeave)||void 0===e||e.call(o),null===i.current&&(i.current=window.setInterval(n,50))})),onPointerLeave:ft(a.onPointerLeave,(()=>{l()}))}))})),ofe=g.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return g.createElement(wt.div,Pe({"aria-hidden":!0},n,{ref:t}))}));function FB(e){return""===e||void 0===e}const UB=g.forwardRef(((e,t)=>{const{value:r,...n}=e,a=g.useRef(null),o=dn(t,a),i=I2(r);return g.useEffect((()=>{const e=a.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(i!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[i,r]),g.createElement(jB,{asChild:!0},g.createElement("select",Pe({},n,{ref:o,defaultValue:r})))}));function GB(e){const t=si(e),r=g.useRef(""),n=g.useRef(0),a=g.useCallback((e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout((()=>e("")),1e3))}(a)}),[t]),o=g.useCallback((()=>{r.current="",window.clearTimeout(n.current)}),[]);return g.useEffect((()=>()=>window.clearTimeout(n.current)),[]),[r,a,o]}function qB(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,a=r?e.indexOf(r):-1;let o=sfe(e,Math.max(a,0));1===n.length&&(o=o.filter((e=>e!==r)));const i=o.find((e=>e.textValue.toLowerCase().startsWith(n.toLowerCase())));return i!==r?i:void 0}function sfe(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}UB.displayName="BubbleSelect";const WB=Mue,GR=Nue,HB=jue,ife=Lue,cfe=Vue,QB=Bue,lfe=que,YB=Yue,KB=Xue,XB=Jue,ufe=efe,ffe=nfe,ZB=rfe,JB=afe,eF=ofe,dfe=WB,qR=g.forwardRef((({...e},t)=>E.jsx(dfe,{ref:t,...e})));qR.displayName=WB.displayName;const tF=g.forwardRef(((e,t)=>E.jsx(YB,{ref:t,...e})));tF.displayName=YB.displayName;const nF=g.forwardRef(((e,t)=>E.jsx(HB,{ref:t,...e})));nF.displayName=HB.displayName;const WR=g.forwardRef((({className:e,children:t,caption:r,error:n,icon:a,renderCaret:o,...i},s)=>{const l=o?o():E.jsx(s2,{size:20,className:"transition-transform duration-200 group-data-[state=open]/select:rotate-180"});return E.jsxs("div",{className:"w-full",children:[E.jsxs(GR,{ref:s,className:he("group/select flex h-l w-full items-center justify-between rounded-m border bg-background p-xxs text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus-visible:ring-gray-700 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",n?"border-red-500":"border-input",e),...i,children:[E.jsxs("div",{className:he("flex w-full flex-1 items-center gap-xxs",{"max-w-[calc(100%-20px)]":l}),children:[a&&E.jsx("span",{className:he("text-muted-foreground",{"text-red-dark":n}),children:a}),t]}),E.jsx(ife,{asChild:!0,children:l})]}),r||n?n?E.jsxs("div",{className:"mt-xxs flex items-center gap-xxxs text-sm text-red-600",children:[E.jsx(i2,{size:16}),n]}):E.jsxs("div",{className:"mt-xxs flex items-center gap-xxxs text-sm text-muted-foreground",children:[E.jsx(tZ,{size:16}),r]}):null]})}));WR.displayName="SelectTriggerWrapper";const rF=g.forwardRef((({className:e,children:t,caption:r,error:n,icon:a,...o},i)=>E.jsx(WR,{ref:i,className:he("[&>span]:line-clamp-1 [&>span]:text-left",e),caption:r,error:n,icon:a,...o,children:t})));rF.displayName=GR.displayName;const HR=g.forwardRef((({className:e,children:t,position:r="popper",...n},a)=>{const o=g.useMemo((()=>{const e=t=>{var r,n;if(!t)return!1;if(Array.isArray(t))return t.some(e);if(g.isValidElement(t)){const a=null==(r=t.type)?void 0:r.displayName;return"SelectActions"===a||"SelectFooter"===a||e(null==(n=t.props)?void 0:n.children)}return!1};return e(t)}),[t]);return E.jsx(cfe,{children:E.jsx(QB,{ref:a,className:he("z-[101] flex max-h-[var(--radix-select-content-available-height)] min-w-[8rem] flex-col rounded-lg border border-gray-200 bg-white text-popover-foreground","shadow-[0px_0px_12px_0px_rgba(0,0,0,0.08)]","data-[state=open]:animate-in data-[state=closed]:animate-out ","data-[state=open]:fade-in data-[state=open]:slide-in-from-top-2 ","data-[state=closed]:fade-out data-[state=closed]:slide-out-to-top-2 ","data-[state=closed]:duration-150 data-[state=open]:duration-150 ","data-[state=closed]:[animation-timing-function:ease-in] data-[state=open]:[animation-timing-function:ease-out]","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:E.jsx(lfe,{className:he("flex flex-col gap-xxxs overflow-y-auto px-xxs",{"py-xxs":!o},"popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})})}));HR.displayName=QB.displayName;const aF=g.forwardRef((({className:e,...t},r)=>E.jsx(KB,{ref:r,className:he("text-sm font-medium text-gray-900",e),...t})));aF.displayName=KB.displayName;const oF=g.forwardRef((({className:e,showCheck:t=!0,checkPosition:r="right",children:n,...a},o)=>{const i=E.jsx(ffe,{children:E.jsx(o2,{size:20})});return E.jsxs(XB,{ref:o,className:he("relative flex cursor-default select-none items-center gap-xxs rounded-m p-xxs","text-base font-medium text-gray-900 outline-none transition-colors hover:bg-gray-100","focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[t&&"left"===r&&i,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:E.jsx(ufe,{children:n})}),t&&"right"===r&&i]})}));oF.displayName=XB.displayName;const sF=g.forwardRef((({className:e,...t},r)=>E.jsx(eF,{ref:r,className:he("-mx-1 my-1 h-px bg-gray-200",e),...t})));sF.displayName=eF.displayName;const pfe=({selectedValues:e=[],onRemoveValue:t})=>{const r=g.useRef(null),[n,a]=g.useState(e.length);return g.useLayoutEffect((()=>{if(!r.current||0===e.length)return void a(e.length);const n=r.current.offsetWidth-60,o=document.createElement("div");Object.assign(o.style,{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",display:"flex",gap:"4px",top:"-9999px",left:"-9999px"}),document.body.appendChild(o);let i=0,s=0;for(const r of e){const e=document.createElement("div");e.className="gap-xxxs p-xxs flex cursor-pointer items-center rounded-sm bg-gray-100 text-sm font-medium text-gray-900";const a=document.createElement("span");if(a.textContent="string"==typeof r?r:r.value,e.appendChild(a),"string"!=typeof r&&r.avatar){const t=document.createElement("div");t.className="w-6 h-6 rounded-full bg-gray-300 flex-shrink-0",e.insertBefore(t,a)}if(t){const t=document.createElement("button");t.innerHTML="×",t.className="ml-1 rounded-full outline-none",e.appendChild(t)}o.appendChild(e);const l=e.offsetWidth+4;if(!(i+l<=n))break;i+=l,s++}document.body.removeChild(o),a(Math.max(1,s))}),[e,t]),{containerRef:r,visibleCount:n}},iF=({hiddenCount:e,selectedValues:t=[],onRemoveValue:r})=>{const n=e=>{e.stopPropagation(),e.preventDefault()};return E.jsx("div",{onPointerDown:n,onMouseDown:n,onClick:n,children:E.jsxs(qR,{name:"hidden-chips-counter",children:[E.jsx(GR,{asChild:!0,children:E.jsx("div",{children:E.jsx(TL,{text:`+${e}`})})}),E.jsx(HR,{align:"end",className:"max-h-[250px] w-screen max-w-[300px] gap-xxxs overflow-y-auto",children:t.map((e=>{const t="string"==typeof e?e:e.value;return E.jsxs("div",{className:"flex justify-between p-xxs",onClick:e=>e.stopPropagation(),children:[E.jsx("span",{children:t}),E.jsx(jv,{size:16,className:"cursor-pointer",onClick:()=>null==r?void 0:r(t)})]},t)}))})]})})};iF.displayName="SelectHiddenChipsCounter";const hfe=g.forwardRef(((e,t)=>{const{className:r,selectedValues:n=[],placeholder:a,onRemoveValue:o,icon:i,caption:s,error:l,...c}=e,{containerRef:u,visibleCount:f}=pfe({selectedValues:n,onRemoveValue:o}),d=n.length-f;return E.jsx(WR,{ref:t,className:r,caption:s,error:l,icon:i,...c,children:E.jsx("div",{ref:u,className:"flex w-full flex-1 flex-nowrap overflow-hidden",children:0===n.length?E.jsx("span",{children:a||"Select options..."}):E.jsxs(Gae,{children:[n.slice(0,f).map((e=>{const t="string"==typeof e?e:e.value;return E.jsx(TL,{avatarSrc:"string"==typeof e?void 0:e.avatar,text:t,onRemove:()=>null==o?void 0:o(t)},t)})),d>0&&E.jsx(iF,{hiddenCount:d,onRemoveValue:o,selectedValues:n})]})})})}));hfe.displayName="SelectMultiTrigger";const cF=g.forwardRef((({value:e,isSelected:t=!1,isLoading:r=!1,checkboxPosition:n="right",onSelect:a,className:o,children:i,...s},l)=>{const c=r?E.jsx(yf,{size:24,className:"flex-shrink-0 animate-spin text-blue_100"}):E.jsx(sR,{size:"default",variant:"default",checked:t}),u=()=>{null==a||a(e)};return E.jsxs("div",{ref:l,className:he("relative flex cursor-pointer select-none items-center gap-xxs rounded-m","p-xxs text-base font-medium text-gray-900 outline-none transition-colors hover:bg-gray-100","focus:bg-accent focus:text-accent-foreground",{"pointer-events-none":r},o),onClick:u,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),u())},...s,children:["left"===n&&c,E.jsx("div",{className:"flex flex-1 items-center gap-xxs",children:i}),"right"===n&&c]})}));cF.displayName="SelectCheckboxItem";const mfe=g.forwardRef((({className:e,...t},r)=>E.jsx(ZB,{ref:r,className:he("flex cursor-default items-center justify-center py-xxs",e),...t,children:E.jsx(RX,{size:16})})));mfe.displayName=ZB.displayName;const gfe=g.forwardRef((({className:e,...t},r)=>E.jsx(JB,{ref:r,className:he("flex cursor-default items-center justify-center p-xxs",e),...t,children:E.jsx(s2,{size:16})})));gfe.displayName=JB.displayName;const lF=g.forwardRef((({className:e,children:t,...r},n)=>E.jsx("div",{ref:n,className:he("sticky top-0 z-20 bg-white p-xxs",e),...r,children:t})));lF.displayName="SelectActions";const uF=g.forwardRef((({className:e,children:t,...r},n)=>E.jsx("div",{ref:n,className:he("sticky bottom-0 z-20 bg-white p-xxs",e),...r,children:t})));uF.displayName="SelectFooter";const fF=xB,dF=g.createContext({}),pF=({...e})=>E.jsx(dF.Provider,{value:{name:e.name},children:E.jsx(pue,{...e})}),Sf=()=>{const e=g.useContext(dF),t=g.useContext(hF),r=N2();e||console.error("useFormContext must be used within a FormProvider");const{getFieldState:n,formState:a}=r,o=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},hF=g.createContext({}),Jv=g.forwardRef((({className:e,...t},r)=>{const n=g.useId();return E.jsx(hF.Provider,{value:{id:n},children:E.jsx("div",{ref:r,className:he("mt-[8px]",e),...t})})}));Jv.displayName="FormItem";const V2=g.forwardRef((({className:e,isRequired:t,...r},n)=>{const{formItemId:a}=Sf();return E.jsxs(DB,{ref:n,className:he("mb-2 text-sm font-medium",e),htmlFor:a,...r,children:[t&&"*",r.children]})}));V2.displayName="FormLabel";const QR=g.forwardRef((({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:a,formMessageId:o}=Sf();return E.jsx(Ip,{ref:t,id:n,"aria-describedby":r?`${a} ${o}`:`${a}`,"aria-invalid":!!r,...e})}));QR.displayName="FormControl";const yfe=g.forwardRef((({className:e,...t},r)=>{const{formDescriptionId:n}=Sf();return E.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})}));yfe.displayName="FormDescription";const eb=g.forwardRef((({className:e,children:t,...r},n)=>{const{error:a,formMessageId:o}=Sf(),i=a?String(null==a?void 0:a.message):t;return i?E.jsxs("p",{ref:n,id:o,className:he("flex items-start gap-1 pt-xxs text-sm text-red-dark",e),...r,children:[E.jsx(i2,{size:16,className:"text-red-dark"})," ",i]}):null}));eb.displayName="FormMessage";const YR=g.forwardRef((({...e},t)=>{const{name:r}=Sf();return E.jsx(qR,{ref:t,name:r,...e})}));YR.displayName="FormSelect";const KR=g.forwardRef((({className:e,children:t,...r},n)=>{const{formItemId:a}=Sf();return E.jsx(rF,{ref:n,id:a,className:e,...r,children:t})}));KR.displayName="FormSelectTrigger";const XR=g.forwardRef(((e,t)=>E.jsx(HR,{ref:t,...e})));XR.displayName="FormSelectContent";const mF=g.forwardRef(((e,t)=>E.jsx(oF,{ref:t,...e})));mF.displayName="FormSelectItem";const gF=g.forwardRef(((e,t)=>E.jsx(tF,{ref:t,...e})));gF.displayName="FormSelectGroup";const vfe=g.forwardRef(((e,t)=>E.jsx(aF,{ref:t,...e})));vfe.displayName="FormSelectLabel";const bfe=g.forwardRef(((e,t)=>E.jsx(sF,{ref:t,...e})));bfe.displayName="FormSelectSeparator";const yF=g.forwardRef(((e,t)=>E.jsx(nF,{ref:t,...e})));function Gi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function vF(e,t=[]){let r=[];const n=()=>{const t=r.map((e=>g.createContext(e)));return function(r){const n=(null==r?void 0:r[e])||t;return g.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const a=g.createContext(n),o=r.length;function i(t){const{scope:r,children:n,...i}=t,s=(null==r?void 0:r[e][o])||a,l=g.useMemo((()=>i),Object.values(i));return g.createElement(s.Provider,{value:l},n)}return r=[...r,n],i.displayName=t+"Provider",[i,function(r,i){const s=(null==i?void 0:i[e][o])||a,l=g.useContext(s);if(l)return l;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},_fe(n,...t)]}function _fe(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return g.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}function H0(e){const t=g.useRef(e);return g.useEffect((()=>{t.current=e})),g.useMemo((()=>(...e)=>{var r;return null===(r=t.current)||void 0===r?void 0:r.call(t,...e)}),[])}function wfe({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=kfe({defaultProp:t,onChange:r}),o=void 0!==e,i=o?e:n,s=H0(r);return[i,g.useCallback((t=>{if(o){const r="function"==typeof t?t(e):t;r!==e&&s(r)}else a(t)}),[o,e,a,s])]}function kfe({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,a=g.useRef(n),o=H0(t);return g.useEffect((()=>{a.current!==n&&(o(n),a.current=n)}),[n,a,o]),r}function xfe(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Sfe(...e){return t=>e.forEach((e=>xfe(e,t)))}function Efe(...e){return g.useCallback(Sfe(...e),e)}function Pm(e){return e.split("-")[0]}function tb(e){return e.split("-")[1]}function Q0(e){return["top","bottom"].includes(Pm(e))?"x":"y"}function ZR(e){return"y"===e?"height":"width"}function iN(e,t,r){let{reference:n,floating:a}=e;const o=n.x+n.width/2-a.width/2,i=n.y+n.height/2-a.height/2,s=Q0(t),l=ZR(s),c=n[l]/2-a[l]/2,u="x"===s;let f;switch(Pm(t)){case"top":f={x:o,y:n.y-a.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:i};break;case"left":f={x:n.x-a.width,y:i};break;default:f={x:n.x,y:n.y}}switch(tb(t)){case"start":f[s]-=c*(r&&u?-1:1);break;case"end":f[s]+=c*(r&&u?-1:1)}return f}yF.displayName="FormSelectValue";const Cfe=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:c,y:u}=iN(l,n,s),f=n,d={},p=0;for(let r=0;r<o.length;r++){const{name:h,fn:g}=o[r],{x:m,y:y,data:v,reset:b}=await g({x:c,y:u,initialPlacement:n,placement:f,strategy:a,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});c=m??c,u=y??u,d={...d,[h]:{...d[h],...v}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(l=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:c,y:u}=iN(l,f,s))),r=-1)}return{x:c,y:u,placement:f,strategy:a,middlewareData:d}};function bF(e){return"number"!=typeof e?(t=e,{top:0,right:0,bottom:0,left:0,...t}):{top:e,right:e,bottom:e,left:e};var t}function gw(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function pv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=bF(p),g=s[d?"floating"===f?"reference":"floating":f],m=gw(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y=gw(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...i.floating,x:n,y:a}:i.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),strategy:l}):i[f]);return{top:m.top-y.top+h.top,bottom:y.bottom-m.bottom+h.bottom,left:m.left-y.left+h.left,right:y.right-m.right+h.right}}const Ife=Math.min,Hh=Math.max;function iI(e,t,r){return Hh(e,Ife(t,r))}const cN=e=>({name:"arrow",options:e,async fn(t){const{element:r,padding:n=0}=e??{},{x:a,y:o,placement:i,rects:s,platform:l}=t;if(null==r)return{};const c=bF(n),u={x:a,y:o},f=Q0(i),d=tb(i),p=ZR(f),h=await l.getDimensions(r),g="y"===f?"top":"left",m="y"===f?"bottom":"right",y=s.reference[p]+s.reference[f]-u[f]-s.floating[p],v=u[f]-s.reference[f],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(r));let w=b?"y"===f?b.clientHeight||0:b.clientWidth||0:0;0===w&&(w=s.floating[p]);const _=y/2-v/2,k=c[g],x=w-h[p]-c[m],E=w/2-h[p]/2+_,A=iI(k,E,x),S=("start"===d?c[g]:c[m])>0&&E!==A&&s.reference[p]<=s.floating[p];return{[f]:u[f]-(S?E<k?k-E:x-E:0),data:{[f]:A,centerOffset:E-A}}}}),Afe={left:"right",right:"left",bottom:"top",top:"bottom"};function yw(e){return e.replace(/left|right|bottom|top/g,(e=>Afe[e]))}function Rfe(e,t,r){void 0===r&&(r=!1);const n=tb(e),a=Q0(e),o=ZR(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=yw(i)),{main:i,cross:yw(i)}}const Tfe={start:"end",end:"start"};function lN(e){return e.replace(/start|end/g,(e=>Tfe[e]))}const _F=["top","right","bottom","left"];_F.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]);const Pfe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:a,rects:o,initialPlacement:i,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:p=!0,...h}=e,g=Pm(n),m=[i,...f||(g!==i&&p?function(e){const t=yw(e);return[lN(e),t,lN(t)]}(i):[yw(i)])],y=await pv(t,h),v=[];let b=(null==(r=a.flip)?void 0:r.overflows)||[];if(c&&v.push(y[g]),u){const{main:e,cross:t}=Rfe(n,o,await(null==s.isRTL?void 0:s.isRTL(l.floating)));v.push(y[e],y[t])}if(b=[...b,{placement:n,overflows:v}],!v.every((e=>e<=0))){var w,_;const e=(null!=(w=null==(_=a.flip)?void 0:_.index)?w:0)+1,t=m[e];if(t)return{data:{index:e,overflows:b},reset:{placement:t}};let r="bottom";switch(d){case"bestFit":{var k;const e=null==(k=b.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0].placement;e&&(r=e);break}case"initialPlacement":r=i}if(n!==r)return{reset:{placement:r}}}return{}}}};function uN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fN(e){return _F.some((t=>e[t]>=0))}const $fe=function(e){let{strategy:t="referenceHidden",...r}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:n}=e;switch(t){case"referenceHidden":{const t=uN(await pv(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:fN(t)}}}case"escaped":{const t=uN(await pv(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:fN(t)}}}default:return{}}}}},zfe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,a=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=Pm(r),s=tb(r),l="x"===Q0(r),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,e);return{x:r+a.x,y:n+a.y,data:a}}}};function wF(e){return"x"===e?"y":"x"}const Mfe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=e,c={x:r,y:n},u=await pv(t,l),f=Q0(Pm(a)),d=wF(f);let p=c[f],h=c[d];if(o){const e="y"===f?"bottom":"right";p=iI(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=iI(h+u["y"===d?"top":"left"],h,h-u[e])}const g=s.fn({...t,[f]:p,[d]:h});return{...g,data:{x:g.x-r,y:g.y-n}}}}},Ofe=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:r,y:n},f=Q0(a),d=wF(f);let p=u[f],h=u[d];const g="function"==typeof s?s({...o,placement:a}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+m.mainAxis,r=o.reference[f]+o.reference[e]-m.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var y,v,b,w;const e="y"===f?"width":"height",t=["top","left"].includes(Pm(a)),r=o.reference[d]-o.floating[e]+(t&&null!=(y=null==(v=i.offset)?void 0:v[d])?y:0)+(t?0:m.crossAxis),n=o.reference[d]+o.reference[e]+(t?0:null!=(b=null==(w=i.offset)?void 0:w[d])?b:0)-(t?m.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[f]:p,[d]:h}}}},Nfe=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:a,elements:o}=t,{apply:i,...s}=e,l=await pv(t,s),c=Pm(r),u=tb(r);let f,d;"top"===c||"bottom"===c?(f=c,d=u===(await(null==a.isRTL?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(d=c,f="end"===u?"top":"bottom");const p=Hh(l.left,0),h=Hh(l.right,0),g=Hh(l.top,0),m=Hh(l.bottom,0),y={availableHeight:n.floating.height-(["left","right"].includes(r)?2*(0!==g||0!==m?g+m:Hh(l.top,l.bottom)):l[f]),availableWidth:n.floating.width-(["top","bottom"].includes(r)?2*(0!==p||0!==h?p+h:Hh(l.left,l.right)):l[d])},v=await a.getDimensions(o.floating);null==i||i({...t,...y});const b=await a.getDimensions(o.floating);return v.width!==b.width||v.height!==b.height?{reset:{rects:!0}}:{}}}};function kF(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Ef(e){if(null==e)return window;if(!kF(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function nb(e){return Ef(e).getComputedStyle(e)}function hf(e){return kF(e)?"":e?(e.nodeName||"").toLowerCase():""}function xF(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function Zl(e){return e instanceof Ef(e).HTMLElement}function wp(e){return e instanceof Ef(e).Element}function JR(e){return!(typeof ShadowRoot>"u")&&(e instanceof Ef(e).ShadowRoot||e instanceof ShadowRoot)}function B2(e){const{overflow:t,overflowX:r,overflowY:n}=nb(e);return/auto|scroll|overlay|hidden/.test(t+n+r)}function Dfe(e){return["table","td","th"].includes(hf(e))}function dN(e){const t=/firefox/i.test(xF()),r=nb(e);return"none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||["transform","perspective"].includes(r.willChange)||t&&"filter"===r.willChange||t&&!!r.filter&&"none"!==r.filter}function SF(){return!/^((?!chrome|android).)*safari/i.test(xF())}const pN=Math.min,By=Math.max,vw=Math.round;function mf(e,t,r){var n,a,o,i;void 0===t&&(t=!1),void 0===r&&(r=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&Zl(e)&&(l=e.offsetWidth>0&&vw(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&vw(s.height)/e.offsetHeight||1);const u=wp(e)?Ef(e):window,f=!SF()&&r,d=(s.left+(f&&null!=(n=null==(a=u.visualViewport)?void 0:a.offsetLeft)?n:0))/l,p=(s.top+(f&&null!=(o=null==(i=u.visualViewport)?void 0:i.offsetTop)?o:0))/c,h=s.width/l,g=s.height/c;return{width:h,height:g,top:p,right:d+h,bottom:p+g,left:d,x:d,y:p}}function dp(e){return(t=e,(t instanceof Ef(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function F2(e){return wp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function EF(e){return mf(dp(e)).left+F2(e).scrollLeft}function jfe(e,t,r){const n=Zl(t),a=dp(t),o=mf(e,n&&function(e){const t=mf(e);return vw(t.width)!==e.offsetWidth||vw(t.height)!==e.offsetHeight}(t),"fixed"===r);let i={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(n||!n&&"fixed"!==r)if(("body"!==hf(t)||B2(a))&&(i=F2(t)),Zl(t)){const e=mf(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else a&&(s.x=EF(a));return{x:o.left+i.scrollLeft-s.x,y:o.top+i.scrollTop-s.y,width:o.width,height:o.height}}function CF(e){return"html"===hf(e)?e:e.assignedSlot||e.parentNode||(JR(e)?e.host:null)||dp(e)}function hN(e){return Zl(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function cI(e){const t=Ef(e);let r=hN(e);for(;r&&Dfe(r)&&"static"===getComputedStyle(r).position;)r=hN(r);return r&&("html"===hf(r)||"body"===hf(r)&&"static"===getComputedStyle(r).position&&!dN(r))?t:r||function(e){let t=CF(e);for(JR(t)&&(t=t.host);Zl(t)&&!["html","body"].includes(hf(t));){if(dN(t))return t;t=t.parentNode}return null}(e)||t}function mN(e){if(Zl(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=mf(e);return{width:t.width,height:t.height}}function IF(e){const t=CF(e);return["html","body","#document"].includes(hf(t))?e.ownerDocument.body:Zl(t)&&B2(t)?t:IF(t)}function bw(e,t){var r;void 0===t&&(t=[]);const n=IF(e),a=n===(null==(r=e.ownerDocument)?void 0:r.body),o=Ef(n),i=a?[o].concat(o.visualViewport||[],B2(n)?n:[]):n,s=t.concat(i);return a?s:s.concat(bw(i))}function gN(e,t,r){return"viewport"===t?gw(function(e,t){const r=Ef(e),n=dp(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=SF();(e||!e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}(e,r)):wp(t)?function(e,t){const r=mf(e,!1,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft;return{top:n,left:a,x:a,y:n,right:a+e.clientWidth,bottom:n+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,r):gw(function(e){var t;const r=dp(e),n=F2(e),a=null==(t=e.ownerDocument)?void 0:t.body,o=By(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=By(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let s=-n.scrollLeft+EF(e);const l=-n.scrollTop;return"rtl"===nb(a||r).direction&&(s+=By(r.clientWidth,a?a.clientWidth:0)-o),{width:o,height:i,x:s,y:l}}(dp(e)))}function Lfe(e){const t=bw(e),r=["absolute","fixed"].includes(nb(e).position)&&Zl(e)?cI(e):e;return wp(r)?t.filter((e=>wp(e)&&function(e,t){const r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&JR(r)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}(e,r)&&"body"!==hf(e))):[]}const Vfe={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[..."clippingAncestors"===r?Lfe(t):[].concat(r),n],i=o[0],s=o.reduce(((e,r)=>{const n=gN(t,r,a);return e.top=By(n.top,e.top),e.right=pN(n.right,e.right),e.bottom=pN(n.bottom,e.bottom),e.left=By(n.left,e.left),e}),gN(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const a=Zl(r),o=dp(r);if(r===o)return t;let i={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((a||!a&&"fixed"!==n)&&(("body"!==hf(r)||B2(o))&&(i=F2(r)),Zl(r))){const e=mf(r,!0);s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}return{...t,x:t.x-i.scrollLeft+s.x,y:t.y-i.scrollTop+s.y}},isElement:wp,getDimensions:mN,getOffsetParent:cI,getDocumentElement:dp,getElementRects:e=>{let{reference:t,floating:r,strategy:n}=e;return{reference:jfe(t,cI(r),n),floating:{...mN(r),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===nb(e).direction};function Bfe(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=!0,animationFrame:s=!1}=n,l=a&&!s,c=o&&!s,u=l||c?[...wp(e)?bw(e):[],...bw(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",r,{passive:!0}),c&&e.addEventListener("resize",r)}));let f,d=null;if(i){let n=!0;d=new ResizeObserver((()=>{n||r(),n=!1})),wp(e)&&!s&&d.observe(e),d.observe(t)}let p=s?mf(e):null;return s&&function t(){const n=mf(e);!p||n.x===p.x&&n.y===p.y&&n.width===p.width&&n.height===p.height||r(),p=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",r),c&&e.removeEventListener("resize",r)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(f)}}const Ffe=(e,t,r)=>Cfe(e,t,{platform:Vfe,...r});var lI=typeof document<"u"?g.useLayoutEffect:g.useEffect;function uI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;0!=n--;)if(!uI(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){const r=a[n];if(!("_owner"===r&&e.$$typeof||uI(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function Ufe(e){const t=g.useRef(e);return lI((()=>{t.current=e})),t}function Gfe(e){let{middleware:t,placement:r="bottom",strategy:n="absolute",whileElementsMounted:a}=void 0===e?{}:e;const o=g.useRef(null),i=g.useRef(null),s=Ufe(a),l=g.useRef(null),[c,u]=g.useState({x:null,y:null,strategy:n,placement:r,middlewareData:{}}),[f,d]=g.useState(t);uI(null==f?void 0:f.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||d(t);const p=g.useCallback((()=>{!o.current||!i.current||Ffe(o.current,i.current,{middleware:f,placement:r,strategy:n}).then((e=>{h.current&&Qc.flushSync((()=>{u(e)}))}))}),[f,r,n]);lI((()=>{h.current&&p()}),[p]);const h=g.useRef(!1);lI((()=>(h.current=!0,()=>{h.current=!1})),[]);const m=g.useCallback((()=>{if("function"==typeof l.current&&(l.current(),l.current=null),o.current&&i.current)if(s.current){const e=s.current(o.current,i.current,p);l.current=e}else p()}),[p,s]),y=g.useCallback((e=>{o.current=e,m()}),[m]),v=g.useCallback((e=>{i.current=e,m()}),[m]),b=g.useMemo((()=>({reference:o,floating:i})),[]);return g.useMemo((()=>({...c,update:p,refs:b,reference:y,floating:v})),[c,p,b,y,v])}const qfe=e=>{const{element:t,padding:r}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?cN({element:t.current,padding:r}).fn(e):{}:t?cN({element:t,padding:r}).fn(e):{}}};function Wfe(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Hfe(...e){return t=>e.forEach((e=>Wfe(e,t)))}const AF=g.forwardRef(((e,t)=>{const{children:r,...n}=e,a=g.Children.toArray(r),o=a.find(Yfe);if(o){const e=o.props.children,r=a.map((t=>t===o?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t));return g.createElement(fI,Pe({},n,{ref:t}),g.isValidElement(e)?g.cloneElement(e,void 0,r):null)}return g.createElement(fI,Pe({},n,{ref:t}),r)}));AF.displayName="Slot";const fI=g.forwardRef(((e,t)=>{const{children:r,...n}=e;return g.isValidElement(r)?g.cloneElement(r,{...Kfe(n,r.props),ref:Hfe(t,r.ref)}):g.Children.count(r)>1?g.Children.only(null):null}));fI.displayName="SlotClone";const Qfe=({children:e})=>g.createElement(g.Fragment,null,e);function Yfe(e){return g.isValidElement(e)&&e.type===Qfe}function Kfe(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{o(...e),a(...e)}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}const Xfe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],I0=Xfe.reduce(((e,t)=>{const r=g.forwardRef(((e,r)=>{const{asChild:n,...a}=e,o=n?AF:t;return g.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),g.createElement(o,Pe({},a,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function Zfe(e,t){e&&Qc.flushSync((()=>e.dispatchEvent(t)))}function Jfe(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function ede(...e){return t=>e.forEach((e=>Jfe(e,t)))}function RF(...e){return g.useCallback(ede(...e),e)}const em=null!=globalThis&&globalThis.document?g.useLayoutEffect:()=>{};function tde(e){const[t,r]=g.useState(void 0);return em((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),t}const TF="Popper",[eT,PF]=vF(TF),[nde,$F]=eT(TF),rde=e=>{const{__scopePopper:t,children:r}=e,[n,a]=g.useState(null);return g.createElement(nde,{scope:t,anchor:n,onAnchorChange:a},r)},ade="PopperAnchor",ode=g.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,o=$F(ade,r),i=g.useRef(null),s=RF(t,i);return g.useEffect((()=>{o.onAnchorChange((null==n?void 0:n.current)||i.current)})),n?null:g.createElement(I0.div,Pe({},a,{ref:s}))})),_w="PopperContent",[sde,Lot]=eT(_w),[ide,cde]=eT(_w,{hasParent:!1,positionUpdateFns:new Set}),lde=g.forwardRef(((e,t)=>{var r,n,a,o,i,s,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:h=0,arrowPadding:m=0,collisionBoundary:y=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:w=!1,avoidCollisions:_=!0,onPlaced:k,...x}=e,E=$F(_w,u),[A,S]=g.useState(null),C=RF(t,(e=>S(e))),[z,I]=g.useState(null),j=tde(z),P=null!==(r=null==j?void 0:j.width)&&void 0!==r?r:0,T=null!==(n=null==j?void 0:j.height)&&void 0!==n?n:0,R=f+("center"!==p?"-"+p:""),N="number"==typeof v?v:{top:0,right:0,bottom:0,left:0,...v},O=Array.isArray(y)?y:[y],M=O.length>0,D={padding:N,boundary:O.filter(fde),altBoundary:M},{reference:L,floating:q,strategy:V,x:B,y:U,placement:F,middlewareData:$,update:G}=Gfe({strategy:"fixed",placement:R,whileElementsMounted:Bfe,middleware:[dde(),zfe({mainAxis:d+T,alignmentAxis:h}),_?Mfe({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?Ofe():void 0,...D}):void 0,z?qfe({element:z,padding:m}):void 0,_?Pfe({...D}):void 0,Nfe({...D,apply:({elements:e,availableWidth:t,availableHeight:r})=>{e.floating.style.setProperty("--radix-popper-available-width",`${t}px`),e.floating.style.setProperty("--radix-popper-available-height",`${r}px`)}}),pde({arrowWidth:P,arrowHeight:T}),w?$fe({strategy:"referenceHidden"}):void 0].filter(ude)});em((()=>{L(E.anchor)}),[L,E.anchor]);const Q=null!==B&&null!==U,[W,H]=zF(F),K=H0(k);em((()=>{Q&&(null==K||K())}),[Q,K]);const Y=null===(a=$.arrow)||void 0===a?void 0:a.x,Z=null===(o=$.arrow)||void 0===o?void 0:o.y,X=0!==(null===(i=$.arrow)||void 0===i?void 0:i.centerOffset),[J,ee]=g.useState();em((()=>{A&&ee(window.getComputedStyle(A).zIndex)}),[A]);const{hasParent:te,positionUpdateFns:re}=cde(_w,u),ne=!te;g.useLayoutEffect((()=>{if(!ne)return re.add(G),()=>{re.delete(G)}}),[ne,re,G]),em((()=>{ne&&Q&&Array.from(re).reverse().forEach((e=>requestAnimationFrame(e)))}),[ne,Q,re]);const ae={"data-side":W,"data-align":H,...x,ref:C,style:{...x.style,animation:Q?void 0:"none",opacity:null!==(s=$.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return g.createElement("div",{ref:q,"data-radix-popper-content-wrapper":"",style:{position:V,left:0,top:0,transform:Q?`translate3d(${Math.round(B)}px, ${Math.round(U)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[null===(l=$.transformOrigin)||void 0===l?void 0:l.x,null===(c=$.transformOrigin)||void 0===c?void 0:c.y].join(" ")},dir:e.dir},g.createElement(sde,{scope:u,placedSide:W,onArrowChange:I,arrowX:Y,arrowY:Z,shouldHideArrow:X},ne?g.createElement(ide,{scope:u,hasParent:!0,positionUpdateFns:re},g.createElement(I0.div,ae)):g.createElement(I0.div,ae)))}));function ude(e){return void 0!==e}function fde(e){return null!==e}const dde=()=>({name:"anchorCssProperties",fn(e){const{rects:t,elements:r}=e,{width:n,height:a}=t.reference;return r.floating.style.setProperty("--radix-popper-anchor-width",`${n}px`),r.floating.style.setProperty("--radix-popper-anchor-height",`${a}px`),{}}}),pde=e=>({name:"transformOrigin",options:e,fn(t){var r,n,a,o,i;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(r=c.arrow)||void 0===r?void 0:r.centerOffset),f=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[p,h]=zF(s),g={start:"0%",center:"50%",end:"100%"}[h],m=(null!==(n=null===(a=c.arrow)||void 0===a?void 0:a.x)&&void 0!==n?n:0)+f/2,y=(null!==(o=null===(i=c.arrow)||void 0===i?void 0:i.y)&&void 0!==o?o:0)+d/2;let v="",b="";return"bottom"===p?(v=u?g:`${m}px`,b=-d+"px"):"top"===p?(v=u?g:`${m}px`,b=`${l.floating.height+d}px`):"right"===p?(v=-d+"px",b=u?g:`${y}px`):"left"===p&&(v=`${l.floating.width+d}px`,b=u?g:`${y}px`),{data:{x:v,y:b}}}});function zF(e){const[t,r="center"]=e.split("-");return[t,r]}const hde=rde,mde=ode,gde=lde,yde=g.forwardRef(((e,t)=>{var r;const{container:n=(null==globalThis||null===(r=globalThis.document)||void 0===r?void 0:r.body),...a}=e;return n?xA.createPortal(g.createElement(I0.div,Pe({},a,{ref:t})),n):null}));function vde(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function bde(...e){return t=>e.forEach((e=>vde(e,t)))}function _de(...e){return g.useCallback(bde(...e),e)}function wde(e,t){return g.useReducer(((e,r)=>t[e][r]??e),e)}const tT=e=>{const{present:t,children:r}=e,n=kde(t),a="function"==typeof r?r({present:n.isPresent}):g.Children.only(r),o=_de(n.ref,a.ref);return"function"==typeof r||n.isPresent?g.cloneElement(a,{ref:o}):null};function kde(e){const[t,r]=g.useState(),n=g.useRef({}),a=g.useRef(e),o=g.useRef("none"),i=e?"mounted":"unmounted",[s,l]=wde(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect((()=>{const e=p_(n.current);o.current="mounted"===s?e:"none"}),[s]),em((()=>{const t=n.current,r=a.current;if(r!==e){const n=o.current,i=p_(t);e?l("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?l("UNMOUNT"):l(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),a.current=e}}),[e,l]),em((()=>{if(t){const e=e=>{const r=p_(n.current).includes(e.animationName);e.target===t&&r&&Qc.flushSync((()=>l("ANIMATION_END")))},r=e=>{e.target===t&&(o.current=p_(n.current))};return t.addEventListener("animationstart",r),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",r),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback((e=>{e&&(n.current=getComputedStyle(e)),r(e)}),[])}}function p_(e){return(null==e?void 0:e.animationName)||"none"}function xde(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function Sde(...e){return t=>e.forEach((e=>xde(e,t)))}function Ede(...e){return g.useCallback(Sde(...e),e)}function Cde(e,t=(null==globalThis?void 0:globalThis.document)){const r=H0(e);g.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}tT.displayName="Presence";const dI="dismissableLayer.update",Ide="dismissableLayer.pointerDownOutside",Ade="dismissableLayer.focusOutside";let yN;const Rde=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tde=g.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,u=g.useContext(Rde),[f,d]=g.useState(null),p=null!==(r=null==f?void 0:f.ownerDocument)&&void 0!==r?r:null==globalThis?void 0:globalThis.document,[,h]=g.useState({}),m=Ede(t,(e=>d(e))),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,k=w>=b,x=Pde((e=>{const t=e.target,r=[...u.branches].some((e=>e.contains(t)));!k||r||(null==o||o(e),null==s||s(e),e.defaultPrevented||null==l||l())}),p),E=$de((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==l||l())}),p);return Cde((e=>{w===u.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),p),g.useEffect((()=>{if(f)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(yN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),vN(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=yN)}}),[f,p,n,u]),g.useEffect((()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),vN())}),[f,u]),g.useEffect((()=>{const e=()=>h({});return document.addEventListener(dI,e),()=>document.removeEventListener(dI,e)}),[]),g.createElement(I0.div,Pe({},c,{ref:m,style:{pointerEvents:_?k?"auto":"none":void 0,...e.style},onFocusCapture:Gi(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Gi(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Gi(e.onPointerDownCapture,x.onPointerDownCapture)}))}));function Pde(e,t=(null==globalThis?void 0:globalThis.document)){const r=H0(e),n=g.useRef(!1),a=g.useRef((()=>{}));return g.useEffect((()=>{const e=e=>{if(e.target&&!n.current){let n=function(){MF(Ide,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}n.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,r]),{onPointerDownCapture:()=>n.current=!0}}function $de(e,t=(null==globalThis?void 0:globalThis.document)){const r=H0(e),n=g.useRef(!1);return g.useEffect((()=>{const e=e=>{e.target&&!n.current&&MF(Ade,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function vN(){const e=new CustomEvent(dI);document.dispatchEvent(e)}function MF(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Zfe(a,o):a.dispatchEvent(o)}let rE;const OF="HoverCard",[NF,Vot]=vF(OF,[PF]),nT=PF(),[zde,U2]=NF(OF),Mde=e=>{const{__scopeHoverCard:t,children:r,open:n,defaultOpen:a,onOpenChange:o,openDelay:i=700,closeDelay:s=300}=e,l=nT(t),c=g.useRef(0),u=g.useRef(0),f=g.useRef(!1),d=g.useRef(!1),[p=!1,h]=wfe({prop:n,defaultProp:a,onChange:o}),m=g.useCallback((()=>{clearTimeout(u.current),c.current=window.setTimeout((()=>h(!0)),i)}),[i,h]),y=g.useCallback((()=>{clearTimeout(c.current),!f.current&&!d.current&&(u.current=window.setTimeout((()=>h(!1)),s))}),[s,h]),v=g.useCallback((()=>h(!1)),[h]);return g.useEffect((()=>()=>{clearTimeout(c.current),clearTimeout(u.current)}),[]),g.createElement(zde,{scope:t,open:p,onOpenChange:h,onOpen:m,onClose:y,onDismiss:v,hasSelectionRef:f,isPointerDownOnContentRef:d},g.createElement(hde,l,r))},Ode="HoverCardTrigger",Nde=g.forwardRef(((e,t)=>{const{__scopeHoverCard:r,...n}=e,a=U2(Ode,r),o=nT(r);return g.createElement(mde,Pe({asChild:!0},o),g.createElement(I0.a,Pe({"data-state":a.open?"open":"closed"},n,{ref:t,onPointerEnter:Gi(e.onPointerEnter,ww(a.onOpen)),onPointerLeave:Gi(e.onPointerLeave,ww(a.onClose)),onFocus:Gi(e.onFocus,a.onOpen),onBlur:Gi(e.onBlur,a.onClose),onTouchStart:Gi(e.onTouchStart,(e=>e.preventDefault()))})))})),DF="HoverCardPortal",[Dde,jde]=NF(DF,{forceMount:void 0}),Lde=e=>{const{__scopeHoverCard:t,forceMount:r,children:n,container:a}=e,o=U2(DF,t);return g.createElement(Dde,{scope:t,forceMount:r},g.createElement(tT,{present:r||o.open},g.createElement(yde,{asChild:!0,container:a},n)))},pI="HoverCardContent",Vde=g.forwardRef(((e,t)=>{const r=jde(pI,e.__scopeHoverCard),{forceMount:n=r.forceMount,...a}=e,o=U2(pI,e.__scopeHoverCard);return g.createElement(tT,{present:n||o.open},g.createElement(Bde,Pe({"data-state":o.open?"open":"closed"},a,{onPointerEnter:Gi(e.onPointerEnter,ww(o.onOpen)),onPointerLeave:Gi(e.onPointerLeave,ww(o.onClose)),ref:t})))})),Bde=g.forwardRef(((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,...s}=e,l=U2(pI,r),c=nT(r),u=g.useRef(null),f=Efe(t,u),[d,p]=g.useState(!1);return g.useEffect((()=>{if(d){const e=document.body;return rE=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect="none",e.style.webkitUserSelect="none",()=>{e.style.userSelect=rE,e.style.webkitUserSelect=rE}}}),[d]),g.useEffect((()=>{if(u.current){const e=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout((()=>{var e;""!==(null===(e=document.getSelection())||void 0===e?void 0:e.toString())&&(l.hasSelectionRef.current=!0)}))};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}}),[l.isPointerDownOnContentRef,l.hasSelectionRef]),g.useEffect((()=>{u.current&&Fde(u.current).forEach((e=>e.setAttribute("tabindex","-1")))})),g.createElement(Tde,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:Gi(o,(e=>{e.preventDefault()})),onDismiss:l.onDismiss},g.createElement(gde,Pe({},c,s,{onPointerDown:Gi(s.onPointerDown,(e=>{e.currentTarget.contains(e.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0})),ref:f,style:{...s.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))}));function ww(e){return t=>"touch"===t.pointerType?void 0:e()}function Fde(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}const Ude=Mde,Gde=Nde,qde=Lde,jF=Vde,LF=Ude,VF=Gde,Wde=qde,rT=g.forwardRef((({className:e,align:t="center",sideOffset:r=4,...n},a)=>E.jsx(jF,{ref:a,align:t,sideOffset:r,className:he("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})));rT.displayName=jF.displayName;const Y0=g.forwardRef((({className:e,type:t,...r},n)=>{const{error:a}=Sf();return E.jsx("input",{type:t,title:r.disabled?"Disabled":"",className:he("flex w-full rounded-m px-s py-3.5 text-base text-gray-900 outline outline-1 outline-input ring-offset-background transition-all duration-200 ease-in-out file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-base placeholder:text-gray-400 placeholder:text-muted-foreground focus-visible:bg-gray-50 focus-visible:text-gray-900 focus-visible:outline-2 focus-visible:outline-blue_120 enabled:hover:outline-2 enabled:hover:outline-gray-400 disabled:bg-transparent disabled:text-gray-300 disabled:outline-gray-200 disabled:ring-0 disabled:ring-transparent disabled:placeholder:text-gray-300",{"bg-red_30_17 outline-red-dark":!!a},e),ref:n,...r})}));function Hde(e,t=[]){let r=[];const n=()=>{const t=r.map((e=>g.createContext(e)));return function(r){const n=(null==r?void 0:r[e])||t;return g.useMemo((()=>({[`__scope${e}`]:{...r,[e]:n}})),[r,n])}};return n.scopeName=e,[function(t,n){const a=g.createContext(n),o=r.length;r=[...r,n];const i=t=>{var r;const{scope:n,children:i,...s}=t,l=(null==(r=null==n?void 0:n[e])?void 0:r[o])||a,c=g.useMemo((()=>s),Object.values(s));return E.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(r,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=g.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},Qde(n,...t)]}function Qde(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const n=r.reduce(((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]})),{});return g.useMemo((()=>({[`__scope${t.scopeName}`]:n})),[n])}};return r.scopeName=t.scopeName,r}function bN(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Yde(...e){return t=>{let r=!1;const n=e.map((e=>{const n=bN(e,t);return!r&&"function"==typeof n&&(r=!0),n}));if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():bN(e[t],null)}}}}function Kde(e){const t=Xde(e),r=g.forwardRef(((e,r)=>{const{children:n,...a}=e,o=g.Children.toArray(n),i=o.find(Jde);if(i){const e=i.props.children,n=o.map((t=>t===i?g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null:t));return E.jsx(t,{...a,ref:r,children:g.isValidElement(e)?g.cloneElement(e,void 0,n):null})}return E.jsx(t,{...a,ref:r,children:n})}));return r.displayName=`${e}.Slot`,r}function Xde(e){const t=g.forwardRef(((e,t)=>{const{children:r,...n}=e;if(g.isValidElement(r)){const e=tpe(r),a=epe(n,r.props);return r.type!==g.Fragment&&(a.ref=t?Yde(t,e):e),g.cloneElement(r,a)}return g.Children.count(r)>1?g.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}Y0.displayName="Input";var Zde=Symbol("radix.slottable");function Jde(e){return g.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Zde}function epe(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}function tpe(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var npe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],BF=npe.reduce(((e,t)=>{const r=Kde(`Primitive.${t}`),n=g.forwardRef(((e,n)=>{const{asChild:a,...o}=e,i=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{}),aT="Progress",oT=100,[rpe,Bot]=Hde(aT),[ape,ope]=rpe(aT),FF=g.forwardRef(((e,t)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:o=spe,...i}=e;(a||0===a)&&!_N(a)&&console.error(ipe(`${a}`,"Progress"));const s=_N(a)?a:oT;null!==n&&!wN(n,s)&&console.error(cpe(`${n}`,"Progress"));const l=wN(n,s)?n:null,c=kw(l)?o(l,s):void 0;return E.jsx(ape,{scope:r,value:l,max:s,children:E.jsx(BF.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":kw(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":qF(l,s),"data-value":l??void 0,"data-max":s,...i,ref:t})})}));FF.displayName=aT;var UF="ProgressIndicator",GF=g.forwardRef(((e,t)=>{const{__scopeProgress:r,...n}=e,a=ope(UF,r);return E.jsx(BF.div,{"data-state":qF(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})}));function spe(e,t){return`${Math.round(e/t*100)}%`}function qF(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function kw(e){return"number"==typeof e}function _N(e){return kw(e)&&!isNaN(e)&&e>0}function wN(e,t){return kw(e)&&!isNaN(e)&&e<=t&&e>=0}function ipe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${oT}\`.`}function cpe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or ${oT} if no \`max\` prop is set)\n - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}GF.displayName=UF;var WF=FF,lpe=GF;const upe=g.forwardRef((({className:e,value:t,indicatorClassName:r,...n},a)=>E.jsx(WF,{ref:a,className:he("relative h-[7px] w-full overflow-hidden rounded-full bg-blue_10",e),...n,children:E.jsx(lpe,{className:he("h-full w-full flex-1 rounded-full bg-blue_100 transition-all",r),style:{transform:`translateX(-${100-(t||0)}%)`}})})));upe.displayName=WF.displayName;const HF="Radio",[fpe,QF]=as(HF),[dpe,ppe]=fpe(HF),hpe=g.forwardRef(((e,t)=>{const{__scopeRadio:r,name:n,checked:a=!1,required:o,disabled:i,value:s="on",onCheck:l,...c}=e,[u,f]=g.useState(null),d=dn(t,(e=>f(e))),p=g.useRef(!1),h=!u||!!u.closest("form");return g.createElement(dpe,{scope:r,checked:a,disabled:i},g.createElement(wt.button,Pe({type:"button",role:"radio","aria-checked":a,"data-state":YF(a),"data-disabled":i?"":void 0,disabled:i,value:s},c,{ref:d,onClick:ft(e.onClick,(e=>{a||null==l||l(),h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())}))})),h&&g.createElement(ype,{control:u,bubbles:!p.current,name:n,value:s,checked:a,required:o,disabled:i,style:{transform:"translateX(-100%)"}}))})),mpe="RadioIndicator",gpe=g.forwardRef(((e,t)=>{const{__scopeRadio:r,forceMount:n,...a}=e,o=ppe(mpe,r);return g.createElement(ii,{present:n||o.checked},g.createElement(wt.span,Pe({"data-state":YF(o.checked),"data-disabled":o.disabled?"":void 0},a,{ref:t})))})),ype=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,o=g.useRef(null),i=I2(r),s=A2(t);return g.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&a){const t=new Event("click",{bubbles:n});a.call(e,r),e.dispatchEvent(t)}}),[i,r,n]),g.createElement("input",Pe({type:"radio","aria-hidden":!0,defaultChecked:r},a,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function YF(e){return e?"checked":"unchecked"}const vpe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],KF="RadioGroup",[bpe,Fot]=as(KF,[G0,QF]),XF=G0(),ZF=QF(),[_pe,wpe]=bpe(KF),kpe=g.forwardRef(((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:a,value:o,required:i=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...d}=e,p=XF(r),h=Wv(c),[m,y]=Yl({prop:o,defaultProp:a,onChange:f});return g.createElement(_pe,{scope:r,name:n,required:i,disabled:s,value:m,onValueChange:y},g.createElement(AR,Pe({asChild:!0},p,{orientation:l,dir:h,loop:u}),g.createElement(wt.div,Pe({role:"radiogroup","aria-required":i,"aria-orientation":l,"data-disabled":s?"":void 0,dir:h},d,{ref:t}))))})),xpe="RadioGroupItem",Spe=g.forwardRef(((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...a}=e,o=wpe(xpe,r),i=o.disabled||n,s=XF(r),l=ZF(r),c=g.useRef(null),u=dn(t,c),f=o.value===a.value,d=g.useRef(!1);return g.useEffect((()=>{const e=e=>{vpe.includes(e.key)&&(d.current=!0)},t=()=>d.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}}),[]),g.createElement(RR,Pe({asChild:!0},s,{focusable:!i,active:f}),g.createElement(hpe,Pe({disabled:i,required:o.required,checked:f},l,a,{name:o.name,ref:u,onCheck:()=>o.onValueChange(a.value),onKeyDown:ft((e=>{"Enter"===e.key&&e.preventDefault()})),onFocus:ft(a.onFocus,(()=>{var e;d.current&&(null===(e=c.current)||void 0===e||e.click())}))})))})),Epe=g.forwardRef(((e,t)=>{const{__scopeRadioGroup:r,...n}=e,a=ZF(r);return g.createElement(gpe,Pe({},a,n,{ref:t}))})),JF=kpe,eU=Spe,Cpe=Epe,Ipe=g.forwardRef((({className:e,...t},r)=>E.jsx(JF,{className:he("grid gap-2",e),...t,ref:r})));Ipe.displayName=JF.displayName;const Ape=g.forwardRef((({className:e,...t},r)=>E.jsx(eU,{ref:r,className:he("aspect-square size-6 rounded-full border border-gray-300 disabled:cursor-not-allowed disabled:border-gray-100 disabled:bg-gray-100","data-[state=checked]:border-blue_100 data-[state=checked]:bg-blue_100 hover:data-[state=checked]:border-blue_120","disabled:data-[state=checked]:border-gray-100 disabled:data-[state=checked]:bg-gray-100","transition-[border] duration-200 hover:data-[state=checked]:bg-blue_120 md:hover:border-2",e),...t,children:E.jsx(Cpe,{className:"flex items-center justify-center",children:E.jsx(VX,{className:"stack-animate size-2 border-none",style:{fill:t.disabled?"var(--gray-300)":"white",color:t.disabled?"var(--gray-300)":"white"}})})})));Ape.displayName=eU.displayName;const Rpe=PA,Tpe=h2,tU=g.forwardRef((({className:e,...t},r)=>E.jsx(j0,{className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r})));tU.displayName=j0.displayName;const Ppe=Yi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),nU=g.forwardRef((({side:e="right",className:t,overlayClassName:r,children:n,...a},o)=>E.jsxs(Tpe,{children:[E.jsx(tU,{className:he("bg-gray-900/70",r)}),E.jsxs(L0,{ref:o,className:he(Ppe({side:e}),t),...a,children:[n,E.jsxs(m2,{className:"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[E.jsx(jv,{className:"h-4 w-4"}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));nU.displayName=L0.displayName;const rU=({className:e,...t})=>E.jsx("div",{className:he("flex flex-col space-y-2 text-center sm:text-left",e),...t});rU.displayName="SheetHeader";const aU=g.forwardRef((({className:e,...t},r)=>E.jsx(Lv,{ref:r,className:he("text-lg font-semibold text-foreground",e),...t})));aU.displayName=Lv.displayName;const oU=g.forwardRef((({className:e,...t},r)=>E.jsx(Vv,{ref:r,className:he("text-sm text-muted-foreground",e),...t})));oU.displayName=Vv.displayName;const[G2,Uot]=as("Tooltip",[U0]),sT=U0(),$pe="TooltipProvider",zpe=700,hI="tooltip.open",[Mpe,iT]=G2($pe),Ope=e=>{const{__scopeTooltip:t,delayDuration:r=zpe,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:o}=e,[i,s]=g.useState(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect((()=>{const e=c.current;return()=>window.clearTimeout(e)}),[]),g.createElement(Mpe,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:g.useCallback((()=>{window.clearTimeout(c.current),s(!1)}),[]),onClose:g.useCallback((()=>{window.clearTimeout(c.current),c.current=window.setTimeout((()=>s(!0)),n)}),[n]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback((e=>{l.current=e}),[]),disableHoverableContent:a},o)},cT="Tooltip",[Npe,rb]=G2(cT),sU=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:s}=e,l=iT(cT,e.__scopeTooltip),c=sT(t),[u,f]=g.useState(null),d=jc(),p=g.useRef(0),h=i??l.disableHoverableContent,m=s??l.delayDuration,y=g.useRef(!1),[v=!1,b]=Yl({prop:n,defaultProp:a,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(hI))):l.onClose(),null==o||o(e)}}),w=g.useMemo((()=>v?y.current?"delayed-open":"instant-open":"closed"),[v]),_=g.useCallback((()=>{window.clearTimeout(p.current),y.current=!1,b(!0)}),[b]),k=g.useCallback((()=>{window.clearTimeout(p.current),b(!1)}),[b]),x=g.useCallback((()=>{window.clearTimeout(p.current),p.current=window.setTimeout((()=>{y.current=!0,b(!0)}),m)}),[m,b]);return g.useEffect((()=>()=>window.clearTimeout(p.current)),[]),g.createElement(SR,c,g.createElement(Npe,{scope:t,contentId:d,open:v,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:g.useCallback((()=>{l.isOpenDelayed?x():_()}),[l.isOpenDelayed,x,_]),onTriggerLeave:g.useCallback((()=>{h?k():window.clearTimeout(p.current)}),[k,h]),onOpen:_,onClose:k,disableHoverableContent:h},r))},kN="TooltipTrigger",iU=g.forwardRef(((e,t)=>{const{__scopeTooltip:r,...n}=e,a=rb(kN,r),o=iT(kN,r),i=sT(r),s=dn(t,g.useRef(null),a.onTriggerChange),l=g.useRef(!1),c=g.useRef(!1),u=g.useCallback((()=>l.current=!1),[]);return g.useEffect((()=>()=>document.removeEventListener("pointerup",u)),[u]),g.createElement(ER,Pe({asChild:!0},i),g.createElement(wt.button,Pe({"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute},n,{ref:s,onPointerMove:ft(e.onPointerMove,(e=>{"touch"!==e.pointerType&&!c.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),c.current=!0)})),onPointerLeave:ft(e.onPointerLeave,(()=>{a.onTriggerLeave(),c.current=!1})),onPointerDown:ft(e.onPointerDown,(()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:ft(e.onFocus,(()=>{l.current||a.onOpen()})),onBlur:ft(e.onBlur,a.onClose),onClick:ft(e.onClick,a.onClose)})))})),cU="TooltipPortal",[Dpe,jpe]=G2(cU,{forceMount:void 0}),Lpe=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,o=rb(cU,t);return g.createElement(Dpe,{scope:t,forceMount:r},g.createElement(ii,{present:r||o.open},g.createElement(u2,{asChild:!0,container:a},n)))},hv="TooltipContent",lU=g.forwardRef(((e,t)=>{const r=jpe(hv,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...o}=e,i=rb(hv,e.__scopeTooltip);return g.createElement(ii,{present:n||i.open},i.disableHoverableContent?g.createElement(uU,Pe({side:a},o,{ref:t})):g.createElement(Vpe,Pe({side:a},o,{ref:t})))})),Vpe=g.forwardRef(((e,t)=>{const r=rb(hv,e.__scopeTooltip),n=iT(hv,e.__scopeTooltip),a=g.useRef(null),o=dn(t,a),[i,s]=g.useState(null),{trigger:l,onClose:c}=r,u=a.current,{onPointerInTransitChange:f}=n,d=g.useCallback((()=>{s(null),f(!1)}),[f]),p=g.useCallback(((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=Wpe([...Upe(n,Fpe(n,r.getBoundingClientRect())),...Gpe(t.getBoundingClientRect())]);s(a),f(!0)}),[f]);return g.useEffect((()=>()=>d()),[d]),g.useEffect((()=>{if(l&&u){const e=e=>p(e,u),t=e=>p(e,l);return l.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[l,u,p,d]),g.useEffect((()=>{if(i){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==l?void 0:l.contains(t))||(null==u?void 0:u.contains(t)),a=!qpe(r,i);n?d():a&&(d(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[l,u,i,c,d]),g.createElement(uU,Pe({},e,{ref:o}))})),[Bpe,Got]=G2(cT,{isInside:!1}),uU=g.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...s}=e,l=rb(hv,r),c=sT(r),{onClose:u}=l;return g.useEffect((()=>(document.addEventListener(hI,u),()=>document.removeEventListener(hI,u))),[u]),g.useEffect((()=>{if(l.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(l.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[l.trigger,u]),g.createElement(l2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:u},g.createElement(CR,Pe({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),g.createElement(CA,null,n),g.createElement(Bpe,{scope:r,isInside:!0},g.createElement(Iue,{id:l.contentId,role:"tooltip"},a||n))))}));function Fpe(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,a,o)){case o:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Upe(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}function Gpe(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function qpe(e,t){const{x:r,y:n}=e;let a=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){const i=t[e].x,s=t[e].y,l=t[o].x,c=t[o].y;s>n!=c>n&&r<(l-i)*(n-s)/(c-s)+i&&(a=!a)}return a}function Wpe(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),Hpe(t)}function Hpe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}const Qpe=sU,Ype=iU,Kpe=Lpe,fU=lU,Xpe=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Zpe={deviceType:Xpe(),deviceWidth:window.innerWidth},dU=ur({name:"ui",initialState:Zpe,reducers:{},extraReducers:e=>{e.addCase(UY,((e,{payload:t})=>{e.deviceType=t})),e.addCase(GY,((e,{payload:t})=>{e.deviceWidth=t}))},selectors:{selectDeviceType:e=>e.deviceType,selectDeviceWidth:e=>e.deviceWidth,selectIsMobile:e=>"mobile"===e.deviceType,selectIsTablet:e=>"tablet"===e.deviceType,selectIsDesktop:e=>"desktop"===e.deviceType}});var aE,xN,oE,SN,sE,EN,iE,CN,cE,IN,lE,AN,uE,RN,fE,TN,dE,PN,pE,$N,hE,zN,mE,MN,gE,ON,yE,NN,vE,DN,bE,jN,_E,LN,wE,VN,kE,BN,xE,FN,SE,UN,EE,GN,CE,qN,IE,WN,AE,HN,RE,QN,TE,YN,PE,KN,$E,XN,zE,ZN,ME,JN,OE,e5,NE,t5,DE,n5,jE,r5,LE,a5,VE,o5,BE,s5,FE,i5,UE,c5,GE,l5;function pU(){if(xN)return aE;xN=1;var e=dL(),t=e&&new e;return aE=t}function hU(){if(SN)return oE;SN=1;var e=eR(),t=pU();return oE=t?function(e,r){return t.set(e,r),e}:e}function q2(){if(EN)return sE;EN=1;var e=C2(),t=Yc();return sE=function(r){return function(){var n=arguments;switch(n.length){case 0:return new r;case 1:return new r(n[0]);case 2:return new r(n[0],n[1]);case 3:return new r(n[0],n[1],n[2]);case 4:return new r(n[0],n[1],n[2],n[3]);case 5:return new r(n[0],n[1],n[2],n[3],n[4]);case 6:return new r(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new r(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var a=e(r.prototype),o=r.apply(a,n);return t(o)?o:a}},sE}function Jpe(){if(CN)return iE;CN=1;var e=q2(),t=os();return iE=function(r,n,a){var o=1&n,i=e(r);return function e(){return(this&&this!==t&&this instanceof e?i:r).apply(o?a:this,arguments)}},iE}function mU(){if(IN)return cE;IN=1;var e=Math.max;return cE=function(t,r,n,a){for(var o=-1,i=t.length,s=n.length,l=-1,c=r.length,u=e(i-s,0),f=Array(c+u),d=!a;++l<c;)f[l]=r[l];for(;++o<s;)(d||o<i)&&(f[n[o]]=t[o]);for(;u--;)f[l++]=t[o++];return f}}function gU(){if(AN)return lE;AN=1;var e=Math.max;return lE=function(t,r,n,a){for(var o=-1,i=t.length,s=-1,l=n.length,c=-1,u=r.length,f=e(i-l,0),d=Array(f+u),p=!a;++o<f;)d[o]=t[o];for(var h=o;++c<u;)d[h+c]=r[c];for(;++s<l;)(p||o<i)&&(d[h+n[s]]=t[o++]);return d}}function ehe(){if(RN)return uE;return RN=1,uE=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}}function lT(){if(TN)return fE;return TN=1,fE=function(){}}function uT(){if(PN)return dE;PN=1;var e=C2(),t=lT();function r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}return r.prototype=e(t.prototype),r.prototype.constructor=r,dE=r}function yU(){if($N)return pE;$N=1;var e=pU(),t=gL();return pE=e?function(t){return e.get(t)}:t}function the(){if(zN)return hE;zN=1;return hE={}}function nhe(){if(MN)return mE;MN=1;var e=the(),t=Object.prototype.hasOwnProperty;return mE=function(r){for(var n=r.name+"",a=e[n],o=t.call(e,n)?a.length:0;o--;){var i=a[o],s=i.func;if(null==s||s==r)return i.name}return n}}function vU(){if(ON)return gE;ON=1;var e=C2(),t=lT();function r(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}return r.prototype=e(t.prototype),r.prototype.constructor=r,gE=r}function rhe(){if(NN)return yE;NN=1;var e=uT(),t=vU(),r=E2();return yE=function(n){if(n instanceof e)return n.clone();var a=new t(n.__wrapped__,n.__chain__);return a.__actions__=r(n.__actions__),a.__index__=n.__index__,a.__values__=n.__values__,a}}function ahe(){if(DN)return vE;DN=1;var e=uT(),t=vU(),r=lT(),n=As(),a=ci(),o=rhe(),i=Object.prototype.hasOwnProperty;function s(r){if(a(r)&&!n(r)&&!(r instanceof e)){if(r instanceof t)return r;if(i.call(r,"__wrapped__"))return o(r)}return new t(r)}return s.prototype=r.prototype,s.prototype.constructor=s,vE=s}function ohe(){if(jN)return bE;jN=1;var e=uT(),t=yU(),r=nhe(),n=ahe();return bE=function(a){var o=r(a),i=n[o];if("function"!=typeof i||!(o in e.prototype))return!1;if(a===i)return!0;var s=t(i);return!!s&&a===s[0]}}function bU(){if(LN)return _E;LN=1;var e=hU(),t=vL()(e);return _E=t}function she(){if(VN)return wE;VN=1;var e=/\{\n\/\* \[wrapped with (.+)\] \*/,t=/,? & /;return wE=function(r){var n=r.match(e);return n?n[1].split(t):[]}}function ihe(){if(BN)return kE;BN=1;var e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;return kE=function(t,r){var n=r.length;if(!n)return t;var a=n-1;return r[a]=(n>1?"& ":"")+r[a],r=r.join(n>2?", ":" "),t.replace(e,"{\n/* [wrapped with "+r+"] */\n")}}function che(){if(FN)return xE;FN=1;var e=rR(),t=Yre(),r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];return xE=function(n,a){return e(r,(function(e){var r="_."+e[0];a&e[1]&&!t(n,r)&&n.push(r)})),n.sort()}}function _U(){if(UN)return SE;UN=1;var e=she(),t=ihe(),r=bL(),n=che();return SE=function(a,o,i){var s=o+"";return r(a,t(s,n(e(s),i)))}}function wU(){if(GN)return EE;GN=1;var e=ohe(),t=bU(),r=_U();return EE=function(n,a,o,i,s,l,c,u,f,d){var p=8&a;a|=p?32:64,4&(a&=~(p?64:32))||(a&=-4);var h=[n,a,s,p?l:void 0,p?c:void 0,p?void 0:l,p?void 0:c,u,f,d],g=o.apply(void 0,h);return e(n)&&t(g,h),g.placeholder=i,r(g,n,a)}}function kU(){if(qN)return CE;return qN=1,CE=function(e){return e.placeholder}}function lhe(){if(WN)return IE;WN=1;var e=E2(),t=YA(),r=Math.min;return IE=function(n,a){for(var o=n.length,i=r(a.length,o),s=e(n);i--;){var l=a[i];n[i]=t(l,o)?s[l]:void 0}return n}}function fT(){if(HN)return AE;HN=1;var e="__lodash_placeholder__";return AE=function(t,r){for(var n=-1,a=t.length,o=0,i=[];++n<a;){var s=t[n];(s===r||s===e)&&(t[n]=e,i[o++]=n)}return i}}function xU(){if(QN)return RE;QN=1;var e=mU(),t=gU(),r=ehe(),n=q2(),a=wU(),o=kU(),i=lhe(),s=fT(),l=os();return RE=function c(u,f,d,p,h,g,m,y,v,b){var w=128&f,_=1&f,k=2&f,x=24&f,E=512&f,A=k?void 0:n(u);return function S(){for(var C=arguments.length,z=Array(C),I=C;I--;)z[I]=arguments[I];if(x)var j=o(S),P=r(z,j);if(p&&(z=e(z,p,h,x)),g&&(z=t(z,g,m,x)),C-=P,x&&C<b){var T=s(z,j);return a(u,f,c,S.placeholder,d,z,T,y,v,b-C)}var R=_?d:this,N=k?R[u]:u;return C=z.length,y?z=i(z,y):E&&C>1&&z.reverse(),w&&v<C&&(z.length=v),this&&this!==l&&this instanceof S&&(N=A||n(N)),N.apply(R,z)}},RE}function uhe(){if(YN)return TE;YN=1;var e=tR(),t=q2(),r=xU(),n=wU(),a=kU(),o=fT(),i=os();return TE=function(s,l,c){var u=t(s);return function t(){for(var f=arguments.length,d=Array(f),p=f,h=a(t);p--;)d[p]=arguments[p];var g=f<3&&d[0]!==h&&d[f-1]!==h?[]:o(d,h);return(f-=g.length)<c?n(s,l,r,t.placeholder,void 0,d,g,void 0,void 0,c-f):e(this&&this!==i&&this instanceof t?u:s,this,d)}},TE}function fhe(){if(KN)return PE;KN=1;var e=tR(),t=q2(),r=os();return PE=function(n,a,o,i){var s=1&a,l=t(n);return function t(){for(var a=-1,c=arguments.length,u=-1,f=i.length,d=Array(f+c),p=this&&this!==r&&this instanceof t?l:n;++u<f;)d[u]=i[u];for(;c--;)d[u++]=arguments[++a];return e(p,s?o:this,d)}},PE}function dhe(){if(XN)return $E;XN=1;var e=mU(),t=gU(),r=fT(),n="__lodash_placeholder__",a=128,o=Math.min;return $E=function(i,s){var l=i[1],c=s[1],u=l|c,f=u<131,d=c==a&&8==l||c==a&&256==l&&i[7].length<=s[8]||384==c&&s[7].length<=s[8]&&8==l;if(!f&&!d)return i;1&c&&(i[2]=s[2],u|=1&l?0:4);var p=s[3];if(p){var h=i[3];i[3]=h?e(h,p,s[4]):p,i[4]=h?r(i[3],n):s[4]}return(p=s[5])&&(h=i[5],i[5]=h?t(h,p,s[6]):p,i[6]=h?r(i[5],n):s[6]),(p=s[7])&&(i[7]=p),c&a&&(i[8]=null==i[8]?s[8]:o(i[8],s[8])),null==i[9]&&(i[9]=s[9]),i[0]=s[0],i[1]=u,i}}function dT(){if(ZN)return zE;ZN=1;var e=hU(),t=Jpe(),r=uhe(),n=xU(),a=fhe(),o=yU(),i=dhe(),s=bU(),l=_U(),c=xL(),u=Math.max;return zE=function(f,d,p,h,g,m,y,v){var b=2&d;if(!b&&"function"!=typeof f)throw new TypeError("Expected a function");var w=h?h.length:0;if(w||(d&=-97,h=g=void 0),y=void 0===y?y:u(c(y),0),v=void 0===v?v:c(v),w-=g?g.length:0,64&d){var _=h,k=g;h=g=void 0}var x=b?void 0:o(f),E=[f,d,p,h,g,_,k,m,y,v];if(x&&i(E,x),f=E[0],d=E[1],p=E[2],h=E[3],g=E[4],!(v=E[9]=void 0===E[9]?b?0:f.length:u(E[9]-w,0))&&24&d&&(d&=-25),d&&1!=d)A=8==d||16==d?r(f,d,v):32!=d&&33!=d||g.length?n.apply(void 0,E):a(f,d,p,h);else var A=t(f,d,p);return l((x?e:s)(A,E),f,d)}}function phe(){if(JN)return ME;JN=1;var e=dT();return ME=function(t,r,n){return r=n?void 0:r,r=t&&null==r?t.length:r,e(t,128,void 0,void 0,void 0,void 0,r)}}function hhe(){if(e5)return OE;e5=1;var e=IL();return OE=function(t){return e(t,4)}}function mhe(){if(t5)return NE;t5=1;var e=dT();function t(r,n,a){var o=e(r,8,void 0,void 0,void 0,void 0,void 0,n=a?void 0:n);return o.placeholder=t.placeholder,o}return t.placeholder={},NE=t}function ghe(){if(n5)return DE;n5=1;var e=wf(),t=ci(),r=yae();return DE=function(n){if(!t(n))return!1;var a=e(n);return"[object Error]"==a||"[object DOMException]"==a||"string"==typeof n.message&&"string"==typeof n.name&&!r(n)}}function yhe(){if(r5)return jE;r5=1;var e=Gv(),t=ci();return jE=function(r){return t(r)&&"[object WeakMap]"==e(r)}}function vhe(){if(a5)return LE;a5=1;var e=IL(),t=Gre();return LE=function(r){return t("function"==typeof r?r:e(r,1))}}function bhe(){if(o5)return VE;o5=1;var e=dT(),t=jae(),r=t((function(t,r){return e(t,256,void 0,void 0,void 0,r)}));return VE=r}function _he(){if(s5)return BE;s5=1;var e=K7(),t=E2(),r=As(),n=Fv(),a=Y7(),o=Uv(),i=k2();return BE=function(s){return r(s)?e(s,o):n(s)?[s]:t(a(i(s)))}}function whe(){return i5||(i5=1,FE={ary:phe(),assign:EL(),clone:hhe(),curry:mhe(),forEach:rR(),isArray:As(),isError:ghe(),isFunction:y2(),isWeakMap:yhe(),iteratee:vhe(),keys:lL(),rearg:bhe(),toInteger:xL(),toPath:_he()}),FE}function SU(){if(c5)return UE;c5=1;var e=L8(),t=whe();return UE=function(r,n,a){return e(t,r,n,a)}}function khe(){if(l5)return GE;l5=1;var e=SU()("debounce",wL());return e.placeholder=wA(),GE=e}var xhe=khe();const She=tu(xhe);function EU(e,t,r=window){const n=g.useRef(t);g.useEffect((()=>{n.current=t}),[t]),g.useEffect((()=>{if(!r)return;const t=e=>n.current(e);return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}}),[e,r])}const CU=()=>en(dU.selectors.selectIsMobile);function y0({className:e,...t}){return E.jsx("div",{className:he("animate-pulse rounded-md bg-muted",e),...t})}const Ehe="sidebar_state",Che=604800,Ihe="12rem",Ahe="18rem",Rhe="2rem",The="b",IU=g.createContext(null);function W2(){const e=g.useContext(IU);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Phe=g.forwardRef((({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:o,...i},s)=>{const l=CU(),[c,u]=g.useState(!1),[f,d]=g.useState(e),p=t??f,h=g.useCallback((e=>{const t="function"==typeof e?e(p):e;r?r(t):d(t),document.cookie=`${Ehe}=${t}; path=/; max-age=604800`}),[r,p]),m=g.useCallback((()=>l?u((e=>!e)):h((e=>!e))),[l,h,u]);g.useEffect((()=>{const e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[m]);const y=p?"expanded":"collapsed",v=g.useMemo((()=>({state:y,open:p,setOpen:h,isMobile:l,openMobile:c,setOpenMobile:u,toggleSidebar:m})),[y,p,h,l,c,u,m]);return E.jsx(IU.Provider,{value:v,children:E.jsx(Ope,{delayDuration:0,children:E.jsx("div",{style:{"--sidebar-width":Ihe,"--sidebar-width-icon":Rhe,...a},className:he("group/sidebar-wrapper flex min-h-svh w-full bg-gray-100 has-[[data-variant=inset]]:bg-sidebar",n),ref:s,...i,children:o})})})}));Phe.displayName="SidebarProvider";const $he=g.forwardRef((({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...o},i)=>{const{isMobile:s,state:l,openMobile:c,setOpenMobile:u}=W2();return"none"===r?E.jsx("div",{className:he("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:i,...o,children:a}):s?E.jsx(Rpe,{open:c,onOpenChange:u,children:E.jsxs(nU,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ahe},side:e,children:[E.jsxs(rU,{className:"sr-only",children:[E.jsx(aU,{children:"Sidebar"}),E.jsx(oU,{children:"Displays the mobile sidebar."})]}),E.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):E.jsxs("div",{ref:i,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":"collapsed"===l?r:"","data-variant":t,"data-side":e,children:[E.jsx("div",{className:he("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===t||"inset"===t?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),E.jsx("div",{className:he("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===t||"inset"===t?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:E.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-sm group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})}));$he.displayName="Sidebar";const zhe=g.forwardRef((({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a,open:o}=W2();return E.jsx(Gn,{ref:n,"data-sidebar":"trigger",variant:"tertiary",size:"icon_m",className:he("size-6 text-gray-900",e),onClick:e=>{null==t||t(e),a()},...r,children:o?E.jsx(gZ,{size:16}):E.jsx(hZ,{size:16})})}));zhe.displayName="SidebarTrigger";const Mhe=g.forwardRef((({className:e,...t},r)=>{const{toggleSidebar:n}=W2();return E.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:he("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}));Mhe.displayName="SidebarRail";const Ohe=g.forwardRef((({className:e,...t},r)=>E.jsx("main",{ref:r,className:he("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-m md:peer-data-[variant=inset]:shadow",e),...t})));Ohe.displayName="SidebarInset";const Nhe=g.forwardRef((({className:e,...t},r)=>E.jsx(Y0,{ref:r,"data-sidebar":"input",className:he("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t})));Nhe.displayName="SidebarInput";const Dhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"header",className:he("flex flex-col gap-xxs p-xs",e),...t})));Dhe.displayName="SidebarHeader";const jhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"footer",className:he("flex flex-col gap-2 p-2",e),...t})));jhe.displayName="SidebarFooter";const Lhe=g.forwardRef((({className:e,...t},r)=>E.jsx(OR,{ref:r,"data-sidebar":"separator",className:he("mx-2 w-auto bg-sidebar-border",e),...t})));Lhe.displayName="SidebarSeparator";const Vhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"content",className:he("flex min-h-0 flex-1 flex-col gap-xxxs overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})));Vhe.displayName="SidebarContent";const Bhe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"group",className:he("relative flex w-full min-w-0 flex-col pt-xs",e),...t})));Bhe.displayName="SidebarGroup";const Fhe=g.forwardRef((({className:e,asChild:t=!1,...r},n)=>{const a=t?Ip:"div";return E.jsx(a,{ref:n,"data-sidebar":"group-label",className:he("flex h-s shrink-0 items-center rounded-md px-xxs py-xxs text-xs font-semibold text-gray-700 opacity-60 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-xl group-data-[collapsible=icon]:opacity-0",e),...r})}));Fhe.displayName="SidebarGroupLabel";const Uhe=g.forwardRef((({className:e,asChild:t=!1,...r},n)=>{const a=t?Ip:"button";return E.jsx(a,{ref:n,"data-sidebar":"group-action",className:he("absolute right-xs top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})}));Uhe.displayName="SidebarGroupAction";const Ghe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"group-content",className:he("w-full text-sm",e),...t})));Ghe.displayName="SidebarGroupContent";const qhe=g.forwardRef((({className:e,...t},r)=>E.jsx("ul",{ref:r,"data-sidebar":"menu",className:he("flex w-full min-w-0 flex-col p-xs font-semibold text-gray-700 [&_svg]:size-4",e),...t})));qhe.displayName="SidebarMenu";const Whe=g.forwardRef((({className:e,...t},r)=>E.jsx("li",{ref:r,"data-sidebar":"menu-item",className:he("group/menu-item relative",e),...t})));Whe.displayName="SidebarMenuItem";const Hhe=Yi("peer/menu-button flex w-full items-center gap-xxs overflow-hidden rounded-sm p-xxs text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:text-blue_100 hover:bg-white focus-visible:ring-2 active:bg-white active:text-blue_100 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-white data-[active=true]:font-medium data-[active=true]:text-blue_100 data-[state=open]:hover:bg-white data-[state=open]:hover:text-blue_100 group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:text-blue_100 hover:bg-white",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-white hover:text-blue_100 hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-s text-sm",sm:"h-m text-xs",lg:"h-l text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Qhe=g.forwardRef((({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:o,...i},s)=>{const l=e?Ip:"button",{isMobile:c,state:u}=W2(),f=E.jsx(l,{ref:s,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:he(Hhe({variant:r,size:n}),o),...i});return a?("string"==typeof a&&(a={children:a}),E.jsxs(sU,{children:[E.jsx(iU,{asChild:!0,children:f}),E.jsx(lU,{side:"right",align:"center",hidden:"collapsed"!==u||c,...a})]})):f}));Qhe.displayName="SidebarMenuButton";const Yhe=g.forwardRef((({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const o=t?Ip:"button";return E.jsx(o,{ref:a,"data-sidebar":"menu-action",className:he("absolute right-xxxs top-xxs flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-xxxs","peer-data-[size=default]/menu-button:top-xxs","peer-data-[size=lg]/menu-button:top-xs","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})}));Yhe.displayName="SidebarMenuAction";const Khe=g.forwardRef((({className:e,...t},r)=>E.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:he("pointer-events-none absolute right-xxxs flex h-m min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-xxxs","peer-data-[size=default]/menu-button:top-xxs","peer-data-[size=lg]/menu-button:top-xs","group-data-[collapsible=icon]:hidden",e),...t})));Khe.displayName="SidebarMenuBadge";const Xhe=g.forwardRef((({className:e,showIcon:t=!1,...r},n)=>{const a=g.useMemo((()=>`${Math.floor(40*Math.random())+50}%`),[]);return E.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:he("flex h-8 items-center gap-xxs rounded-md px-xxs",e),...r,children:[t&&E.jsx(y0,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),E.jsx(y0,{className:"h-xxxs max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})}));Xhe.displayName="SidebarMenuSkeleton";const Zhe=g.forwardRef((({className:e,...t},r)=>E.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:he("flex min-w-0 translate-x-px flex-col gap-xxxs border-l border-sidebar-border","group-data-[collapsible=icon]:hidden",e),...t})));Zhe.displayName="SidebarMenuSub";const Jhe=g.forwardRef((({...e},t)=>E.jsx("li",{ref:t,...e})));Jhe.displayName="SidebarMenuSubItem";const eme=g.forwardRef((({asChild:e=!1,size:t="md",isActive:r,className:n,...a},o)=>{const i=e?Ip:"a";return E.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:he("flex h-s min-w-0 -translate-x-px items-center gap-xxs overflow-hidden rounded-sm px-xxs text-sm text-gray-700 outline-none ring-sidebar-ring hover:bg-white hover:text-blue_100 focus-visible:ring-2 active:bg-white active:text-blue_100 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-blue_100","data-[active=true]:bg-white data-[active=true]:text-blue_100","sm"===t&&"text-xs","md"===t&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})}));eme.displayName="SidebarMenuSubButton";const AU="Switch",[tme,qot]=as(AU),[nme,rme]=tme(AU),ame=g.forwardRef(((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:o,required:i,disabled:s,value:l="on",onCheckedChange:c,...u}=e,[f,d]=g.useState(null),p=dn(t,(e=>d(e))),h=g.useRef(!1),m=!f||!!f.closest("form"),[y=!1,v]=Yl({prop:a,defaultProp:o,onChange:c});return g.createElement(nme,{scope:r,checked:y,disabled:s},g.createElement(wt.button,Pe({type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":RU(y),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onClick:ft(e.onClick,(e=>{v((e=>!e)),m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())}))})),m&&g.createElement(ime,{control:f,bubbles:!h.current,name:n,value:l,checked:y,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))})),ome="SwitchThumb",sme=g.forwardRef(((e,t)=>{const{__scopeSwitch:r,...n}=e,a=rme(ome,r);return g.createElement(wt.span,Pe({"data-state":RU(a.checked),"data-disabled":a.disabled?"":void 0},n,{ref:t}))})),ime=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,o=g.useRef(null),i=I2(r),s=A2(t);return g.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(i!==r&&a){const t=new Event("click",{bubbles:n});a.call(e,r),e.dispatchEvent(t)}}),[i,r,n]),g.createElement("input",Pe({type:"checkbox","aria-hidden":!0,defaultChecked:r},a,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function RU(e){return e?"checked":"unchecked"}const TU=ame,cme=sme,lme=g.forwardRef((({className:e,...t},r)=>E.jsx(TU,{className:he("group peer inline-flex h-xs w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:bg-blue_100 data-[state=unchecked]:bg-gray-200","disabled:cursor-not-allowed disabled:!bg-gray-100 md:hover:data-[state=checked]:bg-blue_120 md:hover:data-[state=unchecked]:!bg-gray-300",e),...t,ref:r,children:E.jsx(cme,{className:he("pointer-events-none block size-xxs rounded-full bg-background shadow-lg ring-0 transition-[transform,width] data-[state=checked]:translate-x-[20px] data-[state=unchecked]:translate-x-0",{"md:group-hover:w-[26px] md:group-hover:data-[state=checked]:translate-x-[14px]":!t.disabled,"bg-gray-300":t.disabled})})})));lme.displayName=TU.displayName;const PU=(e,t,{skipParams:r=!1}={})=>{const{props:n,params:a}=Object.keys(t).reduce(((r,n)=>(e.includes(`:${n}`)?r.props[n]=t[n]:r.params.set(n,t[n]),r)),{props:{},params:new URLSearchParams}),o=Object.keys(n).reduce(((e,t)=>{const r=new RegExp(`/:${t}\\?`,"g");return(e=e.replace(r,`/${n[t]}`)).replace(new RegExp(`:${t}`,"g"),n[t])}),e).replace(/\/:[^/]+?\?/g,"");return a.toString()&&!r?`${o}?${a.toString()}`:o},ume=e=>e&&da.values(e).length?"?"+new URLSearchParams(e).toString():"",u5={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!n2.getToken(),isAuthenticated:!1,isAskLoginOpen:!1},Hi=ur({name:"auth",initialState:u5,reducers:{setAskLoginOpen:(e,t)=>{e.isAskLoginOpen=t.payload},login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload||null,e.isPending=!1},logout:()=>({...u5,isPending:!1}),setNewEmail:(e,t)=>{e.newEmail=t.payload},setForgotPasswordStep:(e,t)=>{e.forgotPasswordStep=t.payload},updateForgotPasswordFields:(e,t)=>{e.forgotPasswordFields={...e.forgotPasswordFields,...t.payload}},resetForgotPasswordFields:e=>{e.forgotPasswordFields=null},setSignupStep:(e,t)=>{e.signupStep=t.payload},updateSignupFields:(e,t)=>{e.signupFields={...e.signupFields,...t.payload}},resetSignupFields:e=>{e.signupFields=null},setPending:(e,t)=>{e.isPending=t.payload}},selectors:{selectAskLoginOpen:e=>e.isAskLoginOpen,selectToken:e=>e.token,selectNewEmail:e=>e.newEmail,selectForgotPasswordStep:e=>e.forgotPasswordStep,selectForgotPasswordFields:e=>e.forgotPasswordFields,selectSignupStep:e=>e.signupStep,selectSignupFields:e=>e.signupFields,selectPending:e=>e.isPending,selectIsAuthenticated:e=>e.isAuthenticated}}),fme={data:null,isPending:!1,isSuccess:!1},Xo=ur({name:"userNoHTML",initialState:fme,reducers:{setUser:(e,t)=>{e.data=t.payload},setPending:(e,t)=>{e.isPending=t.payload},setSuccess:(e,{payload:t})=>{e.isSuccess=t},setError:(e,{payload:t})=>{e.error=t}},selectors:{selectUser:e=>e.data,selectPending:e=>e.isPending,selectError:e=>e.error,selectSuccess:e=>e.isSuccess}}),f5={data:null,isError:!1,isPending:!1,isSuccess:!1},Hl=ur({name:"user",initialState:f5,reducers:{reset:e=>{Object.assign(e,f5)}},extraReducers:e=>{e.addCase(m8,((e,{payload:t})=>{e.data=t})).addCase(g8,((e,{payload:t})=>{e.data&&Object.assign(e.data,t||{})})).addCase(TC,((e,{payload:t})=>{e.isSuccess=t})).addCase(RC,((e,{payload:t})=>{e.isPending=t})).addCase(h8,((e,{payload:t})=>{e.isError=t})).addCase(p8,((e,{payload:t})=>{e.error=t})).addCase(qY,((e,{payload:t})=>{var r;null!=(r=e.data)&&r.users&&(e.data.users=e.data.users.map((e=>t.id===e.id?t:e)))}))},selectors:{selectIsError:e=>e.isError,selectError:e=>e.error,selectPending:e=>e.isPending,selectData:e=>e.data,selectAccount:e=>{var t;return null==(t=e.data)?void 0:t.account},selectAccountId:e=>{var t;return null==(t=e.data)?void 0:t.account.id},selectUsers:e=>{var t;return null==(t=e.data)?void 0:t.users},selectUserById:(e,t)=>{var r;return null==(r=e.data)?void 0:r.users.find((({id:e})=>e===t))},selectCurrentUser:e=>{var t;return null==(t=e.data)?void 0:t.users.find((({id:t})=>{var r;return t===(null==(r=e.data)?void 0:r.selectedUserId)}))},selectSelectedUserId:e=>{var t;return null==(t=e.data)?void 0:t.selectedUserId},selectSuccess:e=>e.isSuccess}});var Oj;const dme={value:(null==(Oj=bA())?void 0:Oj.initialState)??null},pme=ur({name:"initialState",initialState:dme,reducers:{setInitialState:(e,t)=>{e.value=t.payload},clearInitialState:e=>{e.value=null}},selectors:{selectInitialState:e=>e.value}}),pT=e=>e,H2=zr(pT,(e=>e.data)),hme=zr(pT,(e=>e.error)),mme=zr(pT,(e=>e.isPending)),gme=zr(H2,(e=>null==e?void 0:e.rules)),yme=zr(H2,(e=>null==e?void 0:e.contact_account)),vme=zr(H2,(e=>(null==e?void 0:e.stats)&&Object.fromEntries(Object.entries(e.stats).map((([e,t])=>[e,t??0]))))),bme={data:null,isPending:!1},_me=ur({name:"instanceInfo",initialState:bme,reducers:{},extraReducers:e=>{e.addCase(S8,((e,{payload:t})=>{e.data=t})).addCase(zC,((e,{payload:t})=>{e.isPending=t})).addCase(E8,((e,{payload:t})=>{e.error=t}))},selectors:{selectInstanceInfo:H2,selectInstanceInfoError:hme,selectInstanceInfoPending:mme,selectPlatformRules:gme,selectInstanceContacts:yme,selectInstanceStats:vme,selectDescription:e=>{var t;return null==(t=e.data)?void 0:t.description},selectStats:e=>{var t;return null==(t=e.data)?void 0:t.stats},selectRegistrations:e=>{var t;return null==(t=e.data)?void 0:t.configuration.registrations}}}),wme={data:null,isPending:!1,isSuccess:!1},kme=ur({name:"profileSettings",initialState:wme,reducers:{setPending:(e,t)=>{e.isPending=t.payload},setSuccess:(e,{payload:t})=>{e.isSuccess=t},setError:(e,{payload:t})=>{e.error=t}},extraReducers:e=>{e.addCase(D_,((e,{payload:t})=>{e.data=t}))},selectors:{selectProfileSettings:e=>e.data,selectPending:e=>e.isPending,selectError:e=>e.error,selectSuccess:e=>e.isSuccess}}),xme={sms:"wellesley.admin.sms",openai:"wellesley.admin.openai",uploads:"wellesley.admin.uploads",captcha:"wellesley.admin.captcha",language:"wellesley.admin.language",mediacache:"wellesley.admin.mediacache",translation:"wellesley.admin.translation",link_service:"wellesley.admin.link_service"},xw={posts:"wellesley.posts",translation:"wellesley.translation",registration:"wellesley.registration",confirmationCode:"wellesley.confirmationCode",uploadsPolicyDoc:"wellesley.uploads.policy.doc",uploadsPolicyAudio:"wellesley.uploads.policy.audio",uploadsPolicyImage:"wellesley.uploads.policy.image",uploadsPolicyVideo:"wellesley.uploads.policy.video",captcha:"wellesley.captcha",access:"wellesley.access",branding:"wellesley.branding",instanceAdmin:"wellesley.instance.admin",legal:"wellesley.instance.legal",domainBlocks:"wellesley.instance.domainBlocks",contacts:"wellesley.instance.contacts"},ql=e=>(null==e?void 0:e.map((e=>e.value||e)))||[],Sme={data:null,isPending:!1},{posts:qE,uploadsPolicyDoc:d5,uploadsPolicyAudio:WE,uploadsPolicyImage:h_,uploadsPolicyVideo:ay,registration:$U,captcha:Eme,instanceAdmin:Cme,branding:Ime,translation:Ame,domainBlocks:Rme,access:Tme}=xw,{captcha:Pme,language:$me,translation:zme,openai:Mme,link_service:Ome}=xme,$m=e=>e.data,Nme=zr($m,(e=>{var t,r,n;return{max_characters:(null==(t=null==e?void 0:e[qE])?void 0:t.max_characters)||0,max_media_attachments:(null==(r=null==e?void 0:e[qE])?void 0:r.max_media_attachments)||0,max_pins:(null==(n=null==e?void 0:e[qE])?void 0:n.max_pins)||0}})),hT=zr($m,(e=>{var t,r,n;return{...null==e?void 0:e[h_],maxSize:(null==(t=null==e?void 0:e[h_])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[h_])?void 0:r.maxMatrix)||0,maxResolution:(null==(n=null==e?void 0:e[h_])?void 0:n.maxResolution)||0}})),Dme=zr(hT,(e=>ql(e.extensions))),mT=zr($m,(e=>{var t,r,n,a;return{...null==e?void 0:e[ay],maxSize:(null==(t=null==e?void 0:e[ay])?void 0:t.maxSize)||0,maxMatrix:(null==(r=null==e?void 0:e[ay])?void 0:r.maxMatrix)||0,maxDuration:(null==(n=null==e?void 0:e[ay])?void 0:n.maxDuration)||0,maxResolution:(null==(a=null==e?void 0:e[ay])?void 0:a.maxResolution)||0}})),jme=zr(mT,(e=>ql(e.extensions))),zU=zr($m,(e=>{var t,r;return{...null==e?void 0:e[WE],maxSize:null==(t=null==e?void 0:e[WE])?void 0:t.maxSize,keepOriginal:(null==(r=null==e?void 0:e[WE])?void 0:r.keepOriginal)||0}})),MU=zr($m,(e=>{var t;return{...null==e?void 0:e[d5],maxSize:(null==(t=null==e?void 0:e[d5])?void 0:t.maxSize)||0}})),OU=zr([hT,mT,zU,MU],((e,t,r,n)=>({IMAGE:ql(null==e?void 0:e.extensions),VIDEO:ql(null==t?void 0:t.extensions),AUDIO:ql(null==r?void 0:r.extensions),DOCUMENT:ql(null==n?void 0:n.extensions)}))),Lme=zr(OU,(e=>Object.keys(e).reduce(((t,r)=>[...t,...e[r]||[]]),[]))),Vme=zr($m,(e=>{var t;return null==(t=null==e?void 0:e[$U])?void 0:t.invites})),Nc=ur({name:"platformSettings",initialState:Sme,reducers:{setError:(e,t)=>{e.error=t.payload},setPending:(e,t)=>{e.isPending=t.payload}},extraReducers:e=>{e.addCase(MC,((e,{payload:t})=>{e.data={...e.data,...t}}))},selectors:{selectSettings:$m,selectPostConfig:Nme,selectDocPolicy:MU,selectImagePolicy:hT,selectVideoPolicy:mT,selectAudioPolicy:zU,selectInvitesEnabled:Vme,selectImageExtensions:Dme,selectVideoExtensions:jme,selectSupportedExtensions:OU,selectFullExtensionsList:Lme,selectRegistration:e=>{var t;return null==(t=e.data)?void 0:t[$U]},selectLanguageDetection:e=>{var t;return null==(t=e.data)?void 0:t[$me]},selectLanguageTranslation:e=>{var t;return null==(t=e.data)?void 0:t[zme]},selectOpenai:e=>{var t;return null==(t=e.data)?void 0:t[Mme]},selectCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[Eme]},selectAdminCaptcha:e=>{var t;return null==(t=e.data)?void 0:t[Pme]},selectPlatformTranslation:e=>{var t;return null==(t=e.data)?void 0:t[Ame]},selectAccess:e=>{var t;return null==(t=e.data)?void 0:t[Tme]},selectBranding:e=>{var t;return null==(t=e.data)?void 0:t[Ime]},selectLinkService:e=>{var t;return null==(t=e.data)?void 0:t[Ome]},selectInstanceAdmin:e=>{var t;return null==(t=e.data)?void 0:t[Cme]},selectLegal:e=>{var t;return null==(t=e.data)?void 0:t[xw.legal]},selectDomainBlocks:e=>{var t;return null==(t=e.data)?void 0:t[Rme]},selectContacts:e=>{var t;return null==(t=e.data)?void 0:t[xw.contacts]}}}),p5={data:{userId:"",list:[]},count:{},isPending:!1},Bme=e=>e,Fme=e=>e.error,Ume=e=>e.isPending,Gme=e=>{var t;return null==(t=e.count)?void 0:t.total},qme=e=>{var t;return null==(t=e.count)?void 0:t.unread},Wme=e=>e.data.userId,gT=zr(Bme,(e=>e.data.list)),Hme=zr(gT,(e=>null==e?void 0:e.filter((e=>"UNREAD"===e.status)))),Qme=zr(gT,(e=>null==e?void 0:e.at(-1))),A0=ur({name:"notifications",initialState:p5,reducers:{updateNotification:(e,t)=>{var r;if(!e.data.list)return;const n=t.payload;e.data.list=null==(r=e.data.list)?void 0:r.map((e=>e.id===n.id?{...e,...n}:e))},readAll:e=>{var t;e.data.list&&(e.data.list=null==(t=e.data.list)?void 0:t.map((e=>({...e,status:"READ"}))))}},extraReducers:e=>{e.addCase(PC,((e,t)=>{e.isPending=t.payload})).addCase(b8,((e,t)=>{e.error=t.payload})).addCase(_8,((e,t)=>{const r=t.payload.userId,n=t.payload.list;e.data={userId:r,list:[...e.data.list||[],...n.filter((t=>{var r;return!(null!=(r=e.data.list)&&r.some((e=>e.id===t.id)))}))]}})).addCase(y8,((e,t)=>{e.count.unread=(e.count.unread||0)+1,e.data.list&&(e.data.list=[t.payload,...e.data.list||[]])})).addCase(v8,((e,t)=>{e.data.list&&(e.data.list=e.data.list.map((e=>e.id===t.payload.id?{...e,status:t.payload.status}:e)))})).addCase(w8,((e,t)=>{e.count.total=t.payload})).addCase($C,((e,t)=>{e.count.unread=t.payload})).addCase(k8,(()=>p5)).addCase(x8,((e,t)=>{var r,n,a;const o=t.payload;"UNREAD"===(null==(n=null==(r=e.data.list)?void 0:r.find((e=>e.id===o)))?void 0:n.status)&&e.count.unread&&(e.count.unread-=1),e.data.list=(null==(a=e.data.list)?void 0:a.filter((e=>e.id!==o)))||[]})).addCase(WY,(e=>{e.data.list&&(e.data.list=e.data.list.map((e=>"FOLLOW_REQUEST"===e.type?{...e,followResponse:"Accepted"}:e)))}))},selectors:{selectError:Fme,selectIsPending:Ume,selectTotalCount:Gme,selectUnreadCount:qme,selectNotifications:gT,selectUnreadNotifications:Hme,selectLastNotification:Qme,selectNotificationsOwner:Wme}});function Yme(){return!(typeof navigator<"u"&&"boolean"==typeof navigator.onLine)||navigator.onLine}const Kme={isOnline:Yme()},Xme=ur({name:"network",initialState:Kme,reducers:{setOnline:(e,{payload:t})=>{e.isOnline=t}},selectors:{selectOnline:e=>e.isOnline}}),Rp=RQ(lr,Xme,dU,Hi,Hl,Xo,pme,_me,A0,kme,Nc);kr("app/hydrate");const yT=()=>window._wlsy_store,NU=(e,t)=>(null!=t&&t.props&&!da.isNumber(e)?PU(e,null==t?void 0:t.props):e)+ume(null==t?void 0:t.queryParams),Zme=e=>!(null==e||!e.target);function mI(e,t){const r=NU(e,t);if(Zme(t)&&"_blank"===t.target){const{origin:e}=new URL(document.referrer||window.location.origin),t=r.includes("://")?r:e+r;window.open(t,"_blank")}else yT().dispatch(u8(r))}const vT=()=>mI,Bc=({to:e,props:t,children:r,target:n,queryParams:a,className:o,disabled:i,onClick:s,...l})=>{const c=vT(),u=NU(e,{queryParams:a,props:t}),{baseUrl:f}=a2.get(),d=n?u:`${f}${u}`;return E.jsx("a",{href:d,target:n,onClick:r=>{r.preventDefault(),!i&&(null==s||s(r),c(e,{queryParams:a,props:t,target:r.ctrlKey||r.metaKey?"_blank":n}))},className:o,...l,children:r})};
88
88
  /**
89
89
  * @remix-run/router v1.15.2
90
90
  *