@owox/web 0.10.0-next-20251016124231 → 0.10.0-next-20251017095437
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-D9MUiPW0.js +730 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/index-CiJIH4WG.js +0 -730
|
@@ -1,730 +0,0 @@
|
|
|
1
|
-
var bk=Object.defineProperty;var Sk=(e,t,n)=>t in e?bk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Rs=(e,t,n)=>Sk(e,typeof t!="symbol"?t+"":t,n);function Ck(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function BT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var By={exports:{}},Cd={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var KE;function wk(){if(KE)return Cd;KE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return Cd.Fragment=t,Cd.jsx=n,Cd.jsxs=n,Cd}var ZE;function Ek(){return ZE||(ZE=1,By.exports=wk()),By.exports}var o=Ek(),Gy={exports:{}},ct={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var YE;function Rk(){if(YE)return ct;YE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function R(L,P,K){this.props=L,this.context=P,this.refs=E,this.updater=K||w}R.prototype.isReactComponent={},R.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,P,"setState")},R.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=R.prototype;function j(L,P,K){this.props=L,this.context=P,this.refs=E,this.updater=K||w}var O=j.prototype=new T;O.constructor=j,C(O,R.prototype),O.isPureReactComponent=!0;var D=Array.isArray;function N(){}var A={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function V(L,P,K){var ne=K.ref;return{$$typeof:e,type:L,key:P,ref:ne!==void 0?ne:null,props:K}}function q(L,P){return V(L.type,P,L.props)}function H(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function W(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(K){return P[K]})}var re=/\/+/g;function G(L,P){return typeof L=="object"&&L!==null&&L.key!=null?W(""+L.key):P.toString(36)}function Q(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(N,N):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function I(L,P,K,ne,fe){var ge=typeof L;(ge==="undefined"||ge==="boolean")&&(L=null);var ue=!1;if(L===null)ue=!0;else switch(ge){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(L.$$typeof){case e:case t:ue=!0;break;case g:return ue=L._init,I(ue(L._payload),P,K,ne,fe)}}if(ue)return fe=fe(L),ue=ne===""?"."+G(L,0):ne,D(fe)?(K="",ue!=null&&(K=ue.replace(re,"$&/")+"/"),I(fe,P,K,"",function(xe){return xe})):fe!=null&&(H(fe)&&(fe=q(fe,K+(fe.key==null||L&&L.key===fe.key?"":(""+fe.key).replace(re,"$&/")+"/")+ue)),P.push(fe)),1;ue=0;var Ae=ne===""?".":ne+":";if(D(L))for(var Re=0;Re<L.length;Re++)ne=L[Re],ge=Ae+G(ne,Re),ue+=I(ne,P,K,ge,fe);else if(Re=b(L),typeof Re=="function")for(L=Re.call(L),Re=0;!(ne=L.next()).done;)ne=ne.value,ge=Ae+G(ne,Re++),ue+=I(ne,P,K,ge,fe);else if(ge==="object"){if(typeof L.then=="function")return I(Q(L),P,K,ne,fe);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ue}function Y(L,P,K){if(L==null)return L;var ne=[],fe=0;return I(L,ne,"","",function(ge){return P.call(K,ge,fe++)}),ne}function B(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(K){(L._status===0||L._status===-1)&&(L._status=1,L._result=K)},function(K){(L._status===0||L._status===-1)&&(L._status=2,L._result=K)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var oe=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},be={map:Y,forEach:function(L,P,K){Y(L,function(){P.apply(this,arguments)},K)},count:function(L){var P=0;return Y(L,function(){P++}),P},toArray:function(L){return Y(L,function(P){return P})||[]},only:function(L){if(!H(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return ct.Activity=v,ct.Children=be,ct.Component=R,ct.Fragment=n,ct.Profiler=s,ct.PureComponent=j,ct.StrictMode=r,ct.Suspense=h,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,ct.__COMPILER_RUNTIME={__proto__:null,c:function(L){return A.H.useMemoCache(L)}},ct.cache=function(L){return function(){return L.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(L,P,K){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ne=C({},L.props),fe=L.key;if(P!=null)for(ge in P.key!==void 0&&(fe=""+P.key),P)!k.call(P,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&P.ref===void 0||(ne[ge]=P[ge]);var ge=arguments.length-2;if(ge===1)ne.children=K;else if(1<ge){for(var ue=Array(ge),Ae=0;Ae<ge;Ae++)ue[Ae]=arguments[Ae+2];ne.children=ue}return V(L.type,fe,ne)},ct.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},ct.createElement=function(L,P,K){var ne,fe={},ge=null;if(P!=null)for(ne in P.key!==void 0&&(ge=""+P.key),P)k.call(P,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(fe[ne]=P[ne]);var ue=arguments.length-2;if(ue===1)fe.children=K;else if(1<ue){for(var Ae=Array(ue),Re=0;Re<ue;Re++)Ae[Re]=arguments[Re+2];fe.children=Ae}if(L&&L.defaultProps)for(ne in ue=L.defaultProps,ue)fe[ne]===void 0&&(fe[ne]=ue[ne]);return V(L,ge,fe)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(L){return{$$typeof:d,render:L}},ct.isValidElement=H,ct.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:B}},ct.memo=function(L,P){return{$$typeof:m,type:L,compare:P===void 0?null:P}},ct.startTransition=function(L){var P=A.T,K={};A.T=K;try{var ne=L(),fe=A.S;fe!==null&&fe(K,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(N,oe)}catch(ge){oe(ge)}finally{P!==null&&K.types!==null&&(P.types=K.types),A.T=P}},ct.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},ct.use=function(L){return A.H.use(L)},ct.useActionState=function(L,P,K){return A.H.useActionState(L,P,K)},ct.useCallback=function(L,P){return A.H.useCallback(L,P)},ct.useContext=function(L){return A.H.useContext(L)},ct.useDebugValue=function(){},ct.useDeferredValue=function(L,P){return A.H.useDeferredValue(L,P)},ct.useEffect=function(L,P){return A.H.useEffect(L,P)},ct.useEffectEvent=function(L){return A.H.useEffectEvent(L)},ct.useId=function(){return A.H.useId()},ct.useImperativeHandle=function(L,P,K){return A.H.useImperativeHandle(L,P,K)},ct.useInsertionEffect=function(L,P){return A.H.useInsertionEffect(L,P)},ct.useLayoutEffect=function(L,P){return A.H.useLayoutEffect(L,P)},ct.useMemo=function(L,P){return A.H.useMemo(L,P)},ct.useOptimistic=function(L,P){return A.H.useOptimistic(L,P)},ct.useReducer=function(L,P,K){return A.H.useReducer(L,P,K)},ct.useRef=function(L){return A.H.useRef(L)},ct.useState=function(L){return A.H.useState(L)},ct.useSyncExternalStore=function(L,P,K){return A.H.useSyncExternalStore(L,P,K)},ct.useTransition=function(){return A.H.useTransition()},ct.version="19.2.0",ct}var WE;function J0(){return WE||(WE=1,Gy.exports=Rk()),Gy.exports}var p=J0();const _e=BT(p),GT=Ck({__proto__:null,default:_e},[p]);var qy={exports:{}},wd={},Ky={exports:{}},Zy={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var QE;function Tk(){return QE||(QE=1,(function(e){function t(I,Y){var B=I.length;I.push(Y);e:for(;0<B;){var oe=B-1>>>1,be=I[oe];if(0<s(be,Y))I[oe]=Y,I[B]=be,B=oe;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var Y=I[0],B=I.pop();if(B!==Y){I[0]=B;e:for(var oe=0,be=I.length,L=be>>>1;oe<L;){var P=2*(oe+1)-1,K=I[P],ne=P+1,fe=I[ne];if(0>s(K,B))ne<be&&0>s(fe,K)?(I[oe]=fe,I[ne]=B,oe=ne):(I[oe]=K,I[P]=B,oe=P);else if(ne<be&&0>s(fe,B))I[oe]=fe,I[ne]=B,oe=ne;else break e}}return Y}function s(I,Y){var B=I.sortIndex-Y.sortIndex;return B!==0?B:I.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],g=1,v=null,x=3,b=!1,w=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function O(I){for(var Y=n(m);Y!==null;){if(Y.callback===null)r(m);else if(Y.startTime<=I)r(m),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(m)}}function D(I){if(C=!1,O(I),!w)if(n(h)!==null)w=!0,N||(N=!0,W());else{var Y=n(m);Y!==null&&Q(D,Y.startTime-I)}}var N=!1,A=-1,k=5,V=-1;function q(){return E?!0:!(e.unstable_now()-V<k)}function H(){if(E=!1,N){var I=e.unstable_now();V=I;var Y=!0;try{e:{w=!1,C&&(C=!1,T(A),A=-1),b=!0;var B=x;try{t:{for(O(I),v=n(h);v!==null&&!(v.expirationTime>I&&q());){var oe=v.callback;if(typeof oe=="function"){v.callback=null,x=v.priorityLevel;var be=oe(v.expirationTime<=I);if(I=e.unstable_now(),typeof be=="function"){v.callback=be,O(I),Y=!0;break t}v===n(h)&&r(h),O(I)}else r(h);v=n(h)}if(v!==null)Y=!0;else{var L=n(m);L!==null&&Q(D,L.startTime-I),Y=!1}}break e}finally{v=null,x=B,b=!1}Y=void 0}}finally{Y?W():N=!1}}}var W;if(typeof j=="function")W=function(){j(H)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,G=re.port2;re.port1.onmessage=H,W=function(){G.postMessage(null)}}else W=function(){R(H,0)};function Q(I,Y){A=R(function(){I(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(I){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var B=x;x=Y;try{return I()}finally{x=B}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(I,Y){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var B=x;x=I;try{return Y()}finally{x=B}},e.unstable_scheduleCallback=function(I,Y,B){var oe=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?oe+B:oe):B=oe,I){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=B+be,I={id:g++,callback:Y,priorityLevel:I,startTime:B,expirationTime:be,sortIndex:-1},B>oe?(I.sortIndex=B,t(m,I),n(h)===null&&I===n(m)&&(C?(T(A),A=-1):C=!0,Q(D,B-oe))):(I.sortIndex=be,t(h,I),w||b||(w=!0,N||(N=!0,W()))),I},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(I){var Y=x;return function(){var B=x;x=Y;try{return I.apply(this,arguments)}finally{x=B}}}})(Zy)),Zy}var XE;function jk(){return XE||(XE=1,Ky.exports=Tk()),Ky.exports}var Yy={exports:{}},Cr={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var JE;function _k(){if(JE)return Cr;JE=1;var e=J0();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,m,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:m,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Cr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cr.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(h,m,null,g)},Cr.flushSync=function(h){var m=c.T,g=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=m,r.p=g,r.d.f()}},Cr.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},Cr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Cr.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:b}):g==="script"&&r.d.X(h,{crossOrigin:v,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Cr.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},Cr.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin);r.d.L(h,g,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Cr.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},Cr.requestFormReset=function(h){r.d.r(h)},Cr.unstable_batchedUpdates=function(h,m){return h(m)},Cr.useFormState=function(h,m,g){return c.H.useFormState(h,m,g)},Cr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Cr.version="19.2.0",Cr}var eR;function qT(){if(eR)return Yy.exports;eR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Yy.exports=_k(),Yy.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var tR;function Nk(){if(tR)return wd;tR=1;var e=jk(),t=J0(),n=qT();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function c(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function h(a){if(l(a)!==a)throw Error(r(188))}function m(a){var i=a.alternate;if(!i){if(i=l(a),i===null)throw Error(r(188));return i!==a?null:a}for(var u=a,f=i;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return h(y),a;if(S===f)return h(y),i;S=S.sibling}throw Error(r(188))}if(u.return!==f.return)u=y,f=S;else{for(var _=!1,M=y.child;M;){if(M===u){_=!0,u=y,f=S;break}if(M===f){_=!0,f=y,u=S;break}M=M.sibling}if(!_){for(M=S.child;M;){if(M===u){_=!0,u=S,f=y;break}if(M===f){_=!0,f=S,u=y;break}M=M.sibling}if(!_)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:i}function g(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=g(a),i!==null)return i;a=a.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),j=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function W(a){return a===null||typeof a!="object"?null:(a=H&&a[H]||a["@@iterator"],typeof a=="function"?a:null)}var re=Symbol.for("react.client.reference");function G(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===re?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case N:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case j:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case O:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case A:return i=a.displayName||null,i!==null?i:G(a.type)||"Memo";case k:i=a._payload,a=a._init;try{return G(a(i))}catch{}}return null}var Q=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},oe=[],be=-1;function L(a){return{current:a}}function P(a){0>be||(a.current=oe[be],oe[be]=null,be--)}function K(a,i){be++,oe[be]=a.current,a.current=i}var ne=L(null),fe=L(null),ge=L(null),ue=L(null);function Ae(a,i){switch(K(ge,i),K(fe,a),K(ne,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?gE(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=gE(i),a=vE(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}P(ne),K(ne,a)}function Re(){P(ne),P(fe),P(ge)}function xe(a){a.memoizedState!==null&&K(ue,a);var i=ne.current,u=vE(i,a.type);i!==u&&(K(fe,a),K(ne,u))}function Je(a){fe.current===a&&(P(ne),P(fe)),ue.current===a&&(P(ue),yd._currentValue=B)}var Qe,zt;function Te(a){if(Qe===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Qe=i&&i[1]||"",zt=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Qe+a+zt}var ft=!1;function lt(a,i){if(!a||ft)return"";ft=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ce){var ae=ce}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(ce){ae=ce}a.call(pe.prototype)}}else{try{throw Error()}catch(ce){ae=ce}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ce){if(ce&&ae&&typeof ce.stack=="string")return[ce.stack,ae.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=f.DetermineComponentFrameRoot(),_=S[0],M=S[1];if(_&&M){var F=_.split(`
|
|
44
|
-
`),te=M.split(`
|
|
45
|
-
`);for(y=f=0;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(f===F.length||y===te.length)for(f=F.length-1,y=te.length-1;1<=f&&0<=y&&F[f]!==te[y];)y--;for(;1<=f&&0<=y;f--,y--)if(F[f]!==te[y]){if(f!==1||y!==1)do if(f--,y--,0>y||F[f]!==te[y]){var he=`
|
|
46
|
-
`+F[f].replace(" at new "," at ");return a.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",a.displayName)),he}while(1<=f&&0<=y);break}}}finally{ft=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Te(u):""}function sn(a,i){switch(a.tag){case 26:case 27:case 5:return Te(a.type);case 16:return Te("Lazy");case 13:return a.child!==i&&i!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return lt(a.type,!1);case 11:return lt(a.type.render,!1);case 1:return lt(a.type,!0);case 31:return Te("Activity");default:return""}}function Ea(a){try{var i="",u=null;do i+=sn(a,u),u=a,a=a.return;while(a);return i}catch(f){return`
|
|
47
|
-
Error generating stack: `+f.message+`
|
|
48
|
-
`+f.stack}}var ur=Object.prototype.hasOwnProperty,z=e.unstable_scheduleCallback,J=e.unstable_cancelCallback,de=e.unstable_shouldYield,Ne=e.unstable_requestPaint,ye=e.unstable_now,Ce=e.unstable_getCurrentPriorityLevel,Le=e.unstable_ImmediatePriority,at=e.unstable_UserBlockingPriority,ht=e.unstable_NormalPriority,gn=e.unstable_LowPriority,Fr=e.unstable_IdlePriority,Rn=e.log,xr=e.unstable_setDisableYieldValue,zr=null,vn=null;function dr(a){if(typeof Rn=="function"&&xr(a),vn&&typeof vn.setStrictMode=="function")try{vn.setStrictMode(zr,a)}catch{}}var Tn=Math.clz32?Math.clz32:Zl,ko=Math.log,Ra=Math.LN2;function Zl(a){return a>>>=0,a===0?32:31-(ko(a)/Ra|0)|0}var vs=256,Io=262144,cn=4194304;function hn(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function jn(a,i,u){var f=a.pendingLanes;if(f===0)return 0;var y=0,S=a.suspendedLanes,_=a.pingedLanes;a=a.warmLanes;var M=f&134217727;return M!==0?(f=M&~S,f!==0?y=hn(f):(_&=M,_!==0?y=hn(_):u||(u=M&~a,u!==0&&(y=hn(u))))):(M=f&~S,M!==0?y=hn(M):_!==0?y=hn(_):u||(u=f&~a,u!==0&&(y=hn(u)))),y===0?0:i!==0&&i!==y&&(i&S)===0&&(S=y&-y,u=i&-i,S>=u||S===32&&(u&4194048)!==0)?i:y}function Kn(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function Zn(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nr(){var a=cn;return cn<<=1,(cn&62914560)===0&&(cn=4194304),a}function br(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function U(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Z(a,i,u,f,y,S){var _=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var M=a.entanglements,F=a.expirationTimes,te=a.hiddenUpdates;for(u=_&~u;0<u;){var he=31-Tn(u),pe=1<<he;M[he]=0,F[he]=-1;var ae=te[he];if(ae!==null)for(te[he]=null,he=0;he<ae.length;he++){var ce=ae[he];ce!==null&&(ce.lane&=-536870913)}u&=~pe}f!==0&&se(a,f,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(_&~i))}function se(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var f=31-Tn(i);a.entangledLanes|=i,a.entanglements[f]=a.entanglements[f]|1073741824|u&261930}function ve(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var f=31-Tn(u),y=1<<f;y&i|a[f]&i&&(a[f]|=i),u&=~y}}function Ee(a,i){var u=i&-i;return u=(u&42)!==0?1:Fe(u),(u&(a.suspendedLanes|i))!==0?0:u}function Fe(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Ve(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ie(){var a=Y.p;return a!==0?a:(a=window.event,a===void 0?32:zE(a.type))}function Ge(a,i){var u=Y.p;try{return Y.p=a,i()}finally{Y.p=u}}var qe=Math.random().toString(36).slice(2),Ue="__reactFiber$"+qe,Me="__reactProps$"+qe,st="__reactContainer$"+qe,Ft="__reactEvents$"+qe,kn="__reactListeners$"+qe,fr="__reactHandles$"+qe,rn="__reactResources$"+qe,Lt="__reactMarker$"+qe;function Za(a){delete a[Ue],delete a[Me],delete a[Ft],delete a[kn],delete a[fr]}function Ta(a){var i=a[Ue];if(i)return i;for(var u=a.parentNode;u;){if(i=u[st]||u[Ue]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=EE(a);a!==null;){if(u=a[Ue])return u;a=EE(a)}return i}a=u,u=a.parentNode}return null}function Mr(a){if(a=a[Ue]||a[st]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function Sr(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function ys(a){var i=a[rn];return i||(i=a[rn]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function un(a){a[Lt]=!0}var xs=new Set,qi={};function ja(a,i){gt(a,i),gt(a+"Capture",i)}function gt(a,i){for(qi[a]=i,a=0;a<i.length;a++)xs.add(i[a])}var rr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Bs={},bs={};function _n(a){return ur.call(bs,a)?!0:ur.call(Bs,a)?!1:rr.test(a)?bs[a]=!0:(Bs[a]=!0,!1)}function Gs(a,i,u){if(_n(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function Ki(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function Ya(a,i,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+f)}}function _a(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function l1(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function hM(a,i,u){var f=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,S=f.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return y.call(this)},set:function(_){u=""+_,S.call(this,_)}}),Object.defineProperty(a,i,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(_){u=""+_},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Pg(a){if(!a._valueTracker){var i=l1(a)?"checked":"value";a._valueTracker=hM(a,i,""+a[i])}}function c1(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return a&&(f=l1(a)?a.checked?"true":"false":a.value),a=f,a!==u?(i.setValue(a),!0):!1}function Qf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var mM=/[\n"\\]/g;function Na(a){return a.replace(mM,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ug(a,i,u,f,y,S,_,M){a.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.type=_:a.removeAttribute("type"),i!=null?_==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+_a(i)):a.value!==""+_a(i)&&(a.value=""+_a(i)):_!=="submit"&&_!=="reset"||a.removeAttribute("value"),i!=null?Fg(a,_,_a(i)):u!=null?Fg(a,_,_a(u)):f!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+_a(M):a.removeAttribute("name")}function u1(a,i,u,f,y,S,_,M){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),i!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||i!=null)){Pg(a);return}u=u!=null?""+_a(u):"",i=i!=null?""+_a(i):u,M||i===a.value||(a.value=i),a.defaultValue=i}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=M?a.checked:!!f,a.defaultChecked=!!f,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.name=_),Pg(a)}function Fg(a,i,u){i==="number"&&Qf(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Yl(a,i,u,f){if(a=a.options,i){i={};for(var y=0;y<u.length;y++)i["$"+u[y]]=!0;for(u=0;u<a.length;u++)y=i.hasOwnProperty("$"+a[u].value),a[u].selected!==y&&(a[u].selected=y),y&&f&&(a[u].defaultSelected=!0)}else{for(u=""+_a(u),i=null,y=0;y<a.length;y++){if(a[y].value===u){a[y].selected=!0,f&&(a[y].defaultSelected=!0);return}i!==null||a[y].disabled||(i=a[y])}i!==null&&(i.selected=!0)}}function d1(a,i,u){if(i!=null&&(i=""+_a(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+_a(u):""}function f1(a,i,u,f){if(i==null){if(f!=null){if(u!=null)throw Error(r(92));if(Q(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),i=u}u=_a(i),a.defaultValue=u,f=a.textContent,f===u&&f!==""&&f!==null&&(a.value=f),Pg(a)}function Wl(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var pM=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function h1(a,i,u){var f=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":f?a.setProperty(i,u):typeof u!="number"||u===0||pM.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function m1(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var y in i)f=i[y],i.hasOwnProperty(y)&&u[y]!==f&&h1(a,y,f)}else for(var S in i)i.hasOwnProperty(S)&&h1(a,S,i[S])}function zg(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gM=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vM=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xf(a){return vM.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function qs(){}var Vg=null;function Hg(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ql=null,Xl=null;function p1(a){var i=Mr(a);if(i&&(a=i.stateNode)){var u=a[Me]||null;e:switch(a=i.stateNode,i.type){case"input":if(Ug(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Na(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==a&&f.form===a.form){var y=f[Me]||null;if(!y)throw Error(r(90));Ug(f,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<u.length;i++)f=u[i],f.form===a.form&&c1(f)}break e;case"textarea":d1(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Yl(a,!!u.multiple,i,!1)}}}var $g=!1;function g1(a,i,u){if($g)return a(i,u);$g=!0;try{var f=a(i);return f}finally{if($g=!1,(Ql!==null||Xl!==null)&&(Fh(),Ql&&(i=Ql,a=Xl,Xl=Ql=null,p1(i),a)))for(i=0;i<a.length;i++)p1(a[i])}}function Iu(a,i){var u=a.stateNode;if(u===null)return null;var f=u[Me]||null;if(f===null)return null;u=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var Ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bg=!1;if(Ks)try{var Lu={};Object.defineProperty(Lu,"passive",{get:function(){Bg=!0}}),window.addEventListener("test",Lu,Lu),window.removeEventListener("test",Lu,Lu)}catch{Bg=!1}var Lo=null,Gg=null,Jf=null;function v1(){if(Jf)return Jf;var a,i=Gg,u=i.length,f,y="value"in Lo?Lo.value:Lo.textContent,S=y.length;for(a=0;a<u&&i[a]===y[a];a++);var _=u-a;for(f=1;f<=_&&i[u-f]===y[S-f];f++);return Jf=y.slice(a,1<f?1-f:void 0)}function eh(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function th(){return!0}function y1(){return!1}function Vr(a){function i(u,f,y,S,_){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=S,this.target=_,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(u=a[M],this[M]=u?u(S):S[M]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?th:y1,this.isPropagationStopped=y1,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=th)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=th)},persist:function(){},isPersistent:th}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nh=Vr(Zi),Pu=v({},Zi,{view:0,detail:0}),yM=Vr(Pu),qg,Kg,Uu,rh=v({},Pu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yg,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Uu&&(Uu&&a.type==="mousemove"?(qg=a.screenX-Uu.screenX,Kg=a.screenY-Uu.screenY):Kg=qg=0,Uu=a),qg)},movementY:function(a){return"movementY"in a?a.movementY:Kg}}),x1=Vr(rh),xM=v({},rh,{dataTransfer:0}),bM=Vr(xM),SM=v({},Pu,{relatedTarget:0}),Zg=Vr(SM),CM=v({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),wM=Vr(CM),EM=v({},Zi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),RM=Vr(EM),TM=v({},Zi,{data:0}),b1=Vr(TM),jM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_M={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AM(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=NM[a])?!!i[a]:!1}function Yg(){return AM}var DM=v({},Pu,{key:function(a){if(a.key){var i=jM[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=eh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?_M[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yg,charCode:function(a){return a.type==="keypress"?eh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?eh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),OM=Vr(DM),MM=v({},rh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S1=Vr(MM),kM=v({},Pu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yg}),IM=Vr(kM),LM=v({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),PM=Vr(LM),UM=v({},rh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),FM=Vr(UM),zM=v({},Zi,{newState:0,oldState:0}),VM=Vr(zM),HM=[9,13,27,32],Wg=Ks&&"CompositionEvent"in window,Fu=null;Ks&&"documentMode"in document&&(Fu=document.documentMode);var $M=Ks&&"TextEvent"in window&&!Fu,C1=Ks&&(!Wg||Fu&&8<Fu&&11>=Fu),w1=" ",E1=!1;function R1(a,i){switch(a){case"keyup":return HM.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Jl=!1;function BM(a,i){switch(a){case"compositionend":return T1(i);case"keypress":return i.which!==32?null:(E1=!0,w1);case"textInput":return a=i.data,a===w1&&E1?null:a;default:return null}}function GM(a,i){if(Jl)return a==="compositionend"||!Wg&&R1(a,i)?(a=v1(),Jf=Gg=Lo=null,Jl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return C1&&i.locale!=="ko"?null:i.data;default:return null}}var qM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function j1(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!qM[a.type]:i==="textarea"}function _1(a,i,u,f){Ql?Xl?Xl.push(f):Xl=[f]:Ql=f,i=qh(i,"onChange"),0<i.length&&(u=new nh("onChange","change",null,u,f),a.push({event:u,listeners:i}))}var zu=null,Vu=null;function KM(a){uE(a,0)}function ah(a){var i=Sr(a);if(c1(i))return a}function N1(a,i){if(a==="change")return i}var A1=!1;if(Ks){var Qg;if(Ks){var Xg="oninput"in document;if(!Xg){var D1=document.createElement("div");D1.setAttribute("oninput","return;"),Xg=typeof D1.oninput=="function"}Qg=Xg}else Qg=!1;A1=Qg&&(!document.documentMode||9<document.documentMode)}function O1(){zu&&(zu.detachEvent("onpropertychange",M1),Vu=zu=null)}function M1(a){if(a.propertyName==="value"&&ah(Vu)){var i=[];_1(i,Vu,a,Hg(a)),g1(KM,i)}}function ZM(a,i,u){a==="focusin"?(O1(),zu=i,Vu=u,zu.attachEvent("onpropertychange",M1)):a==="focusout"&&O1()}function YM(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ah(Vu)}function WM(a,i){if(a==="click")return ah(i)}function QM(a,i){if(a==="input"||a==="change")return ah(i)}function XM(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var ta=typeof Object.is=="function"?Object.is:XM;function Hu(a,i){if(ta(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!ur.call(i,y)||!ta(a[y],i[y]))return!1}return!0}function k1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function I1(a,i){var u=k1(a);a=0;for(var f;u;){if(u.nodeType===3){if(f=a+u.textContent.length,a<=i&&f>=i)return{node:u,offset:i-a};a=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=k1(u)}}function L1(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?L1(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function P1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=Qf(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=Qf(a.document)}return i}function Jg(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var JM=Ks&&"documentMode"in document&&11>=document.documentMode,ec=null,ev=null,$u=null,tv=!1;function U1(a,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;tv||ec==null||ec!==Qf(f)||(f=ec,"selectionStart"in f&&Jg(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),$u&&Hu($u,f)||($u=f,f=qh(ev,"onSelect"),0<f.length&&(i=new nh("onSelect","select",null,i,u),a.push({event:i,listeners:f}),i.target=ec)))}function Yi(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var tc={animationend:Yi("Animation","AnimationEnd"),animationiteration:Yi("Animation","AnimationIteration"),animationstart:Yi("Animation","AnimationStart"),transitionrun:Yi("Transition","TransitionRun"),transitionstart:Yi("Transition","TransitionStart"),transitioncancel:Yi("Transition","TransitionCancel"),transitionend:Yi("Transition","TransitionEnd")},nv={},F1={};Ks&&(F1=document.createElement("div").style,"AnimationEvent"in window||(delete tc.animationend.animation,delete tc.animationiteration.animation,delete tc.animationstart.animation),"TransitionEvent"in window||delete tc.transitionend.transition);function Wi(a){if(nv[a])return nv[a];if(!tc[a])return a;var i=tc[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in F1)return nv[a]=i[u];return a}var z1=Wi("animationend"),V1=Wi("animationiteration"),H1=Wi("animationstart"),e5=Wi("transitionrun"),t5=Wi("transitionstart"),n5=Wi("transitioncancel"),$1=Wi("transitionend"),B1=new Map,rv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");rv.push("scrollEnd");function Wa(a,i){B1.set(a,i),ja(i,[a])}var sh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Aa=[],nc=0,av=0;function oh(){for(var a=nc,i=av=nc=0;i<a;){var u=Aa[i];Aa[i++]=null;var f=Aa[i];Aa[i++]=null;var y=Aa[i];Aa[i++]=null;var S=Aa[i];if(Aa[i++]=null,f!==null&&y!==null){var _=f.pending;_===null?y.next=y:(y.next=_.next,_.next=y),f.pending=y}S!==0&&G1(u,y,S)}}function ih(a,i,u,f){Aa[nc++]=a,Aa[nc++]=i,Aa[nc++]=u,Aa[nc++]=f,av|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function sv(a,i,u,f){return ih(a,i,u,f),lh(a)}function Qi(a,i){return ih(a,null,null,i),lh(a)}function G1(a,i,u){a.lanes|=u;var f=a.alternate;f!==null&&(f.lanes|=u);for(var y=!1,S=a.return;S!==null;)S.childLanes|=u,f=S.alternate,f!==null&&(f.childLanes|=u),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&i!==null&&(y=31-Tn(u),a=S.hiddenUpdates,f=a[y],f===null?a[y]=[i]:f.push(i),i.lane=u|536870912),S):null}function lh(a){if(50<dd)throw dd=0,my=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var rc={};function r5(a,i,u,f){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(a,i,u,f){return new r5(a,i,u,f)}function ov(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Zs(a,i){var u=a.alternate;return u===null?(u=na(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function q1(a,i){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function ch(a,i,u,f,y,S){var _=0;if(f=a,typeof a=="function")ov(a)&&(_=1);else if(typeof a=="string")_=lk(a,u,ne.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=na(31,u,i,y),a.elementType=V,a.lanes=S,a;case C:return Xi(u.children,y,S,i);case E:_=8,y|=24;break;case R:return a=na(12,u,i,y|2),a.elementType=R,a.lanes=S,a;case D:return a=na(13,u,i,y),a.elementType=D,a.lanes=S,a;case N:return a=na(19,u,i,y),a.elementType=N,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case j:_=10;break e;case T:_=9;break e;case O:_=11;break e;case A:_=14;break e;case k:_=16,f=null;break e}_=29,u=Error(r(130,a===null?"null":typeof a,"")),f=null}return i=na(_,u,i,y),i.elementType=a,i.type=f,i.lanes=S,i}function Xi(a,i,u,f){return a=na(7,a,f,i),a.lanes=u,a}function iv(a,i,u){return a=na(6,a,null,i),a.lanes=u,a}function K1(a){var i=na(18,null,null,0);return i.stateNode=a,i}function lv(a,i,u){return i=na(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var Z1=new WeakMap;function Da(a,i){if(typeof a=="object"&&a!==null){var u=Z1.get(a);return u!==void 0?u:(i={value:a,source:i,stack:Ea(i)},Z1.set(a,i),i)}return{value:a,source:i,stack:Ea(i)}}var ac=[],sc=0,uh=null,Bu=0,Oa=[],Ma=0,Po=null,Ss=1,Cs="";function Ys(a,i){ac[sc++]=Bu,ac[sc++]=uh,uh=a,Bu=i}function Y1(a,i,u){Oa[Ma++]=Ss,Oa[Ma++]=Cs,Oa[Ma++]=Po,Po=a;var f=Ss;a=Cs;var y=32-Tn(f)-1;f&=~(1<<y),u+=1;var S=32-Tn(i)+y;if(30<S){var _=y-y%5;S=(f&(1<<_)-1).toString(32),f>>=_,y-=_,Ss=1<<32-Tn(i)+y|u<<y|f,Cs=S+a}else Ss=1<<S|u<<y|f,Cs=a}function cv(a){a.return!==null&&(Ys(a,1),Y1(a,1,0))}function uv(a){for(;a===uh;)uh=ac[--sc],ac[sc]=null,Bu=ac[--sc],ac[sc]=null;for(;a===Po;)Po=Oa[--Ma],Oa[Ma]=null,Cs=Oa[--Ma],Oa[Ma]=null,Ss=Oa[--Ma],Oa[Ma]=null}function W1(a,i){Oa[Ma++]=Ss,Oa[Ma++]=Cs,Oa[Ma++]=Po,Ss=i.id,Cs=i.overflow,Po=a}var hr=null,on=null,Rt=!1,Uo=null,ka=!1,dv=Error(r(519));function Fo(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gu(Da(i,a)),dv}function Q1(a){var i=a.stateNode,u=a.type,f=a.memoizedProps;switch(i[Ue]=a,i[Me]=f,u){case"dialog":St("cancel",i),St("close",i);break;case"iframe":case"object":case"embed":St("load",i);break;case"video":case"audio":for(u=0;u<hd.length;u++)St(hd[u],i);break;case"source":St("error",i);break;case"img":case"image":case"link":St("error",i),St("load",i);break;case"details":St("toggle",i);break;case"input":St("invalid",i),u1(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":St("invalid",i);break;case"textarea":St("invalid",i),f1(i,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||f.suppressHydrationWarning===!0||mE(i.textContent,u)?(f.popover!=null&&(St("beforetoggle",i),St("toggle",i)),f.onScroll!=null&&St("scroll",i),f.onScrollEnd!=null&&St("scrollend",i),f.onClick!=null&&(i.onclick=qs),i=!0):i=!1,i||Fo(a,!0)}function X1(a){for(hr=a.return;hr;)switch(hr.tag){case 5:case 31:case 13:ka=!1;return;case 27:case 3:ka=!0;return;default:hr=hr.return}}function oc(a){if(a!==hr)return!1;if(!Rt)return X1(a),Rt=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Ny(a.type,a.memoizedProps)),u=!u),u&&on&&Fo(a),X1(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));on=wE(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));on=wE(a)}else i===27?(i=on,Jo(a.type)?(a=ky,ky=null,on=a):on=i):on=hr?La(a.stateNode.nextSibling):null;return!0}function Ji(){on=hr=null,Rt=!1}function fv(){var a=Uo;return a!==null&&(Gr===null?Gr=a:Gr.push.apply(Gr,a),Uo=null),a}function Gu(a){Uo===null?Uo=[a]:Uo.push(a)}var hv=L(null),el=null,Ws=null;function zo(a,i,u){K(hv,i._currentValue),i._currentValue=u}function Qs(a){a._currentValue=hv.current,P(hv)}function mv(a,i,u){for(;a!==null;){var f=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),a===u)break;a=a.return}}function pv(a,i,u,f){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var _=y.child;S=S.firstContext;e:for(;S!==null;){var M=S;S=y;for(var F=0;F<i.length;F++)if(M.context===i[F]){S.lanes|=u,M=S.alternate,M!==null&&(M.lanes|=u),mv(S.return,u,a),f||(_=null);break e}S=M.next}}else if(y.tag===18){if(_=y.return,_===null)throw Error(r(341));_.lanes|=u,S=_.alternate,S!==null&&(S.lanes|=u),mv(_,u,a),_=null}else _=y.child;if(_!==null)_.return=y;else for(_=y;_!==null;){if(_===a){_=null;break}if(y=_.sibling,y!==null){y.return=_.return,_=y;break}_=_.return}y=_}}function ic(a,i,u,f){a=null;for(var y=i,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var _=y.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var M=y.type;ta(y.pendingProps.value,_.value)||(a!==null?a.push(M):a=[M])}}else if(y===ue.current){if(_=y.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(yd):a=[yd])}y=y.return}a!==null&&pv(i,a,u,f),i.flags|=262144}function dh(a){for(a=a.firstContext;a!==null;){if(!ta(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function tl(a){el=a,Ws=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function mr(a){return J1(el,a)}function fh(a,i){return el===null&&tl(a),J1(a,i)}function J1(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Ws===null){if(a===null)throw Error(r(308));Ws=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else Ws=Ws.next=i;return u}var a5=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,f){a.push(f)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},s5=e.unstable_scheduleCallback,o5=e.unstable_NormalPriority,In={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gv(){return{controller:new a5,data:new Map,refCount:0}}function qu(a){a.refCount--,a.refCount===0&&s5(o5,function(){a.controller.abort()})}var Ku=null,vv=0,lc=0,cc=null;function i5(a,i){if(Ku===null){var u=Ku=[];vv=0,lc=by(),cc={status:"pending",value:void 0,then:function(f){u.push(f)}}}return vv++,i.then(eC,eC),i}function eC(){if(--vv===0&&Ku!==null){cc!==null&&(cc.status="fulfilled");var a=Ku;Ku=null,lc=0,cc=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function l5(a,i){var u=[],f={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return a.then(function(){f.status="fulfilled",f.value=i;for(var y=0;y<u.length;y++)(0,u[y])(i)},function(y){for(f.status="rejected",f.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),f}var tC=I.S;I.S=function(a,i){Uw=ye(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i5(a,i),tC!==null&&tC(a,i)};var nl=L(null);function yv(){var a=nl.current;return a!==null?a:Xt.pooledCache}function hh(a,i){i===null?K(nl,nl.current):K(nl,i.pool)}function nC(){var a=yv();return a===null?null:{parent:In._currentValue,pool:a}}var uc=Error(r(460)),xv=Error(r(474)),mh=Error(r(542)),ph={then:function(){}};function rC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function aC(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(qs,qs),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,oC(a),a;default:if(typeof i.status=="string")i.then(qs,qs);else{if(a=Xt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(f){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=f}},function(f){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,oC(a),a}throw al=i,uc}}function rl(a){try{var i=a._init;return i(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(al=u,uc):u}}var al=null;function sC(){if(al===null)throw Error(r(459));var a=al;return al=null,a}function oC(a){if(a===uc||a===mh)throw Error(r(483))}var dc=null,Zu=0;function gh(a){var i=Zu;return Zu+=1,dc===null&&(dc=[]),aC(dc,a,i)}function Yu(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function vh(a,i){throw i.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function iC(a){function i(X,$){if(a){var ee=X.deletions;ee===null?(X.deletions=[$],X.flags|=16):ee.push($)}}function u(X,$){if(!a)return null;for(;$!==null;)i(X,$),$=$.sibling;return null}function f(X){for(var $=new Map;X!==null;)X.key!==null?$.set(X.key,X):$.set(X.index,X),X=X.sibling;return $}function y(X,$){return X=Zs(X,$),X.index=0,X.sibling=null,X}function S(X,$,ee){return X.index=ee,a?(ee=X.alternate,ee!==null?(ee=ee.index,ee<$?(X.flags|=67108866,$):ee):(X.flags|=67108866,$)):(X.flags|=1048576,$)}function _(X){return a&&X.alternate===null&&(X.flags|=67108866),X}function M(X,$,ee,me){return $===null||$.tag!==6?($=iv(ee,X.mode,me),$.return=X,$):($=y($,ee),$.return=X,$)}function F(X,$,ee,me){var Xe=ee.type;return Xe===C?he(X,$,ee.props.children,me,ee.key):$!==null&&($.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===k&&rl(Xe)===$.type)?($=y($,ee.props),Yu($,ee),$.return=X,$):($=ch(ee.type,ee.key,ee.props,null,X.mode,me),Yu($,ee),$.return=X,$)}function te(X,$,ee,me){return $===null||$.tag!==4||$.stateNode.containerInfo!==ee.containerInfo||$.stateNode.implementation!==ee.implementation?($=lv(ee,X.mode,me),$.return=X,$):($=y($,ee.children||[]),$.return=X,$)}function he(X,$,ee,me,Xe){return $===null||$.tag!==7?($=Xi(ee,X.mode,me,Xe),$.return=X,$):($=y($,ee),$.return=X,$)}function pe(X,$,ee){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=iv(""+$,X.mode,ee),$.return=X,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return ee=ch($.type,$.key,$.props,null,X.mode,ee),Yu(ee,$),ee.return=X,ee;case w:return $=lv($,X.mode,ee),$.return=X,$;case k:return $=rl($),pe(X,$,ee)}if(Q($)||W($))return $=Xi($,X.mode,ee,null),$.return=X,$;if(typeof $.then=="function")return pe(X,gh($),ee);if($.$$typeof===j)return pe(X,fh(X,$),ee);vh(X,$)}return null}function ae(X,$,ee,me){var Xe=$!==null?$.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Xe!==null?null:M(X,$,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Xe?F(X,$,ee,me):null;case w:return ee.key===Xe?te(X,$,ee,me):null;case k:return ee=rl(ee),ae(X,$,ee,me)}if(Q(ee)||W(ee))return Xe!==null?null:he(X,$,ee,me,null);if(typeof ee.then=="function")return ae(X,$,gh(ee),me);if(ee.$$typeof===j)return ae(X,$,fh(X,ee),me);vh(X,ee)}return null}function ce(X,$,ee,me,Xe){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return X=X.get(ee)||null,M($,X,""+me,Xe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return X=X.get(me.key===null?ee:me.key)||null,F($,X,me,Xe);case w:return X=X.get(me.key===null?ee:me.key)||null,te($,X,me,Xe);case k:return me=rl(me),ce(X,$,ee,me,Xe)}if(Q(me)||W(me))return X=X.get(ee)||null,he($,X,me,Xe,null);if(typeof me.then=="function")return ce(X,$,ee,gh(me),Xe);if(me.$$typeof===j)return ce(X,$,ee,fh($,me),Xe);vh($,me)}return null}function He(X,$,ee,me){for(var Xe=null,Mt=null,Ke=$,mt=$=0,wt=null;Ke!==null&&mt<ee.length;mt++){Ke.index>mt?(wt=Ke,Ke=null):wt=Ke.sibling;var kt=ae(X,Ke,ee[mt],me);if(kt===null){Ke===null&&(Ke=wt);break}a&&Ke&&kt.alternate===null&&i(X,Ke),$=S(kt,$,mt),Mt===null?Xe=kt:Mt.sibling=kt,Mt=kt,Ke=wt}if(mt===ee.length)return u(X,Ke),Rt&&Ys(X,mt),Xe;if(Ke===null){for(;mt<ee.length;mt++)Ke=pe(X,ee[mt],me),Ke!==null&&($=S(Ke,$,mt),Mt===null?Xe=Ke:Mt.sibling=Ke,Mt=Ke);return Rt&&Ys(X,mt),Xe}for(Ke=f(Ke);mt<ee.length;mt++)wt=ce(Ke,X,mt,ee[mt],me),wt!==null&&(a&&wt.alternate!==null&&Ke.delete(wt.key===null?mt:wt.key),$=S(wt,$,mt),Mt===null?Xe=wt:Mt.sibling=wt,Mt=wt);return a&&Ke.forEach(function(ai){return i(X,ai)}),Rt&&Ys(X,mt),Xe}function et(X,$,ee,me){if(ee==null)throw Error(r(151));for(var Xe=null,Mt=null,Ke=$,mt=$=0,wt=null,kt=ee.next();Ke!==null&&!kt.done;mt++,kt=ee.next()){Ke.index>mt?(wt=Ke,Ke=null):wt=Ke.sibling;var ai=ae(X,Ke,kt.value,me);if(ai===null){Ke===null&&(Ke=wt);break}a&&Ke&&ai.alternate===null&&i(X,Ke),$=S(ai,$,mt),Mt===null?Xe=ai:Mt.sibling=ai,Mt=ai,Ke=wt}if(kt.done)return u(X,Ke),Rt&&Ys(X,mt),Xe;if(Ke===null){for(;!kt.done;mt++,kt=ee.next())kt=pe(X,kt.value,me),kt!==null&&($=S(kt,$,mt),Mt===null?Xe=kt:Mt.sibling=kt,Mt=kt);return Rt&&Ys(X,mt),Xe}for(Ke=f(Ke);!kt.done;mt++,kt=ee.next())kt=ce(Ke,X,mt,kt.value,me),kt!==null&&(a&&kt.alternate!==null&&Ke.delete(kt.key===null?mt:kt.key),$=S(kt,$,mt),Mt===null?Xe=kt:Mt.sibling=kt,Mt=kt);return a&&Ke.forEach(function(xk){return i(X,xk)}),Rt&&Ys(X,mt),Xe}function Kt(X,$,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===C&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Xe=ee.key;$!==null;){if($.key===Xe){if(Xe=ee.type,Xe===C){if($.tag===7){u(X,$.sibling),me=y($,ee.props.children),me.return=X,X=me;break e}}else if($.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===k&&rl(Xe)===$.type){u(X,$.sibling),me=y($,ee.props),Yu(me,ee),me.return=X,X=me;break e}u(X,$);break}else i(X,$);$=$.sibling}ee.type===C?(me=Xi(ee.props.children,X.mode,me,ee.key),me.return=X,X=me):(me=ch(ee.type,ee.key,ee.props,null,X.mode,me),Yu(me,ee),me.return=X,X=me)}return _(X);case w:e:{for(Xe=ee.key;$!==null;){if($.key===Xe)if($.tag===4&&$.stateNode.containerInfo===ee.containerInfo&&$.stateNode.implementation===ee.implementation){u(X,$.sibling),me=y($,ee.children||[]),me.return=X,X=me;break e}else{u(X,$);break}else i(X,$);$=$.sibling}me=lv(ee,X.mode,me),me.return=X,X=me}return _(X);case k:return ee=rl(ee),Kt(X,$,ee,me)}if(Q(ee))return He(X,$,ee,me);if(W(ee)){if(Xe=W(ee),typeof Xe!="function")throw Error(r(150));return ee=Xe.call(ee),et(X,$,ee,me)}if(typeof ee.then=="function")return Kt(X,$,gh(ee),me);if(ee.$$typeof===j)return Kt(X,$,fh(X,ee),me);vh(X,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,$!==null&&$.tag===6?(u(X,$.sibling),me=y($,ee),me.return=X,X=me):(u(X,$),me=iv(ee,X.mode,me),me.return=X,X=me),_(X)):u(X,$)}return function(X,$,ee,me){try{Zu=0;var Xe=Kt(X,$,ee,me);return dc=null,Xe}catch(Ke){if(Ke===uc||Ke===mh)throw Ke;var Mt=na(29,Ke,null,X.mode);return Mt.lanes=me,Mt.return=X,Mt}finally{}}}var sl=iC(!0),lC=iC(!1),Vo=!1;function bv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sv(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ho(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function $o(a,i,u){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,(Pt&2)!==0){var y=f.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),f.pending=i,i=lh(a),G1(a,null,u),i}return ih(a,f,i,u),lh(a)}function Wu(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,ve(a,u)}}function Cv(a,i){var u=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var _={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=_:S=S.next=_,u=u.next}while(u!==null);S===null?y=S=i:S=S.next=i}else y=S=i;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:f.shared,callbacks:f.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var wv=!1;function Qu(){if(wv){var a=cc;if(a!==null)throw a}}function Xu(a,i,u,f){wv=!1;var y=a.updateQueue;Vo=!1;var S=y.firstBaseUpdate,_=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var F=M,te=F.next;F.next=null,_===null?S=te:_.next=te,_=F;var he=a.alternate;he!==null&&(he=he.updateQueue,M=he.lastBaseUpdate,M!==_&&(M===null?he.firstBaseUpdate=te:M.next=te,he.lastBaseUpdate=F))}if(S!==null){var pe=y.baseState;_=0,he=te=F=null,M=S;do{var ae=M.lane&-536870913,ce=ae!==M.lane;if(ce?(Ct&ae)===ae:(f&ae)===ae){ae!==0&&ae===lc&&(wv=!0),he!==null&&(he=he.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var He=a,et=M;ae=i;var Kt=u;switch(et.tag){case 1:if(He=et.payload,typeof He=="function"){pe=He.call(Kt,pe,ae);break e}pe=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=et.payload,ae=typeof He=="function"?He.call(Kt,pe,ae):He,ae==null)break e;pe=v({},pe,ae);break e;case 2:Vo=!0}}ae=M.callback,ae!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[ae]:ce.push(ae))}else ce={lane:ae,tag:M.tag,payload:M.payload,callback:M.callback,next:null},he===null?(te=he=ce,F=pe):he=he.next=ce,_|=ae;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;ce=M,M=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);he===null&&(F=pe),y.baseState=F,y.firstBaseUpdate=te,y.lastBaseUpdate=he,S===null&&(y.shared.lanes=0),Zo|=_,a.lanes=_,a.memoizedState=pe}}function cC(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function uC(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)cC(u[a],i)}var fc=L(null),yh=L(0);function dC(a,i){a=oo,K(yh,a),K(fc,i),oo=a|i.baseLanes}function Ev(){K(yh,oo),K(fc,fc.current)}function Rv(){oo=yh.current,P(fc),P(yh)}var ra=L(null),Ia=null;function Bo(a){var i=a.alternate;K(Nn,Nn.current&1),K(ra,a),Ia===null&&(i===null||fc.current!==null||i.memoizedState!==null)&&(Ia=a)}function Tv(a){K(Nn,Nn.current),K(ra,a),Ia===null&&(Ia=a)}function fC(a){a.tag===22?(K(Nn,Nn.current),K(ra,a),Ia===null&&(Ia=a)):Go()}function Go(){K(Nn,Nn.current),K(ra,ra.current)}function aa(a){P(ra),Ia===a&&(Ia=null),P(Nn)}var Nn=L(0);function xh(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Oy(u)||My(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Xs=0,ut=null,Gt=null,Ln=null,bh=!1,hc=!1,ol=!1,Sh=0,Ju=0,mc=null,c5=0;function yn(){throw Error(r(321))}function jv(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!ta(a[u],i[u]))return!1;return!0}function _v(a,i,u,f,y,S){return Xs=S,ut=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=a===null||a.memoizedState===null?YC:$v,ol=!1,S=u(f,y),ol=!1,hc&&(S=mC(i,u,f,y)),hC(a),S}function hC(a){I.H=nd;var i=Gt!==null&&Gt.next!==null;if(Xs=0,Ln=Gt=ut=null,bh=!1,Ju=0,mc=null,i)throw Error(r(300));a===null||Pn||(a=a.dependencies,a!==null&&dh(a)&&(Pn=!0))}function mC(a,i,u,f){ut=a;var y=0;do{if(hc&&(mc=null),Ju=0,hc=!1,25<=y)throw Error(r(301));if(y+=1,Ln=Gt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}I.H=WC,S=i(u,f)}while(hc);return S}function u5(){var a=I.H,i=a.useState()[0];return i=typeof i.then=="function"?ed(i):i,a=a.useState()[0],(Gt!==null?Gt.memoizedState:null)!==a&&(ut.flags|=1024),i}function Nv(){var a=Sh!==0;return Sh=0,a}function Av(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Dv(a){if(bh){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}bh=!1}Xs=0,Ln=Gt=ut=null,hc=!1,Ju=Sh=0,mc=null}function kr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?ut.memoizedState=Ln=a:Ln=Ln.next=a,Ln}function An(){if(Gt===null){var a=ut.alternate;a=a!==null?a.memoizedState:null}else a=Gt.next;var i=Ln===null?ut.memoizedState:Ln.next;if(i!==null)Ln=i,Gt=a;else{if(a===null)throw ut.alternate===null?Error(r(467)):Error(r(310));Gt=a,a={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Ln===null?ut.memoizedState=Ln=a:Ln=Ln.next=a}return Ln}function Ch(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ed(a){var i=Ju;return Ju+=1,mc===null&&(mc=[]),a=aC(mc,a,i),i=ut,(Ln===null?i.memoizedState:Ln.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?YC:$v),a}function wh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return ed(a);if(a.$$typeof===j)return mr(a)}throw Error(r(438,String(a)))}function Ov(a){var i=null,u=ut.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var f=ut.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Ch(),ut.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),f=0;f<a;f++)u[f]=q;return i.index++,u}function Js(a,i){return typeof i=="function"?i(a):i}function Eh(a){var i=An();return Mv(i,Gt,a)}function Mv(a,i,u){var f=a.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var y=a.baseQueue,S=f.pending;if(S!==null){if(y!==null){var _=y.next;y.next=S.next,S.next=_}i.baseQueue=y=S,f.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{i=y.next;var M=_=null,F=null,te=i,he=!1;do{var pe=te.lane&-536870913;if(pe!==te.lane?(Ct&pe)===pe:(Xs&pe)===pe){var ae=te.revertLane;if(ae===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),pe===lc&&(he=!0);else if((Xs&ae)===ae){te=te.next,ae===lc&&(he=!0);continue}else pe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},F===null?(M=F=pe,_=S):F=F.next=pe,ut.lanes|=ae,Zo|=ae;pe=te.action,ol&&u(S,pe),S=te.hasEagerState?te.eagerState:u(S,pe)}else ae={lane:pe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},F===null?(M=F=ae,_=S):F=F.next=ae,ut.lanes|=pe,Zo|=pe;te=te.next}while(te!==null&&te!==i);if(F===null?_=S:F.next=M,!ta(S,a.memoizedState)&&(Pn=!0,he&&(u=cc,u!==null)))throw u;a.memoizedState=S,a.baseState=_,a.baseQueue=F,f.lastRenderedState=S}return y===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function kv(a){var i=An(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var f=u.dispatch,y=u.pending,S=i.memoizedState;if(y!==null){u.pending=null;var _=y=y.next;do S=a(S,_.action),_=_.next;while(_!==y);ta(S,i.memoizedState)||(Pn=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),u.lastRenderedState=S}return[S,f]}function pC(a,i,u){var f=ut,y=An(),S=Rt;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=i();var _=!ta((Gt||y).memoizedState,u);if(_&&(y.memoizedState=u,Pn=!0),y=y.queue,Pv(yC.bind(null,f,y,a),[a]),y.getSnapshot!==i||_||Ln!==null&&Ln.memoizedState.tag&1){if(f.flags|=2048,pc(9,{destroy:void 0},vC.bind(null,f,y,u,i),null),Xt===null)throw Error(r(349));S||(Xs&127)!==0||gC(f,i,u)}return u}function gC(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=ut.updateQueue,i===null?(i=Ch(),ut.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function vC(a,i,u,f){i.value=u,i.getSnapshot=f,xC(i)&&bC(a)}function yC(a,i,u){return u(function(){xC(i)&&bC(a)})}function xC(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!ta(a,u)}catch{return!0}}function bC(a){var i=Qi(a,2);i!==null&&qr(i,a,2)}function Iv(a){var i=kr();if(typeof a=="function"){var u=a;if(a=u(),ol){dr(!0);try{u()}finally{dr(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Js,lastRenderedState:a},i}function SC(a,i,u,f){return a.baseState=u,Mv(a,Gt,typeof f=="function"?f:Js)}function d5(a,i,u,f,y){if(jh(a))throw Error(r(485));if(a=i.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){S.listeners.push(_)}};I.T!==null?u(!0):S.isTransition=!1,f(S),u=i.pending,u===null?(S.next=i.pending=S,CC(i,S)):(S.next=u.next,i.pending=u.next=S)}}function CC(a,i){var u=i.action,f=i.payload,y=a.state;if(i.isTransition){var S=I.T,_={};I.T=_;try{var M=u(y,f),F=I.S;F!==null&&F(_,M),wC(a,i,M)}catch(te){Lv(a,i,te)}finally{S!==null&&_.types!==null&&(S.types=_.types),I.T=S}}else try{S=u(y,f),wC(a,i,S)}catch(te){Lv(a,i,te)}}function wC(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){EC(a,i,f)},function(f){return Lv(a,i,f)}):EC(a,i,u)}function EC(a,i,u){i.status="fulfilled",i.value=u,RC(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,CC(a,u)))}function Lv(a,i,u){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=u,RC(i),i=i.next;while(i!==f)}a.action=null}function RC(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function TC(a,i){return i}function jC(a,i){if(Rt){var u=Xt.formState;if(u!==null){e:{var f=ut;if(Rt){if(on){t:{for(var y=on,S=ka;y.nodeType!==8;){if(!S){y=null;break t}if(y=La(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){on=La(y.nextSibling),f=y.data==="F!";break e}}Fo(f)}f=!1}f&&(i=u[0])}}return u=kr(),u.memoizedState=u.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:TC,lastRenderedState:i},u.queue=f,u=qC.bind(null,ut,f),f.dispatch=u,f=Iv(!1),S=Hv.bind(null,ut,!1,f.queue),f=kr(),y={state:i,dispatch:null,action:a,pending:null},f.queue=y,u=d5.bind(null,ut,y,S,u),y.dispatch=u,f.memoizedState=a,[i,u,!1]}function _C(a){var i=An();return NC(i,Gt,a)}function NC(a,i,u){if(i=Mv(a,i,TC)[0],a=Eh(Js)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=ed(i)}catch(_){throw _===uc?mh:_}else f=i;i=An();var y=i.queue,S=y.dispatch;return u!==i.memoizedState&&(ut.flags|=2048,pc(9,{destroy:void 0},f5.bind(null,y,u),null)),[f,S,a]}function f5(a,i){a.action=i}function AC(a){var i=An(),u=Gt;if(u!==null)return NC(i,u,a);An(),i=i.memoizedState,u=An();var f=u.queue.dispatch;return u.memoizedState=a,[i,f,!1]}function pc(a,i,u,f){return a={tag:a,create:u,deps:f,inst:i,next:null},i=ut.updateQueue,i===null&&(i=Ch(),ut.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(f=u.next,u.next=a,a.next=f,i.lastEffect=a),a}function DC(){return An().memoizedState}function Rh(a,i,u,f){var y=kr();ut.flags|=a,y.memoizedState=pc(1|i,{destroy:void 0},u,f===void 0?null:f)}function Th(a,i,u,f){var y=An();f=f===void 0?null:f;var S=y.memoizedState.inst;Gt!==null&&f!==null&&jv(f,Gt.memoizedState.deps)?y.memoizedState=pc(i,S,u,f):(ut.flags|=a,y.memoizedState=pc(1|i,S,u,f))}function OC(a,i){Rh(8390656,8,a,i)}function Pv(a,i){Th(2048,8,a,i)}function h5(a){ut.flags|=4;var i=ut.updateQueue;if(i===null)i=Ch(),ut.updateQueue=i,i.events=[a];else{var u=i.events;u===null?i.events=[a]:u.push(a)}}function MC(a){var i=An().memoizedState;return h5({ref:i,nextImpl:a}),function(){if((Pt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function kC(a,i){return Th(4,2,a,i)}function IC(a,i){return Th(4,4,a,i)}function LC(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function PC(a,i,u){u=u!=null?u.concat([a]):null,Th(4,4,LC.bind(null,i,a),u)}function Uv(){}function UC(a,i){var u=An();i=i===void 0?null:i;var f=u.memoizedState;return i!==null&&jv(i,f[1])?f[0]:(u.memoizedState=[a,i],a)}function FC(a,i){var u=An();i=i===void 0?null:i;var f=u.memoizedState;if(i!==null&&jv(i,f[1]))return f[0];if(f=a(),ol){dr(!0);try{a()}finally{dr(!1)}}return u.memoizedState=[f,i],f}function Fv(a,i,u){return u===void 0||(Xs&1073741824)!==0&&(Ct&261930)===0?a.memoizedState=i:(a.memoizedState=u,a=zw(),ut.lanes|=a,Zo|=a,u)}function zC(a,i,u,f){return ta(u,i)?u:fc.current!==null?(a=Fv(a,u,f),ta(a,i)||(Pn=!0),a):(Xs&42)===0||(Xs&1073741824)!==0&&(Ct&261930)===0?(Pn=!0,a.memoizedState=u):(a=zw(),ut.lanes|=a,Zo|=a,i)}function VC(a,i,u,f,y){var S=Y.p;Y.p=S!==0&&8>S?S:8;var _=I.T,M={};I.T=M,Hv(a,!1,i,u);try{var F=y(),te=I.S;if(te!==null&&te(M,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var he=l5(F,f);td(a,i,he,ia(a))}else td(a,i,f,ia(a))}catch(pe){td(a,i,{then:function(){},status:"rejected",reason:pe},ia())}finally{Y.p=S,_!==null&&M.types!==null&&(_.types=M.types),I.T=_}}function m5(){}function zv(a,i,u,f){if(a.tag!==5)throw Error(r(476));var y=HC(a).queue;VC(a,y,i,B,u===null?m5:function(){return $C(a),u(f)})}function HC(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Js,lastRenderedState:B},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Js,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function $C(a){var i=HC(a);i.next===null&&(i=a.alternate.memoizedState),td(a,i.next.queue,{},ia())}function Vv(){return mr(yd)}function BC(){return An().memoizedState}function GC(){return An().memoizedState}function p5(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=ia();a=Ho(u);var f=$o(i,a,u);f!==null&&(qr(f,i,u),Wu(f,i,u)),i={cache:gv()},a.payload=i;return}i=i.return}}function g5(a,i,u){var f=ia();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},jh(a)?KC(i,u):(u=sv(a,i,u,f),u!==null&&(qr(u,a,f),ZC(u,i,f)))}function qC(a,i,u){var f=ia();td(a,i,u,f)}function td(a,i,u,f){var y={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(jh(a))KC(i,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var _=i.lastRenderedState,M=S(_,u);if(y.hasEagerState=!0,y.eagerState=M,ta(M,_))return ih(a,i,y,0),Xt===null&&oh(),!1}catch{}finally{}if(u=sv(a,i,y,f),u!==null)return qr(u,a,f),ZC(u,i,f),!0}return!1}function Hv(a,i,u,f){if(f={lane:2,revertLane:by(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},jh(a)){if(i)throw Error(r(479))}else i=sv(a,u,f,2),i!==null&&qr(i,a,2)}function jh(a){var i=a.alternate;return a===ut||i!==null&&i===ut}function KC(a,i){hc=bh=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function ZC(a,i,u){if((u&4194048)!==0){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,ve(a,u)}}var nd={readContext:mr,use:wh,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useLayoutEffect:yn,useInsertionEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useSyncExternalStore:yn,useId:yn,useHostTransitionStatus:yn,useFormState:yn,useActionState:yn,useOptimistic:yn,useMemoCache:yn,useCacheRefresh:yn};nd.useEffectEvent=yn;var YC={readContext:mr,use:wh,useCallback:function(a,i){return kr().memoizedState=[a,i===void 0?null:i],a},useContext:mr,useEffect:OC,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,Rh(4194308,4,LC.bind(null,i,a),u)},useLayoutEffect:function(a,i){return Rh(4194308,4,a,i)},useInsertionEffect:function(a,i){Rh(4,2,a,i)},useMemo:function(a,i){var u=kr();i=i===void 0?null:i;var f=a();if(ol){dr(!0);try{a()}finally{dr(!1)}}return u.memoizedState=[f,i],f},useReducer:function(a,i,u){var f=kr();if(u!==void 0){var y=u(i);if(ol){dr(!0);try{u(i)}finally{dr(!1)}}}else y=i;return f.memoizedState=f.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},f.queue=a,a=a.dispatch=g5.bind(null,ut,a),[f.memoizedState,a]},useRef:function(a){var i=kr();return a={current:a},i.memoizedState=a},useState:function(a){a=Iv(a);var i=a.queue,u=qC.bind(null,ut,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Uv,useDeferredValue:function(a,i){var u=kr();return Fv(u,a,i)},useTransition:function(){var a=Iv(!1);return a=VC.bind(null,ut,a.queue,!0,!1),kr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var f=ut,y=kr();if(Rt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),Xt===null)throw Error(r(349));(Ct&127)!==0||gC(f,i,u)}y.memoizedState=u;var S={value:u,getSnapshot:i};return y.queue=S,OC(yC.bind(null,f,S,a),[a]),f.flags|=2048,pc(9,{destroy:void 0},vC.bind(null,f,S,u,i),null),u},useId:function(){var a=kr(),i=Xt.identifierPrefix;if(Rt){var u=Cs,f=Ss;u=(f&~(1<<32-Tn(f)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Sh++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=c5++,i="_"+i+"r_"+u.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:Vv,useFormState:jC,useActionState:jC,useOptimistic:function(a){var i=kr();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Hv.bind(null,ut,!0,u),u.dispatch=i,[a,i]},useMemoCache:Ov,useCacheRefresh:function(){return kr().memoizedState=p5.bind(null,ut)},useEffectEvent:function(a){var i=kr(),u={impl:a};return i.memoizedState=u,function(){if((Pt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},$v={readContext:mr,use:wh,useCallback:UC,useContext:mr,useEffect:Pv,useImperativeHandle:PC,useInsertionEffect:kC,useLayoutEffect:IC,useMemo:FC,useReducer:Eh,useRef:DC,useState:function(){return Eh(Js)},useDebugValue:Uv,useDeferredValue:function(a,i){var u=An();return zC(u,Gt.memoizedState,a,i)},useTransition:function(){var a=Eh(Js)[0],i=An().memoizedState;return[typeof a=="boolean"?a:ed(a),i]},useSyncExternalStore:pC,useId:BC,useHostTransitionStatus:Vv,useFormState:_C,useActionState:_C,useOptimistic:function(a,i){var u=An();return SC(u,Gt,a,i)},useMemoCache:Ov,useCacheRefresh:GC};$v.useEffectEvent=MC;var WC={readContext:mr,use:wh,useCallback:UC,useContext:mr,useEffect:Pv,useImperativeHandle:PC,useInsertionEffect:kC,useLayoutEffect:IC,useMemo:FC,useReducer:kv,useRef:DC,useState:function(){return kv(Js)},useDebugValue:Uv,useDeferredValue:function(a,i){var u=An();return Gt===null?Fv(u,a,i):zC(u,Gt.memoizedState,a,i)},useTransition:function(){var a=kv(Js)[0],i=An().memoizedState;return[typeof a=="boolean"?a:ed(a),i]},useSyncExternalStore:pC,useId:BC,useHostTransitionStatus:Vv,useFormState:AC,useActionState:AC,useOptimistic:function(a,i){var u=An();return Gt!==null?SC(u,Gt,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Ov,useCacheRefresh:GC};WC.useEffectEvent=MC;function Bv(a,i,u,f){i=a.memoizedState,u=u(f,i),u=u==null?i:v({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Gv={enqueueSetState:function(a,i,u){a=a._reactInternals;var f=ia(),y=Ho(f);y.payload=i,u!=null&&(y.callback=u),i=$o(a,y,f),i!==null&&(qr(i,a,f),Wu(i,a,f))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var f=ia(),y=Ho(f);y.tag=1,y.payload=i,u!=null&&(y.callback=u),i=$o(a,y,f),i!==null&&(qr(i,a,f),Wu(i,a,f))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=ia(),f=Ho(u);f.tag=2,i!=null&&(f.callback=i),i=$o(a,f,u),i!==null&&(qr(i,a,u),Wu(i,a,u))}};function QC(a,i,u,f,y,S,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,S,_):i.prototype&&i.prototype.isPureReactComponent?!Hu(u,f)||!Hu(y,S):!0}function XC(a,i,u,f){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==a&&Gv.enqueueReplaceState(i,i.state,null)}function il(a,i){var u=i;if("ref"in i){u={};for(var f in i)f!=="ref"&&(u[f]=i[f])}if(a=a.defaultProps){u===i&&(u=v({},u));for(var y in a)u[y]===void 0&&(u[y]=a[y])}return u}function JC(a){sh(a)}function ew(a){console.error(a)}function tw(a){sh(a)}function _h(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function nw(a,i,u){try{var f=a.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function qv(a,i,u){return u=Ho(u),u.tag=3,u.payload={element:null},u.callback=function(){_h(a,i)},u}function rw(a){return a=Ho(a),a.tag=3,a}function aw(a,i,u,f){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=f.value;a.payload=function(){return y(S)},a.callback=function(){nw(i,u,f)}}var _=u.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(a.callback=function(){nw(i,u,f),typeof y!="function"&&(Yo===null?Yo=new Set([this]):Yo.add(this));var M=f.stack;this.componentDidCatch(f.value,{componentStack:M!==null?M:""})})}function v5(a,i,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=u.alternate,i!==null&&ic(i,u,y,!0),u=ra.current,u!==null){switch(u.tag){case 31:case 13:return Ia===null?zh():u.alternate===null&&xn===0&&(xn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===ph?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([f]):i.add(f),vy(a,f,y)),!1;case 22:return u.flags|=65536,f===ph?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([f]):u.add(f)),vy(a,f,y)),!1}throw Error(r(435,u.tag))}return vy(a,f,y),zh(),!1}if(Rt)return i=ra.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,f!==dv&&(a=Error(r(422),{cause:f}),Gu(Da(a,u)))):(f!==dv&&(i=Error(r(423),{cause:f}),Gu(Da(i,u))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,f=Da(f,u),y=qv(a.stateNode,f,y),Cv(a,y),xn!==4&&(xn=2)),!1;var S=Error(r(520),{cause:f});if(S=Da(S,u),ud===null?ud=[S]:ud.push(S),xn!==4&&(xn=2),i===null)return!0;f=Da(f,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=y&-y,u.lanes|=a,a=qv(u.stateNode,f,a),Cv(u,a),!1;case 1:if(i=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Yo===null||!Yo.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=rw(y),aw(y,a,u,f),Cv(u,y),!1}u=u.return}while(u!==null);return!1}var Kv=Error(r(461)),Pn=!1;function pr(a,i,u,f){i.child=a===null?lC(i,null,u,f):sl(i,a.child,u,f)}function sw(a,i,u,f,y){u=u.render;var S=i.ref;if("ref"in f){var _={};for(var M in f)M!=="ref"&&(_[M]=f[M])}else _=f;return tl(i),f=_v(a,i,u,_,S,y),M=Nv(),a!==null&&!Pn?(Av(a,i,y),eo(a,i,y)):(Rt&&M&&cv(i),i.flags|=1,pr(a,i,f,y),i.child)}function ow(a,i,u,f,y){if(a===null){var S=u.type;return typeof S=="function"&&!ov(S)&&S.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=S,iw(a,i,S,f,y)):(a=ch(u.type,null,f,i,i.mode,y),a.ref=i.ref,a.return=i,i.child=a)}if(S=a.child,!ty(a,y)){var _=S.memoizedProps;if(u=u.compare,u=u!==null?u:Hu,u(_,f)&&a.ref===i.ref)return eo(a,i,y)}return i.flags|=1,a=Zs(S,f),a.ref=i.ref,a.return=i,i.child=a}function iw(a,i,u,f,y){if(a!==null){var S=a.memoizedProps;if(Hu(S,f)&&a.ref===i.ref)if(Pn=!1,i.pendingProps=f=S,ty(a,y))(a.flags&131072)!==0&&(Pn=!0);else return i.lanes=a.lanes,eo(a,i,y)}return Zv(a,i,u,f,y)}function lw(a,i,u,f){var y=f.children,S=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,a!==null){for(f=i.child=a.child,y=0;f!==null;)y=y|f.lanes|f.childLanes,f=f.sibling;f=y&~S}else f=0,i.child=null;return cw(a,i,S,u,f)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&hh(i,S!==null?S.cachePool:null),S!==null?dC(i,S):Ev(),fC(i);else return f=i.lanes=536870912,cw(a,i,S!==null?S.baseLanes|u:u,u,f)}else S!==null?(hh(i,S.cachePool),dC(i,S),Go(),i.memoizedState=null):(a!==null&&hh(i,null),Ev(),Go());return pr(a,i,y,u),i.child}function rd(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function cw(a,i,u,f,y){var S=yv();return S=S===null?null:{parent:In._currentValue,pool:S},i.memoizedState={baseLanes:u,cachePool:S},a!==null&&hh(i,null),Ev(),fC(i),a!==null&&ic(a,i,f,!0),i.childLanes=y,null}function Nh(a,i){return i=Dh({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function uw(a,i,u){return sl(i,a.child,null,u),a=Nh(i,i.pendingProps),a.flags|=2,aa(i),i.memoizedState=null,a}function y5(a,i,u){var f=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(Rt){if(f.mode==="hidden")return a=Nh(i,f),i.lanes=536870912,rd(null,a);if(Tv(i),(a=on)?(a=CE(a,ka),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:Po!==null?{id:Ss,overflow:Cs}:null,retryLane:536870912,hydrationErrors:null},u=K1(a),u.return=i,i.child=u,hr=i,on=null)):a=null,a===null)throw Fo(i);return i.lanes=536870912,null}return Nh(i,f)}var S=a.memoizedState;if(S!==null){var _=S.dehydrated;if(Tv(i),y)if(i.flags&256)i.flags&=-257,i=uw(a,i,u);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if(Pn||ic(a,i,u,!1),y=(u&a.childLanes)!==0,Pn||y){if(f=Xt,f!==null&&(_=Ee(f,u),_!==0&&_!==S.retryLane))throw S.retryLane=_,Qi(a,_),qr(f,a,_),Kv;zh(),i=uw(a,i,u)}else a=S.treeContext,on=La(_.nextSibling),hr=i,Rt=!0,Uo=null,ka=!1,a!==null&&W1(i,a),i=Nh(i,f),i.flags|=4096;return i}return a=Zs(a.child,{mode:f.mode,children:f.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Ah(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(i.flags|=4194816)}}function Zv(a,i,u,f,y){return tl(i),u=_v(a,i,u,f,void 0,y),f=Nv(),a!==null&&!Pn?(Av(a,i,y),eo(a,i,y)):(Rt&&f&&cv(i),i.flags|=1,pr(a,i,u,y),i.child)}function dw(a,i,u,f,y,S){return tl(i),i.updateQueue=null,u=mC(i,f,u,y),hC(a),f=Nv(),a!==null&&!Pn?(Av(a,i,S),eo(a,i,S)):(Rt&&f&&cv(i),i.flags|=1,pr(a,i,u,S),i.child)}function fw(a,i,u,f,y){if(tl(i),i.stateNode===null){var S=rc,_=u.contextType;typeof _=="object"&&_!==null&&(S=mr(_)),S=new u(f,S),i.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Gv,i.stateNode=S,S._reactInternals=i,S=i.stateNode,S.props=f,S.state=i.memoizedState,S.refs={},bv(i),_=u.contextType,S.context=typeof _=="object"&&_!==null?mr(_):rc,S.state=i.memoizedState,_=u.getDerivedStateFromProps,typeof _=="function"&&(Bv(i,u,_,f),S.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(_=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),_!==S.state&&Gv.enqueueReplaceState(S,S.state,null),Xu(i,f,S,y),Qu(),S.state=i.memoizedState),typeof S.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(a===null){S=i.stateNode;var M=i.memoizedProps,F=il(u,M);S.props=F;var te=S.context,he=u.contextType;_=rc,typeof he=="object"&&he!==null&&(_=mr(he));var pe=u.getDerivedStateFromProps;he=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,he||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M||te!==_)&&XC(i,S,f,_),Vo=!1;var ae=i.memoizedState;S.state=ae,Xu(i,f,S,y),Qu(),te=i.memoizedState,M||ae!==te||Vo?(typeof pe=="function"&&(Bv(i,u,pe,f),te=i.memoizedState),(F=Vo||QC(i,u,F,f,ae,te,_))?(he||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=te),S.props=f,S.state=te,S.context=_,f=F):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{S=i.stateNode,Sv(a,i),_=i.memoizedProps,he=il(u,_),S.props=he,pe=i.pendingProps,ae=S.context,te=u.contextType,F=rc,typeof te=="object"&&te!==null&&(F=mr(te)),M=u.getDerivedStateFromProps,(te=typeof M=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_!==pe||ae!==F)&&XC(i,S,f,F),Vo=!1,ae=i.memoizedState,S.state=ae,Xu(i,f,S,y),Qu();var ce=i.memoizedState;_!==pe||ae!==ce||Vo||a!==null&&a.dependencies!==null&&dh(a.dependencies)?(typeof M=="function"&&(Bv(i,u,M,f),ce=i.memoizedState),(he=Vo||QC(i,u,he,f,ae,ce,F)||a!==null&&a.dependencies!==null&&dh(a.dependencies))?(te||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(f,ce,F),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(f,ce,F)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||_===a.memoizedProps&&ae===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&ae===a.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=ce),S.props=f,S.state=ce,S.context=F,f=he):(typeof S.componentDidUpdate!="function"||_===a.memoizedProps&&ae===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&ae===a.memoizedState||(i.flags|=1024),f=!1)}return S=f,Ah(a,i),f=(i.flags&128)!==0,S||f?(S=i.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:S.render(),i.flags|=1,a!==null&&f?(i.child=sl(i,a.child,null,y),i.child=sl(i,null,u,y)):pr(a,i,u,y),i.memoizedState=S.state,a=i.child):a=eo(a,i,y),a}function hw(a,i,u,f){return Ji(),i.flags|=256,pr(a,i,u,f),i.child}var Yv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wv(a){return{baseLanes:a,cachePool:nC()}}function Qv(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=oa),a}function mw(a,i,u){var f=i.pendingProps,y=!1,S=(i.flags&128)!==0,_;if((_=S)||(_=a!==null&&a.memoizedState===null?!1:(Nn.current&2)!==0),_&&(y=!0,i.flags&=-129),_=(i.flags&32)!==0,i.flags&=-33,a===null){if(Rt){if(y?Bo(i):Go(),(a=on)?(a=CE(a,ka),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:Po!==null?{id:Ss,overflow:Cs}:null,retryLane:536870912,hydrationErrors:null},u=K1(a),u.return=i,i.child=u,hr=i,on=null)):a=null,a===null)throw Fo(i);return My(a)?i.lanes=32:i.lanes=536870912,null}var M=f.children;return f=f.fallback,y?(Go(),y=i.mode,M=Dh({mode:"hidden",children:M},y),f=Xi(f,y,u,null),M.return=i,f.return=i,M.sibling=f,i.child=M,f=i.child,f.memoizedState=Wv(u),f.childLanes=Qv(a,_,u),i.memoizedState=Yv,rd(null,f)):(Bo(i),Xv(i,M))}var F=a.memoizedState;if(F!==null&&(M=F.dehydrated,M!==null)){if(S)i.flags&256?(Bo(i),i.flags&=-257,i=Jv(a,i,u)):i.memoizedState!==null?(Go(),i.child=a.child,i.flags|=128,i=null):(Go(),M=f.fallback,y=i.mode,f=Dh({mode:"visible",children:f.children},y),M=Xi(M,y,u,null),M.flags|=2,f.return=i,M.return=i,f.sibling=M,i.child=f,sl(i,a.child,null,u),f=i.child,f.memoizedState=Wv(u),f.childLanes=Qv(a,_,u),i.memoizedState=Yv,i=rd(null,f));else if(Bo(i),My(M)){if(_=M.nextSibling&&M.nextSibling.dataset,_)var te=_.dgst;_=te,f=Error(r(419)),f.stack="",f.digest=_,Gu({value:f,source:null,stack:null}),i=Jv(a,i,u)}else if(Pn||ic(a,i,u,!1),_=(u&a.childLanes)!==0,Pn||_){if(_=Xt,_!==null&&(f=Ee(_,u),f!==0&&f!==F.retryLane))throw F.retryLane=f,Qi(a,f),qr(_,a,f),Kv;Oy(M)||zh(),i=Jv(a,i,u)}else Oy(M)?(i.flags|=192,i.child=a.child,i=null):(a=F.treeContext,on=La(M.nextSibling),hr=i,Rt=!0,Uo=null,ka=!1,a!==null&&W1(i,a),i=Xv(i,f.children),i.flags|=4096);return i}return y?(Go(),M=f.fallback,y=i.mode,F=a.child,te=F.sibling,f=Zs(F,{mode:"hidden",children:f.children}),f.subtreeFlags=F.subtreeFlags&65011712,te!==null?M=Zs(te,M):(M=Xi(M,y,u,null),M.flags|=2),M.return=i,f.return=i,f.sibling=M,i.child=f,rd(null,f),f=i.child,M=a.child.memoizedState,M===null?M=Wv(u):(y=M.cachePool,y!==null?(F=In._currentValue,y=y.parent!==F?{parent:F,pool:F}:y):y=nC(),M={baseLanes:M.baseLanes|u,cachePool:y}),f.memoizedState=M,f.childLanes=Qv(a,_,u),i.memoizedState=Yv,rd(a.child,f)):(Bo(i),u=a.child,a=u.sibling,u=Zs(u,{mode:"visible",children:f.children}),u.return=i,u.sibling=null,a!==null&&(_=i.deletions,_===null?(i.deletions=[a],i.flags|=16):_.push(a)),i.child=u,i.memoizedState=null,u)}function Xv(a,i){return i=Dh({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function Dh(a,i){return a=na(22,a,null,i),a.lanes=0,a}function Jv(a,i,u){return sl(i,a.child,null,u),a=Xv(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function pw(a,i,u){a.lanes|=i;var f=a.alternate;f!==null&&(f.lanes|=i),mv(a.return,i,u)}function ey(a,i,u,f,y,S){var _=a.memoizedState;_===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y,treeForkCount:S}:(_.isBackwards=i,_.rendering=null,_.renderingStartTime=0,_.last=f,_.tail=u,_.tailMode=y,_.treeForkCount=S)}function gw(a,i,u){var f=i.pendingProps,y=f.revealOrder,S=f.tail;f=f.children;var _=Nn.current,M=(_&2)!==0;if(M?(_=_&1|2,i.flags|=128):_&=1,K(Nn,_),pr(a,i,f,u),f=Rt?Bu:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&pw(a,u,i);else if(a.tag===19)pw(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(u=i.child,y=null;u!==null;)a=u.alternate,a!==null&&xh(a)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),ey(i,!1,y,u,S,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(a=y.alternate,a!==null&&xh(a)===null){i.child=y;break}a=y.sibling,y.sibling=u,u=y,y=a}ey(i,!0,u,null,S,f);break;case"together":ey(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function eo(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),Zo|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(ic(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,u=Zs(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=Zs(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function ty(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&dh(a)))}function x5(a,i,u){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),zo(i,In,a.memoizedState.cache),Ji();break;case 27:case 5:xe(i);break;case 4:Ae(i,i.stateNode.containerInfo);break;case 10:zo(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Tv(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Bo(i),i.flags|=128,null):(u&i.child.childLanes)!==0?mw(a,i,u):(Bo(i),a=eo(a,i,u),a!==null?a.sibling:null);Bo(i);break;case 19:var y=(a.flags&128)!==0;if(f=(u&i.childLanes)!==0,f||(ic(a,i,u,!1),f=(u&i.childLanes)!==0),y){if(f)return gw(a,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),K(Nn,Nn.current),f)break;return null;case 22:return i.lanes=0,lw(a,i,u,i.pendingProps);case 24:zo(i,In,a.memoizedState.cache)}return eo(a,i,u)}function vw(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)Pn=!0;else{if(!ty(a,u)&&(i.flags&128)===0)return Pn=!1,x5(a,i,u);Pn=(a.flags&131072)!==0}else Pn=!1,Rt&&(i.flags&1048576)!==0&&Y1(i,Bu,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(a=rl(i.elementType),i.type=a,typeof a=="function")ov(a)?(f=il(a,f),i.tag=1,i=fw(null,i,a,f,u)):(i.tag=0,i=Zv(null,i,a,f,u));else{if(a!=null){var y=a.$$typeof;if(y===O){i.tag=11,i=sw(null,i,a,f,u);break e}else if(y===A){i.tag=14,i=ow(null,i,a,f,u);break e}}throw i=G(a)||a,Error(r(306,i,""))}}return i;case 0:return Zv(a,i,i.type,i.pendingProps,u);case 1:return f=i.type,y=il(f,i.pendingProps),fw(a,i,f,y,u);case 3:e:{if(Ae(i,i.stateNode.containerInfo),a===null)throw Error(r(387));f=i.pendingProps;var S=i.memoizedState;y=S.element,Sv(a,i),Xu(i,f,null,u);var _=i.memoizedState;if(f=_.cache,zo(i,In,f),f!==S.cache&&pv(i,[In],u,!0),Qu(),f=_.element,S.isDehydrated)if(S={element:f,isDehydrated:!1,cache:_.cache},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){i=hw(a,i,f,u);break e}else if(f!==y){y=Da(Error(r(424)),i),Gu(y),i=hw(a,i,f,u);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(on=La(a.firstChild),hr=i,Rt=!0,Uo=null,ka=!0,u=lC(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ji(),f===y){i=eo(a,i,u);break e}pr(a,i,f,u)}i=i.child}return i;case 26:return Ah(a,i),a===null?(u=_E(i.type,null,i.pendingProps,null))?i.memoizedState=u:Rt||(u=i.type,a=i.pendingProps,f=Kh(ge.current).createElement(u),f[Ue]=i,f[Me]=a,gr(f,u,a),un(f),i.stateNode=f):i.memoizedState=_E(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return xe(i),a===null&&Rt&&(f=i.stateNode=RE(i.type,i.pendingProps,ge.current),hr=i,ka=!0,y=on,Jo(i.type)?(ky=y,on=La(f.firstChild)):on=y),pr(a,i,i.pendingProps.children,u),Ah(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Rt&&((y=f=on)&&(f=Y5(f,i.type,i.pendingProps,ka),f!==null?(i.stateNode=f,hr=i,on=La(f.firstChild),ka=!1,y=!0):y=!1),y||Fo(i)),xe(i),y=i.type,S=i.pendingProps,_=a!==null?a.memoizedProps:null,f=S.children,Ny(y,S)?f=null:_!==null&&Ny(y,_)&&(i.flags|=32),i.memoizedState!==null&&(y=_v(a,i,u5,null,null,u),yd._currentValue=y),Ah(a,i),pr(a,i,f,u),i.child;case 6:return a===null&&Rt&&((a=u=on)&&(u=W5(u,i.pendingProps,ka),u!==null?(i.stateNode=u,hr=i,on=null,a=!0):a=!1),a||Fo(i)),null;case 13:return mw(a,i,u);case 4:return Ae(i,i.stateNode.containerInfo),f=i.pendingProps,a===null?i.child=sl(i,null,f,u):pr(a,i,f,u),i.child;case 11:return sw(a,i,i.type,i.pendingProps,u);case 7:return pr(a,i,i.pendingProps,u),i.child;case 8:return pr(a,i,i.pendingProps.children,u),i.child;case 12:return pr(a,i,i.pendingProps.children,u),i.child;case 10:return f=i.pendingProps,zo(i,i.type,f.value),pr(a,i,f.children,u),i.child;case 9:return y=i.type._context,f=i.pendingProps.children,tl(i),y=mr(y),f=f(y),i.flags|=1,pr(a,i,f,u),i.child;case 14:return ow(a,i,i.type,i.pendingProps,u);case 15:return iw(a,i,i.type,i.pendingProps,u);case 19:return gw(a,i,u);case 31:return y5(a,i,u);case 22:return lw(a,i,u,i.pendingProps);case 24:return tl(i),f=mr(In),a===null?(y=yv(),y===null&&(y=Xt,S=gv(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),i.memoizedState={parent:f,cache:y},bv(i),zo(i,In,y)):((a.lanes&u)!==0&&(Sv(a,i),Xu(i,null,null,u),Qu()),y=a.memoizedState,S=i.memoizedState,y.parent!==f?(y={parent:f,cache:f},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),zo(i,In,f)):(f=S.cache,zo(i,In,f),f!==y.cache&&pv(i,[In],u,!0))),pr(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function to(a){a.flags|=4}function ny(a,i,u,f,y){if((i=(a.mode&32)!==0)&&(i=!1),i){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(Bw())a.flags|=8192;else throw al=ph,xv}else a.flags&=-16777217}function yw(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!ME(i))if(Bw())a.flags|=8192;else throw al=ph,xv}function Oh(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?nr():536870912,a.lanes|=i,xc|=i)}function ad(a,i){if(!Rt)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function ln(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,f=0;if(i)for(var y=a.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=f,a.childLanes=u,i}function b5(a,i,u){var f=i.pendingProps;switch(uv(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(i),null;case 1:return ln(i),null;case 3:return u=i.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Qs(In),Re(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(oc(i)?to(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,fv())),ln(i),null;case 26:var y=i.type,S=i.memoizedState;return a===null?(to(i),S!==null?(ln(i),yw(i,S)):(ln(i),ny(i,y,null,f,u))):S?S!==a.memoizedState?(to(i),ln(i),yw(i,S)):(ln(i),i.flags&=-16777217):(a=a.memoizedProps,a!==f&&to(i),ln(i),ny(i,y,a,f,u)),null;case 27:if(Je(i),u=ge.current,y=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&to(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return ln(i),null}a=ne.current,oc(i)?Q1(i):(a=RE(y,f,u),i.stateNode=a,to(i))}return ln(i),null;case 5:if(Je(i),y=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&to(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return ln(i),null}if(S=ne.current,oc(i))Q1(i);else{var _=Kh(ge.current);switch(S){case 1:S=_.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=_.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=_.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=_.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=_.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof f.is=="string"?_.createElement("select",{is:f.is}):_.createElement("select"),f.multiple?S.multiple=!0:f.size&&(S.size=f.size);break;default:S=typeof f.is=="string"?_.createElement(y,{is:f.is}):_.createElement(y)}}S[Ue]=i,S[Me]=f;e:for(_=i.child;_!==null;){if(_.tag===5||_.tag===6)S.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===i)break e;for(;_.sibling===null;){if(_.return===null||_.return===i)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}i.stateNode=S;e:switch(gr(S,y,f),y){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&to(i)}}return ln(i),ny(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,u),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==f&&to(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(r(166));if(a=ge.current,oc(i)){if(a=i.stateNode,u=i.memoizedProps,f=null,y=hr,y!==null)switch(y.tag){case 27:case 5:f=y.memoizedProps}a[Ue]=i,a=!!(a.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||mE(a.nodeValue,u)),a||Fo(i,!0)}else a=Kh(a).createTextNode(f),a[Ue]=i,i.stateNode=a}return ln(i),null;case 31:if(u=i.memoizedState,a===null||a.memoizedState!==null){if(f=oc(i),u!==null){if(a===null){if(!f)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Ue]=i}else Ji(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ln(i),a=!1}else u=fv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return i.flags&256?(aa(i),i):(aa(i),null);if((i.flags&128)!==0)throw Error(r(558))}return ln(i),null;case 13:if(f=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=oc(i),f!==null&&f.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Ue]=i}else Ji(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ln(i),y=!1}else y=fv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(aa(i),i):(aa(i),null)}return aa(i),(i.flags&128)!==0?(i.lanes=u,i):(u=f!==null,a=a!==null&&a.memoizedState!==null,u&&(f=i.child,y=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(y=f.alternate.memoizedState.cachePool.pool),S=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(S=f.memoizedState.cachePool.pool),S!==y&&(f.flags|=2048)),u!==a&&u&&(i.child.flags|=8192),Oh(i,i.updateQueue),ln(i),null);case 4:return Re(),a===null&&Ey(i.stateNode.containerInfo),ln(i),null;case 10:return Qs(i.type),ln(i),null;case 19:if(P(Nn),f=i.memoizedState,f===null)return ln(i),null;if(y=(i.flags&128)!==0,S=f.rendering,S===null)if(y)ad(f,!1);else{if(xn!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(S=xh(a),S!==null){for(i.flags|=128,ad(f,!1),a=S.updateQueue,i.updateQueue=a,Oh(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)q1(u,a),u=u.sibling;return K(Nn,Nn.current&1|2),Rt&&Ys(i,f.treeForkCount),i.child}a=a.sibling}f.tail!==null&&ye()>Ph&&(i.flags|=128,y=!0,ad(f,!1),i.lanes=4194304)}else{if(!y)if(a=xh(S),a!==null){if(i.flags|=128,y=!0,a=a.updateQueue,i.updateQueue=a,Oh(i,a),ad(f,!0),f.tail===null&&f.tailMode==="hidden"&&!S.alternate&&!Rt)return ln(i),null}else 2*ye()-f.renderingStartTime>Ph&&u!==536870912&&(i.flags|=128,y=!0,ad(f,!1),i.lanes=4194304);f.isBackwards?(S.sibling=i.child,i.child=S):(a=f.last,a!==null?a.sibling=S:i.child=S,f.last=S)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=ye(),a.sibling=null,u=Nn.current,K(Nn,y?u&1|2:u&1),Rt&&Ys(i,f.treeForkCount),a):(ln(i),null);case 22:case 23:return aa(i),Rv(),f=i.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(u&536870912)!==0&&(i.flags&128)===0&&(ln(i),i.subtreeFlags&6&&(i.flags|=8192)):ln(i),u=i.updateQueue,u!==null&&Oh(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048),a!==null&&P(nl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Qs(In),ln(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function S5(a,i){switch(uv(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return Qs(In),Re(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return Je(i),null;case 31:if(i.memoizedState!==null){if(aa(i),i.alternate===null)throw Error(r(340));Ji()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(aa(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Ji()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return P(Nn),null;case 4:return Re(),null;case 10:return Qs(i.type),null;case 22:case 23:return aa(i),Rv(),a!==null&&P(nl),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return Qs(In),null;case 25:return null;default:return null}}function xw(a,i){switch(uv(i),i.tag){case 3:Qs(In),Re();break;case 26:case 27:case 5:Je(i);break;case 4:Re();break;case 31:i.memoizedState!==null&&aa(i);break;case 13:aa(i);break;case 19:P(Nn);break;case 10:Qs(i.type);break;case 22:case 23:aa(i),Rv(),a!==null&&P(nl);break;case 24:Qs(In)}}function sd(a,i){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var y=f.next;u=y;do{if((u.tag&a)===a){f=void 0;var S=u.create,_=u.inst;f=S(),_.destroy=f}u=u.next}while(u!==y)}}catch(M){Ht(i,i.return,M)}}function qo(a,i,u){try{var f=i.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var S=y.next;f=S;do{if((f.tag&a)===a){var _=f.inst,M=_.destroy;if(M!==void 0){_.destroy=void 0,y=i;var F=u,te=M;try{te()}catch(he){Ht(y,F,he)}}}f=f.next}while(f!==S)}}catch(he){Ht(i,i.return,he)}}function bw(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{uC(i,u)}catch(f){Ht(a,a.return,f)}}}function Sw(a,i,u){u.props=il(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(f){Ht(a,i,f)}}function od(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof u=="function"?a.refCleanup=u(f):u.current=f}}catch(y){Ht(a,i,y)}}function ws(a,i){var u=a.ref,f=a.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){Ht(a,i,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Ht(a,i,y)}else u.current=null}function Cw(a){var i=a.type,u=a.memoizedProps,f=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(y){Ht(a,a.return,y)}}function ry(a,i,u){try{var f=a.stateNode;$5(f,a.type,u,i),f[Me]=i}catch(y){Ht(a,a.return,y)}}function ww(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Jo(a.type)||a.tag===4}function ay(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||ww(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Jo(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function sy(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(a),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=qs));else if(f!==4&&(f===27&&Jo(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(sy(a,i,u),a=a.sibling;a!==null;)sy(a,i,u),a=a.sibling}function Mh(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(f!==4&&(f===27&&Jo(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Mh(a,i,u),a=a.sibling;a!==null;)Mh(a,i,u),a=a.sibling}function Ew(a){var i=a.stateNode,u=a.memoizedProps;try{for(var f=a.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);gr(i,f,u),i[Ue]=a,i[Me]=u}catch(S){Ht(a,a.return,S)}}var no=!1,Un=!1,oy=!1,Rw=typeof WeakSet=="function"?WeakSet:Set,ar=null;function C5(a,i){if(a=a.containerInfo,jy=em,a=P1(a),Jg(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,S=f.focusNode;f=f.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var _=0,M=-1,F=-1,te=0,he=0,pe=a,ae=null;t:for(;;){for(var ce;pe!==u||y!==0&&pe.nodeType!==3||(M=_+y),pe!==S||f!==0&&pe.nodeType!==3||(F=_+f),pe.nodeType===3&&(_+=pe.nodeValue.length),(ce=pe.firstChild)!==null;)ae=pe,pe=ce;for(;;){if(pe===a)break t;if(ae===u&&++te===y&&(M=_),ae===S&&++he===f&&(F=_),(ce=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=ce}u=M===-1||F===-1?null:{start:M,end:F}}else u=null}u=u||{start:0,end:0}}else u=null;for(_y={focusedElem:a,selectionRange:u},em=!1,ar=i;ar!==null;)if(i=ar,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,ar=a;else for(;ar!==null;){switch(i=ar,S=i.alternate,a=i.flags,i.tag){case 0:if((a&4)!==0&&(a=i.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)y=a[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,u=i,y=S.memoizedProps,S=S.memoizedState,f=u.stateNode;try{var He=il(u.type,y);a=f.getSnapshotBeforeUpdate(He,S),f.__reactInternalSnapshotBeforeUpdate=a}catch(et){Ht(u,u.return,et)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)Dy(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Dy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,ar=a;break}ar=i.return}}function Tw(a,i,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:ao(a,u),f&4&&sd(5,u);break;case 1:if(ao(a,u),f&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(_){Ht(u,u.return,_)}else{var y=il(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(y,i,a.__reactInternalSnapshotBeforeUpdate)}catch(_){Ht(u,u.return,_)}}f&64&&bw(u),f&512&&od(u,u.return);break;case 3:if(ao(a,u),f&64&&(a=u.updateQueue,a!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{uC(a,i)}catch(_){Ht(u,u.return,_)}}break;case 27:i===null&&f&4&&Ew(u);case 26:case 5:ao(a,u),i===null&&f&4&&Cw(u),f&512&&od(u,u.return);break;case 12:ao(a,u);break;case 31:ao(a,u),f&4&&Nw(a,u);break;case 13:ao(a,u),f&4&&Aw(a,u),f&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=D5.bind(null,u),Q5(a,u))));break;case 22:if(f=u.memoizedState!==null||no,!f){i=i!==null&&i.memoizedState!==null||Un,y=no;var S=Un;no=f,(Un=i)&&!S?so(a,u,(u.subtreeFlags&8772)!==0):ao(a,u),no=y,Un=S}break;case 30:break;default:ao(a,u)}}function jw(a){var i=a.alternate;i!==null&&(a.alternate=null,jw(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&Za(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var dn=null,Hr=!1;function ro(a,i,u){for(u=u.child;u!==null;)_w(a,i,u),u=u.sibling}function _w(a,i,u){if(vn&&typeof vn.onCommitFiberUnmount=="function")try{vn.onCommitFiberUnmount(zr,u)}catch{}switch(u.tag){case 26:Un||ws(u,i),ro(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Un||ws(u,i);var f=dn,y=Hr;Jo(u.type)&&(dn=u.stateNode,Hr=!1),ro(a,i,u),pd(u.stateNode),dn=f,Hr=y;break;case 5:Un||ws(u,i);case 6:if(f=dn,y=Hr,dn=null,ro(a,i,u),dn=f,Hr=y,dn!==null)if(Hr)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(u.stateNode)}catch(S){Ht(u,i,S)}else try{dn.removeChild(u.stateNode)}catch(S){Ht(u,i,S)}break;case 18:dn!==null&&(Hr?(a=dn,bE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),jc(a)):bE(dn,u.stateNode));break;case 4:f=dn,y=Hr,dn=u.stateNode.containerInfo,Hr=!0,ro(a,i,u),dn=f,Hr=y;break;case 0:case 11:case 14:case 15:qo(2,u,i),Un||qo(4,u,i),ro(a,i,u);break;case 1:Un||(ws(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Sw(u,i,f)),ro(a,i,u);break;case 21:ro(a,i,u);break;case 22:Un=(f=Un)||u.memoizedState!==null,ro(a,i,u),Un=f;break;default:ro(a,i,u)}}function Nw(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{jc(a)}catch(u){Ht(i,i.return,u)}}}function Aw(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{jc(a)}catch(u){Ht(i,i.return,u)}}function w5(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new Rw),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new Rw),i;default:throw Error(r(435,a.tag))}}function kh(a,i){var u=w5(a);i.forEach(function(f){if(!u.has(f)){u.add(f);var y=O5.bind(null,a,f);f.then(y,y)}})}function $r(a,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],S=a,_=i,M=_;e:for(;M!==null;){switch(M.tag){case 27:if(Jo(M.type)){dn=M.stateNode,Hr=!1;break e}break;case 5:dn=M.stateNode,Hr=!1;break e;case 3:case 4:dn=M.stateNode.containerInfo,Hr=!0;break e}M=M.return}if(dn===null)throw Error(r(160));_w(S,_,y),dn=null,Hr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Dw(i,a),i=i.sibling}var Qa=null;function Dw(a,i){var u=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:$r(i,a),Br(a),f&4&&(qo(3,a,a.return),sd(3,a),qo(5,a,a.return));break;case 1:$r(i,a),Br(a),f&512&&(Un||u===null||ws(u,u.return)),f&64&&no&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var y=Qa;if($r(i,a),Br(a),f&512&&(Un||u===null||ws(u,u.return)),f&4){var S=u!==null?u.memoizedState:null;if(f=a.memoizedState,u===null)if(f===null)if(a.stateNode===null){e:{f=a.type,u=a.memoizedProps,y=y.ownerDocument||y;t:switch(f){case"title":S=y.getElementsByTagName("title")[0],(!S||S[Lt]||S[Ue]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(f),y.head.insertBefore(S,y.querySelector("head > title"))),gr(S,f,u),S[Ue]=a,un(S),f=S;break e;case"link":var _=DE("link","href",y).get(f+(u.href||""));if(_){for(var M=0;M<_.length;M++)if(S=_[M],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){_.splice(M,1);break t}}S=y.createElement(f),gr(S,f,u),y.head.appendChild(S);break;case"meta":if(_=DE("meta","content",y).get(f+(u.content||""))){for(M=0;M<_.length;M++)if(S=_[M],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){_.splice(M,1);break t}}S=y.createElement(f),gr(S,f,u),y.head.appendChild(S);break;default:throw Error(r(468,f))}S[Ue]=a,un(S),f=S}a.stateNode=f}else OE(y,a.type,a.stateNode);else a.stateNode=AE(y,f,a.memoizedProps);else S!==f?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,f===null?OE(y,a.type,a.stateNode):AE(y,f,a.memoizedProps)):f===null&&a.stateNode!==null&&ry(a,a.memoizedProps,u.memoizedProps)}break;case 27:$r(i,a),Br(a),f&512&&(Un||u===null||ws(u,u.return)),u!==null&&f&4&&ry(a,a.memoizedProps,u.memoizedProps);break;case 5:if($r(i,a),Br(a),f&512&&(Un||u===null||ws(u,u.return)),a.flags&32){y=a.stateNode;try{Wl(y,"")}catch(He){Ht(a,a.return,He)}}f&4&&a.stateNode!=null&&(y=a.memoizedProps,ry(a,y,u!==null?u.memoizedProps:y)),f&1024&&(oy=!0);break;case 6:if($r(i,a),Br(a),f&4){if(a.stateNode===null)throw Error(r(162));f=a.memoizedProps,u=a.stateNode;try{u.nodeValue=f}catch(He){Ht(a,a.return,He)}}break;case 3:if(Wh=null,y=Qa,Qa=Zh(i.containerInfo),$r(i,a),Qa=y,Br(a),f&4&&u!==null&&u.memoizedState.isDehydrated)try{jc(i.containerInfo)}catch(He){Ht(a,a.return,He)}oy&&(oy=!1,Ow(a));break;case 4:f=Qa,Qa=Zh(a.stateNode.containerInfo),$r(i,a),Br(a),Qa=f;break;case 12:$r(i,a),Br(a);break;case 31:$r(i,a),Br(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,kh(a,f)));break;case 13:$r(i,a),Br(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Lh=ye()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,kh(a,f)));break;case 22:y=a.memoizedState!==null;var F=u!==null&&u.memoizedState!==null,te=no,he=Un;if(no=te||y,Un=he||F,$r(i,a),Un=he,no=te,Br(a),f&8192)e:for(i=a.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(u===null||F||no||Un||ll(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){F=u=i;try{if(S=F.stateNode,y)_=S.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{M=F.stateNode;var pe=F.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;M.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(He){Ht(F,F.return,He)}}}else if(i.tag===6){if(u===null){F=i;try{F.stateNode.nodeValue=y?"":F.memoizedProps}catch(He){Ht(F,F.return,He)}}}else if(i.tag===18){if(u===null){F=i;try{var ce=F.stateNode;y?SE(ce,!0):SE(F.stateNode,!1)}catch(He){Ht(F,F.return,He)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=a.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,kh(a,u))));break;case 19:$r(i,a),Br(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,kh(a,f)));break;case 30:break;case 21:break;default:$r(i,a),Br(a)}}function Br(a){var i=a.flags;if(i&2){try{for(var u,f=a.return;f!==null;){if(ww(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=ay(a);Mh(a,S,y);break;case 5:var _=u.stateNode;u.flags&32&&(Wl(_,""),u.flags&=-33);var M=ay(a);Mh(a,M,_);break;case 3:case 4:var F=u.stateNode.containerInfo,te=ay(a);sy(a,te,F);break;default:throw Error(r(161))}}catch(he){Ht(a,a.return,he)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function Ow(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;Ow(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function ao(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Tw(a,i.alternate,i),i=i.sibling}function ll(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:qo(4,i,i.return),ll(i);break;case 1:ws(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Sw(i,i.return,u),ll(i);break;case 27:pd(i.stateNode);case 26:case 5:ws(i,i.return),ll(i);break;case 22:i.memoizedState===null&&ll(i);break;case 30:ll(i);break;default:ll(i)}a=a.sibling}}function so(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,y=a,S=i,_=S.flags;switch(S.tag){case 0:case 11:case 15:so(y,S,u),sd(4,S);break;case 1:if(so(y,S,u),f=S,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){Ht(f,f.return,te)}if(f=S,y=f.updateQueue,y!==null){var M=f.stateNode;try{var F=y.shared.hiddenCallbacks;if(F!==null)for(y.shared.hiddenCallbacks=null,y=0;y<F.length;y++)cC(F[y],M)}catch(te){Ht(f,f.return,te)}}u&&_&64&&bw(S),od(S,S.return);break;case 27:Ew(S);case 26:case 5:so(y,S,u),u&&f===null&&_&4&&Cw(S),od(S,S.return);break;case 12:so(y,S,u);break;case 31:so(y,S,u),u&&_&4&&Nw(y,S);break;case 13:so(y,S,u),u&&_&4&&Aw(y,S);break;case 22:S.memoizedState===null&&so(y,S,u),od(S,S.return);break;case 30:break;default:so(y,S,u)}i=i.sibling}}function iy(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&qu(u))}function ly(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&qu(a))}function Xa(a,i,u,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Mw(a,i,u,f),i=i.sibling}function Mw(a,i,u,f){var y=i.flags;switch(i.tag){case 0:case 11:case 15:Xa(a,i,u,f),y&2048&&sd(9,i);break;case 1:Xa(a,i,u,f);break;case 3:Xa(a,i,u,f),y&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&qu(a)));break;case 12:if(y&2048){Xa(a,i,u,f),a=i.stateNode;try{var S=i.memoizedProps,_=S.id,M=S.onPostCommit;typeof M=="function"&&M(_,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(F){Ht(i,i.return,F)}}else Xa(a,i,u,f);break;case 31:Xa(a,i,u,f);break;case 13:Xa(a,i,u,f);break;case 23:break;case 22:S=i.stateNode,_=i.alternate,i.memoizedState!==null?S._visibility&2?Xa(a,i,u,f):id(a,i):S._visibility&2?Xa(a,i,u,f):(S._visibility|=2,gc(a,i,u,f,(i.subtreeFlags&10256)!==0||!1)),y&2048&&iy(_,i);break;case 24:Xa(a,i,u,f),y&2048&&ly(i.alternate,i);break;default:Xa(a,i,u,f)}}function gc(a,i,u,f,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var S=a,_=i,M=u,F=f,te=_.flags;switch(_.tag){case 0:case 11:case 15:gc(S,_,M,F,y),sd(8,_);break;case 23:break;case 22:var he=_.stateNode;_.memoizedState!==null?he._visibility&2?gc(S,_,M,F,y):id(S,_):(he._visibility|=2,gc(S,_,M,F,y)),y&&te&2048&&iy(_.alternate,_);break;case 24:gc(S,_,M,F,y),y&&te&2048&&ly(_.alternate,_);break;default:gc(S,_,M,F,y)}i=i.sibling}}function id(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,f=i,y=f.flags;switch(f.tag){case 22:id(u,f),y&2048&&iy(f.alternate,f);break;case 24:id(u,f),y&2048&&ly(f.alternate,f);break;default:id(u,f)}i=i.sibling}}var ld=8192;function vc(a,i,u){if(a.subtreeFlags&ld)for(a=a.child;a!==null;)kw(a,i,u),a=a.sibling}function kw(a,i,u){switch(a.tag){case 26:vc(a,i,u),a.flags&ld&&a.memoizedState!==null&&ck(u,Qa,a.memoizedState,a.memoizedProps);break;case 5:vc(a,i,u);break;case 3:case 4:var f=Qa;Qa=Zh(a.stateNode.containerInfo),vc(a,i,u),Qa=f;break;case 22:a.memoizedState===null&&(f=a.alternate,f!==null&&f.memoizedState!==null?(f=ld,ld=16777216,vc(a,i,u),ld=f):vc(a,i,u));break;default:vc(a,i,u)}}function Iw(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function cd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];ar=f,Pw(f,a)}Iw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Lw(a),a=a.sibling}function Lw(a){switch(a.tag){case 0:case 11:case 15:cd(a),a.flags&2048&&qo(9,a,a.return);break;case 3:cd(a);break;case 12:cd(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Ih(a)):cd(a);break;default:cd(a)}}function Ih(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];ar=f,Pw(f,a)}Iw(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:qo(8,i,i.return),Ih(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Ih(i));break;default:Ih(i)}a=a.sibling}}function Pw(a,i){for(;ar!==null;){var u=ar;switch(u.tag){case 0:case 11:case 15:qo(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:qu(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,ar=f;else e:for(u=a;ar!==null;){f=ar;var y=f.sibling,S=f.return;if(jw(f),f===u){ar=null;break e}if(y!==null){y.return=S,ar=y;break e}ar=S}}}var E5={getCacheForType:function(a){var i=mr(In),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u},cacheSignal:function(){return mr(In).controller.signal}},R5=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Xt=null,bt=null,Ct=0,Vt=0,sa=null,Ko=!1,yc=!1,cy=!1,oo=0,xn=0,Zo=0,cl=0,uy=0,oa=0,xc=0,ud=null,Gr=null,dy=!1,Lh=0,Uw=0,Ph=1/0,Uh=null,Yo=null,Yn=0,Wo=null,bc=null,io=0,fy=0,hy=null,Fw=null,dd=0,my=null;function ia(){return(Pt&2)!==0&&Ct!==0?Ct&-Ct:I.T!==null?by():Ie()}function zw(){if(oa===0)if((Ct&536870912)===0||Rt){var a=Io;Io<<=1,(Io&3932160)===0&&(Io=262144),oa=a}else oa=536870912;return a=ra.current,a!==null&&(a.flags|=32),oa}function qr(a,i,u){(a===Xt&&(Vt===2||Vt===9)||a.cancelPendingCommit!==null)&&(Sc(a,0),Qo(a,Ct,oa,!1)),U(a,u),((Pt&2)===0||a!==Xt)&&(a===Xt&&((Pt&2)===0&&(cl|=u),xn===4&&Qo(a,Ct,oa,!1)),Es(a))}function Vw(a,i,u){if((Pt&6)!==0)throw Error(r(327));var f=!u&&(i&127)===0&&(i&a.expiredLanes)===0||Kn(a,i),y=f?_5(a,i):gy(a,i,!0),S=f;do{if(y===0){yc&&!f&&Qo(a,i,0,!1);break}else{if(u=a.current.alternate,S&&!T5(u)){y=gy(a,i,!1),S=!1;continue}if(y===2){if(S=i,a.errorRecoveryDisabledLanes&S)var _=0;else _=a.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){i=_;e:{var M=a;y=ud;var F=M.current.memoizedState.isDehydrated;if(F&&(Sc(M,_).flags|=256),_=gy(M,_,!1),_!==2){if(cy&&!F){M.errorRecoveryDisabledLanes|=S,cl|=S,y=4;break e}S=Gr,Gr=y,S!==null&&(Gr===null?Gr=S:Gr.push.apply(Gr,S))}y=_}if(S=!1,y!==2)continue}}if(y===1){Sc(a,0),Qo(a,i,0,!0);break}e:{switch(f=a,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:Qo(f,i,oa,!Ko);break e;case 2:Gr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(y=Lh+300-ye(),10<y)){if(Qo(f,i,oa,!Ko),jn(f,0,!0)!==0)break e;io=i,f.timeoutHandle=yE(Hw.bind(null,f,u,Gr,Uh,dy,i,oa,cl,xc,Ko,S,"Throttled",-0,0),y);break e}Hw(f,u,Gr,Uh,dy,i,oa,cl,xc,Ko,S,null,-0,0)}}break}while(!0);Es(a)}function Hw(a,i,u,f,y,S,_,M,F,te,he,pe,ae,ce){if(a.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qs},kw(i,S,pe);var He=(S&62914560)===S?Lh-ye():(S&4194048)===S?Uw-ye():0;if(He=uk(pe,He),He!==null){io=S,a.cancelPendingCommit=He(Ww.bind(null,a,i,S,u,f,y,_,M,F,he,pe,null,ae,ce)),Qo(a,S,_,!te);return}}Ww(a,i,S,u,f,y,_,M,F)}function T5(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var y=u[f],S=y.getSnapshot;y=y.value;try{if(!ta(S(),y))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Qo(a,i,u,f){i&=~uy,i&=~cl,a.suspendedLanes|=i,a.pingedLanes&=~i,f&&(a.warmLanes|=i),f=a.expirationTimes;for(var y=i;0<y;){var S=31-Tn(y),_=1<<S;f[S]=-1,y&=~_}u!==0&&se(a,u,i)}function Fh(){return(Pt&6)===0?(fd(0),!1):!0}function py(){if(bt!==null){if(Vt===0)var a=bt.return;else a=bt,Ws=el=null,Dv(a),dc=null,Zu=0,a=bt;for(;a!==null;)xw(a.alternate,a),a=a.return;bt=null}}function Sc(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,q5(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),io=0,py(),Xt=a,bt=u=Zs(a.current,null),Ct=i,Vt=0,sa=null,Ko=!1,yc=Kn(a,i),cy=!1,xc=oa=uy=cl=Zo=xn=0,Gr=ud=null,dy=!1,(i&8)!==0&&(i|=i&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=i;0<f;){var y=31-Tn(f),S=1<<y;i|=a[y],f&=~S}return oo=i,oh(),u}function $w(a,i){ut=null,I.H=nd,i===uc||i===mh?(i=sC(),Vt=3):i===xv?(i=sC(),Vt=4):Vt=i===Kv?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,sa=i,bt===null&&(xn=1,_h(a,Da(i,a.current)))}function Bw(){var a=ra.current;return a===null?!0:(Ct&4194048)===Ct?Ia===null:(Ct&62914560)===Ct||(Ct&536870912)!==0?a===Ia:!1}function Gw(){var a=I.H;return I.H=nd,a===null?nd:a}function qw(){var a=I.A;return I.A=E5,a}function zh(){xn=4,Ko||(Ct&4194048)!==Ct&&ra.current!==null||(yc=!0),(Zo&134217727)===0&&(cl&134217727)===0||Xt===null||Qo(Xt,Ct,oa,!1)}function gy(a,i,u){var f=Pt;Pt|=2;var y=Gw(),S=qw();(Xt!==a||Ct!==i)&&(Uh=null,Sc(a,i)),i=!1;var _=xn;e:do try{if(Vt!==0&&bt!==null){var M=bt,F=sa;switch(Vt){case 8:py(),_=6;break e;case 3:case 2:case 9:case 6:ra.current===null&&(i=!0);var te=Vt;if(Vt=0,sa=null,Cc(a,M,F,te),u&&yc){_=0;break e}break;default:te=Vt,Vt=0,sa=null,Cc(a,M,F,te)}}j5(),_=xn;break}catch(he){$w(a,he)}while(!0);return i&&a.shellSuspendCounter++,Ws=el=null,Pt=f,I.H=y,I.A=S,bt===null&&(Xt=null,Ct=0,oh()),_}function j5(){for(;bt!==null;)Kw(bt)}function _5(a,i){var u=Pt;Pt|=2;var f=Gw(),y=qw();Xt!==a||Ct!==i?(Uh=null,Ph=ye()+500,Sc(a,i)):yc=Kn(a,i);e:do try{if(Vt!==0&&bt!==null){i=bt;var S=sa;t:switch(Vt){case 1:Vt=0,sa=null,Cc(a,i,S,1);break;case 2:case 9:if(rC(S)){Vt=0,sa=null,Zw(i);break}i=function(){Vt!==2&&Vt!==9||Xt!==a||(Vt=7),Es(a)},S.then(i,i);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:rC(S)?(Vt=0,sa=null,Zw(i)):(Vt=0,sa=null,Cc(a,i,S,7));break;case 5:var _=null;switch(bt.tag){case 26:_=bt.memoizedState;case 5:case 27:var M=bt;if(_?ME(_):M.stateNode.complete){Vt=0,sa=null;var F=M.sibling;if(F!==null)bt=F;else{var te=M.return;te!==null?(bt=te,Vh(te)):bt=null}break t}}Vt=0,sa=null,Cc(a,i,S,5);break;case 6:Vt=0,sa=null,Cc(a,i,S,6);break;case 8:py(),xn=6;break e;default:throw Error(r(462))}}N5();break}catch(he){$w(a,he)}while(!0);return Ws=el=null,I.H=f,I.A=y,Pt=u,bt!==null?0:(Xt=null,Ct=0,oh(),xn)}function N5(){for(;bt!==null&&!de();)Kw(bt)}function Kw(a){var i=vw(a.alternate,a,oo);a.memoizedProps=a.pendingProps,i===null?Vh(a):bt=i}function Zw(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=dw(u,i,i.pendingProps,i.type,void 0,Ct);break;case 11:i=dw(u,i,i.pendingProps,i.type.render,i.ref,Ct);break;case 5:Dv(i);default:xw(u,i),i=bt=q1(i,oo),i=vw(u,i,oo)}a.memoizedProps=a.pendingProps,i===null?Vh(a):bt=i}function Cc(a,i,u,f){Ws=el=null,Dv(i),dc=null,Zu=0;var y=i.return;try{if(v5(a,y,i,u,Ct)){xn=1,_h(a,Da(u,a.current)),bt=null;return}}catch(S){if(y!==null)throw bt=y,S;xn=1,_h(a,Da(u,a.current)),bt=null;return}i.flags&32768?(Rt||f===1?a=!0:yc||(Ct&536870912)!==0?a=!1:(Ko=a=!0,(f===2||f===9||f===3||f===6)&&(f=ra.current,f!==null&&f.tag===13&&(f.flags|=16384))),Yw(i,a)):Vh(i)}function Vh(a){var i=a;do{if((i.flags&32768)!==0){Yw(i,Ko);return}a=i.return;var u=b5(i.alternate,i,oo);if(u!==null){bt=u;return}if(i=i.sibling,i!==null){bt=i;return}bt=i=a}while(i!==null);xn===0&&(xn=5)}function Yw(a,i){do{var u=S5(a.alternate,a);if(u!==null){u.flags&=32767,bt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){bt=a;return}bt=a=u}while(a!==null);xn=6,bt=null}function Ww(a,i,u,f,y,S,_,M,F){a.cancelPendingCommit=null;do Hh();while(Yn!==0);if((Pt&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(S=i.lanes|i.childLanes,S|=av,Z(a,u,S,_,M,F),a===Xt&&(bt=Xt=null,Ct=0),bc=i,Wo=a,io=u,fy=S,hy=y,Fw=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,M5(ht,function(){return tE(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,y=Y.p,Y.p=2,_=Pt,Pt|=4;try{C5(a,i,u)}finally{Pt=_,Y.p=y,I.T=f}}Yn=1,Qw(),Xw(),Jw()}}function Qw(){if(Yn===1){Yn=0;var a=Wo,i=bc,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var f=Y.p;Y.p=2;var y=Pt;Pt|=4;try{Dw(i,a);var S=_y,_=P1(a.containerInfo),M=S.focusedElem,F=S.selectionRange;if(_!==M&&M&&M.ownerDocument&&L1(M.ownerDocument.documentElement,M)){if(F!==null&&Jg(M)){var te=F.start,he=F.end;if(he===void 0&&(he=te),"selectionStart"in M)M.selectionStart=te,M.selectionEnd=Math.min(he,M.value.length);else{var pe=M.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var ce=ae.getSelection(),He=M.textContent.length,et=Math.min(F.start,He),Kt=F.end===void 0?et:Math.min(F.end,He);!ce.extend&&et>Kt&&(_=Kt,Kt=et,et=_);var X=I1(M,et),$=I1(M,Kt);if(X&&$&&(ce.rangeCount!==1||ce.anchorNode!==X.node||ce.anchorOffset!==X.offset||ce.focusNode!==$.node||ce.focusOffset!==$.offset)){var ee=pe.createRange();ee.setStart(X.node,X.offset),ce.removeAllRanges(),et>Kt?(ce.addRange(ee),ce.extend($.node,$.offset)):(ee.setEnd($.node,$.offset),ce.addRange(ee))}}}}for(pe=[],ce=M;ce=ce.parentNode;)ce.nodeType===1&&pe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<pe.length;M++){var me=pe[M];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}em=!!jy,_y=jy=null}finally{Pt=y,Y.p=f,I.T=u}}a.current=i,Yn=2}}function Xw(){if(Yn===2){Yn=0;var a=Wo,i=bc,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var f=Y.p;Y.p=2;var y=Pt;Pt|=4;try{Tw(a,i.alternate,i)}finally{Pt=y,Y.p=f,I.T=u}}Yn=3}}function Jw(){if(Yn===4||Yn===3){Yn=0,Ne();var a=Wo,i=bc,u=io,f=Fw;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Yn=5:(Yn=0,bc=Wo=null,eE(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(Yo=null),Ve(u),i=i.stateNode,vn&&typeof vn.onCommitFiberRoot=="function")try{vn.onCommitFiberRoot(zr,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=I.T,y=Y.p,Y.p=2,I.T=null;try{for(var S=a.onRecoverableError,_=0;_<f.length;_++){var M=f[_];S(M.value,{componentStack:M.stack})}}finally{I.T=i,Y.p=y}}(io&3)!==0&&Hh(),Es(a),y=a.pendingLanes,(u&261930)!==0&&(y&42)!==0?a===my?dd++:(dd=0,my=a):dd=0,fd(0)}}function eE(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,qu(i)))}function Hh(){return Qw(),Xw(),Jw(),tE()}function tE(){if(Yn!==5)return!1;var a=Wo,i=fy;fy=0;var u=Ve(io),f=I.T,y=Y.p;try{Y.p=32>u?32:u,I.T=null,u=hy,hy=null;var S=Wo,_=io;if(Yn=0,bc=Wo=null,io=0,(Pt&6)!==0)throw Error(r(331));var M=Pt;if(Pt|=4,Lw(S.current),Mw(S,S.current,_,u),Pt=M,fd(0,!1),vn&&typeof vn.onPostCommitFiberRoot=="function")try{vn.onPostCommitFiberRoot(zr,S)}catch{}return!0}finally{Y.p=y,I.T=f,eE(a,i)}}function nE(a,i,u){i=Da(u,i),i=qv(a.stateNode,i,2),a=$o(a,i,2),a!==null&&(U(a,2),Es(a))}function Ht(a,i,u){if(a.tag===3)nE(a,a,u);else for(;i!==null;){if(i.tag===3){nE(i,a,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Yo===null||!Yo.has(f))){a=Da(u,a),u=rw(2),f=$o(i,u,2),f!==null&&(aw(u,f,i,a),U(f,2),Es(f));break}}i=i.return}}function vy(a,i,u){var f=a.pingCache;if(f===null){f=a.pingCache=new R5;var y=new Set;f.set(i,y)}else y=f.get(i),y===void 0&&(y=new Set,f.set(i,y));y.has(u)||(cy=!0,y.add(u),a=A5.bind(null,a,i,u),i.then(a,a))}function A5(a,i,u){var f=a.pingCache;f!==null&&f.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Xt===a&&(Ct&u)===u&&(xn===4||xn===3&&(Ct&62914560)===Ct&&300>ye()-Lh?(Pt&2)===0&&Sc(a,0):uy|=u,xc===Ct&&(xc=0)),Es(a)}function rE(a,i){i===0&&(i=nr()),a=Qi(a,i),a!==null&&(U(a,i),Es(a))}function D5(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),rE(a,u)}function O5(a,i){var u=0;switch(a.tag){case 31:case 13:var f=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(i),rE(a,u)}function M5(a,i){return z(a,i)}var $h=null,wc=null,yy=!1,Bh=!1,xy=!1,Xo=0;function Es(a){a!==wc&&a.next===null&&(wc===null?$h=wc=a:wc=wc.next=a),Bh=!0,yy||(yy=!0,I5())}function fd(a,i){if(!xy&&Bh){xy=!0;do for(var u=!1,f=$h;f!==null;){if(a!==0){var y=f.pendingLanes;if(y===0)var S=0;else{var _=f.suspendedLanes,M=f.pingedLanes;S=(1<<31-Tn(42|a)+1)-1,S&=y&~(_&~M),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,iE(f,S))}else S=Ct,S=jn(f,f===Xt?S:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(S&3)===0||Kn(f,S)||(u=!0,iE(f,S));f=f.next}while(u);xy=!1}}function k5(){aE()}function aE(){Bh=yy=!1;var a=0;Xo!==0&&G5()&&(a=Xo);for(var i=ye(),u=null,f=$h;f!==null;){var y=f.next,S=sE(f,i);S===0?(f.next=null,u===null?$h=y:u.next=y,y===null&&(wc=u)):(u=f,(a!==0||(S&3)!==0)&&(Bh=!0)),f=y}Yn!==0&&Yn!==5||fd(a),Xo!==0&&(Xo=0)}function sE(a,i){for(var u=a.suspendedLanes,f=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var _=31-Tn(S),M=1<<_,F=y[_];F===-1?((M&u)===0||(M&f)!==0)&&(y[_]=Zn(M,i)):F<=i&&(a.expiredLanes|=M),S&=~M}if(i=Xt,u=Ct,u=jn(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,u===0||a===i&&(Vt===2||Vt===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&J(f),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Kn(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(f!==null&&J(f),Ve(u)){case 2:case 8:u=at;break;case 32:u=ht;break;case 268435456:u=Fr;break;default:u=ht}return f=oE.bind(null,a),u=z(u,f),a.callbackPriority=i,a.callbackNode=u,i}return f!==null&&f!==null&&J(f),a.callbackPriority=2,a.callbackNode=null,2}function oE(a,i){if(Yn!==0&&Yn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Hh()&&a.callbackNode!==u)return null;var f=Ct;return f=jn(a,a===Xt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(Vw(a,f,i),sE(a,ye()),a.callbackNode!=null&&a.callbackNode===u?oE.bind(null,a):null)}function iE(a,i){if(Hh())return null;Vw(a,i,!0)}function I5(){K5(function(){(Pt&6)!==0?z(Le,k5):aE()})}function by(){if(Xo===0){var a=lc;a===0&&(a=vs,vs<<=1,(vs&261888)===0&&(vs=256)),Xo=a}return Xo}function lE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Xf(""+a)}function cE(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function L5(a,i,u,f,y){if(i==="submit"&&u&&u.stateNode===y){var S=lE((y[Me]||null).action),_=f.submitter;_&&(i=(i=_[Me]||null)?lE(i.formAction):_.getAttribute("formAction"),i!==null&&(S=i,_=null));var M=new nh("action","action",null,f,y);a.push({event:M,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Xo!==0){var F=_?cE(y,_):new FormData(y);zv(u,{pending:!0,data:F,method:y.method,action:S},null,F)}}else typeof S=="function"&&(M.preventDefault(),F=_?cE(y,_):new FormData(y),zv(u,{pending:!0,data:F,method:y.method,action:S},S,F))},currentTarget:y}]})}}for(var Sy=0;Sy<rv.length;Sy++){var Cy=rv[Sy],P5=Cy.toLowerCase(),U5=Cy[0].toUpperCase()+Cy.slice(1);Wa(P5,"on"+U5)}Wa(z1,"onAnimationEnd"),Wa(V1,"onAnimationIteration"),Wa(H1,"onAnimationStart"),Wa("dblclick","onDoubleClick"),Wa("focusin","onFocus"),Wa("focusout","onBlur"),Wa(e5,"onTransitionRun"),Wa(t5,"onTransitionStart"),Wa(n5,"onTransitionCancel"),Wa($1,"onTransitionEnd"),gt("onMouseEnter",["mouseout","mouseover"]),gt("onMouseLeave",["mouseout","mouseover"]),gt("onPointerEnter",["pointerout","pointerover"]),gt("onPointerLeave",["pointerout","pointerover"]),ja("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ja("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ja("onBeforeInput",["compositionend","keypress","textInput","paste"]),ja("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ja("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ja("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),F5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hd));function uE(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var f=a[u],y=f.event;f=f.listeners;e:{var S=void 0;if(i)for(var _=f.length-1;0<=_;_--){var M=f[_],F=M.instance,te=M.currentTarget;if(M=M.listener,F!==S&&y.isPropagationStopped())break e;S=M,y.currentTarget=te;try{S(y)}catch(he){sh(he)}y.currentTarget=null,S=F}else for(_=0;_<f.length;_++){if(M=f[_],F=M.instance,te=M.currentTarget,M=M.listener,F!==S&&y.isPropagationStopped())break e;S=M,y.currentTarget=te;try{S(y)}catch(he){sh(he)}y.currentTarget=null,S=F}}}}function St(a,i){var u=i[Ft];u===void 0&&(u=i[Ft]=new Set);var f=a+"__bubble";u.has(f)||(dE(i,a,2,!1),u.add(f))}function wy(a,i,u){var f=0;i&&(f|=4),dE(u,a,f,i)}var Gh="_reactListening"+Math.random().toString(36).slice(2);function Ey(a){if(!a[Gh]){a[Gh]=!0,xs.forEach(function(u){u!=="selectionchange"&&(F5.has(u)||wy(u,!1,a),wy(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[Gh]||(i[Gh]=!0,wy("selectionchange",!1,i))}}function dE(a,i,u,f){switch(zE(i)){case 2:var y=hk;break;case 8:y=mk;break;default:y=Fy}u=y.bind(null,i,u,a),y=void 0,!Bg||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),f?y!==void 0?a.addEventListener(i,u,{capture:!0,passive:y}):a.addEventListener(i,u,!0):y!==void 0?a.addEventListener(i,u,{passive:y}):a.addEventListener(i,u,!1)}function Ry(a,i,u,f,y){var S=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var _=f.tag;if(_===3||_===4){var M=f.stateNode.containerInfo;if(M===y)break;if(_===4)for(_=f.return;_!==null;){var F=_.tag;if((F===3||F===4)&&_.stateNode.containerInfo===y)return;_=_.return}for(;M!==null;){if(_=Ta(M),_===null)return;if(F=_.tag,F===5||F===6||F===26||F===27){f=S=_;continue e}M=M.parentNode}}f=f.return}g1(function(){var te=S,he=Hg(u),pe=[];e:{var ae=B1.get(a);if(ae!==void 0){var ce=nh,He=a;switch(a){case"keypress":if(eh(u)===0)break e;case"keydown":case"keyup":ce=OM;break;case"focusin":He="focus",ce=Zg;break;case"focusout":He="blur",ce=Zg;break;case"beforeblur":case"afterblur":ce=Zg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=x1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=bM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=IM;break;case z1:case V1:case H1:ce=wM;break;case $1:ce=PM;break;case"scroll":case"scrollend":ce=yM;break;case"wheel":ce=FM;break;case"copy":case"cut":case"paste":ce=RM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=S1;break;case"toggle":case"beforetoggle":ce=VM}var et=(i&4)!==0,Kt=!et&&(a==="scroll"||a==="scrollend"),X=et?ae!==null?ae+"Capture":null:ae;et=[];for(var $=te,ee;$!==null;){var me=$;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||X===null||(me=Iu($,X),me!=null&&et.push(md($,me,ee))),Kt)break;$=$.return}0<et.length&&(ae=new ce(ae,He,null,u,he),pe.push({event:ae,listeners:et}))}}if((i&7)===0){e:{if(ae=a==="mouseover"||a==="pointerover",ce=a==="mouseout"||a==="pointerout",ae&&u!==Vg&&(He=u.relatedTarget||u.fromElement)&&(Ta(He)||He[st]))break e;if((ce||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ce?(He=u.relatedTarget||u.toElement,ce=te,He=He?Ta(He):null,He!==null&&(Kt=l(He),et=He.tag,He!==Kt||et!==5&&et!==27&&et!==6)&&(He=null)):(ce=null,He=te),ce!==He)){if(et=x1,me="onMouseLeave",X="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(et=S1,me="onPointerLeave",X="onPointerEnter",$="pointer"),Kt=ce==null?ae:Sr(ce),ee=He==null?ae:Sr(He),ae=new et(me,$+"leave",ce,u,he),ae.target=Kt,ae.relatedTarget=ee,me=null,Ta(he)===te&&(et=new et(X,$+"enter",He,u,he),et.target=ee,et.relatedTarget=Kt,me=et),Kt=me,ce&&He)t:{for(et=z5,X=ce,$=He,ee=0,me=X;me;me=et(me))ee++;me=0;for(var Xe=$;Xe;Xe=et(Xe))me++;for(;0<ee-me;)X=et(X),ee--;for(;0<me-ee;)$=et($),me--;for(;ee--;){if(X===$||$!==null&&X===$.alternate){et=X;break t}X=et(X),$=et($)}et=null}else et=null;ce!==null&&fE(pe,ae,ce,et,!1),He!==null&&Kt!==null&&fE(pe,Kt,He,et,!0)}}e:{if(ae=te?Sr(te):window,ce=ae.nodeName&&ae.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ae.type==="file")var Mt=N1;else if(j1(ae))if(A1)Mt=QM;else{Mt=YM;var Ke=ZM}else ce=ae.nodeName,!ce||ce.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?te&&zg(te.elementType)&&(Mt=N1):Mt=WM;if(Mt&&(Mt=Mt(a,te))){_1(pe,Mt,u,he);break e}Ke&&Ke(a,ae,te),a==="focusout"&&te&&ae.type==="number"&&te.memoizedProps.value!=null&&Fg(ae,"number",ae.value)}switch(Ke=te?Sr(te):window,a){case"focusin":(j1(Ke)||Ke.contentEditable==="true")&&(ec=Ke,ev=te,$u=null);break;case"focusout":$u=ev=ec=null;break;case"mousedown":tv=!0;break;case"contextmenu":case"mouseup":case"dragend":tv=!1,U1(pe,u,he);break;case"selectionchange":if(JM)break;case"keydown":case"keyup":U1(pe,u,he)}var mt;if(Wg)e:{switch(a){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else Jl?R1(a,u)&&(wt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(wt="onCompositionStart");wt&&(C1&&u.locale!=="ko"&&(Jl||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&Jl&&(mt=v1()):(Lo=he,Gg="value"in Lo?Lo.value:Lo.textContent,Jl=!0)),Ke=qh(te,wt),0<Ke.length&&(wt=new b1(wt,a,null,u,he),pe.push({event:wt,listeners:Ke}),mt?wt.data=mt:(mt=T1(u),mt!==null&&(wt.data=mt)))),(mt=$M?BM(a,u):GM(a,u))&&(wt=qh(te,"onBeforeInput"),0<wt.length&&(Ke=new b1("onBeforeInput","beforeinput",null,u,he),pe.push({event:Ke,listeners:wt}),Ke.data=mt)),L5(pe,a,te,u,he)}uE(pe,i)})}function md(a,i,u){return{instance:a,listener:i,currentTarget:u}}function qh(a,i){for(var u=i+"Capture",f=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Iu(a,u),y!=null&&f.unshift(md(a,y,S)),y=Iu(a,i),y!=null&&f.push(md(a,y,S))),a.tag===3)return f;a=a.return}return[]}function z5(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function fE(a,i,u,f,y){for(var S=i._reactName,_=[];u!==null&&u!==f;){var M=u,F=M.alternate,te=M.stateNode;if(M=M.tag,F!==null&&F===f)break;M!==5&&M!==26&&M!==27||te===null||(F=te,y?(te=Iu(u,S),te!=null&&_.unshift(md(u,te,F))):y||(te=Iu(u,S),te!=null&&_.push(md(u,te,F)))),u=u.return}_.length!==0&&a.push({event:i,listeners:_})}var V5=/\r\n?/g,H5=/\u0000|\uFFFD/g;function hE(a){return(typeof a=="string"?a:""+a).replace(V5,`
|
|
49
|
-
`).replace(H5,"")}function mE(a,i){return i=hE(i),hE(a)===i}function qt(a,i,u,f,y,S){switch(u){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||Wl(a,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&Wl(a,""+f);break;case"className":Ki(a,"class",f);break;case"tabIndex":Ki(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Ki(a,u,f);break;case"style":m1(a,f,S);break;case"data":if(i!=="object"){Ki(a,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=Xf(""+f),a.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(i!=="input"&&qt(a,i,"name",y.name,y,null),qt(a,i,"formEncType",y.formEncType,y,null),qt(a,i,"formMethod",y.formMethod,y,null),qt(a,i,"formTarget",y.formTarget,y,null)):(qt(a,i,"encType",y.encType,y,null),qt(a,i,"method",y.method,y,null),qt(a,i,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=Xf(""+f),a.setAttribute(u,f);break;case"onClick":f!=null&&(a.onclick=qs);break;case"onScroll":f!=null&&St("scroll",a);break;case"onScrollEnd":f!=null&&St("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){a.removeAttribute("xlink:href");break}u=Xf(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""+f):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":f===!0?a.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,f):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(u,f):a.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(u):a.setAttribute(u,f);break;case"popover":St("beforetoggle",a),St("toggle",a),Gs(a,"popover",f);break;case"xlinkActuate":Ya(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ya(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ya(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ya(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ya(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ya(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ya(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ya(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ya(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Gs(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gM.get(u)||u,Gs(a,u,f))}}function Ty(a,i,u,f,y,S){switch(u){case"style":m1(a,f,S);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof f=="string"?Wl(a,f):(typeof f=="number"||typeof f=="bigint")&&Wl(a,""+f);break;case"onScroll":f!=null&&St("scroll",a);break;case"onScrollEnd":f!=null&&St("scrollend",a);break;case"onClick":f!=null&&(a.onclick=qs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qi.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),i=u.slice(2,y?u.length-7:void 0),S=a[Me]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(i,S,y),typeof f=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,f,y);break e}u in a?a[u]=f:f===!0?a.setAttribute(u,""):Gs(a,u,f)}}}function gr(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",a),St("load",a);var f=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var _=u[S];if(_!=null)switch(S){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:qt(a,i,S,_,u,null)}}y&&qt(a,i,"srcSet",u.srcSet,u,null),f&&qt(a,i,"src",u.src,u,null);return;case"input":St("invalid",a);var M=S=_=y=null,F=null,te=null;for(f in u)if(u.hasOwnProperty(f)){var he=u[f];if(he!=null)switch(f){case"name":y=he;break;case"type":_=he;break;case"checked":F=he;break;case"defaultChecked":te=he;break;case"value":S=he;break;case"defaultValue":M=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:qt(a,i,f,he,u,null)}}u1(a,S,M,F,te,_,y,!1);return;case"select":St("invalid",a),f=_=S=null;for(y in u)if(u.hasOwnProperty(y)&&(M=u[y],M!=null))switch(y){case"value":S=M;break;case"defaultValue":_=M;break;case"multiple":f=M;default:qt(a,i,y,M,u,null)}i=S,u=_,a.multiple=!!f,i!=null?Yl(a,!!f,i,!1):u!=null&&Yl(a,!!f,u,!0);return;case"textarea":St("invalid",a),S=y=f=null;for(_ in u)if(u.hasOwnProperty(_)&&(M=u[_],M!=null))switch(_){case"value":f=M;break;case"defaultValue":y=M;break;case"children":S=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:qt(a,i,_,M,u,null)}f1(a,f,y,S);return;case"option":for(F in u)if(u.hasOwnProperty(F)&&(f=u[F],f!=null))switch(F){case"selected":a.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:qt(a,i,F,f,u,null)}return;case"dialog":St("beforetoggle",a),St("toggle",a),St("cancel",a),St("close",a);break;case"iframe":case"object":St("load",a);break;case"video":case"audio":for(f=0;f<hd.length;f++)St(hd[f],a);break;case"image":St("error",a),St("load",a);break;case"details":St("toggle",a);break;case"embed":case"source":case"link":St("error",a),St("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(f=u[te],f!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:qt(a,i,te,f,u,null)}return;default:if(zg(i)){for(he in u)u.hasOwnProperty(he)&&(f=u[he],f!==void 0&&Ty(a,i,he,f,u,void 0));return}}for(M in u)u.hasOwnProperty(M)&&(f=u[M],f!=null&&qt(a,i,M,f,u,null))}function $5(a,i,u,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,_=null,M=null,F=null,te=null,he=null;for(ce in u){var pe=u[ce];if(u.hasOwnProperty(ce)&&pe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":F=pe;default:f.hasOwnProperty(ce)||qt(a,i,ce,null,f,pe)}}for(var ae in f){var ce=f[ae];if(pe=u[ae],f.hasOwnProperty(ae)&&(ce!=null||pe!=null))switch(ae){case"type":S=ce;break;case"name":y=ce;break;case"checked":te=ce;break;case"defaultChecked":he=ce;break;case"value":_=ce;break;case"defaultValue":M=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,i));break;default:ce!==pe&&qt(a,i,ae,ce,f,pe)}}Ug(a,_,M,F,te,he,S,y);return;case"select":ce=_=M=ae=null;for(S in u)if(F=u[S],u.hasOwnProperty(S)&&F!=null)switch(S){case"value":break;case"multiple":ce=F;default:f.hasOwnProperty(S)||qt(a,i,S,null,f,F)}for(y in f)if(S=f[y],F=u[y],f.hasOwnProperty(y)&&(S!=null||F!=null))switch(y){case"value":ae=S;break;case"defaultValue":M=S;break;case"multiple":_=S;default:S!==F&&qt(a,i,y,S,f,F)}i=M,u=_,f=ce,ae!=null?Yl(a,!!u,ae,!1):!!f!=!!u&&(i!=null?Yl(a,!!u,i,!0):Yl(a,!!u,u?[]:"",!1));return;case"textarea":ce=ae=null;for(M in u)if(y=u[M],u.hasOwnProperty(M)&&y!=null&&!f.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:qt(a,i,M,null,f,y)}for(_ in f)if(y=f[_],S=u[_],f.hasOwnProperty(_)&&(y!=null||S!=null))switch(_){case"value":ae=y;break;case"defaultValue":ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&qt(a,i,_,y,f,S)}d1(a,ae,ce);return;case"option":for(var He in u)if(ae=u[He],u.hasOwnProperty(He)&&ae!=null&&!f.hasOwnProperty(He))switch(He){case"selected":a.selected=!1;break;default:qt(a,i,He,null,f,ae)}for(F in f)if(ae=f[F],ce=u[F],f.hasOwnProperty(F)&&ae!==ce&&(ae!=null||ce!=null))switch(F){case"selected":a.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:qt(a,i,F,ae,f,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var et in u)ae=u[et],u.hasOwnProperty(et)&&ae!=null&&!f.hasOwnProperty(et)&&qt(a,i,et,null,f,ae);for(te in f)if(ae=f[te],ce=u[te],f.hasOwnProperty(te)&&ae!==ce&&(ae!=null||ce!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,i));break;default:qt(a,i,te,ae,f,ce)}return;default:if(zg(i)){for(var Kt in u)ae=u[Kt],u.hasOwnProperty(Kt)&&ae!==void 0&&!f.hasOwnProperty(Kt)&&Ty(a,i,Kt,void 0,f,ae);for(he in f)ae=f[he],ce=u[he],!f.hasOwnProperty(he)||ae===ce||ae===void 0&&ce===void 0||Ty(a,i,he,ae,f,ce);return}}for(var X in u)ae=u[X],u.hasOwnProperty(X)&&ae!=null&&!f.hasOwnProperty(X)&&qt(a,i,X,null,f,ae);for(pe in f)ae=f[pe],ce=u[pe],!f.hasOwnProperty(pe)||ae===ce||ae==null&&ce==null||qt(a,i,pe,ae,f,ce)}function pE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B5(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var y=u[f],S=y.transferSize,_=y.initiatorType,M=y.duration;if(S&&M&&pE(_)){for(_=0,M=y.responseEnd,f+=1;f<u.length;f++){var F=u[f],te=F.startTime;if(te>M)break;var he=F.transferSize,pe=F.initiatorType;he&&pE(pe)&&(F=F.responseEnd,_+=he*(F<M?1:(M-te)/(F-te)))}if(--f,i+=8*(S+_)/(y.duration/1e3),a++,10<a)break}}if(0<a)return i/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var jy=null,_y=null;function Kh(a){return a.nodeType===9?a:a.ownerDocument}function gE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vE(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function Ny(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ay=null;function G5(){var a=window.event;return a&&a.type==="popstate"?a===Ay?!1:(Ay=a,!0):(Ay=null,!1)}var yE=typeof setTimeout=="function"?setTimeout:void 0,q5=typeof clearTimeout=="function"?clearTimeout:void 0,xE=typeof Promise=="function"?Promise:void 0,K5=typeof queueMicrotask=="function"?queueMicrotask:typeof xE<"u"?function(a){return xE.resolve(null).then(a).catch(Z5)}:yE;function Z5(a){setTimeout(function(){throw a})}function Jo(a){return a==="head"}function bE(a,i){var u=i,f=0;do{var y=u.nextSibling;if(a.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(f===0){a.removeChild(y),jc(i);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")pd(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,pd(u);for(var S=u.firstChild;S;){var _=S.nextSibling,M=S.nodeName;S[Lt]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=_}}else u==="body"&&pd(a.ownerDocument.body);u=y}while(u);jc(i)}function SE(a,i){var u=a;a=0;do{var f=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=f}while(u)}function Dy(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Dy(u),Za(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function Y5(a,i,u,f){for(;a.nodeType===1;){var y=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[Lt])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=La(a.nextSibling),a===null)break}return null}function W5(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=La(a.nextSibling),a===null))return null;return a}function CE(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=La(a.nextSibling),a===null))return null;return a}function Oy(a){return a.data==="$?"||a.data==="$~"}function My(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function Q5(a,i){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||u.readyState!=="loading")i();else{var f=function(){i(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function La(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return a}var ky=null;function wE(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(i===0)return La(a.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}a=a.nextSibling}return null}function EE(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return a;i--}else u!=="/$"&&u!=="/&"||i++}a=a.previousSibling}return null}function RE(a,i,u){switch(i=Kh(u),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function pd(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);Za(a)}var Pa=new Map,TE=new Set;function Zh(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var lo=Y.d;Y.d={f:X5,r:J5,D:ek,C:tk,L:nk,m:rk,X:sk,S:ak,M:ok};function X5(){var a=lo.f(),i=Fh();return a||i}function J5(a){var i=Mr(a);i!==null&&i.tag===5&&i.type==="form"?$C(i):lo.r(a)}var Ec=typeof document>"u"?null:document;function jE(a,i,u){var f=Ec;if(f&&typeof i=="string"&&i){var y=Na(i);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),TE.has(y)||(TE.add(y),a={rel:a,crossOrigin:u,href:i},f.querySelector(y)===null&&(i=f.createElement("link"),gr(i,"link",a),un(i),f.head.appendChild(i)))}}function ek(a){lo.D(a),jE("dns-prefetch",a,null)}function tk(a,i){lo.C(a,i),jE("preconnect",a,i)}function nk(a,i,u){lo.L(a,i,u);var f=Ec;if(f&&a&&i){var y='link[rel="preload"][as="'+Na(i)+'"]';i==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Na(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Na(u.imageSizes)+'"]')):y+='[href="'+Na(a)+'"]';var S=y;switch(i){case"style":S=Rc(a);break;case"script":S=Tc(a)}Pa.has(S)||(a=v({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),Pa.set(S,a),f.querySelector(y)!==null||i==="style"&&f.querySelector(gd(S))||i==="script"&&f.querySelector(vd(S))||(i=f.createElement("link"),gr(i,"link",a),un(i),f.head.appendChild(i)))}}function rk(a,i){lo.m(a,i);var u=Ec;if(u&&a){var f=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Na(f)+'"][href="'+Na(a)+'"]',S=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Tc(a)}if(!Pa.has(S)&&(a=v({rel:"modulepreload",href:a},i),Pa.set(S,a),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(vd(S)))return}f=u.createElement("link"),gr(f,"link",a),un(f),u.head.appendChild(f)}}}function ak(a,i,u){lo.S(a,i,u);var f=Ec;if(f&&a){var y=ys(f).hoistableStyles,S=Rc(a);i=i||"default";var _=y.get(S);if(!_){var M={loading:0,preload:null};if(_=f.querySelector(gd(S)))M.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":i},u),(u=Pa.get(S))&&Iy(a,u);var F=_=f.createElement("link");un(F),gr(F,"link",a),F._p=new Promise(function(te,he){F.onload=te,F.onerror=he}),F.addEventListener("load",function(){M.loading|=1}),F.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Yh(_,i,f)}_={type:"stylesheet",instance:_,count:1,state:M},y.set(S,_)}}}function sk(a,i){lo.X(a,i);var u=Ec;if(u&&a){var f=ys(u).hoistableScripts,y=Tc(a),S=f.get(y);S||(S=u.querySelector(vd(y)),S||(a=v({src:a,async:!0},i),(i=Pa.get(y))&&Ly(a,i),S=u.createElement("script"),un(S),gr(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(y,S))}}function ok(a,i){lo.M(a,i);var u=Ec;if(u&&a){var f=ys(u).hoistableScripts,y=Tc(a),S=f.get(y);S||(S=u.querySelector(vd(y)),S||(a=v({src:a,async:!0,type:"module"},i),(i=Pa.get(y))&&Ly(a,i),S=u.createElement("script"),un(S),gr(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(y,S))}}function _E(a,i,u,f){var y=(y=ge.current)?Zh(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Rc(u.href),u=ys(y).hoistableStyles,f=u.get(i),f||(f={type:"style",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Rc(u.href);var S=ys(y).hoistableStyles,_=S.get(a);if(_||(y=y.ownerDocument||y,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,_),(S=y.querySelector(gd(a)))&&!S._p&&(_.instance=S,_.state.loading=5),Pa.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Pa.set(a,u),S||ik(y,a,u,_.state))),i&&f===null)throw Error(r(528,""));return _}if(i&&f!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Tc(u),u=ys(y).hoistableScripts,f=u.get(i),f||(f={type:"script",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Rc(a){return'href="'+Na(a)+'"'}function gd(a){return'link[rel="stylesheet"]['+a+"]"}function NE(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function ik(a,i,u,f){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=a.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),gr(i,"link",u),un(i),a.head.appendChild(i))}function Tc(a){return'[src="'+Na(a)+'"]'}function vd(a){return"script[async]"+a}function AE(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var f=a.querySelector('style[data-href~="'+Na(u.href)+'"]');if(f)return i.instance=f,un(f),f;var y=v({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),un(f),gr(f,"style",y),Yh(f,u.precedence,a),i.instance=f;case"stylesheet":y=Rc(u.href);var S=a.querySelector(gd(y));if(S)return i.state.loading|=4,i.instance=S,un(S),S;f=NE(u),(y=Pa.get(y))&&Iy(f,y),S=(a.ownerDocument||a).createElement("link"),un(S);var _=S;return _._p=new Promise(function(M,F){_.onload=M,_.onerror=F}),gr(S,"link",f),i.state.loading|=4,Yh(S,u.precedence,a),i.instance=S;case"script":return S=Tc(u.src),(y=a.querySelector(vd(S)))?(i.instance=y,un(y),y):(f=u,(y=Pa.get(S))&&(f=v({},u),Ly(f,y)),a=a.ownerDocument||a,y=a.createElement("script"),un(y),gr(y,"link",f),a.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,Yh(f,u.precedence,a));return i.instance}function Yh(a,i,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=f.length?f[f.length-1]:null,S=y,_=0;_<f.length;_++){var M=f[_];if(M.dataset.precedence===i)S=M;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function Iy(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function Ly(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var Wh=null;function DE(a,i,u){if(Wh===null){var f=new Map,y=Wh=new Map;y.set(u,f)}else y=Wh,f=y.get(u),f||(f=new Map,y.set(u,f));if(f.has(a))return f;for(f.set(a,null),u=u.getElementsByTagName(a),y=0;y<u.length;y++){var S=u[y];if(!(S[Lt]||S[Ue]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var _=S.getAttribute(i)||"";_=a+_;var M=f.get(_);M?M.push(S):f.set(_,[S])}}return f}function OE(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function lk(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function ME(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function ck(a,i,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Rc(f.href),S=i.querySelector(gd(y));if(S){i=S._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=Qh.bind(a),i.then(a,a)),u.state.loading|=4,u.instance=S,un(S);return}S=i.ownerDocument||i,f=NE(f),(y=Pa.get(y))&&Iy(f,y),S=S.createElement("link"),un(S);var _=S;_._p=new Promise(function(M,F){_.onload=M,_.onerror=F}),gr(S,"link",f),u.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=Qh.bind(a),i.addEventListener("load",u),i.addEventListener("error",u))}}var Py=0;function uk(a,i){return a.stylesheets&&a.count===0&&Jh(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var f=setTimeout(function(){if(a.stylesheets&&Jh(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+i);0<a.imgBytes&&Py===0&&(Py=62500*B5());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Jh(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Py?50:800)+i);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(f),clearTimeout(y)}}:null}function Qh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jh(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Xh=null;function Jh(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Xh=new Map,i.forEach(dk,a),Xh=null,Qh.call(a))}function dk(a,i){if(!(i.state.loading&4)){var u=Xh.get(a);if(u)var f=u.get(null);else{u=new Map,Xh.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var _=y[S];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(u.set(_.dataset.precedence,_),f=_)}f&&u.set(null,f)}y=i.instance,_=y.getAttribute("data-precedence"),S=u.get(_)||f,S===f&&u.set(null,y),u.set(_,y),this.count++,f=Qh.bind(this),y.addEventListener("load",f),y.addEventListener("error",f),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),i.state.loading|=4}}var yd={$$typeof:j,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function fk(a,i,u,f,y,S,_,M,F){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=br(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=br(0),this.hiddenUpdates=br(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function kE(a,i,u,f,y,S,_,M,F,te,he,pe){return a=new fk(a,i,u,_,F,te,he,pe,M),i=1,S===!0&&(i|=24),S=na(3,null,null,i),a.current=S,S.stateNode=a,i=gv(),i.refCount++,a.pooledCache=i,i.refCount++,S.memoizedState={element:f,isDehydrated:u,cache:i},bv(S),a}function IE(a){return a?(a=rc,a):rc}function LE(a,i,u,f,y,S){y=IE(y),f.context===null?f.context=y:f.pendingContext=y,f=Ho(i),f.payload={element:u},S=S===void 0?null:S,S!==null&&(f.callback=S),u=$o(a,f,i),u!==null&&(qr(u,a,i),Wu(u,a,i))}function PE(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function Uy(a,i){PE(a,i),(a=a.alternate)&&PE(a,i)}function UE(a){if(a.tag===13||a.tag===31){var i=Qi(a,67108864);i!==null&&qr(i,a,67108864),Uy(a,67108864)}}function FE(a){if(a.tag===13||a.tag===31){var i=ia();i=Fe(i);var u=Qi(a,i);u!==null&&qr(u,a,i),Uy(a,i)}}var em=!0;function hk(a,i,u,f){var y=I.T;I.T=null;var S=Y.p;try{Y.p=2,Fy(a,i,u,f)}finally{Y.p=S,I.T=y}}function mk(a,i,u,f){var y=I.T;I.T=null;var S=Y.p;try{Y.p=8,Fy(a,i,u,f)}finally{Y.p=S,I.T=y}}function Fy(a,i,u,f){if(em){var y=zy(f);if(y===null)Ry(a,i,f,tm,u),VE(a,f);else if(gk(y,a,i,u,f))f.stopPropagation();else if(VE(a,f),i&4&&-1<pk.indexOf(a)){for(;y!==null;){var S=Mr(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var _=hn(S.pendingLanes);if(_!==0){var M=S;for(M.pendingLanes|=2,M.entangledLanes|=2;_;){var F=1<<31-Tn(_);M.entanglements[1]|=F,_&=~F}Es(S),(Pt&6)===0&&(Ph=ye()+500,fd(0))}}break;case 31:case 13:M=Qi(S,2),M!==null&&qr(M,S,2),Fh(),Uy(S,2)}if(S=zy(f),S===null&&Ry(a,i,f,tm,u),S===y)break;y=S}y!==null&&f.stopPropagation()}else Ry(a,i,f,null,u)}}function zy(a){return a=Hg(a),Vy(a)}var tm=null;function Vy(a){if(tm=null,a=Ta(a),a!==null){var i=l(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=c(i),a!==null)return a;a=null}else if(u===31){if(a=d(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return tm=a,null}function zE(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case Le:return 2;case at:return 8;case ht:case gn:return 32;case Fr:return 268435456;default:return 32}default:return 32}}var Hy=!1,ei=null,ti=null,ni=null,xd=new Map,bd=new Map,ri=[],pk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function VE(a,i){switch(a){case"focusin":case"focusout":ei=null;break;case"dragenter":case"dragleave":ti=null;break;case"mouseover":case"mouseout":ni=null;break;case"pointerover":case"pointerout":xd.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":bd.delete(i.pointerId)}}function Sd(a,i,u,f,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:S,targetContainers:[y]},i!==null&&(i=Mr(i),i!==null&&UE(i)),a):(a.eventSystemFlags|=f,i=a.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),a)}function gk(a,i,u,f,y){switch(i){case"focusin":return ei=Sd(ei,a,i,u,f,y),!0;case"dragenter":return ti=Sd(ti,a,i,u,f,y),!0;case"mouseover":return ni=Sd(ni,a,i,u,f,y),!0;case"pointerover":var S=y.pointerId;return xd.set(S,Sd(xd.get(S)||null,a,i,u,f,y)),!0;case"gotpointercapture":return S=y.pointerId,bd.set(S,Sd(bd.get(S)||null,a,i,u,f,y)),!0}return!1}function HE(a){var i=Ta(a.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){a.blockedOn=i,Ge(a.priority,function(){FE(u)});return}}else if(i===31){if(i=d(u),i!==null){a.blockedOn=i,Ge(a.priority,function(){FE(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function nm(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=zy(a.nativeEvent);if(u===null){u=a.nativeEvent;var f=new u.constructor(u.type,u);Vg=f,u.target.dispatchEvent(f),Vg=null}else return i=Mr(u),i!==null&&UE(i),a.blockedOn=u,!1;i.shift()}return!0}function $E(a,i,u){nm(a)&&u.delete(i)}function vk(){Hy=!1,ei!==null&&nm(ei)&&(ei=null),ti!==null&&nm(ti)&&(ti=null),ni!==null&&nm(ni)&&(ni=null),xd.forEach($E),bd.forEach($E)}function rm(a,i){a.blockedOn===i&&(a.blockedOn=null,Hy||(Hy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,vk)))}var am=null;function BE(a){am!==a&&(am=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){am===a&&(am=null);for(var i=0;i<a.length;i+=3){var u=a[i],f=a[i+1],y=a[i+2];if(typeof f!="function"){if(Vy(f||u)===null)continue;break}var S=Mr(u);S!==null&&(a.splice(i,3),i-=3,zv(S,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function jc(a){function i(F){return rm(F,a)}ei!==null&&rm(ei,a),ti!==null&&rm(ti,a),ni!==null&&rm(ni,a),xd.forEach(i),bd.forEach(i);for(var u=0;u<ri.length;u++){var f=ri[u];f.blockedOn===a&&(f.blockedOn=null)}for(;0<ri.length&&(u=ri[0],u.blockedOn===null);)HE(u),u.blockedOn===null&&ri.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var y=u[f],S=u[f+1],_=y[Me]||null;if(typeof S=="function")_||BE(u);else if(_){var M=null;if(S&&S.hasAttribute("formAction")){if(y=S,_=S[Me]||null)M=_.formAction;else if(Vy(y)!==null)continue}else M=_.action;typeof M=="function"?u[f+1]=M:(u.splice(f,3),f-=3),BE(u)}}}function GE(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(_){return y=_})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function $y(a){this._internalRoot=a}sm.prototype.render=$y.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,f=ia();LE(u,f,a,i,null,null)},sm.prototype.unmount=$y.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;LE(a.current,2,null,a,null,null),Fh(),i[st]=null}};function sm(a){this._internalRoot=a}sm.prototype.unstable_scheduleHydration=function(a){if(a){var i=Ie();a={blockedOn:null,target:a,priority:i};for(var u=0;u<ri.length&&i!==0&&i<ri[u].priority;u++);ri.splice(u,0,a),u===0&&HE(a)}};var qE=t.version;if(qE!=="19.2.0")throw Error(r(527,qE,"19.2.0"));Y.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=m(i),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var yk={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var om=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!om.isDisabled&&om.supportsFiber)try{zr=om.inject(yk),vn=om}catch{}}return wd.createRoot=function(a,i){if(!s(a))throw Error(r(299));var u=!1,f="",y=JC,S=ew,_=tw;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(_=i.onRecoverableError)),i=kE(a,1,!1,null,null,u,f,null,y,S,_,GE),a[st]=i.current,Ey(a),new $y(i)},wd.hydrateRoot=function(a,i,u){if(!s(a))throw Error(r(299));var f=!1,y="",S=JC,_=ew,M=tw,F=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(_=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError),u.formState!==void 0&&(F=u.formState)),i=kE(a,1,!0,i,u??null,f,y,F,S,_,M,GE),i.context=IE(null),u=i.current,f=ia(),f=Fe(f),y=Ho(f),y.callback=null,$o(u,y,f),u=f,i.current.lanes=u,U(i,u),Es(i),a[st]=i.current,Ey(a),new sm(i)},wd.version="19.2.0",wd}var nR;function Ak(){if(nR)return qy.exports;nR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qy.exports=Nk(),qy.exports}var Dk=Ak();/**
|
|
50
|
-
* react-router v7.9.4
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var KT=e=>{throw TypeError(e)},Ok=(e,t,n)=>t.has(e)||KT("Cannot "+n),Wy=(e,t,n)=>(Ok(e,t,"read from private field"),n?n.call(e):t.get(e)),Mk=(e,t,n)=>t.has(e)?KT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),rR="popstate";function kk(e={}){function t(r,s){let{pathname:l,search:c,hash:d}=r.location;return Yd("",{pathname:l,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ci(s)}return Lk(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function On(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ik(){return Math.random().toString(36).substring(2,10)}function aR(e,t){return{usr:e.state,key:e.key,idx:t}}function Yd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Di(t):t,state:n,key:t&&t.key||r||Ik()}}function Ci({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Di(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Lk(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,c=s.history,d="POP",h=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function v(){d="POP";let E=g(),R=E==null?null:E-m;m=E,h&&h({action:d,location:C.location,delta:R})}function x(E,R){d="PUSH";let T=Yd(C.location,E,R);m=g()+1;let j=aR(T,m),O=C.createHref(T);try{c.pushState(j,"",O)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(O)}l&&h&&h({action:d,location:C.location,delta:1})}function b(E,R){d="REPLACE";let T=Yd(C.location,E,R);m=g();let j=aR(T,m),O=C.createHref(T);c.replaceState(j,"",O),l&&h&&h({action:d,location:C.location,delta:0})}function w(E){return ZT(E)}let C={get action(){return d},get location(){return e(s,c)},listen(E){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(rR,v),h=E,()=>{s.removeEventListener(rR,v),h=null}},createHref(E){return t(s,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:b,go(E){return c.go(E)}};return C}function ZT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ci(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ld,sR=class{constructor(e){if(Mk(this,Ld,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Wy(this,Ld).has(e))return Wy(this,Ld).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Wy(this,Ld).set(e,t)}};Ld=new WeakMap;var Pk=new Set(["lazy","caseSensitive","path","id","index","children"]);function Uk(e){return Pk.has(e)}var Fk=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function zk(e){return Fk.has(e)}function Vk(e){return e.index===!0}function Wd(e,t,n=[],r={},s=!1){return e.map((l,c)=>{let d=[...n,String(c)],h=typeof l.id=="string"?l.id:d.join("-");if(xt(l.index!==!0||!l.children,"Cannot specify children on an index route"),xt(s||!r[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),Vk(l)){let m={...l,...t(l),id:h};return r[h]=m,m}else{let m={...l,...t(l),id:h,children:void 0};return r[h]=m,l.children&&(m.children=Wd(l.children,t,d,r,s)),m}})}function ui(e,t,n="/"){return Dm(e,t,n,!1)}function Dm(e,t,n,r){let s=typeof t=="string"?Di(t):t,l=Va(s.pathname||"/",n);if(l==null)return null;let c=YT(e);$k(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let m=eI(l);d=Xk(c[h],m,r)}return d}function Hk(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function YT(e,t=[],n=[],r="",s=!1){let l=(c,d,h=s,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;xt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let v=Ms([r,g.relativePath]),x=n.concat(g);c.children&&c.children.length>0&&(xt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),YT(c.children,t,x,v,h)),!(c.path==null&&!c.index)&&t.push({path:v,score:Wk(v,c.index),routesMeta:x})};return e.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))l(c,d);else for(let m of WT(c.path))l(c,d,!0,m)}),t}function WT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let c=WT(r.join("/")),d=[];return d.push(...c.map(h=>h===""?l:[l,h].join("/"))),s&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function $k(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Qk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Bk=/^:[\w-]+$/,Gk=3,qk=2,Kk=1,Zk=10,Yk=-2,oR=e=>e==="*";function Wk(e,t){let n=e.split("/"),r=n.length;return n.some(oR)&&(r+=Yk),t&&(r+=qk),n.filter(s=>!oR(s)).reduce((s,l)=>s+(Bk.test(l)?Gk:l===""?Kk:Zk),r)}function Qk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Xk(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",c=[];for(let d=0;d<r.length;++d){let h=r[d],m=d===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",v=Gm({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),x=h.route;if(!v&&m&&n&&!r[r.length-1].route.index&&(v=Gm({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:Ms([l,v.pathname]),pathnameBase:aI(Ms([l,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(l=Ms([l,v.pathnameBase]))}return c}function Gm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Jk(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:r.reduce((m,{paramName:g,isOptional:v},x)=>{if(g==="*"){let w=d[x]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return v&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function Jk(e,t=!1,n=!0){On(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h)=>(r.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function eI(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return On(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Va(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function tI({basename:e,pathname:t}){return t==="/"?e:Ms([e,t])}function nI(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Di(e):e;return{pathname:n?n.startsWith("/")?n:rI(n,t):t,search:sI(r),hash:oI(s)}}function rI(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Qy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function QT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Op(e){let t=QT(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Mp(e,t,n,r=!1){let s;typeof e=="string"?s=Di(e):(s={...e},xt(!s.pathname||!s.pathname.includes("?"),Qy("?","pathname","search",s)),xt(!s.pathname||!s.pathname.includes("#"),Qy("#","pathname","hash",s)),xt(!s.search||!s.search.includes("#"),Qy("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.pathname,d;if(c==null)d=n;else{let v=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}d=v>=0?t[v]:"/"}let h=nI(s,d),m=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var Ms=e=>e.join("/").replace(/\/\/+/g,"/"),aI=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sI=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oI=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,qm=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Qd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var XT=["POST","PUT","PATCH","DELETE"],iI=new Set(XT),lI=["GET",...XT],cI=new Set(lI),uI=new Set([301,302,303,307,308]),dI=new Set([307,308]),Xy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fI={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ed={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eb=e=>hI.test(e),mI=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),JT="remix-router-transitions",ej=Symbol("ResetLoaderData");function pI(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";xt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||mI,l={},c=Wd(e.routes,s,void 0,l),d,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let m=e.dataStrategy||bI,g={...e.future},v=null,x=new Set,b=null,w=null,C=null,E=e.hydrationData!=null,R=ui(c,e.history.location,h),T=!1,j=null,O;if(R==null&&!e.patchRoutesOnNavigation){let U=Ua(404,{pathname:e.history.location.pathname}),{matches:Z,route:se}=im(c);O=!0,R=Z,j={[se.id]:U}}else if(R&&!e.hydrationData&&Kn(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(U=>U.route.lazy))O=!1;else if(!R.some(U=>tb(U.route)))O=!0;else{let U=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let se=R.findIndex(ve=>Z[ve.route.id]!==void 0);O=R.slice(0,se+1).every(ve=>!Yx(ve.route,U,Z))}else O=R.every(se=>!Yx(se.route,U,Z))}else{O=!1,R=[];let U=Kn(null,c,e.history.location.pathname);U.active&&U.matches&&(T=!0,R=U.matches)}let D,N={historyAction:e.history.action,location:e.history.location,matches:R,initialized:O,navigation:Xy,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},A="POP",k=!1,V,q=!1,H=new Map,W=null,re=!1,G=!1,Q=new Set,I=new Map,Y=0,B=-1,oe=new Map,be=new Set,L=new Map,P=new Map,K=new Set,ne=new Map,fe,ge=null;function ue(){if(v=e.history.listen(({action:U,location:Z,delta:se})=>{if(fe){fe(),fe=void 0;return}On(ne.size===0||se!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ve=Zl({currentLocation:N.location,nextLocation:Z,historyAction:U});if(ve&&se!=null){let Ee=new Promise(Fe=>{fe=Fe});e.history.go(se*-1),Ra(ve,{state:"blocked",location:Z,proceed(){Ra(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Ee.then(()=>e.history.go(se))},reset(){let Fe=new Map(N.blockers);Fe.set(ve,Ed),xe({blockers:Fe})}});return}return Te(U,Z)}),n){II(t,H);let U=()=>LI(t,H);t.addEventListener("pagehide",U),W=()=>t.removeEventListener("pagehide",U)}return N.initialized||Te("POP",N.location,{initialHydration:!0}),D}function Ae(){v&&v(),W&&W(),x.clear(),V&&V.abort(),N.fetchers.forEach((U,Z)=>Fr(Z)),N.blockers.forEach((U,Z)=>ko(Z))}function Re(U){return x.add(U),()=>x.delete(U)}function xe(U,Z={}){U.matches&&(U.matches=U.matches.map(Ee=>{let Fe=l[Ee.route.id],Ve=Ee.route;return Ve.element!==Fe.element||Ve.errorElement!==Fe.errorElement||Ve.hydrateFallbackElement!==Fe.hydrateFallbackElement?{...Ee,route:Fe}:Ee})),N={...N,...U};let se=[],ve=[];N.fetchers.forEach((Ee,Fe)=>{Ee.state==="idle"&&(K.has(Fe)?se.push(Fe):ve.push(Fe))}),K.forEach(Ee=>{!N.fetchers.has(Ee)&&!I.has(Ee)&&se.push(Ee)}),[...x].forEach(Ee=>Ee(N,{deletedFetchers:se,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),se.forEach(Ee=>Fr(Ee)),ve.forEach(Ee=>N.fetchers.delete(Ee))}function Je(U,Z,{flushSync:se}={}){var Ue,Me;let ve=N.actionData!=null&&N.navigation.formMethod!=null&&Yr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((Ue=U.state)==null?void 0:Ue._isRedirect)!==!0,Ee;Z.actionData?Object.keys(Z.actionData).length>0?Ee=Z.actionData:Ee=null:ve?Ee=N.actionData:Ee=null;let Fe=Z.loaderData?gR(N.loaderData,Z.loaderData,Z.matches||[],Z.errors):N.loaderData,Ve=N.blockers;Ve.size>0&&(Ve=new Map(Ve),Ve.forEach((st,Ft)=>Ve.set(Ft,Ed)));let Ie=re?!1:jn(U,Z.matches||N.matches),Ge=k===!0||N.navigation.formMethod!=null&&Yr(N.navigation.formMethod)&&((Me=U.state)==null?void 0:Me._isRedirect)!==!0;d&&(c=d,d=void 0),re||A==="POP"||(A==="PUSH"?e.history.push(U,U.state):A==="REPLACE"&&e.history.replace(U,U.state));let qe;if(A==="POP"){let st=H.get(N.location.pathname);st&&st.has(U.pathname)?qe={currentLocation:N.location,nextLocation:U}:H.has(U.pathname)&&(qe={currentLocation:U,nextLocation:N.location})}else if(q){let st=H.get(N.location.pathname);st?st.add(U.pathname):(st=new Set([U.pathname]),H.set(N.location.pathname,st)),qe={currentLocation:N.location,nextLocation:U}}xe({...Z,actionData:Ee,loaderData:Fe,historyAction:A,location:U,initialized:!0,navigation:Xy,revalidation:"idle",restoreScrollPosition:Ie,preventScrollReset:Ge,blockers:Ve},{viewTransitionOpts:qe,flushSync:se===!0}),A="POP",k=!1,q=!1,re=!1,G=!1,ge==null||ge.resolve(),ge=null}async function Qe(U,Z){if(typeof U=="number"){e.history.go(U);return}let se=Zx(N.location,N.matches,h,U,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:ve,submission:Ee,error:Fe}=iR(!1,se,Z),Ve=N.location,Ie=Yd(N.location,ve,Z&&Z.state);Ie={...Ie,...e.history.encodeLocation(Ie)};let Ge=Z&&Z.replace!=null?Z.replace:void 0,qe="PUSH";Ge===!0?qe="REPLACE":Ge===!1||Ee!=null&&Yr(Ee.formMethod)&&Ee.formAction===N.location.pathname+N.location.search&&(qe="REPLACE");let Ue=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,Me=(Z&&Z.flushSync)===!0,st=Zl({currentLocation:Ve,nextLocation:Ie,historyAction:qe});if(st){Ra(st,{state:"blocked",location:Ie,proceed(){Ra(st,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),Qe(U,Z)},reset(){let Ft=new Map(N.blockers);Ft.set(st,Ed),xe({blockers:Ft})}});return}await Te(qe,Ie,{submission:Ee,pendingError:Fe,preventScrollReset:Ue,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:Me})}function zt(){ge||(ge=PI()),Ce(),xe({revalidation:"loading"});let U=ge.promise;return N.navigation.state==="submitting"?U:N.navigation.state==="idle"?(Te(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),U):(Te(A||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:q===!0}),U)}async function Te(U,Z,se){V&&V.abort(),V=null,A=U,re=(se&&se.startUninterruptedRevalidation)===!0,hn(N.location,N.matches),k=(se&&se.preventScrollReset)===!0,q=(se&&se.enableViewTransition)===!0;let ve=d||c,Ee=se&&se.overrideNavigation,Fe=se!=null&&se.initialHydration&&N.matches&&N.matches.length>0&&!T?N.matches:ui(ve,Z,h),Ve=(se&&se.flushSync)===!0;if(Fe&&N.initialized&&!G&&_I(N.location,Z)&&!(se&&se.submission&&Yr(se.submission.formMethod))){Je(Z,{matches:Fe},{flushSync:Ve});return}let Ie=Kn(Fe,ve,Z.pathname);if(Ie.active&&Ie.matches&&(Fe=Ie.matches),!Fe){let{error:fr,notFoundMatches:rn,route:Lt}=vs(Z.pathname);Je(Z,{matches:rn,loaderData:{},errors:{[Lt.id]:fr}},{flushSync:Ve});return}V=new AbortController;let Ge=Lc(e.history,Z,V.signal,se&&se.submission),qe=e.getContext?await e.getContext():new sR,Ue;if(se&&se.pendingError)Ue=[di(Fe).route.id,{type:"error",error:se.pendingError}];else if(se&&se.submission&&Yr(se.submission.formMethod)){let fr=await ft(Ge,Z,se.submission,Fe,qe,Ie.active,se&&se.initialHydration===!0,{replace:se.replace,flushSync:Ve});if(fr.shortCircuited)return;if(fr.pendingActionResult){let[rn,Lt]=fr.pendingActionResult;if(la(Lt)&&Qd(Lt.error)&&Lt.error.status===404){V=null,Je(Z,{matches:fr.matches,loaderData:{},errors:{[rn]:Lt.error}});return}}Fe=fr.matches||Fe,Ue=fr.pendingActionResult,Ee=Jy(Z,se.submission),Ve=!1,Ie.active=!1,Ge=Lc(e.history,Ge.url,Ge.signal)}let{shortCircuited:Me,matches:st,loaderData:Ft,errors:kn}=await lt(Ge,Z,Fe,qe,Ie.active,Ee,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,Ve,Ue);Me||(V=null,Je(Z,{matches:st||Fe,...vR(Ue),loaderData:Ft,errors:kn}))}async function ft(U,Z,se,ve,Ee,Fe,Ve,Ie={}){Ce();let Ge=MI(Z,se);if(xe({navigation:Ge},{flushSync:Ie.flushSync===!0}),Fe){let Me=await Zn(ve,Z.pathname,U.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:Ft,route:kn}=im(c);return{matches:Ft,pendingActionResult:[kn.id,{type:"error",error:Me.error}]}}let st=di(Me.partialMatches).route.id;return{matches:Me.partialMatches,pendingActionResult:[st,{type:"error",error:Me.error}]}}else if(Me.matches)ve=Me.matches;else{let{notFoundMatches:st,error:Ft,route:kn}=vs(Z.pathname);return{matches:st,pendingActionResult:[kn.id,{type:"error",error:Ft}]}}}let qe,Ue=Om(ve,Z);if(!Ue.route.action&&!Ue.route.lazy)qe={type:"error",error:Ua(405,{method:U.method,pathname:Z.pathname,routeId:Ue.route.id})};else{let Me=Kc(s,l,U,ve,Ue,Ve?[]:r,Ee),st=await Ne(U,Me,Ee,null);if(qe=st[Ue.route.id],!qe){for(let Ft of ve)if(st[Ft.route.id]){qe=st[Ft.route.id];break}}if(U.signal.aborted)return{shortCircuited:!0}}if(pl(qe)){let Me;return Ie&&Ie.replace!=null?Me=Ie.replace:Me=hR(qe.response.headers.get("Location"),new URL(U.url),h)===N.location.pathname+N.location.search,await de(U,qe,!0,{submission:se,replace:Me}),{shortCircuited:!0}}if(la(qe)){let Me=di(ve,Ue.route.id);return(Ie&&Ie.replace)!==!0&&(A="PUSH"),{matches:ve,pendingActionResult:[Me.route.id,qe,Ue.route.id]}}return{matches:ve,pendingActionResult:[Ue.route.id,qe]}}async function lt(U,Z,se,ve,Ee,Fe,Ve,Ie,Ge,qe,Ue,Me){let st=Fe||Jy(Z,Ve),Ft=Ve||Ie||xR(st),kn=!re&&!qe;if(Ee){if(kn){let rr=sn(Me);xe({navigation:st,...rr!==void 0?{actionData:rr}:{}},{flushSync:Ue})}let gt=await Zn(se,Z.pathname,U.signal);if(gt.type==="aborted")return{shortCircuited:!0};if(gt.type==="error"){if(gt.partialMatches.length===0){let{matches:Bs,route:bs}=im(c);return{matches:Bs,loaderData:{},errors:{[bs.id]:gt.error}}}let rr=di(gt.partialMatches).route.id;return{matches:gt.partialMatches,loaderData:{},errors:{[rr]:gt.error}}}else if(gt.matches)se=gt.matches;else{let{error:rr,notFoundMatches:Bs,route:bs}=vs(Z.pathname);return{matches:Bs,loaderData:{},errors:{[bs.id]:rr}}}}let fr=d||c,{dsMatches:rn,revalidatingFetchers:Lt}=lR(U,ve,s,l,e.history,N,se,Ft,Z,qe?[]:r,qe===!0,G,Q,K,L,be,fr,h,e.patchRoutesOnNavigation!=null,Me);if(B=++Y,!e.dataStrategy&&!rn.some(gt=>gt.shouldLoad)&&!rn.some(gt=>gt.route.middleware&>.route.middleware.length>0)&&Lt.length===0){let gt=vn();return Je(Z,{matches:se,loaderData:{},errors:Me&&la(Me[1])?{[Me[0]]:Me[1].error}:null,...vR(Me),...gt?{fetchers:new Map(N.fetchers)}:{}},{flushSync:Ue}),{shortCircuited:!0}}if(kn){let gt={};if(!Ee){gt.navigation=st;let rr=sn(Me);rr!==void 0&&(gt.actionData=rr)}Lt.length>0&&(gt.fetchers=Ea(Lt)),xe(gt,{flushSync:Ue})}Lt.forEach(gt=>{xr(gt.key),gt.controller&&I.set(gt.key,gt.controller)});let Za=()=>Lt.forEach(gt=>xr(gt.key));V&&V.signal.addEventListener("abort",Za);let{loaderResults:Ta,fetcherResults:Mr}=await ye(rn,Lt,U,ve);if(U.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Za),Lt.forEach(gt=>I.delete(gt.key));let Sr=lm(Ta);if(Sr)return await de(U,Sr.result,!0,{replace:Ge}),{shortCircuited:!0};if(Sr=lm(Mr),Sr)return be.add(Sr.key),await de(U,Sr.result,!0,{replace:Ge}),{shortCircuited:!0};let{loaderData:ys,errors:un}=pR(N,se,Ta,Me,Lt,Mr);qe&&N.errors&&(un={...N.errors,...un});let xs=vn(),qi=dr(B),ja=xs||qi||Lt.length>0;return{matches:se,loaderData:ys,errors:un,...ja?{fetchers:new Map(N.fetchers)}:{}}}function sn(U){if(U&&!la(U[1]))return{[U[0]]:U[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Ea(U){return U.forEach(Z=>{let se=N.fetchers.get(Z.key),ve=Rd(void 0,se?se.data:void 0);N.fetchers.set(Z.key,ve)}),new Map(N.fetchers)}async function ur(U,Z,se,ve){xr(U);let Ee=(ve&&ve.flushSync)===!0,Fe=d||c,Ve=Zx(N.location,N.matches,h,se,Z,ve==null?void 0:ve.relative),Ie=ui(Fe,Ve,h),Ge=Kn(Ie,Fe,Ve);if(Ge.active&&Ge.matches&&(Ie=Ge.matches),!Ie){at(U,Z,Ua(404,{pathname:Ve}),{flushSync:Ee});return}let{path:qe,submission:Ue,error:Me}=iR(!0,Ve,ve);if(Me){at(U,Z,Me,{flushSync:Ee});return}let st=e.getContext?await e.getContext():new sR,Ft=(ve&&ve.preventScrollReset)===!0;if(Ue&&Yr(Ue.formMethod)){await z(U,Z,qe,Ie,st,Ge.active,Ee,Ft,Ue);return}L.set(U,{routeId:Z,path:qe}),await J(U,Z,qe,Ie,st,Ge.active,Ee,Ft,Ue)}async function z(U,Z,se,ve,Ee,Fe,Ve,Ie,Ge){Ce(),L.delete(U);let qe=N.fetchers.get(U);Le(U,kI(Ge,qe),{flushSync:Ve});let Ue=new AbortController,Me=Lc(e.history,se,Ue.signal,Ge);if(Fe){let _n=await Zn(ve,new URL(Me.url).pathname,Me.signal,U);if(_n.type==="aborted")return;if(_n.type==="error"){at(U,Z,_n.error,{flushSync:Ve});return}else if(_n.matches)ve=_n.matches;else{at(U,Z,Ua(404,{pathname:se}),{flushSync:Ve});return}}let st=Om(ve,se);if(!st.route.action&&!st.route.lazy){let _n=Ua(405,{method:Ge.formMethod,pathname:se,routeId:Z});at(U,Z,_n,{flushSync:Ve});return}I.set(U,Ue);let Ft=Y,kn=Kc(s,l,Me,ve,st,r,Ee),rn=(await Ne(Me,kn,Ee,U))[st.route.id];if(Me.signal.aborted){I.get(U)===Ue&&I.delete(U);return}if(K.has(U)){if(pl(rn)||la(rn)){Le(U,ho(void 0));return}}else{if(pl(rn))if(I.delete(U),B>Ft){Le(U,ho(void 0));return}else return be.add(U),Le(U,Rd(Ge)),de(Me,rn,!1,{fetcherSubmission:Ge,preventScrollReset:Ie});if(la(rn)){at(U,Z,rn.error);return}}let Lt=N.navigation.location||N.location,Za=Lc(e.history,Lt,Ue.signal),Ta=d||c,Mr=N.navigation.state!=="idle"?ui(Ta,N.navigation.location,h):N.matches;xt(Mr,"Didn't find any matches after fetcher action");let Sr=++Y;oe.set(U,Sr);let ys=Rd(Ge,rn.data);N.fetchers.set(U,ys);let{dsMatches:un,revalidatingFetchers:xs}=lR(Za,Ee,s,l,e.history,N,Mr,Ge,Lt,r,!1,G,Q,K,L,be,Ta,h,e.patchRoutesOnNavigation!=null,[st.route.id,rn]);xs.filter(_n=>_n.key!==U).forEach(_n=>{let Gs=_n.key,Ki=N.fetchers.get(Gs),Ya=Rd(void 0,Ki?Ki.data:void 0);N.fetchers.set(Gs,Ya),xr(Gs),_n.controller&&I.set(Gs,_n.controller)}),xe({fetchers:new Map(N.fetchers)});let qi=()=>xs.forEach(_n=>xr(_n.key));Ue.signal.addEventListener("abort",qi);let{loaderResults:ja,fetcherResults:gt}=await ye(un,xs,Za,Ee);if(Ue.signal.aborted)return;if(Ue.signal.removeEventListener("abort",qi),oe.delete(U),I.delete(U),xs.forEach(_n=>I.delete(_n.key)),N.fetchers.has(U)){let _n=ho(rn.data);N.fetchers.set(U,_n)}let rr=lm(ja);if(rr)return de(Za,rr.result,!1,{preventScrollReset:Ie});if(rr=lm(gt),rr)return be.add(rr.key),de(Za,rr.result,!1,{preventScrollReset:Ie});let{loaderData:Bs,errors:bs}=pR(N,Mr,ja,void 0,xs,gt);dr(Sr),N.navigation.state==="loading"&&Sr>B?(xt(A,"Expected pending action"),V&&V.abort(),Je(N.navigation.location,{matches:Mr,loaderData:Bs,errors:bs,fetchers:new Map(N.fetchers)})):(xe({errors:bs,loaderData:gR(N.loaderData,Bs,Mr,bs),fetchers:new Map(N.fetchers)}),G=!1)}async function J(U,Z,se,ve,Ee,Fe,Ve,Ie,Ge){let qe=N.fetchers.get(U);Le(U,Rd(Ge,qe?qe.data:void 0),{flushSync:Ve});let Ue=new AbortController,Me=Lc(e.history,se,Ue.signal);if(Fe){let Lt=await Zn(ve,new URL(Me.url).pathname,Me.signal,U);if(Lt.type==="aborted")return;if(Lt.type==="error"){at(U,Z,Lt.error,{flushSync:Ve});return}else if(Lt.matches)ve=Lt.matches;else{at(U,Z,Ua(404,{pathname:se}),{flushSync:Ve});return}}let st=Om(ve,se);I.set(U,Ue);let Ft=Y,kn=Kc(s,l,Me,ve,st,r,Ee),rn=(await Ne(Me,kn,Ee,U))[st.route.id];if(I.get(U)===Ue&&I.delete(U),!Me.signal.aborted){if(K.has(U)){Le(U,ho(void 0));return}if(pl(rn))if(B>Ft){Le(U,ho(void 0));return}else{be.add(U),await de(Me,rn,!1,{preventScrollReset:Ie});return}if(la(rn)){at(U,Z,rn.error);return}Le(U,ho(rn.data))}}async function de(U,Z,se,{submission:ve,fetcherSubmission:Ee,preventScrollReset:Fe,replace:Ve}={}){Z.response.headers.has("X-Remix-Revalidate")&&(G=!0);let Ie=Z.response.headers.get("Location");xt(Ie,"Expected a Location header on the redirect Response"),Ie=hR(Ie,new URL(U.url),h);let Ge=Yd(N.location,Ie,{_isRedirect:!0});if(n){let kn=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))kn=!0;else if(eb(Ie)){const fr=ZT(Ie,!0);kn=fr.origin!==t.location.origin||Va(fr.pathname,h)==null}if(kn){Ve?t.location.replace(Ie):t.location.assign(Ie);return}}V=null;let qe=Ve===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Me,formEncType:st}=N.navigation;!ve&&!Ee&&Ue&&Me&&st&&(ve=xR(N.navigation));let Ft=ve||Ee;if(dI.has(Z.response.status)&&Ft&&Yr(Ft.formMethod))await Te(qe,Ge,{submission:{...Ft,formAction:Ie},preventScrollReset:Fe||k,enableViewTransition:se?q:void 0});else{let kn=Jy(Ge,ve);await Te(qe,Ge,{overrideNavigation:kn,fetcherSubmission:Ee,preventScrollReset:Fe||k,enableViewTransition:se?q:void 0})}}async function Ne(U,Z,se,ve){let Ee,Fe={};try{Ee=await CI(m,U,Z,ve,se,!1)}catch(Ve){return Z.filter(Ie=>Ie.shouldLoad).forEach(Ie=>{Fe[Ie.route.id]={type:"error",error:Ve}}),Fe}if(U.signal.aborted)return Fe;for(let[Ve,Ie]of Object.entries(Ee))if(DI(Ie)){let Ge=Ie.result;Fe[Ve]={type:"redirect",response:TI(Ge,U,Ve,Z,h)}}else Fe[Ve]=await RI(Ie);return Fe}async function ye(U,Z,se,ve){let Ee=Ne(se,U,ve,null),Fe=Promise.all(Z.map(async Ge=>{if(Ge.matches&&Ge.match&&Ge.request&&Ge.controller){let Ue=(await Ne(Ge.request,Ge.matches,ve,Ge.key))[Ge.match.route.id];return{[Ge.key]:Ue}}else return Promise.resolve({[Ge.key]:{type:"error",error:Ua(404,{pathname:Ge.path})}})})),Ve=await Ee,Ie=(await Fe).reduce((Ge,qe)=>Object.assign(Ge,qe),{});return{loaderResults:Ve,fetcherResults:Ie}}function Ce(){G=!0,L.forEach((U,Z)=>{I.has(Z)&&Q.add(Z),xr(Z)})}function Le(U,Z,se={}){N.fetchers.set(U,Z),xe({fetchers:new Map(N.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function at(U,Z,se,ve={}){let Ee=di(N.matches,Z);Fr(U),xe({errors:{[Ee.route.id]:se},fetchers:new Map(N.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function ht(U){return P.set(U,(P.get(U)||0)+1),K.has(U)&&K.delete(U),N.fetchers.get(U)||fI}function gn(U,Z){xr(U,Z==null?void 0:Z.reason),Le(U,ho(null))}function Fr(U){let Z=N.fetchers.get(U);I.has(U)&&!(Z&&Z.state==="loading"&&oe.has(U))&&xr(U),L.delete(U),oe.delete(U),be.delete(U),K.delete(U),Q.delete(U),N.fetchers.delete(U)}function Rn(U){let Z=(P.get(U)||0)-1;Z<=0?(P.delete(U),K.add(U)):P.set(U,Z),xe({fetchers:new Map(N.fetchers)})}function xr(U,Z){let se=I.get(U);se&&(se.abort(Z),I.delete(U))}function zr(U){for(let Z of U){let se=ht(Z),ve=ho(se.data);N.fetchers.set(Z,ve)}}function vn(){let U=[],Z=!1;for(let se of be){let ve=N.fetchers.get(se);xt(ve,`Expected fetcher: ${se}`),ve.state==="loading"&&(be.delete(se),U.push(se),Z=!0)}return zr(U),Z}function dr(U){let Z=[];for(let[se,ve]of oe)if(ve<U){let Ee=N.fetchers.get(se);xt(Ee,`Expected fetcher: ${se}`),Ee.state==="loading"&&(xr(se),oe.delete(se),Z.push(se))}return zr(Z),Z.length>0}function Tn(U,Z){let se=N.blockers.get(U)||Ed;return ne.get(U)!==Z&&ne.set(U,Z),se}function ko(U){N.blockers.delete(U),ne.delete(U)}function Ra(U,Z){let se=N.blockers.get(U)||Ed;xt(se.state==="unblocked"&&Z.state==="blocked"||se.state==="blocked"&&Z.state==="blocked"||se.state==="blocked"&&Z.state==="proceeding"||se.state==="blocked"&&Z.state==="unblocked"||se.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${se.state} -> ${Z.state}`);let ve=new Map(N.blockers);ve.set(U,Z),xe({blockers:ve})}function Zl({currentLocation:U,nextLocation:Z,historyAction:se}){if(ne.size===0)return;ne.size>1&&On(!1,"A router only supports one blocker at a time");let ve=Array.from(ne.entries()),[Ee,Fe]=ve[ve.length-1],Ve=N.blockers.get(Ee);if(!(Ve&&Ve.state==="proceeding")&&Fe({currentLocation:U,nextLocation:Z,historyAction:se}))return Ee}function vs(U){let Z=Ua(404,{pathname:U}),se=d||c,{matches:ve,route:Ee}=im(se);return{notFoundMatches:ve,route:Ee,error:Z}}function Io(U,Z,se){if(b=U,C=Z,w=se||null,!E&&N.navigation===Xy){E=!0;let ve=jn(N.location,N.matches);ve!=null&&xe({restoreScrollPosition:ve})}return()=>{b=null,C=null,w=null}}function cn(U,Z){return w&&w(U,Z.map(ve=>Hk(ve,N.loaderData)))||U.key}function hn(U,Z){if(b&&C){let se=cn(U,Z);b[se]=C()}}function jn(U,Z){if(b){let se=cn(U,Z),ve=b[se];if(typeof ve=="number")return ve}return null}function Kn(U,Z,se){if(e.patchRoutesOnNavigation)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:Dm(Z,se,h,!0)}}else return{active:!0,matches:Dm(Z,se,h,!0)||[]};return{active:!1,matches:null}}async function Zn(U,Z,se,ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:U};let Ee=U;for(;;){let Fe=d==null,Ve=d||c,Ie=l;try{await e.patchRoutesOnNavigation({signal:se,path:Z,matches:Ee,fetcherKey:ve,patch:(Ue,Me)=>{se.aborted||cR(Ue,Me,Ve,Ie,s,!1)}})}catch(Ue){return{type:"error",error:Ue,partialMatches:Ee}}finally{Fe&&!se.aborted&&(c=[...c])}if(se.aborted)return{type:"aborted"};let Ge=ui(Ve,Z,h);if(Ge)return{type:"success",matches:Ge};let qe=Dm(Ve,Z,h,!0);if(!qe||Ee.length===qe.length&&Ee.every((Ue,Me)=>Ue.route.id===qe[Me].route.id))return{type:"success",matches:null};Ee=qe}}function nr(U){l={},d=Wd(U,s,void 0,l)}function br(U,Z,se=!1){let ve=d==null;cR(U,Z,d||c,l,s,se),ve&&(c=[...c],xe({}))}return D={get basename(){return h},get future(){return g},get state(){return N},get routes(){return c},get window(){return t},initialize:ue,subscribe:Re,enableScrollRestoration:Io,navigate:Qe,fetch:ur,revalidate:zt,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:ht,resetFetcher:gn,deleteFetcher:Rn,dispose:Ae,getBlocker:Tn,deleteBlocker:ko,patchRoutes:br,_internalFetchControllers:I,_internalSetRoutes:nr,_internalSetStateDoNotUseOrYouWillBreakYourApp(U){xe(U)}},D}function gI(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Zx(e,t,n,r,s,l){let c,d;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){d=m;break}}else c=t,d=t[t.length-1];let h=Mp(r||".",Op(c),Va(e.pathname,n)||e.pathname,l==="path");if(r==null&&(h.search=e.search,h.hash=e.hash),(r==null||r===""||r===".")&&d){let m=nb(h.search);if(d.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&m){let g=new URLSearchParams(h.search),v=g.getAll("index");g.delete("index"),v.filter(b=>b).forEach(b=>g.append("index",b));let x=g.toString();h.search=x?`?${x}`:""}}return n!=="/"&&(h.pathname=tI({basename:n,pathname:h.pathname})),Ci(h)}function iR(e,t,n){if(!n||!gI(n))return{path:t};if(n.formMethod&&!OI(n.formMethod))return{path:t,error:Ua(405,{method:n.formMethod})};let r=()=>({path:t,error:Ua(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=oj(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Yr(l))return r();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,w])=>`${x}${b}=${w}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!Yr(l))return r();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return r()}}}xt(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=Qx(n.formData),h=n.formData;else if(n.body instanceof FormData)d=Qx(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=mR(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=mR(d)}catch{return r()}let m={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Yr(m.formMethod))return{path:t,submission:m};let g=Di(t);return e&&g.search&&nb(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Ci(g),submission:m}}function lR(e,t,n,r,s,l,c,d,h,m,g,v,x,b,w,C,E,R,T,j){var re;let O=j?la(j[1])?j[1].error:j[1].data:void 0,D=s.createURL(l.location),N=s.createURL(h),A;if(g&&l.errors){let G=Object.keys(l.errors)[0];A=c.findIndex(Q=>Q.route.id===G)}else if(j&&la(j[1])){let G=j[0];A=c.findIndex(Q=>Q.route.id===G)-1}let k=j?j[1].statusCode:void 0,V=k&&k>=400,q={currentUrl:D,currentParams:((re=l.matches[0])==null?void 0:re.params)||{},nextUrl:N,nextParams:c[0].params,...d,actionResult:O,actionStatus:k},H=c.map((G,Q)=>{let{route:I}=G,Y=null;if(A!=null&&Q>A?Y=!1:I.lazy?Y=!0:tb(I)?g?Y=Yx(I,l.loaderData,l.errors):vI(l.loaderData,l.matches[Q],G)&&(Y=!0):Y=!1,Y!==null)return Wx(n,r,e,G,m,t,Y);let B=V?!1:v||D.pathname+D.search===N.pathname+N.search||D.search!==N.search||yI(l.matches[Q],G),oe={...q,defaultShouldRevalidate:B},be=Km(G,oe);return Wx(n,r,e,G,m,t,be,oe)}),W=[];return w.forEach((G,Q)=>{if(g||!c.some(K=>K.route.id===G.routeId)||b.has(Q))return;let I=l.fetchers.get(Q),Y=I&&I.state!=="idle"&&I.data===void 0,B=ui(E,G.path,R);if(!B){if(T&&Y)return;W.push({key:Q,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(C.has(Q))return;let oe=Om(B,G.path),be=new AbortController,L=Lc(s,G.path,be.signal),P=null;if(x.has(Q))x.delete(Q),P=Kc(n,r,L,B,oe,m,t);else if(Y)v&&(P=Kc(n,r,L,B,oe,m,t));else{let K={...q,defaultShouldRevalidate:V?!1:v};Km(oe,K)&&(P=Kc(n,r,L,B,oe,m,t,K))}P&&W.push({key:Q,routeId:G.routeId,path:G.path,matches:P,match:oe,request:L,controller:be})}),{dsMatches:H,revalidatingFetchers:W}}function tb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Yx(e,t,n){if(e.lazy)return!0;if(!tb(e))return!1;let r=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function vI(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function yI(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Km(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function cR(e,t,n,r,s,l){let c;if(e){let m=r[e];xt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let d=[],h=[];if(t.forEach(m=>{let g=c.find(v=>tj(m,v));g?h.push({existingRoute:g,newRoute:m}):d.push(m)}),d.length>0){let m=Wd(d,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(l&&h.length>0)for(let m=0;m<h.length;m++){let{existingRoute:g,newRoute:v}=h[m],x=g,[b]=Wd([v],s,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function tj(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(l=>tj(n,l))}):!1}var uR=new WeakMap,nj=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(xt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let c=uR.get(s);c||(c={},uR.set(s,c));let d=c[e];if(d)return d;let h=(async()=>{let m=Uk(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)On(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(v)On(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=h,h},dR=new WeakMap;function xI(e,t,n,r,s){let l=n[e.id];if(xt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=dR.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{xt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let w in x){let C=x[w];if(C===void 0)continue;let E=zk(w),T=l[w]!==void 0&&w!=="hasErrorBoundary";E?On(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?On(!T,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=C}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return dR.set(l,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(e.lazy),d=[],h;for(let g of c){if(s&&s.includes(g))continue;let v=nj({key:g,route:e,manifest:n,mapRouteProperties:r});v&&(d.push(v),g===t&&(h=v))}let m=d.length>0?Promise.all(d).then(()=>{}):void 0;return m==null||m.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:h}}async function fR(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{n[t[l].route.id]=s}),n}async function bI(e){return e.matches.some(t=>t.route.middleware)?rj(e,()=>fR(e)):fR(e)}function rj(e,t){return SI(e,t,r=>r,NI,n);function n(r,s,l){if(l)return Promise.resolve(Object.assign(l.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.unstable_shouldCallHandler()),0)),h=di(c,c[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:r}})}}}async function SI(e,t,n,r,s){let{matches:l,request:c,params:d,context:h}=e,m=l.flatMap(v=>v.route.middleware?v.route.middleware.map(x=>[v.route.id,x]):[]);return await aj({request:c,params:d,context:h},m,t,n,r,s)}async function aj(e,t,n,r,s,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=t[c];if(!h)return await n();let[m,g]=h,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await aj(e,t,n,r,s,l,c+1)},v.value}catch(b){return v={value:await l(b,m,v)},v.value}};try{let b=await g(e,x),w=b!=null?r(b):void 0;return s(w)?w:v?w??v.value:(v={value:await x()},v.value)}catch(b){return await l(b,m,v)}}function sj(e,t,n,r,s){let l=nj({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=xI(r.route,Yr(n.method)?"action":"loader",t,e,s);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Wx(e,t,n,r,s,l,c,d=null){let h=!1,m=sj(e,t,n,r,s);return{...r,_lazyPromises:m,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(g){return h=!0,d?typeof g=="boolean"?Km(r,{...d,defaultShouldRevalidate:g}):Km(r,d):c},resolve(g){let{lazy:v,loader:x,middleware:b}=r.route,w=h||c||g&&!Yr(n.method)&&(v||x),C=b&&b.length>0&&!x&&!v;return w&&!C?wI({request:n,match:r,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:g,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Kc(e,t,n,r,s,l,c,d=null){return r.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:sj(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Wx(e,t,n,h,l,c,!0,d))}async function CI(e,t,n,r,s,l){n.some(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware}));let c={request:t,params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let g=c;return rj(g,()=>m({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var g,v;return[(g=m._lazyPromises)==null?void 0:g.handler,(v=m._lazyPromises)==null?void 0:v.route]}))}catch{}return h}async function wI({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:s,scopedContext:l}){let c,d,h=Yr(e.method),m=h?"action":"loader",g=v=>{let x,b=new Promise((E,R)=>x=R);d=()=>x(),e.signal.addEventListener("abort",d);let w=E=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${t.route.id}]`)):v({request:e,params:t.params,context:l},...E!==void 0?[E]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(R=>w(R)):w())}}catch(E){return{type:"error",result:E}}})();return Promise.race([C,b])};try{let v=h?t.route.action:t.route.loader;if(n||r)if(v){let x,[b]=await Promise.all([g(v).catch(w=>{x=w}),n,r]);if(x!==void 0)throw x;c=b}else{await n;let x=h?t.route.action:t.route.loader;if(x)[c]=await Promise.all([g(x),r]);else if(m==="action"){let b=new URL(e.url),w=b.pathname+b.search;throw Ua(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(v)c=await g(v);else{let x=new URL(e.url),b=x.pathname+x.search;throw Ua(404,{pathname:b})}}catch(v){return{type:"error",result:v}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function EI(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function RI(e){var r,s,l,c,d,h;let{result:t,type:n}=e;if(ij(t)){let m;try{m=await EI(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new qm(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return n==="error"?yR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new qm(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:Qd(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Qd(t)?t.status:void 0}:yR(t)?{type:"data",data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function TI(e,t,n,r,s){let l=e.headers.get("Location");if(xt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!eb(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=Zx(new URL(t.url),c,s,l),e.headers.set("Location",l)}return e}function hR(e,t,n){if(eb(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=Va(s.pathname,n)!=null;if(s.origin===t.origin&&l)return s.pathname+s.search+s.hash}return e}function Lc(e,t,n,r){let s=e.createURL(oj(t)).toString(),l={signal:n};if(r&&Yr(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=Qx(r.formData):l.body=r.formData}return new Request(s,l)}function Qx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function mR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function jI(e,t,n,r=!1,s=!1){let l={},c=null,d,h=!1,m={},g=n&&la(n[1])?n[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let x=v.route.id,b=t[x];if(xt(!pl(b),"Cannot handle redirect results in processLoaderData"),la(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},s)c[x]=w;else{let C=di(e,x);c[C.route.id]==null&&(c[C.route.id]=w)}r||(l[x]=ej),h||(h=!0,d=Qd(b.error)?b.error.status:500),b.headers&&(m[x]=b.headers)}else l[x]=b.data,b.statusCode&&b.statusCode!==200&&!h&&(d=b.statusCode),b.headers&&(m[x]=b.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:m}}function pR(e,t,n,r,s,l){let{loaderData:c,errors:d}=jI(t,n,r);return s.filter(h=>!h.matches||h.matches.some(m=>m.shouldLoad)).forEach(h=>{let{key:m,match:g,controller:v}=h;if(v&&v.signal.aborted)return;let x=l[m];if(xt(x,"Did not find corresponding fetcher result"),la(x)){let b=di(e.matches,g==null?void 0:g.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(m)}else if(pl(x))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=ho(x.data);e.fetchers.set(m,b)}}),{loaderData:c,errors:d}}function gR(e,t,n,r){let s=Object.entries(t).filter(([,l])=>l!==ej).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function vR(e){return e?la(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function di(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function im(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ua(e,{pathname:t,routeId:n,method:r,type:s,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new qm(e||500,c,new Error(d),!0)}function lm(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(pl(s))return{key:r,result:s}}}function oj(e){let t=typeof e=="string"?Di(e):e;return Ci({...t,hash:""})}function _I(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function NI(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&AI(n))}function AI(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function DI(e){return ij(e.result)&&uI.has(e.result.status)}function la(e){return e.type==="error"}function pl(e){return(e&&e.type)==="redirect"}function yR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ij(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function OI(e){return cI.has(e.toUpperCase())}function Yr(e){return iI.has(e.toUpperCase())}function nb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Om(e,t){let n=typeof t=="string"?Di(t).search:t.search;if(e[e.length-1].route.index&&nb(n||""))return e[e.length-1];let r=QT(e);return r[r.length-1]}function xR(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:l,json:c}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function Jy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function MI(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Rd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function kI(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ho(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function II(e,t){try{let n=e.sessionStorage.getItem(JT);if(n){let r=JSON.parse(n);for(let[s,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function LI(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(JT,JSON.stringify(n))}catch(r){On(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function PI(){let e,t,n=new Promise((r,s)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{s(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Il=p.createContext(null);Il.displayName="DataRouter";var pf=p.createContext(null);pf.displayName="DataRouterState";p.createContext(!1);var rb=p.createContext({isTransitioning:!1});rb.displayName="ViewTransition";var lj=p.createContext(new Map);lj.displayName="Fetchers";var UI=p.createContext(null);UI.displayName="Await";var ds=p.createContext(null);ds.displayName="Navigation";var kp=p.createContext(null);kp.displayName="Location";var Ba=p.createContext({outlet:null,matches:[],isDataRoute:!1});Ba.displayName="Route";var ab=p.createContext(null);ab.displayName="RouteError";function FI(e,{relative:t}={}){xt(hu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext(ds),{hash:s,pathname:l,search:c}=gf(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Ms([n,l])),r.createHref({pathname:d,search:c,hash:s})}function hu(){return p.useContext(kp)!=null}function Ao(){return xt(hu(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(kp).location}var cj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uj(e){p.useContext(ds).static||p.useLayoutEffect(e)}function sb(){let{isDataRoute:e}=p.useContext(Ba);return e?JI():zI()}function zI(){xt(hu(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(Il),{basename:t,navigator:n}=p.useContext(ds),{matches:r}=p.useContext(Ba),{pathname:s}=Ao(),l=JSON.stringify(Op(r)),c=p.useRef(!1);return uj(()=>{c.current=!0}),p.useCallback((h,m={})=>{if(On(c.current,cj),!c.current)return;if(typeof h=="number"){n.go(h);return}let g=Mp(h,JSON.parse(l),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ms([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,l,s,e])}var dj=p.createContext(null);function fs(){return p.useContext(dj)}function VI(e){let t=p.useContext(Ba).outlet;return p.useMemo(()=>t&&p.createElement(dj.Provider,{value:e},t),[t,e])}function fj(){let{matches:e}=p.useContext(Ba),t=e[e.length-1];return t?t.params:{}}function gf(e,{relative:t}={}){let{matches:n}=p.useContext(Ba),{pathname:r}=Ao(),s=JSON.stringify(Op(n));return p.useMemo(()=>Mp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function HI(e,t,n,r,s){xt(hu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=p.useContext(ds),{matches:c}=p.useContext(Ba),d=c[c.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let T=v&&v.path||"";hj(m,!v||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let x=Ao(),b;b=x;let w=b.pathname||"/",C=w;if(g!=="/"){let T=g.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let E=ui(e,{pathname:C});return On(v||E!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),On(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),KI(E&&E.map(T=>Object.assign({},T,{params:Object.assign({},h,T.params),pathname:Ms([g,l.encodeLocation?l.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?g:Ms([g,l.encodeLocation?l.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,n,r,s)}function $I(){let e=XI(),t=Qd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,c)}var BI=p.createElement($I,null),GI=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?p.createElement(Ba.Provider,{value:this.props.routeContext},p.createElement(ab.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function qI({routeContext:e,match:t,children:n}){let r=p.useContext(Il);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Ba.Provider,{value:e},n)}function KI(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=n==null?void 0:n.errors;if(c!=null){let m=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);xt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,m+1))}let d=!1,h=-1;if(n)for(let m=0;m<l.length;m++){let g=l[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(h=m),g.route.id){let{loaderData:v,errors:x}=n,b=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||b){d=!0,h>=0?l=l.slice(0,h+1):l=[l[0]];break}}}return l.reduceRight((m,g,v)=>{let x,b=!1,w=null,C=null;n&&(x=c&&g.route.id?c[g.route.id]:void 0,w=g.route.errorElement||BI,d&&(h<0&&v===0?(hj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):h===v&&(b=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,v+1)),R=()=>{let T;return x?T=w:b?T=C:g.route.Component?T=p.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=m,p.createElement(qI,{match:g,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?p.createElement(GI,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):R()},null)}function ob(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZI(e){let t=p.useContext(Il);return xt(t,ob(e)),t}function YI(e){let t=p.useContext(pf);return xt(t,ob(e)),t}function WI(e){let t=p.useContext(Ba);return xt(t,ob(e)),t}function ib(e){let t=WI(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function QI(){return ib("useRouteId")}function XI(){var r;let e=p.useContext(ab),t=YI("useRouteError"),n=ib("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function JI(){let{router:e}=ZI("useNavigate"),t=ib("useNavigate"),n=p.useRef(!1);return uj(()=>{n.current=!0}),p.useCallback(async(s,l={})=>{On(n.current,cj),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var bR={};function hj(e,t,n){!t&&!bR[e]&&(bR[e]=!0,On(!1,n))}var SR={};function CR(e,t){!e&&!SR[t]&&(SR[t]=!0,console.warn(t))}function e6(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&On(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&On(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&On(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var t6=["HydrateFallback","hydrateFallbackElement"],n6=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function r6({router:e,flushSync:t,unstable_onError:n}){let[r,s]=p.useState(e.state),[l,c]=p.useState(),[d,h]=p.useState({isTransitioning:!1}),[m,g]=p.useState(),[v,x]=p.useState(),[b,w]=p.useState(),C=p.useRef(new Map),E=p.useCallback(D=>{s(N=>(D.errors&&n&&Object.entries(D.errors).forEach(([A,k])=>{var V;((V=N.errors)==null?void 0:V[A])!==k&&n(k)}),D))},[n]),R=p.useCallback((D,{deletedFetchers:N,flushSync:A,viewTransitionOpts:k})=>{D.fetchers.forEach((q,H)=>{q.data!==void 0&&C.current.set(H,q.data)}),N.forEach(q=>C.current.delete(q)),CR(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let V=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(CR(k==null||V,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!k||!V){t&&A?t(()=>E(D)):p.startTransition(()=>E(D));return}if(t&&A){t(()=>{v&&(m&&m.resolve(),v.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})});let q=e.window.document.startViewTransition(()=>{t(()=>E(D))});q.finished.finally(()=>{t(()=>{g(void 0),x(void 0),c(void 0),h({isTransitioning:!1})})}),t(()=>x(q));return}v?(m&&m.resolve(),v.skipTransition(),w({state:D,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(c(D),h({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}))},[e.window,t,v,m,E]);p.useLayoutEffect(()=>e.subscribe(R),[e,R]),p.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new n6)},[d]),p.useEffect(()=>{if(m&&l&&e.window){let D=l,N=m.promise,A=e.window.document.startViewTransition(async()=>{p.startTransition(()=>E(D)),await N});A.finished.finally(()=>{g(void 0),x(void 0),c(void 0),h({isTransitioning:!1})}),x(A)}},[l,m,e.window,E]),p.useEffect(()=>{m&&l&&r.location.key===l.location.key&&m.resolve()},[m,v,r.location,l]),p.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),h({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let T=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,N,A)=>e.navigate(D,{state:N,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(D,N,A)=>e.navigate(D,{replace:!0,state:N,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),j=e.basename||"/",O=p.useMemo(()=>({router:e,navigator:T,static:!1,basename:j,unstable_onError:n}),[e,T,j,n]);return p.createElement(p.Fragment,null,p.createElement(Il.Provider,{value:O},p.createElement(pf.Provider,{value:r},p.createElement(lj.Provider,{value:C.current},p.createElement(rb.Provider,{value:d},p.createElement(i6,{basename:j,location:r.location,navigationType:r.historyAction,navigator:T},p.createElement(a6,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var a6=p.memo(s6);function s6({routes:e,future:t,state:n,unstable_onError:r}){return HI(e,void 0,n,r,t)}function o6({to:e,replace:t,state:n,relative:r}){xt(hu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(ds);On(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=p.useContext(Ba),{pathname:c}=Ao(),d=sb(),h=Mp(e,Op(l),c,r==="path"),m=JSON.stringify(h);return p.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:r})},[d,m,r,t,n]),null}function mj(e){return VI(e.context)}function i6({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1}){xt(!hu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:s,static:l,future:{}}),[c,s,l]);typeof n=="string"&&(n=Di(n));let{pathname:h="/",search:m="",hash:g="",state:v=null,key:x="default"}=n,b=p.useMemo(()=>{let w=Va(h,c);return w==null?null:{location:{pathname:w,search:m,hash:g,state:v,key:x},navigationType:r}},[c,h,m,g,v,x,r]);return On(b!=null,`<Router basename="${c}"> is not able to match the URL "${h}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:p.createElement(ds.Provider,{value:d},p.createElement(kp.Provider,{children:t,value:b}))}var Mm="get",km="application/x-www-form-urlencoded";function Ip(e){return e!=null&&typeof e.tagName=="string"}function l6(e){return Ip(e)&&e.tagName.toLowerCase()==="button"}function c6(e){return Ip(e)&&e.tagName.toLowerCase()==="form"}function u6(e){return Ip(e)&&e.tagName.toLowerCase()==="input"}function d6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function f6(e,t){return e.button===0&&(!t||t==="_self")&&!d6(e)}var cm=null;function h6(){if(cm===null)try{new FormData(document.createElement("form"),0),cm=!1}catch{cm=!0}return cm}var m6=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ex(e){return e!=null&&!m6.has(e)?(On(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${km}"`),null):e}function p6(e,t){let n,r,s,l,c;if(c6(e)){let d=e.getAttribute("action");r=d?Va(d,t):null,n=e.getAttribute("method")||Mm,s=ex(e.getAttribute("enctype"))||km,l=new FormData(e)}else if(l6(e)||u6(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(r=h?Va(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Mm,s=ex(e.getAttribute("formenctype"))||ex(d.getAttribute("enctype"))||km,l=new FormData(d,e),!h6()){let{name:m,type:g,value:v}=e;if(g==="image"){let x=m?`${m}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else m&&l.append(m,v)}}else{if(Ip(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Mm,r=null,s=km,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function g6(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Va(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function v6(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function y6(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function x6(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await v6(l,n);return c.links?c.links():[]}return[]}));return w6(r.flat(1).filter(y6).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function wR(e,t,n,r,s,l){let c=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>{var g;return n[m].pathname!==h.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==h.params["*"]};return l==="assets"?t.filter((h,m)=>c(h,m)||d(h,m)):l==="data"?t.filter((h,m)=>{var v;let g=r.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(c(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((v=n[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function b6(e,t,{includeHydrateFallback:n}={}){return S6(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function S6(e){return[...new Set(e)]}function C6(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function w6(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(C6(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function pj(){let e=p.useContext(Il);return lb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function E6(){let e=p.useContext(pf);return lb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cb=p.createContext(void 0);cb.displayName="FrameworkContext";function gj(){let e=p.useContext(cb);return lb(e,"You must render this element inside a <HydratedRouter> element"),e}function R6(e,t){let n=p.useContext(cb),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:v}=t,x=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=R=>{R.forEach(T=>{c(T.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),p.useEffect(()=>{if(r){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[r]);let b=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:Td(d,b),onBlur:Td(h,w),onMouseEnter:Td(m,b),onMouseLeave:Td(g,w),onTouchStart:Td(v,b)}]:[!1,x,{}]}function Td(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function T6({page:e,...t}){let{router:n}=pj(),r=p.useMemo(()=>ui(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(_6,{page:e,matches:r,...t}):null}function j6(e){let{manifest:t,routeModules:n}=gj(),[r,s]=p.useState([]);return p.useEffect(()=>{let l=!1;return x6(e,t,n).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,n]),r}function _6({page:e,matches:t,...n}){let r=Ao(),{manifest:s,routeModules:l}=gj(),{basename:c}=pj(),{loaderData:d,matches:h}=E6(),m=p.useMemo(()=>wR(e,t,h,s,r,"data"),[e,t,h,s,r]),g=p.useMemo(()=>wR(e,t,h,s,r,"assets"),[e,t,h,s,r]),v=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(R=>{var j;let T=s.routes[R.route.id];!T||!T.hasLoader||(!m.some(O=>O.route.id===R.route.id)&&R.route.id in d&&((j=l[R.route.id])!=null&&j.shouldRevalidate)||T.hasClientLoader?C=!0:w.add(R.route.id))}),w.size===0)return[];let E=g6(e,c,"data");return C&&w.size>0&&E.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,d,r,s,m,t,e,l]),x=p.useMemo(()=>b6(g,s),[g,s]),b=j6(g);return p.createElement(p.Fragment,null,v.map(w=>p.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>p.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:C})=>p.createElement("link",{key:w,nonce:n.nonce,...C})))}function N6(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vj&&(window.__reactRouterVersion="7.9.4")}catch{}function A6(e,t){return pI({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:kk({window:t==null?void 0:t.window}),hydrationData:D6(),routes:e,mapRouteProperties:e6,hydrationRouteProperties:t6,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function D6(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:O6(e.errors)}),e}function O6(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new qm(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let c=new l(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(s.message);l.stack="",n[r]=l}}else n[r]=s;return n}var yj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ha=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,state:d,target:h,to:m,preventScrollReset:g,viewTransition:v,...x},b){let{basename:w}=p.useContext(ds),C=typeof m=="string"&&yj.test(m),E,R=!1;if(typeof m=="string"&&C&&(E=m,vj))try{let V=new URL(window.location.href),q=m.startsWith("//")?new URL(V.protocol+m):new URL(m),H=Va(q.pathname,w);q.origin===V.origin&&H!=null?m=H+q.search+q.hash:R=!0}catch{On(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=FI(m,{relative:s}),[j,O,D]=R6(r,x),N=I6(m,{replace:c,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:v});function A(V){t&&t(V),V.defaultPrevented||N(V)}let k=p.createElement("a",{...x,...D,href:E||T,onClick:R||l?t:A,ref:N6(b,O),target:h,"data-discover":!C&&n==="render"?"true":void 0});return j&&!C?p.createElement(p.Fragment,null,k,p.createElement(T6,{page:T})):k});Ha.displayName="Link";var vf=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:d,children:h,...m},g){let v=gf(c,{relative:m.relative}),x=Ao(),b=p.useContext(pf),{navigator:w,basename:C}=p.useContext(ds),E=b!=null&&z6(v)&&d===!0,R=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,T=x.pathname,j=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),j=j?j.toLowerCase():null,R=R.toLowerCase()),j&&C&&(j=Va(j,C)||j);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let D=T===R||!s&&T.startsWith(R)&&T.charAt(O)==="/",N=j!=null&&(j===R||!s&&j.startsWith(R)&&j.charAt(R.length)==="/"),A={isActive:D,isPending:N,isTransitioning:E},k=D?t:void 0,V;typeof r=="function"?V=r(A):V=[r,D?"active":null,N?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let q=typeof l=="function"?l(A):l;return p.createElement(Ha,{...m,"aria-current":k,className:V,ref:g,style:q,to:c,viewTransition:d},typeof h=="function"?h(A):h)});vf.displayName="NavLink";var M6=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:c=Mm,action:d,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:v,...x},b)=>{let w=U6(),C=F6(d,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&yj.test(d),T=j=>{if(h&&h(j),j.defaultPrevented)return;j.preventDefault();let O=j.nativeEvent.submitter,D=(O==null?void 0:O.getAttribute("formmethod"))||c;w(O||j.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:s,state:l,relative:m,preventScrollReset:g,viewTransition:v})};return p.createElement("form",{ref:b,method:E,action:C,onSubmit:r?h:T,...x,"data-discover":!R&&e==="render"?"true":void 0})});M6.displayName="Form";function k6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xj(e){let t=p.useContext(Il);return xt(t,k6(e)),t}function I6(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:l,viewTransition:c}={}){let d=sb(),h=Ao(),m=gf(e,{relative:l});return p.useCallback(g=>{if(f6(g,t)){g.preventDefault();let v=n!==void 0?n:Ci(h)===Ci(m);d(e,{replace:v,state:r,preventScrollReset:s,relative:l,viewTransition:c})}},[h,d,m,n,r,t,e,s,l,c])}var L6=0,P6=()=>`__${String(++L6)}__`;function U6(){let{router:e}=xj("useSubmit"),{basename:t}=p.useContext(ds),n=QI();return p.useCallback(async(r,s={})=>{let{action:l,method:c,encType:d,formData:h,body:m}=p6(r,t);if(s.navigate===!1){let g=s.fetcherKey||P6();await e.fetch(g,n,s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,flushSync:s.flushSync})}else await e.navigate(s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function F6(e,{relative:t}={}){let{basename:n}=p.useContext(ds),r=p.useContext(Ba);xt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...gf(e||".",{relative:t})},c=Ao();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ms([n,l.pathname])),Ci(l)}function z6(e,{relative:t}={}){let n=p.useContext(rb);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=xj("useViewTransitionState"),s=gf(e,{relative:t});if(!n.isTransitioning)return!1;let l=Va(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Va(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Gm(s.pathname,c)!=null||Gm(s.pathname,l)!=null}var as=qT();const V6=BT(as);function H6(e){return p.createElement(r6,{flushSync:as.flushSync,...e})}function ER(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ro(...e){return t=>{let n=!1;const r=e.map(s=>{const l=ER(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():ER(e[s],null)}}}}function vt(...e){return p.useCallback(Ro(...e),e)}function wi(e){const t=$6(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),h=d.find(B6);if(h){const m=h.props.children,g=d.map(v=>v===h?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:v);return o.jsx(t,{...c,ref:s,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}var Lp=wi("Slot");function $6(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=q6(s),d=G6(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ro(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bj=Symbol("radix.slottable");function Sj(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=bj,t}function B6(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bj}function G6(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const h=l(...d);return s(...d),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function q6(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Cj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Cj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wj(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Cj(e))&&(r&&(r+=" "),r+=t);return r}const RR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TR=wj,yf=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return TR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(m=>{const g=n==null?void 0:n[m],v=l==null?void 0:l[m];if(g===null)return null;const x=RR(g)||RR(v);return s[m][x]}),d=n&&Object.entries(n).reduce((m,g)=>{let[v,x]=g;return x===void 0||(m[v]=x),m},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:v,className:x,...b}=g;return Object.entries(b).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...l,...d}[C]):{...l,...d}[C]===E})?[...m,v,x]:m},[]);return TR(e,c,h,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
62
|
-
* @license lucide-react v0.475.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const K6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ej=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
67
|
-
* @license lucide-react v0.475.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/var Z6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
72
|
-
* @license lucide-react v0.475.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const Y6=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...d},h)=>p.createElement("svg",{ref:h,...Z6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ej("lucide",s),...d},[...c.map(([m,g])=>p.createElement(m,g)),...Array.isArray(l)?l:[l]]));/**
|
|
77
|
-
* @license lucide-react v0.475.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const ke=(e,t)=>{const n=p.forwardRef(({className:r,...s},l)=>p.createElement(Y6,{ref:l,iconNode:t,className:Ej(`lucide-${K6(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
82
|
-
* @license lucide-react v0.475.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const W6=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],ub=ke("ArchiveRestore",W6);/**
|
|
87
|
-
* @license lucide-react v0.475.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const Q6=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M15 4h5l-5 6h5",key:"8asdl1"}],["path",{d:"M15 20v-3.5a2.5 2.5 0 0 1 5 0V20",key:"r6l5cz"}],["path",{d:"M20 18h-5",key:"18j1r2"}]],jR=ke("ArrowDownZA",Q6);/**
|
|
92
|
-
* @license lucide-react v0.475.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const X6=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],J6=ke("ArrowLeft",X6);/**
|
|
97
|
-
* @license lucide-react v0.475.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const eL=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],tL=ke("ArrowRightLeft",eL);/**
|
|
102
|
-
* @license lucide-react v0.475.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const nL=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],_R=ke("ArrowUpAZ",nL);/**
|
|
107
|
-
* @license lucide-react v0.475.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const rL=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],NR=ke("ArrowUpDown",rL);/**
|
|
112
|
-
* @license lucide-react v0.475.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const aL=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],sL=ke("Asterisk",aL);/**
|
|
117
|
-
* @license lucide-react v0.475.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const oL=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],iL=ke("BadgeAlert",oL);/**
|
|
122
|
-
* @license lucide-react v0.475.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const lL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],cL=ke("Ban",lL);/**
|
|
127
|
-
* @license lucide-react v0.475.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const uL=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],dL=ke("BookOpen",uL);/**
|
|
132
|
-
* @license lucide-react v0.475.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const fL=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],hL=ke("Box",fL);/**
|
|
137
|
-
* @license lucide-react v0.475.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const mL=[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],pL=ke("BriefcaseBusiness",mL);/**
|
|
142
|
-
* @license lucide-react v0.475.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const gL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ir=ke("Check",gL);/**
|
|
147
|
-
* @license lucide-react v0.475.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const vL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ga=ke("ChevronDown",vL);/**
|
|
152
|
-
* @license lucide-react v0.475.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const yL=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],xL=ke("ChevronLeft",yL);/**
|
|
157
|
-
* @license lucide-react v0.475.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const bL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],hs=ke("ChevronRight",bL);/**
|
|
162
|
-
* @license lucide-react v0.475.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const SL=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ls=ke("ChevronUp",SL);/**
|
|
167
|
-
* @license lucide-react v0.475.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const CL=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],wL=ke("ChevronsDownUp",CL);/**
|
|
172
|
-
* @license lucide-react v0.475.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const EL=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],db=ke("ChevronsUpDown",EL);/**
|
|
177
|
-
* @license lucide-react v0.475.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const RL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],xf=ke("CircleAlert",RL);/**
|
|
182
|
-
* @license lucide-react v0.475.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const TL=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Rj=ke("CircleCheckBig",TL);/**
|
|
187
|
-
* @license lucide-react v0.475.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const jL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pp=ke("CircleCheck",jL);/**
|
|
192
|
-
* @license lucide-react v0.475.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const _L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],NL=ke("CircleStop",_L);/**
|
|
197
|
-
* @license lucide-react v0.475.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const AL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Xd=ke("CircleX",AL);/**
|
|
202
|
-
* @license lucide-react v0.475.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const DL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],OL=ke("Circle",DL);/**
|
|
207
|
-
* @license lucide-react v0.475.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const ML=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],fb=ke("Code",ML);/**
|
|
212
|
-
* @license lucide-react v0.475.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const kL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],IL=ke("Columns3",kL);/**
|
|
217
|
-
* @license lucide-react v0.475.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const LL=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Jd=ke("Copy",LL);/**
|
|
222
|
-
* @license lucide-react v0.475.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const PL=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],UL=ke("DatabaseZap",PL);/**
|
|
227
|
-
* @license lucide-react v0.475.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const FL=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Zm=ke("Database",FL);/**
|
|
232
|
-
* @license lucide-react v0.475.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const zL=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],VL=ke("Download",zL);/**
|
|
237
|
-
* @license lucide-react v0.475.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const HL=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],$L=ke("EllipsisVertical",HL);/**
|
|
242
|
-
* @license lucide-react v0.475.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const BL=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],qa=ke("Ellipsis",BL);/**
|
|
247
|
-
* @license lucide-react v0.475.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const GL=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],wl=ke("ExternalLink",GL);/**
|
|
252
|
-
* @license lucide-react v0.475.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const qL=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],KL=ke("EyeOff",qL);/**
|
|
257
|
-
* @license lucide-react v0.475.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const ZL=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Tj=ke("Eye",ZL);/**
|
|
262
|
-
* @license lucide-react v0.475.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const YL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],WL=ke("FileText",YL);/**
|
|
267
|
-
* @license lucide-react v0.475.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const QL=[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]],AR=ke("Gem",QL);/**
|
|
272
|
-
* @license lucide-react v0.475.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const XL=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],JL=ke("GripVertical",XL);/**
|
|
277
|
-
* @license lucide-react v0.475.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const e8=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],t8=ke("Grip",e8);/**
|
|
282
|
-
* @license lucide-react v0.475.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const n8=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],r8=ke("History",n8);/**
|
|
287
|
-
* @license lucide-react v0.475.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const a8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Lr=ke("Info",a8);/**
|
|
292
|
-
* @license lucide-react v0.475.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const s8=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Xx=ke("KeyRound",s8);/**
|
|
297
|
-
* @license lucide-react v0.475.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const o8=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mu=ke("LoaderCircle",o8);/**
|
|
302
|
-
* @license lucide-react v0.475.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const i8=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],l8=ke("Lock",i8);/**
|
|
307
|
-
* @license lucide-react v0.475.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const c8=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],u8=ke("LogOut",c8);/**
|
|
312
|
-
* @license lucide-react v0.475.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const d8=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],f8=ke("Menu",d8);/**
|
|
317
|
-
* @license lucide-react v0.475.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const h8=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],m8=ke("MessageCircleQuestion",h8);/**
|
|
322
|
-
* @license lucide-react v0.475.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const p8=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],g8=ke("MessageCircle",p8);/**
|
|
327
|
-
* @license lucide-react v0.475.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const v8=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],y8=ke("MessageSquare",v8);/**
|
|
332
|
-
* @license lucide-react v0.475.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const x8=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],jj=ke("Monitor",x8);/**
|
|
337
|
-
* @license lucide-react v0.475.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const b8=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],_j=ke("Moon",b8);/**
|
|
342
|
-
* @license lucide-react v0.475.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const S8=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],C8=ke("OctagonAlert",S8);/**
|
|
347
|
-
* @license lucide-react v0.475.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const w8=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],E8=ke("OctagonX",w8);/**
|
|
352
|
-
* @license lucide-react v0.475.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const R8=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],T8=ke("PenLine",R8);/**
|
|
357
|
-
* @license lucide-react v0.475.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const j8=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],bf=ke("Pencil",j8);/**
|
|
362
|
-
* @license lucide-react v0.475.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const _8=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],hb=ke("Play",_8);/**
|
|
367
|
-
* @license lucide-react v0.475.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const N8=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],Nj=ke("Plug",N8);/**
|
|
372
|
-
* @license lucide-react v0.475.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const A8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jr=ke("Plus",A8);/**
|
|
377
|
-
* @license lucide-react v0.475.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const D8=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Aj=ke("RefreshCw",D8);/**
|
|
382
|
-
* @license lucide-react v0.475.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const O8=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],M8=ke("Scale",O8);/**
|
|
387
|
-
* @license lucide-react v0.475.0 - ISC
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the ISC license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const k8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Ll=ke("Search",k8);/**
|
|
392
|
-
* @license lucide-react v0.475.0 - ISC
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the ISC license.
|
|
395
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const I8=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Dj=ke("Settings",I8);/**
|
|
397
|
-
* @license lucide-react v0.475.0 - ISC
|
|
398
|
-
*
|
|
399
|
-
* This source code is licensed under the ISC license.
|
|
400
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const L8=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Oj=ke("Sun",L8);/**
|
|
402
|
-
* @license lucide-react v0.475.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the ISC license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const P8=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],U8=ke("Table",P8);/**
|
|
407
|
-
* @license lucide-react v0.475.0 - ISC
|
|
408
|
-
*
|
|
409
|
-
* This source code is licensed under the ISC license.
|
|
410
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const F8=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],z8=ke("Telescope",F8);/**
|
|
412
|
-
* @license lucide-react v0.475.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const V8=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Mj=ke("Timer",V8);/**
|
|
417
|
-
* @license lucide-react v0.475.0 - ISC
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the ISC license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const H8=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Do=ke("Trash2",H8);/**
|
|
422
|
-
* @license lucide-react v0.475.0 - ISC
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the ISC license.
|
|
425
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const $8=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Up=ke("TriangleAlert",$8);/**
|
|
427
|
-
* @license lucide-react v0.475.0 - ISC
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the ISC license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const B8=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],ef=ke("Unplug",B8);/**
|
|
432
|
-
* @license lucide-react v0.475.0 - ISC
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the ISC license.
|
|
435
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const G8=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],DR=ke("Users",G8);/**
|
|
437
|
-
* @license lucide-react v0.475.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const q8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ru=ke("X",q8),tx=768;function K8(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${tx-1}px)`),r=()=>{t(window.innerWidth<tx)};return n.addEventListener("change",r),t(window.innerWidth<tx),()=>n.removeEventListener("change",r)},[]),!!e}const mb="-",Z8=e=>{const t=W8(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(mb);return d[0]===""&&d.length!==1&&d.shift(),kj(d,t)||Y8(c)},getConflictingClassGroupIds:(c,d)=>{const h=n[c]||[];return d&&r[c]?[...h,...r[c]]:h}}},kj=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?kj(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const l=e.join(mb);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},OR=/^\[(.+)\]$/,Y8=e=>{if(OR.test(e)){const t=OR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},W8=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)Jx(n[s],r,s,t);return r},Jx=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const l=s===""?t:MR(t,s);l.classGroupId=n;return}if(typeof s=="function"){if(Q8(s)){Jx(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([l,c])=>{Jx(c,MR(t,l),n,r)})})},MR=(e,t)=>{let n=e;return t.split(mb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Q8=e=>e.isThemeGetter,X8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return s(l,c),c},set(l,c){n.has(l)?n.set(l,c):s(l,c)}}},e0="!",t0=":",J8=t0.length,e9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let c=0,d=0,h=0,m;for(let w=0;w<s.length;w++){let C=s[w];if(c===0&&d===0){if(C===t0){l.push(s.slice(h,w)),h=w+J8;continue}if(C==="/"){m=w;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const g=l.length===0?s:s.substring(h),v=t9(g),x=v!==g,b=m&&m>h?m-h:void 0;return{modifiers:l,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}};if(t){const s=t+t0,l=r;r=c=>c.startsWith(s)?l(c.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},t9=e=>e.endsWith(e0)?e.substring(0,e.length-1):e.startsWith(e0)?e.substring(1):e,n9=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let l=[];return r.forEach(c=>{c[0]==="["||t[c]?(s.push(...l.sort(),c),l=[]):l.push(c)}),s.push(...l.sort()),s}},r9=e=>({cache:X8(e.cacheSize),parseClassName:e9(e),sortModifiers:n9(e),...Z8(e)}),a9=/\s+/,s9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],d=e.trim().split(a9);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:v,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:C}=n(g);if(v){h=g+(h.length>0?" "+h:h);continue}let E=!!C,R=r(E?w.substring(0,C):w);if(!R){if(!E){h=g+(h.length>0?" "+h:h);continue}if(R=r(w),!R){h=g+(h.length>0?" "+h:h);continue}E=!1}const T=l(x).join(":"),j=b?T+e0:T,O=j+R;if(c.includes(O))continue;c.push(O);const D=s(R,E);for(let N=0;N<D.length;++N){const A=D[N];c.push(j+A)}h=g+(h.length>0?" "+h:h)}return h};function o9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ij(t))&&(r&&(r+=" "),r+=n);return r}const Ij=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ij(e[r]))&&(n&&(n+=" "),n+=t);return n};function i9(e,...t){let n,r,s,l=c;function c(h){const m=t.reduce((g,v)=>v(g),e());return n=r9(m),r=n.cache.get,s=n.cache.set,l=d,d(h)}function d(h){const m=r(h);if(m)return m;const g=s9(h,n);return s(h,g),g}return function(){return l(o9.apply(null,arguments))}}const Wn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Lj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,l9=/^\d+\/\d+$/,c9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,u9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,d9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,h9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_c=e=>l9.test(e),yt=e=>!!e&&!Number.isNaN(Number(e)),si=e=>!!e&&Number.isInteger(Number(e)),nx=e=>e.endsWith("%")&&yt(e.slice(0,-1)),co=e=>c9.test(e),m9=()=>!0,p9=e=>u9.test(e)&&!d9.test(e),Uj=()=>!1,g9=e=>f9.test(e),v9=e=>h9.test(e),y9=e=>!$e(e)&&!Be(e),x9=e=>pu(e,Vj,Uj),$e=e=>Lj.test(e),ul=e=>pu(e,Hj,p9),rx=e=>pu(e,E9,yt),kR=e=>pu(e,Fj,Uj),b9=e=>pu(e,zj,v9),um=e=>pu(e,$j,g9),Be=e=>Pj.test(e),jd=e=>gu(e,Hj),S9=e=>gu(e,R9),IR=e=>gu(e,Fj),C9=e=>gu(e,Vj),w9=e=>gu(e,zj),dm=e=>gu(e,$j,!0),pu=(e,t,n)=>{const r=Lj.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gu=(e,t,n=!1)=>{const r=Pj.exec(e);return r?r[1]?t(r[1]):n:!1},Fj=e=>e==="position"||e==="percentage",zj=e=>e==="image"||e==="url",Vj=e=>e==="length"||e==="size"||e==="bg-size",Hj=e=>e==="length",E9=e=>e==="number",R9=e=>e==="family-name",$j=e=>e==="shadow",T9=()=>{const e=Wn("color"),t=Wn("font"),n=Wn("text"),r=Wn("font-weight"),s=Wn("tracking"),l=Wn("leading"),c=Wn("breakpoint"),d=Wn("container"),h=Wn("spacing"),m=Wn("radius"),g=Wn("shadow"),v=Wn("inset-shadow"),x=Wn("text-shadow"),b=Wn("drop-shadow"),w=Wn("blur"),C=Wn("perspective"),E=Wn("aspect"),R=Wn("ease"),T=Wn("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...O(),Be,$e],N=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],k=()=>[Be,$e,h],V=()=>[_c,"full","auto",...k()],q=()=>[si,"none","subgrid",Be,$e],H=()=>["auto",{span:["full",si,Be,$e]},si,Be,$e],W=()=>[si,"auto",Be,$e],re=()=>["auto","min","max","fr",Be,$e],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...k()],Y=()=>[_c,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],B=()=>[e,Be,$e],oe=()=>[...O(),IR,kR,{position:[Be,$e]}],be=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",C9,x9,{size:[Be,$e]}],P=()=>[nx,jd,ul],K=()=>["","none","full",m,Be,$e],ne=()=>["",yt,jd,ul],fe=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[yt,nx,IR,kR],Ae=()=>["","none",w,Be,$e],Re=()=>["none",yt,Be,$e],xe=()=>["none",yt,Be,$e],Je=()=>[yt,Be,$e],Qe=()=>[_c,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[co],breakpoint:[co],color:[m9],container:[co],"drop-shadow":[co],ease:["in","out","in-out"],font:[y9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[co],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[co],shadow:[co],spacing:["px",yt],text:[co],"text-shadow":[co],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_c,$e,Be,E]}],container:["container"],columns:[{columns:[yt,$e,Be,d]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[si,"auto",Be,$e]}],basis:[{basis:[_c,"full","auto",d,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yt,_c,"auto","initial","none",$e]}],grow:[{grow:["",yt,Be,$e]}],shrink:[{shrink:["",yt,Be,$e]}],order:[{order:[si,"first","last","none",Be,$e]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[d,"screen",...Y()]}],"min-w":[{"min-w":[d,"screen","none",...Y()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,jd,ul]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Be,rx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nx,$e]}],"font-family":[{font:[S9,$e,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Be,$e]}],"line-clamp":[{"line-clamp":[yt,"none",Be,rx]}],leading:[{leading:[l,...k()]}],"list-image":[{"list-image":["none",Be,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[yt,"from-font","auto",Be,ul]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[yt,"auto",Be,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:be()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},si,Be,$e],radial:["",Be,$e],conic:[si,Be,$e]},w9,b9]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yt,Be,$e]}],"outline-w":[{outline:["",yt,jd,ul]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,dm,um]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,dm,um]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[yt,ul]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",x,dm,um]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[yt,Be,$e]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[yt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Be,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[yt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:be()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,$e]}],filter:[{filter:["","none",Be,$e]}],blur:[{blur:Ae()}],brightness:[{brightness:[yt,Be,$e]}],contrast:[{contrast:[yt,Be,$e]}],"drop-shadow":[{"drop-shadow":["","none",b,dm,um]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",yt,Be,$e]}],"hue-rotate":[{"hue-rotate":[yt,Be,$e]}],invert:[{invert:["",yt,Be,$e]}],saturate:[{saturate:[yt,Be,$e]}],sepia:[{sepia:["",yt,Be,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,$e]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[yt,Be,$e]}],"backdrop-contrast":[{"backdrop-contrast":[yt,Be,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yt,Be,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yt,Be,$e]}],"backdrop-invert":[{"backdrop-invert":["",yt,Be,$e]}],"backdrop-opacity":[{"backdrop-opacity":[yt,Be,$e]}],"backdrop-saturate":[{"backdrop-saturate":[yt,Be,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",yt,Be,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yt,"initial",Be,$e]}],ease:[{ease:["linear","initial",R,Be,$e]}],delay:[{delay:[yt,Be,$e]}],animate:[{animate:["none",T,Be,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Be,$e]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:Je()}],"skew-x":[{"skew-x":Je()}],"skew-y":[{"skew-y":Je()}],transform:[{transform:[Be,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,$e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,$e]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[yt,jd,ul,rx]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},j9=i9(T9);function ie(...e){return j9(wj(e))}const pb=yf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-white/4 dark:hover:bg-white/8",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-white/8",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:n,asChild:r=!1,...s}){const l=r?Lp:"button";return o.jsx(l,{"data-slot":"button",className:ie(pb({variant:t,size:n,className:e})),...s})}function Bt({className:e,type:t,...n}){return o.jsx("input",{type:t,"data-slot":"input",className:ie("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var _9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=_9.reduce((e,t)=>{const n=wi(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(h,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bj(e,t){e&&as.flushSync(()=>e.dispatchEvent(t))}var N9="Separator",LR="horizontal",A9=["horizontal","vertical"],Gj=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=LR,...s}=e,l=D9(r)?r:LR,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return o.jsx(Ye.div,{"data-orientation":l,...d,...s,ref:t})});Gj.displayName=N9;function D9(e){return A9.includes(e)}var O9=Gj;function qj({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return o.jsx(O9,{"data-slot":"separator",decorative:n,orientation:t,className:ie("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function M9(e,t){const n=p.createContext(t),r=l=>{const{children:c,...d}=l,h=p.useMemo(()=>d,Object.values(d));return o.jsx(n.Provider,{value:h,children:c})};r.displayName=e+"Provider";function s(l){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function Ur(e,t=[]){let n=[];function r(l,c){const d=p.createContext(c),h=n.length;n=[...n,c];const m=v=>{var R;const{scope:x,children:b,...w}=v,C=((R=x==null?void 0:x[e])==null?void 0:R[h])||d,E=p.useMemo(()=>w,Object.values(w));return o.jsx(C.Provider,{value:E,children:b})};m.displayName=l+"Provider";function g(v,x){var C;const b=((C=x==null?void 0:x[e])==null?void 0:C[h])||d,w=p.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[m,g]}const s=()=>{const l=n.map(c=>p.createContext(c));return function(d){const h=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return s.scopeName=e,[r,k9(s,...t)]}function k9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=r.reduce((d,{useScope:h,scopeName:m})=>{const v=h(l)[`__scope${m}`];return{...d,...v}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var yr=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},I9=GT[" useId ".trim().toString()]||(()=>{}),L9=0;function Mn(e){const[t,n]=p.useState(I9());return yr(()=>{n(r=>r??String(L9++))},[e]),e||(t?`radix-${t}`:"")}var P9=GT[" useInsertionEffect ".trim().toString()]||yr;function Xr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,c]=U9({defaultProp:t,onChange:n}),d=e!==void 0,h=d?e:s;{const g=p.useRef(e!==void 0);p.useEffect(()=>{const v=g.current;v!==d&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=d},[d,r])}const m=p.useCallback(g=>{var v;if(d){const x=F9(g)?g(e):g;x!==e&&((v=c.current)==null||v.call(c,x))}else l(g)},[d,e,l,c]);return[h,m]}function U9({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),l=p.useRef(t);return P9(()=>{l.current=t},[t]),p.useEffect(()=>{var c;s.current!==n&&((c=l.current)==null||c.call(l,n),s.current=n)},[n,s]),[n,r,l]}function F9(e){return typeof e=="function"}function is(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function z9(e,t=globalThis==null?void 0:globalThis.document){const n=is(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var V9="DismissableLayer",n0="dismissableLayer.update",H9="dismissableLayer.pointerDownOutside",$9="dismissableLayer.focusOutside",PR,Kj=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pl=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...h}=e,m=p.useContext(Kj),[g,v]=p.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),w=vt(t,A=>v(A)),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=C.indexOf(E),T=g?C.indexOf(g):-1,j=m.layersWithOutsidePointerEventsDisabled.size>0,O=T>=R,D=q9(A=>{const k=A.target,V=[...m.branches].some(q=>q.contains(k));!O||V||(s==null||s(A),c==null||c(A),A.defaultPrevented||d==null||d())},x),N=K9(A=>{const k=A.target;[...m.branches].some(q=>q.contains(k))||(l==null||l(A),c==null||c(A),A.defaultPrevented||d==null||d())},x);return z9(A=>{T===m.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&d&&(A.preventDefault(),d()))},x),p.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(PR=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),UR(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=PR)}},[g,x,n,m]),p.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),UR())},[g,m]),p.useEffect(()=>{const A=()=>b({});return document.addEventListener(n0,A),()=>document.removeEventListener(n0,A)},[]),o.jsx(Ye.div,{...h,ref:w,style:{pointerEvents:j?O?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,N.onFocusCapture),onBlurCapture:je(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,D.onPointerDownCapture)})});Pl.displayName=V9;var B9="DismissableLayerBranch",G9=p.forwardRef((e,t)=>{const n=p.useContext(Kj),r=p.useRef(null),s=vt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),o.jsx(Ye.div,{...e,ref:s})});G9.displayName=B9;function q9(e,t=globalThis==null?void 0:globalThis.document){const n=is(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let h=function(){Zj(H9,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function K9(e,t=globalThis==null?void 0:globalThis.document){const n=is(e),r=p.useRef(!1);return p.useEffect(()=>{const s=l=>{l.target&&!r.current&&Zj($9,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function UR(){const e=new CustomEvent(n0);document.dispatchEvent(e)}function Zj(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Bj(s,l):s.dispatchEvent(l)}var ax="focusScope.autoFocusOnMount",sx="focusScope.autoFocusOnUnmount",FR={bubbles:!1,cancelable:!0},Z9="FocusScope",Sf=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,h]=p.useState(null),m=is(s),g=is(l),v=p.useRef(null),x=vt(t,C=>h(C)),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let C=function(j){if(b.paused||!d)return;const O=j.target;d.contains(O)?v.current=O:oi(v.current,{select:!0})},E=function(j){if(b.paused||!d)return;const O=j.relatedTarget;O!==null&&(d.contains(O)||oi(v.current,{select:!0}))},R=function(j){if(document.activeElement===document.body)for(const D of j)D.removedNodes.length>0&&oi(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),T.disconnect()}}},[r,d,b.paused]),p.useEffect(()=>{if(d){VR.add(b);const C=document.activeElement;if(!d.contains(C)){const R=new CustomEvent(ax,FR);d.addEventListener(ax,m),d.dispatchEvent(R),R.defaultPrevented||(Y9(e7(Yj(d)),{select:!0}),document.activeElement===C&&oi(d))}return()=>{d.removeEventListener(ax,m),setTimeout(()=>{const R=new CustomEvent(sx,FR);d.addEventListener(sx,g),d.dispatchEvent(R),R.defaultPrevented||oi(C??document.body,{select:!0}),d.removeEventListener(sx,g),VR.remove(b)},0)}}},[d,m,g,b]);const w=p.useCallback(C=>{if(!n&&!r||b.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(E&&R){const T=C.currentTarget,[j,O]=W9(T);j&&O?!C.shiftKey&&R===O?(C.preventDefault(),n&&oi(j,{select:!0})):C.shiftKey&&R===j&&(C.preventDefault(),n&&oi(O,{select:!0})):R===T&&C.preventDefault()}},[n,r,b.paused]);return o.jsx(Ye.div,{tabIndex:-1,...c,ref:x,onKeyDown:w})});Sf.displayName=Z9;function Y9(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(oi(r,{select:t}),document.activeElement!==n)return}function W9(e){const t=Yj(e),n=zR(t,e),r=zR(t.reverse(),e);return[n,r]}function Yj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zR(e,t){for(const n of e)if(!Q9(n,{upTo:t}))return n}function Q9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function X9(e){return e instanceof HTMLInputElement&&"select"in e}function oi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&X9(e)&&t&&e.select()}}var VR=J9();function J9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=HR(e,t),e.unshift(t)},remove(t){var n;e=HR(e,t),(n=e[0])==null||n.resume()}}}function HR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function e7(e){return e.filter(t=>t.tagName!=="A")}var t7="Portal",Ul=p.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[s,l]=p.useState(!1);yr(()=>l(!0),[]);const c=n||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?V6.createPortal(o.jsx(Ye.div,{...r,ref:t}),c):null});Ul.displayName=t7;function n7(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var _r=e=>{const{present:t,children:n}=e,r=r7(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),l=vt(r.ref,a7(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:l}):null};_r.displayName="Presence";function r7(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,h]=n7(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const m=fm(r.current);l.current=d==="mounted"?m:"none"},[d]),yr(()=>{const m=r.current,g=s.current;if(g!==e){const x=l.current,b=fm(m);e?h("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?h("UNMOUNT"):h(g&&x!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),yr(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,v=b=>{const C=fm(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&C&&(h("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=b=>{b.target===t&&(l.current=fm(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:p.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function fm(e){return(e==null?void 0:e.animationName)||"none"}function a7(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ox=0;function Fp(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$R()),document.body.insertAdjacentElement("beforeend",e[1]??$R()),ox++,()=>{ox===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ox--}},[])}function $R(){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 Ns=function(){return Ns=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Ns.apply(this,arguments)};function Wj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function s7(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var Im="right-scroll-bar-position",Lm="width-before-scroll-bar",o7="with-scroll-bars-hidden",i7="--removed-body-scroll-bar-size";function ix(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function l7(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var c7=typeof window<"u"?p.useLayoutEffect:p.useEffect,BR=new WeakMap;function u7(e,t){var n=l7(null,function(r){return e.forEach(function(s){return ix(s,r)})});return c7(function(){var r=BR.get(n);if(r){var s=new Set(r),l=new Set(e),c=n.current;s.forEach(function(d){l.has(d)||ix(d,null)}),l.forEach(function(d){s.has(d)||ix(d,c)})}BR.set(n,e)},[e]),n}function d7(e){return e}function f7(e,t){t===void 0&&(t=d7);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var h=function(){var g=c;c=[],g.forEach(l)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return s}function h7(e){e===void 0&&(e={});var t=f7(null);return t.options=Ns({async:!0,ssr:!1},e),t}var Qj=function(e){var t=e.sideCar,n=Wj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Ns({},n))};Qj.isSideCarExport=!0;function m7(e,t){return e.useMedium(t),Qj}var Xj=h7(),lx=function(){},zp=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:lx,onWheelCapture:lx,onTouchMoveCapture:lx}),s=r[0],l=r[1],c=e.forwardProps,d=e.children,h=e.className,m=e.removeScrollBar,g=e.enabled,v=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,C=e.inert,E=e.allowPinchZoom,R=e.as,T=R===void 0?"div":R,j=e.gapMode,O=Wj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=x,N=u7([n,t]),A=Ns(Ns({},O),s);return p.createElement(p.Fragment,null,g&&p.createElement(D,{sideCar:Xj,removeScrollBar:m,shards:v,noRelative:b,noIsolation:w,inert:C,setCallbacks:l,allowPinchZoom:!!E,lockRef:n,gapMode:j}),c?p.cloneElement(p.Children.only(d),Ns(Ns({},A),{ref:N})):p.createElement(T,Ns({},A,{className:h,ref:N}),d))});zp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zp.classNames={fullWidth:Lm,zeroRight:Im};var p7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p7();return t&&e.setAttribute("nonce",t),e}function v7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function y7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var x7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=g7())&&(v7(t,n),y7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b7=function(){var e=x7();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Jj=function(){var e=b7(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},S7={left:0,top:0,right:0,gap:0},cx=function(e){return parseInt(e||"",10)||0},C7=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[cx(n),cx(r),cx(s)]},w7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return S7;var t=C7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},E7=Jj(),Zc="data-scroll-locked",R7=function(e,t,n,r){var s=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
442
|
-
.`.concat(o7,` {
|
|
443
|
-
overflow: hidden `).concat(r,`;
|
|
444
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
445
|
-
}
|
|
446
|
-
body[`).concat(Zc,`] {
|
|
447
|
-
overflow: hidden `).concat(r,`;
|
|
448
|
-
overscroll-behavior: contain;
|
|
449
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
450
|
-
padding-left: `.concat(s,`px;
|
|
451
|
-
padding-top: `).concat(l,`px;
|
|
452
|
-
padding-right: `).concat(c,`px;
|
|
453
|
-
margin-left:0;
|
|
454
|
-
margin-top:0;
|
|
455
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
456
|
-
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.`).concat(Im,` {
|
|
460
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.`).concat(Lm,` {
|
|
464
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.`).concat(Im," .").concat(Im,` {
|
|
468
|
-
right: 0 `).concat(r,`;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.`).concat(Lm," .").concat(Lm,` {
|
|
472
|
-
margin-right: 0 `).concat(r,`;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
body[`).concat(Zc,`] {
|
|
476
|
-
`).concat(i7,": ").concat(d,`px;
|
|
477
|
-
}
|
|
478
|
-
`)},GR=function(){var e=parseInt(document.body.getAttribute(Zc)||"0",10);return isFinite(e)?e:0},T7=function(){p.useEffect(function(){return document.body.setAttribute(Zc,(GR()+1).toString()),function(){var e=GR()-1;e<=0?document.body.removeAttribute(Zc):document.body.setAttribute(Zc,e.toString())}},[])},j7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;T7();var l=p.useMemo(function(){return w7(s)},[s]);return p.createElement(E7,{styles:R7(l,!t,s,n?"":"!important")})},r0=!1;if(typeof window<"u")try{var hm=Object.defineProperty({},"passive",{get:function(){return r0=!0,!0}});window.addEventListener("test",hm,hm),window.removeEventListener("test",hm,hm)}catch{r0=!1}var Nc=r0?{passive:!1}:!1,_7=function(e){return e.tagName==="TEXTAREA"},e_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_7(e)&&n[t]==="visible")},N7=function(e){return e_(e,"overflowY")},A7=function(e){return e_(e,"overflowX")},qR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=t_(e,r);if(s){var l=n_(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},D7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},O7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},t_=function(e,t){return e==="v"?N7(t):A7(t)},n_=function(e,t){return e==="v"?D7(t):O7(t)},M7=function(e,t){return e==="h"&&t==="rtl"?-1:1},k7=function(e,t,n,r,s){var l=M7(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,h=t.contains(d),m=!1,g=c>0,v=0,x=0;do{if(!d)break;var b=n_(e,d),w=b[0],C=b[1],E=b[2],R=C-E-l*w;(w||R)&&t_(e,d)&&(v+=R,x+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(g&&Math.abs(v)<1||!g&&Math.abs(x)<1)&&(m=!0),m},mm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},KR=function(e){return[e.deltaX,e.deltaY]},ZR=function(e){return e&&"current"in e?e.current:e},I7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},L7=function(e){return`
|
|
479
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
480
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
481
|
-
`)},P7=0,Ac=[];function U7(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(P7++)[0],l=p.useState(Jj)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=s7([e.lockRef.current],(e.shards||[]).map(ZR),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var R=mm(C),T=n.current,j="deltaX"in C?C.deltaX:T[0]-R[0],O="deltaY"in C?C.deltaY:T[1]-R[1],D,N=C.target,A=Math.abs(j)>Math.abs(O)?"h":"v";if("touches"in C&&A==="h"&&N.type==="range")return!1;var k=qR(A,N);if(!k)return!0;if(k?D=A:(D=A==="v"?"h":"v",k=qR(A,N)),!k)return!1;if(!r.current&&"changedTouches"in C&&(j||O)&&(r.current=D),!D)return!0;var V=r.current||D;return k7(V,E,C,V==="h"?j:O)},[]),h=p.useCallback(function(C){var E=C;if(!(!Ac.length||Ac[Ac.length-1]!==l)){var R="deltaY"in E?KR(E):mm(E),T=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&I7(D.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var j=(c.current.shards||[]).map(ZR).filter(Boolean).filter(function(D){return D.contains(E.target)}),O=j.length>0?d(E,j[0]):!c.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),m=p.useCallback(function(C,E,R,T){var j={name:C,delta:E,target:R,should:T,shadowParent:F7(R)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(O){return O!==j})},1)},[]),g=p.useCallback(function(C){n.current=mm(C),r.current=void 0},[]),v=p.useCallback(function(C){m(C.type,KR(C),C.target,d(C,e.lockRef.current))},[]),x=p.useCallback(function(C){m(C.type,mm(C),C.target,d(C,e.lockRef.current))},[]);p.useEffect(function(){return Ac.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",h,Nc),document.addEventListener("touchmove",h,Nc),document.addEventListener("touchstart",g,Nc),function(){Ac=Ac.filter(function(C){return C!==l}),document.removeEventListener("wheel",h,Nc),document.removeEventListener("touchmove",h,Nc),document.removeEventListener("touchstart",g,Nc)}},[]);var b=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(l,{styles:L7(s)}):null,b?p.createElement(j7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function F7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const z7=m7(Xj,U7);var Cf=p.forwardRef(function(e,t){return p.createElement(zp,Ns({},e,{ref:t,sideCar:z7}))});Cf.classNames=zp.classNames;var V7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dc=new WeakMap,pm=new WeakMap,gm={},ux=0,r_=function(e){return e&&(e.host||r_(e.parentNode))},H7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=r_(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$7=function(e,t,n,r){var s=H7(t,Array.isArray(e)?e:[e]);gm[n]||(gm[n]=new WeakMap);var l=gm[n],c=[],d=new Set,h=new Set(s),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};s.forEach(m);var g=function(v){!v||h.has(v)||Array.prototype.forEach.call(v.children,function(x){if(d.has(x))g(x);else try{var b=x.getAttribute(r),w=b!==null&&b!=="false",C=(Dc.get(x)||0)+1,E=(l.get(x)||0)+1;Dc.set(x,C),l.set(x,E),c.push(x),C===1&&w&&pm.set(x,!0),E===1&&x.setAttribute(n,"true"),w||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return g(t),d.clear(),ux++,function(){c.forEach(function(v){var x=Dc.get(v)-1,b=l.get(v)-1;Dc.set(v,x),l.set(v,b),x||(pm.has(v)||v.removeAttribute(r),pm.delete(v)),b||v.removeAttribute(n)}),ux--,ux||(Dc=new WeakMap,Dc=new WeakMap,pm=new WeakMap,gm={})}},Vp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=V7(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),$7(r,s,n,"aria-hidden")):function(){return null}},Hp="Dialog",[a_,s_]=Ur(Hp),[B7,ms]=a_(Hp),o_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),h=p.useRef(null),[m,g]=Xr({prop:r,defaultProp:s??!1,onChange:l,caller:Hp});return o.jsx(B7,{scope:t,triggerRef:d,contentRef:h,contentId:Mn(),titleId:Mn(),descriptionId:Mn(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(v=>!v),[g]),modal:c,children:n})};o_.displayName=Hp;var i_="DialogTrigger",l_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ms(i_,n),l=vt(t,s.triggerRef);return o.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":yb(s.open),...r,ref:l,onClick:je(e.onClick,s.onOpenToggle)})});l_.displayName=i_;var gb="DialogPortal",[G7,c_]=a_(gb,{forceMount:void 0}),u_=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=ms(gb,t);return o.jsx(G7,{scope:t,forceMount:n,children:p.Children.map(r,c=>o.jsx(_r,{present:n||l.open,children:o.jsx(Ul,{asChild:!0,container:s,children:c})}))})};u_.displayName=gb;var Ym="DialogOverlay",d_=p.forwardRef((e,t)=>{const n=c_(Ym,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=ms(Ym,e.__scopeDialog);return l.modal?o.jsx(_r,{present:r||l.open,children:o.jsx(K7,{...s,ref:t})}):null});d_.displayName=Ym;var q7=wi("DialogOverlay.RemoveScroll"),K7=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ms(Ym,n);return o.jsx(Cf,{as:q7,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(Ye.div,{"data-state":yb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),El="DialogContent",f_=p.forwardRef((e,t)=>{const n=c_(El,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=ms(El,e.__scopeDialog);return o.jsx(_r,{present:r||l.open,children:l.modal?o.jsx(Z7,{...s,ref:t}):o.jsx(Y7,{...s,ref:t})})});f_.displayName=El;var Z7=p.forwardRef((e,t)=>{const n=ms(El,e.__scopeDialog),r=p.useRef(null),s=vt(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return Vp(l)},[]),o.jsx(h_,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault())})}),Y7=p.forwardRef((e,t)=>{const n=ms(El,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(h_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),h_=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=ms(El,n),h=p.useRef(null),m=vt(t,h);return Fp(),o.jsxs(o.Fragment,{children:[o.jsx(Sf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(Pl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":yb(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(Q7,{titleId:d.titleId}),o.jsx(J7,{contentRef:h,descriptionId:d.descriptionId})]})]})}),vb="DialogTitle",m_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ms(vb,n);return o.jsx(Ye.h2,{id:s.titleId,...r,ref:t})});m_.displayName=vb;var p_="DialogDescription",g_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ms(p_,n);return o.jsx(Ye.p,{id:s.descriptionId,...r,ref:t})});g_.displayName=p_;var v_="DialogClose",y_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ms(v_,n);return o.jsx(Ye.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>s.onOpenChange(!1))})});y_.displayName=v_;function yb(e){return e?"open":"closed"}var x_="DialogTitleWarning",[W7,b_]=M9(x_,{contentName:El,titleName:vb,docsSlug:"dialog"}),Q7=({titleId:e})=>{const t=b_(x_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
482
|
-
|
|
483
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
484
|
-
|
|
485
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},X7="DialogDescriptionWarning",J7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b_(X7).contentName}}.`;return p.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},$p=o_,eP=l_,Bp=u_,Gp=d_,qp=f_,xb=m_,bb=g_,Kp=y_;function Oi({...e}){return o.jsx($p,{"data-slot":"sheet",...e})}function tP({...e}){return o.jsx(Bp,{"data-slot":"sheet-portal",...e})}function nP({className:e,...t}){return o.jsx(Gp,{"data-slot":"sheet-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Mi({className:e,children:t,side:n="right",...r}){return o.jsxs(tP,{children:[o.jsx(nP,{}),o.jsxs(qp,{"data-slot":"sheet-content",className:ie("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px] md:min-w-[720px] lg:min-w-[960px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px] md:min-w-[720px] lg:min-w-[960px]",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,o.jsxs(Kp,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(ru,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ki({className:e,...t}){return o.jsx("div",{"data-slot":"sheet-header",className:ie("flex flex-col gap-1 border-b p-4",e),...t})}function Ii({className:e,...t}){return o.jsx(xb,{"data-slot":"sheet-title",className:ie("text-foreground font-semibold",e),...t})}function Fl({className:e,...t}){return o.jsx(bb,{"data-slot":"sheet-description",className:ie("text-muted-foreground text-sm",e),...t})}function ts({className:e,...t}){return o.jsx("div",{"data-slot":"skeleton",className:ie("bg-accent animate-pulse rounded-md",e),...t})}const rP=["top","right","bottom","left"],Ei=Math.min,da=Math.max,Wm=Math.round,vm=Math.floor,ks=e=>({x:e,y:e}),aP={left:"right",right:"left",bottom:"top",top:"bottom"},sP={start:"end",end:"start"};function a0(e,t,n){return da(e,Ei(t,n))}function To(e,t){return typeof e=="function"?e(t):e}function jo(e){return e.split("-")[0]}function vu(e){return e.split("-")[1]}function Sb(e){return e==="x"?"y":"x"}function Cb(e){return e==="y"?"height":"width"}const oP=new Set(["top","bottom"]);function As(e){return oP.has(jo(e))?"y":"x"}function wb(e){return Sb(As(e))}function iP(e,t,n){n===void 0&&(n=!1);const r=vu(e),s=wb(e),l=Cb(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Qm(c)),[c,Qm(c)]}function lP(e){const t=Qm(e);return[s0(e),t,s0(t)]}function s0(e){return e.replace(/start|end/g,t=>sP[t])}const YR=["left","right"],WR=["right","left"],cP=["top","bottom"],uP=["bottom","top"];function dP(e,t,n){switch(e){case"top":case"bottom":return n?t?WR:YR:t?YR:WR;case"left":case"right":return t?cP:uP;default:return[]}}function fP(e,t,n,r){const s=vu(e);let l=dP(jo(e),n==="start",r);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(s0)))),l}function Qm(e){return e.replace(/left|right|bottom|top/g,t=>aP[t])}function hP(e){return{top:0,right:0,bottom:0,left:0,...e}}function S_(e){return typeof e!="number"?hP(e):{top:e,right:e,bottom:e,left:e}}function Xm(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function QR(e,t,n){let{reference:r,floating:s}=e;const l=As(t),c=wb(t),d=Cb(c),h=jo(t),m=l==="y",g=r.x+r.width/2-s.width/2,v=r.y+r.height/2-s.height/2,x=r[d]/2-s[d]/2;let b;switch(h){case"top":b={x:g,y:r.y-s.height};break;case"bottom":b={x:g,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:v};break;case"left":b={x:r.x-s.width,y:v};break;default:b={x:r.x,y:r.y}}switch(vu(t)){case"start":b[c]-=x*(n&&m?-1:1);break;case"end":b[c]+=x*(n&&m?-1:1);break}return b}const mP=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:v}=QR(m,r,h),x=r,b={},w=0;for(let C=0;C<d.length;C++){const{name:E,fn:R}=d[C],{x:T,y:j,data:O,reset:D}=await R({x:g,y:v,initialPlacement:r,placement:x,strategy:s,middlewareData:b,rects:m,platform:c,elements:{reference:e,floating:t}});g=T??g,v=j??v,b={...b,[E]:{...b[E],...O}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(x=D.placement),D.rects&&(m=D.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:g,y:v}=QR(m,x,h)),C=-1)}return{x:g,y:v,placement:x,strategy:s,middlewareData:b}};async function tf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:c,elements:d,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:x=!1,padding:b=0}=To(t,e),w=S_(b),E=d[x?v==="floating"?"reference":"floating":v],R=Xm(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(E)))==null||n?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:g,strategy:h})),T=v==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,j=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(j))?await(l.getScale==null?void 0:l.getScale(j))||{x:1,y:1}:{x:1,y:1},D=Xm(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:j,strategy:h}):T);return{top:(R.top-D.top+w.top)/O.y,bottom:(D.bottom-R.bottom+w.bottom)/O.y,left:(R.left-D.left+w.left)/O.x,right:(D.right-R.right+w.right)/O.x}}const pP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:c,elements:d,middlewareData:h}=t,{element:m,padding:g=0}=To(e,t)||{};if(m==null)return{};const v=S_(g),x={x:n,y:r},b=wb(s),w=Cb(b),C=await c.getDimensions(m),E=b==="y",R=E?"top":"left",T=E?"bottom":"right",j=E?"clientHeight":"clientWidth",O=l.reference[w]+l.reference[b]-x[b]-l.floating[w],D=x[b]-l.reference[b],N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let A=N?N[j]:0;(!A||!await(c.isElement==null?void 0:c.isElement(N)))&&(A=d.floating[j]||l.floating[w]);const k=O/2-D/2,V=A/2-C[w]/2-1,q=Ei(v[R],V),H=Ei(v[T],V),W=q,re=A-C[w]-H,G=A/2-C[w]/2+k,Q=a0(W,G,re),I=!h.arrow&&vu(s)!=null&&G!==Q&&l.reference[w]/2-(G<W?q:H)-C[w]/2<0,Y=I?G<W?G-W:G-re:0;return{[b]:x[b]+Y,data:{[b]:Q,centerOffset:G-Q-Y,...I&&{alignmentOffset:Y}},reset:I}}}),gP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:c,initialPlacement:d,platform:h,elements:m}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=To(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=jo(s),T=As(d),j=jo(d)===d,O=await(h.isRTL==null?void 0:h.isRTL(m.floating)),D=x||(j||!C?[Qm(d)]:lP(d)),N=w!=="none";!x&&N&&D.push(...fP(d,C,w,O));const A=[d,...D],k=await tf(t,E),V=[];let q=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&V.push(k[R]),v){const G=iP(s,c,O);V.push(k[G[0]],k[G[1]])}if(q=[...q,{placement:s,overflows:V}],!V.every(G=>G<=0)){var H,W;const G=(((H=l.flip)==null?void 0:H.index)||0)+1,Q=A[G];if(Q&&(!(v==="alignment"?T!==As(Q):!1)||q.every(B=>As(B.placement)===T?B.overflows[0]>0:!0)))return{data:{index:G,overflows:q},reset:{placement:Q}};let I=(W=q.filter(Y=>Y.overflows[0]<=0).sort((Y,B)=>Y.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!I)switch(b){case"bestFit":{var re;const Y=(re=q.filter(B=>{if(N){const oe=As(B.placement);return oe===T||oe==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(oe=>oe>0).reduce((oe,be)=>oe+be,0)]).sort((B,oe)=>B[1]-oe[1])[0])==null?void 0:re[0];Y&&(I=Y);break}case"initialPlacement":I=d;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function XR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JR(e){return rP.some(t=>e[t]>=0)}const vP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=To(e,t);switch(r){case"referenceHidden":{const l=await tf(t,{...s,elementContext:"reference"}),c=XR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:JR(c)}}}case"escaped":{const l=await tf(t,{...s,altBoundary:!0}),c=XR(l,n.floating);return{data:{escapedOffsets:c,escaped:JR(c)}}}default:return{}}}}},C_=new Set(["left","top"]);async function yP(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=jo(n),d=vu(n),h=As(n)==="y",m=C_.has(c)?-1:1,g=l&&h?-1:1,v=To(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),h?{x:b*g,y:x*m}:{x:x*m,y:b*g}}const xP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:c,middlewareData:d}=t,h=await yP(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:c}}}}},bP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:R,y:T}=E;return{x:R,y:T}}},...h}=To(e,t),m={x:n,y:r},g=await tf(t,h),v=As(jo(s)),x=Sb(v);let b=m[x],w=m[v];if(l){const E=x==="y"?"top":"left",R=x==="y"?"bottom":"right",T=b+g[E],j=b-g[R];b=a0(T,b,j)}if(c){const E=v==="y"?"top":"left",R=v==="y"?"bottom":"right",T=w+g[E],j=w-g[R];w=a0(T,w,j)}const C=d.fn({...t,[x]:b,[v]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:l,[v]:c}}}}}},SP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:h=!0,crossAxis:m=!0}=To(e,t),g={x:n,y:r},v=As(s),x=Sb(v);let b=g[x],w=g[v];const C=To(d,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const j=x==="y"?"height":"width",O=l.reference[x]-l.floating[j]+E.mainAxis,D=l.reference[x]+l.reference[j]-E.mainAxis;b<O?b=O:b>D&&(b=D)}if(m){var R,T;const j=x==="y"?"width":"height",O=C_.has(jo(s)),D=l.reference[v]-l.floating[j]+(O&&((R=c.offset)==null?void 0:R[v])||0)+(O?0:E.crossAxis),N=l.reference[v]+l.reference[j]+(O?0:((T=c.offset)==null?void 0:T[v])||0)-(O?E.crossAxis:0);w<D?w=D:w>N&&(w=N)}return{[x]:b,[v]:w}}}},CP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:c,elements:d}=t,{apply:h=()=>{},...m}=To(e,t),g=await tf(t,m),v=jo(s),x=vu(s),b=As(s)==="y",{width:w,height:C}=l.floating;let E,R;v==="top"||v==="bottom"?(E=v,R=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=v,E=x==="end"?"top":"bottom");const T=C-g.top-g.bottom,j=w-g.left-g.right,O=Ei(C-g[E],T),D=Ei(w-g[R],j),N=!t.middlewareData.shift;let A=O,k=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=T),N&&!x){const q=da(g.left,0),H=da(g.right,0),W=da(g.top,0),re=da(g.bottom,0);b?k=w-2*(q!==0||H!==0?q+H:da(g.left,g.right)):A=C-2*(W!==0||re!==0?W+re:da(g.top,g.bottom))}await h({...t,availableWidth:k,availableHeight:A});const V=await c.getDimensions(d.floating);return w!==V.width||C!==V.height?{reset:{rects:!0}}:{}}}};function Zp(){return typeof window<"u"}function yu(e){return w_(e)?(e.nodeName||"").toLowerCase():"#document"}function ma(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vs(e){var t;return(t=(w_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w_(e){return Zp()?e instanceof Node||e instanceof ma(e).Node:!1}function ls(e){return Zp()?e instanceof Element||e instanceof ma(e).Element:!1}function Ps(e){return Zp()?e instanceof HTMLElement||e instanceof ma(e).HTMLElement:!1}function e2(e){return!Zp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ma(e).ShadowRoot}const wP=new Set(["inline","contents"]);function wf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=cs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wP.has(s)}const EP=new Set(["table","td","th"]);function RP(e){return EP.has(yu(e))}const TP=[":popover-open",":modal"];function Yp(e){return TP.some(t=>{try{return e.matches(t)}catch{return!1}})}const jP=["transform","translate","scale","rotate","perspective"],_P=["transform","translate","scale","rotate","perspective","filter"],NP=["paint","layout","strict","content"];function Eb(e){const t=Rb(),n=ls(e)?cs(e):e;return jP.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||_P.some(r=>(n.willChange||"").includes(r))||NP.some(r=>(n.contain||"").includes(r))}function AP(e){let t=Ri(e);for(;Ps(t)&&!au(t);){if(Eb(t))return t;if(Yp(t))return null;t=Ri(t)}return null}function Rb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const DP=new Set(["html","body","#document"]);function au(e){return DP.has(yu(e))}function cs(e){return ma(e).getComputedStyle(e)}function Wp(e){return ls(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ri(e){if(yu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||e2(e)&&e.host||Vs(e);return e2(t)?t.host:t}function E_(e){const t=Ri(e);return au(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ps(t)&&wf(t)?t:E_(t)}function nf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=E_(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),c=ma(s);if(l){const d=o0(c);return t.concat(c,c.visualViewport||[],wf(s)?s:[],d&&n?nf(d):[])}return t.concat(s,nf(s,[],n))}function o0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function R_(e){const t=cs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ps(e),l=s?e.offsetWidth:n,c=s?e.offsetHeight:r,d=Wm(n)!==l||Wm(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function Tb(e){return ls(e)?e:e.contextElement}function Yc(e){const t=Tb(e);if(!Ps(t))return ks(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=R_(t);let c=(l?Wm(n.width):n.width)/r,d=(l?Wm(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const OP=ks(0);function T_(e){const t=ma(e);return!Rb()||!t.visualViewport?OP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ma(e)?!1:t}function Rl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=Tb(e);let c=ks(1);t&&(r?ls(r)&&(c=Yc(r)):c=Yc(e));const d=MP(l,n,r)?T_(l):ks(0);let h=(s.left+d.x)/c.x,m=(s.top+d.y)/c.y,g=s.width/c.x,v=s.height/c.y;if(l){const x=ma(l),b=r&&ls(r)?ma(r):r;let w=x,C=o0(w);for(;C&&r&&b!==w;){const E=Yc(C),R=C.getBoundingClientRect(),T=cs(C),j=R.left+(C.clientLeft+parseFloat(T.paddingLeft))*E.x,O=R.top+(C.clientTop+parseFloat(T.paddingTop))*E.y;h*=E.x,m*=E.y,g*=E.x,v*=E.y,h+=j,m+=O,w=ma(C),C=o0(w)}}return Xm({width:g,height:v,x:h,y:m})}function Qp(e,t){const n=Wp(e).scrollLeft;return t?t.left+n:Rl(Vs(e)).left+n}function j_(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Qp(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function kP(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",c=Vs(r),d=t?Yp(t.floating):!1;if(r===c||d&&l)return n;let h={scrollLeft:0,scrollTop:0},m=ks(1);const g=ks(0),v=Ps(r);if((v||!v&&!l)&&((yu(r)!=="body"||wf(c))&&(h=Wp(r)),Ps(r))){const b=Rl(r);m=Yc(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const x=c&&!v&&!l?j_(c,h):ks(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+g.x+x.x,y:n.y*m.y-h.scrollTop*m.y+g.y+x.y}}function IP(e){return Array.from(e.getClientRects())}function LP(e){const t=Vs(e),n=Wp(e),r=e.ownerDocument.body,s=da(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=da(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Qp(e);const d=-n.scrollTop;return cs(r).direction==="rtl"&&(c+=da(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:c,y:d}}const t2=25;function PP(e,t){const n=ma(e),r=Vs(e),s=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,h=0;if(s){l=s.width,c=s.height;const g=Rb();(!g||g&&t==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}const m=Qp(r);if(m<=0){const g=r.ownerDocument,v=g.body,x=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(r.clientWidth-v.clientWidth-b);w<=t2&&(l-=w)}else m<=t2&&(l+=m);return{width:l,height:c,x:d,y:h}}const UP=new Set(["absolute","fixed"]);function FP(e,t){const n=Rl(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=Ps(e)?Yc(e):ks(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,h=s*l.x,m=r*l.y;return{width:c,height:d,x:h,y:m}}function n2(e,t,n){let r;if(t==="viewport")r=PP(e,n);else if(t==="document")r=LP(Vs(e));else if(ls(t))r=FP(t,n);else{const s=T_(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Xm(r)}function __(e,t){const n=Ri(e);return n===t||!ls(n)||au(n)?!1:cs(n).position==="fixed"||__(n,t)}function zP(e,t){const n=t.get(e);if(n)return n;let r=nf(e,[],!1).filter(d=>ls(d)&&yu(d)!=="body"),s=null;const l=cs(e).position==="fixed";let c=l?Ri(e):e;for(;ls(c)&&!au(c);){const d=cs(c),h=Eb(c);!h&&d.position==="fixed"&&(s=null),(l?!h&&!s:!h&&d.position==="static"&&!!s&&UP.has(s.position)||wf(c)&&!h&&__(e,c))?r=r.filter(g=>g!==c):s=d,c=Ri(c)}return t.set(e,r),r}function VP(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?Yp(t)?[]:zP(t,this._c):[].concat(n),r],d=c[0],h=c.reduce((m,g)=>{const v=n2(t,g,s);return m.top=da(v.top,m.top),m.right=Ei(v.right,m.right),m.bottom=Ei(v.bottom,m.bottom),m.left=da(v.left,m.left),m},n2(t,d,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function HP(e){const{width:t,height:n}=R_(e);return{width:t,height:n}}function $P(e,t,n){const r=Ps(t),s=Vs(t),l=n==="fixed",c=Rl(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const h=ks(0);function m(){h.x=Qp(s)}if(r||!r&&!l)if((yu(t)!=="body"||wf(s))&&(d=Wp(t)),r){const b=Rl(t,!0,l,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else s&&m();l&&!r&&s&&m();const g=s&&!r&&!l?j_(s,d):ks(0),v=c.left+d.scrollLeft-h.x-g.x,x=c.top+d.scrollTop-h.y-g.y;return{x:v,y:x,width:c.width,height:c.height}}function dx(e){return cs(e).position==="static"}function r2(e,t){if(!Ps(e)||cs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Vs(e)===n&&(n=n.ownerDocument.body),n}function N_(e,t){const n=ma(e);if(Yp(e))return n;if(!Ps(e)){let s=Ri(e);for(;s&&!au(s);){if(ls(s)&&!dx(s))return s;s=Ri(s)}return n}let r=r2(e,t);for(;r&&RP(r)&&dx(r);)r=r2(r,t);return r&&au(r)&&dx(r)&&!Eb(r)?n:r||AP(e)||n}const BP=async function(e){const t=this.getOffsetParent||N_,n=this.getDimensions,r=await n(e.floating);return{reference:$P(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GP(e){return cs(e).direction==="rtl"}const qP={convertOffsetParentRelativeRectToViewportRelativeRect:kP,getDocumentElement:Vs,getClippingRect:VP,getOffsetParent:N_,getElementRects:BP,getClientRects:IP,getDimensions:HP,getScale:Yc,isElement:ls,isRTL:GP};function A_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KP(e,t){let n=null,r;const s=Vs(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),l();const m=e.getBoundingClientRect(),{left:g,top:v,width:x,height:b}=m;if(d||t(),!x||!b)return;const w=vm(v),C=vm(s.clientWidth-(g+x)),E=vm(s.clientHeight-(v+b)),R=vm(g),j={rootMargin:-w+"px "+-C+"px "+-E+"px "+-R+"px",threshold:da(0,Ei(1,h))||1};let O=!0;function D(N){const A=N[0].intersectionRatio;if(A!==h){if(!O)return c();A?c(!1,A):r=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!A_(m,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(D,{...j,root:s.ownerDocument})}catch{n=new IntersectionObserver(D,j)}n.observe(e)}return c(!0),l}function ZP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=Tb(e),g=s||l?[...m?nf(m):[],...nf(t)]:[];g.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const v=m&&d?KP(m,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var j;(j=b)==null||j.observe(t)})),n()}),m&&!h&&b.observe(m),b.observe(t));let w,C=h?Rl(e):null;h&&E();function E(){const R=Rl(e);C&&!A_(C,R)&&n(),C=R,w=requestAnimationFrame(E)}return n(),()=>{var R;g.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),v==null||v(),(R=b)==null||R.disconnect(),b=null,h&&cancelAnimationFrame(w)}}const YP=xP,WP=bP,QP=gP,XP=CP,JP=vP,a2=pP,eU=SP,tU=(e,t,n)=>{const r=new Map,s={platform:qP,...n},l={...s.platform,_c:r};return mP(e,t,{...s,platform:l})};var nU=typeof document<"u",rU=function(){},Pm=nU?p.useLayoutEffect:rU;function Jm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jm(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!Jm(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function D_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s2(e,t){const n=D_(e);return Math.round(t*n)/n}function fx(e){const t=p.useRef(e);return Pm(()=>{t.current=e}),t}function aU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:h,open:m}=e,[g,v]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=p.useState(r);Jm(x,r)||b(r);const[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useCallback(B=>{B!==N.current&&(N.current=B,C(B))},[]),j=p.useCallback(B=>{B!==A.current&&(A.current=B,R(B))},[]),O=l||w,D=c||E,N=p.useRef(null),A=p.useRef(null),k=p.useRef(g),V=h!=null,q=fx(h),H=fx(s),W=fx(m),re=p.useCallback(()=>{if(!N.current||!A.current)return;const B={placement:t,strategy:n,middleware:x};H.current&&(B.platform=H.current),tU(N.current,A.current,B).then(oe=>{const be={...oe,isPositioned:W.current!==!1};G.current&&!Jm(k.current,be)&&(k.current=be,as.flushSync(()=>{v(be)}))})},[x,t,n,H,W]);Pm(()=>{m===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[m]);const G=p.useRef(!1);Pm(()=>(G.current=!0,()=>{G.current=!1}),[]),Pm(()=>{if(O&&(N.current=O),D&&(A.current=D),O&&D){if(q.current)return q.current(O,D,re);re()}},[O,D,re,q,V]);const Q=p.useMemo(()=>({reference:N,floating:A,setReference:T,setFloating:j}),[T,j]),I=p.useMemo(()=>({reference:O,floating:D}),[O,D]),Y=p.useMemo(()=>{const B={position:n,left:0,top:0};if(!I.floating)return B;const oe=s2(I.floating,g.x),be=s2(I.floating,g.y);return d?{...B,transform:"translate("+oe+"px, "+be+"px)",...D_(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:be}},[n,d,I.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:re,refs:Q,elements:I,floatingStyles:Y}),[g,re,Q,I,Y])}const sU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?a2({element:r.current,padding:s}).fn(n):{}:r?a2({element:r,padding:s}).fn(n):{}}}},oU=(e,t)=>({...YP(e),options:[e,t]}),iU=(e,t)=>({...WP(e),options:[e,t]}),lU=(e,t)=>({...eU(e),options:[e,t]}),cU=(e,t)=>({...QP(e),options:[e,t]}),uU=(e,t)=>({...XP(e),options:[e,t]}),dU=(e,t)=>({...JP(e),options:[e,t]}),fU=(e,t)=>({...sU(e),options:[e,t]});var hU="Arrow",O_=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return o.jsx(Ye.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});O_.displayName=hU;var mU=O_;function jb(e){const[t,n]=p.useState(void 0);return yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,d;if("borderBoxSize"in l){const h=l.borderBoxSize,m=Array.isArray(h)?h[0]:h;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _b="Popper",[M_,Hs]=Ur(_b),[pU,k_]=M_(_b),I_=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return o.jsx(pU,{scope:t,anchor:r,onAnchorChange:s,children:n})};I_.displayName=_b;var L_="PopperAnchor",P_=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=k_(L_,n),c=p.useRef(null),d=vt(t,c),h=p.useRef(null);return p.useEffect(()=>{const m=h.current;h.current=(r==null?void 0:r.current)||c.current,m!==h.current&&l.onAnchorChange(h.current)}),r?null:o.jsx(Ye.div,{...s,ref:d})});P_.displayName=L_;var Nb="PopperContent",[gU,vU]=M_(Nb),U_=p.forwardRef((e,t)=>{var ue,Ae,Re,xe,Je,Qe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:w,...C}=e,E=k_(Nb,n),[R,T]=p.useState(null),j=vt(t,zt=>T(zt)),[O,D]=p.useState(null),N=jb(O),A=(N==null?void 0:N.width)??0,k=(N==null?void 0:N.height)??0,V=r+(l!=="center"?"-"+l:""),q=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},H=Array.isArray(m)?m:[m],W=H.length>0,re={padding:q,boundary:H.filter(xU),altBoundary:W},{refs:G,floatingStyles:Q,placement:I,isPositioned:Y,middlewareData:B}=aU({strategy:"fixed",placement:V,whileElementsMounted:(...zt)=>ZP(...zt,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[oU({mainAxis:s+k,alignmentAxis:c}),h&&iU({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?lU():void 0,...re}),h&&cU({...re}),uU({...re,apply:({elements:zt,rects:Te,availableWidth:ft,availableHeight:lt})=>{const{width:sn,height:Ea}=Te.reference,ur=zt.floating.style;ur.setProperty("--radix-popper-available-width",`${ft}px`),ur.setProperty("--radix-popper-available-height",`${lt}px`),ur.setProperty("--radix-popper-anchor-width",`${sn}px`),ur.setProperty("--radix-popper-anchor-height",`${Ea}px`)}}),O&&fU({element:O,padding:d}),bU({arrowWidth:A,arrowHeight:k}),x&&dU({strategy:"referenceHidden",...re})]}),[oe,be]=V_(I),L=is(w);yr(()=>{Y&&(L==null||L())},[Y,L]);const P=(ue=B.arrow)==null?void 0:ue.x,K=(Ae=B.arrow)==null?void 0:Ae.y,ne=((Re=B.arrow)==null?void 0:Re.centerOffset)!==0,[fe,ge]=p.useState();return yr(()=>{R&&ge(window.getComputedStyle(R).zIndex)},[R]),o.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:Y?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(xe=B.transformOrigin)==null?void 0:xe.x,(Je=B.transformOrigin)==null?void 0:Je.y].join(" "),...((Qe=B.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(gU,{scope:n,placedSide:oe,onArrowChange:D,arrowX:P,arrowY:K,shouldHideArrow:ne,children:o.jsx(Ye.div,{"data-side":oe,"data-align":be,...C,ref:j,style:{...C.style,animation:Y?void 0:"none"}})})})});U_.displayName=Nb;var F_="PopperArrow",yU={top:"bottom",right:"left",bottom:"top",left:"right"},z_=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=vU(F_,r),c=yU[l.placedSide];return o.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:o.jsx(mU,{...s,ref:n,style:{...s.style,display:"block"}})})});z_.displayName=F_;function xU(e){return e!==null}var bU=e=>({name:"transformOrigin",options:e,fn(t){var E,R,T;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,d=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[m,g]=V_(n),v={start:"0%",center:"50%",end:"100%"}[g],x=(((R=s.arrow)==null?void 0:R.x)??0)+d/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let w="",C="";return m==="bottom"?(w=c?v:`${x}px`,C=`${-h}px`):m==="top"?(w=c?v:`${x}px`,C=`${r.floating.height+h}px`):m==="right"?(w=`${-h}px`,C=c?v:`${b}px`):m==="left"&&(w=`${r.floating.width+h}px`,C=c?v:`${b}px`),{data:{x:w,y:C}}}});function V_(e){const[t,n="center"]=e.split("-");return[t,n]}var xu=I_,bu=P_,Ef=U_,Rf=z_,H_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),SU="VisuallyHidden",$_=p.forwardRef((e,t)=>o.jsx(Ye.span,{...e,ref:t,style:{...H_,...e.style}}));$_.displayName=SU;var CU=$_,[Xp]=Ur("Tooltip",[Hs]),Jp=Hs(),B_="TooltipProvider",wU=700,i0="tooltip.open",[EU,Ab]=Xp(B_),G_=e=>{const{__scopeTooltip:t,delayDuration:n=wU,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),h=p.useRef(0);return p.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),o.jsx(EU,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};G_.displayName=B_;var rf="Tooltip",[RU,Tf]=Xp(rf),q_=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,h=Ab(rf,e.__scopeTooltip),m=Jp(t),[g,v]=p.useState(null),x=Mn(),b=p.useRef(0),w=c??h.disableHoverableContent,C=d??h.delayDuration,E=p.useRef(!1),[R,T]=Xr({prop:r,defaultProp:s??!1,onChange:A=>{A?(h.onOpen(),document.dispatchEvent(new CustomEvent(i0))):h.onClose(),l==null||l(A)},caller:rf}),j=p.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,T(!0)},[T]),D=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),N=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,T(!0),b.current=0},C)},[C,T]);return p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),o.jsx(xu,{...m,children:o.jsx(RU,{scope:t,contentId:x,open:R,stateAttribute:j,trigger:g,onTriggerChange:v,onTriggerEnter:p.useCallback(()=>{h.isOpenDelayedRef.current?N():O()},[h.isOpenDelayedRef,N,O]),onTriggerLeave:p.useCallback(()=>{w?D():(window.clearTimeout(b.current),b.current=0)},[D,w]),onOpen:O,onClose:D,disableHoverableContent:w,children:n})})};q_.displayName=rf;var l0="TooltipTrigger",K_=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Tf(l0,n),l=Ab(l0,n),c=Jp(n),d=p.useRef(null),h=vt(t,d,s.onTriggerChange),m=p.useRef(!1),g=p.useRef(!1),v=p.useCallback(()=>m.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(bu,{asChild:!0,...c,children:o.jsx(Ye.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:je(e.onPointerMove,x=>{x.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:je(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:je(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:je(e.onBlur,s.onClose),onClick:je(e.onClick,s.onClose)})})});K_.displayName=l0;var Db="TooltipPortal",[TU,jU]=Xp(Db,{forceMount:void 0}),Z_=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=Tf(Db,t);return o.jsx(TU,{scope:t,forceMount:n,children:o.jsx(_r,{present:n||l.open,children:o.jsx(Ul,{asChild:!0,container:s,children:r})})})};Z_.displayName=Db;var su="TooltipContent",Y_=p.forwardRef((e,t)=>{const n=jU(su,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,c=Tf(su,e.__scopeTooltip);return o.jsx(_r,{present:r||c.open,children:c.disableHoverableContent?o.jsx(W_,{side:s,...l,ref:t}):o.jsx(_U,{side:s,...l,ref:t})})}),_U=p.forwardRef((e,t)=>{const n=Tf(su,e.__scopeTooltip),r=Ab(su,e.__scopeTooltip),s=p.useRef(null),l=vt(t,s),[c,d]=p.useState(null),{trigger:h,onClose:m}=n,g=s.current,{onPointerInTransitChange:v}=r,x=p.useCallback(()=>{d(null),v(!1)},[v]),b=p.useCallback((w,C)=>{const E=w.currentTarget,R={x:w.clientX,y:w.clientY},T=OU(R,E.getBoundingClientRect()),j=MU(R,T),O=kU(C.getBoundingClientRect()),D=LU([...j,...O]);d(D),v(!0)},[v]);return p.useEffect(()=>()=>x(),[x]),p.useEffect(()=>{if(h&&g){const w=E=>b(E,g),C=E=>b(E,h);return h.addEventListener("pointerleave",w),g.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",C)}}},[h,g,b,x]),p.useEffect(()=>{if(c){const w=C=>{const E=C.target,R={x:C.clientX,y:C.clientY},T=(h==null?void 0:h.contains(E))||(g==null?void 0:g.contains(E)),j=!IU(R,c);T?x():j&&(x(),m())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,g,c,m,x]),o.jsx(W_,{...e,ref:l})}),[NU,AU]=Xp(rf,{isInside:!1}),DU=Sj("TooltipContent"),W_=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,h=Tf(su,n),m=Jp(n),{onClose:g}=h;return p.useEffect(()=>(document.addEventListener(i0,g),()=>document.removeEventListener(i0,g)),[g]),p.useEffect(()=>{if(h.trigger){const v=x=>{const b=x.target;b!=null&&b.contains(h.trigger)&&g()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[h.trigger,g]),o.jsx(Pl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:g,children:o.jsxs(Ef,{"data-state":h.stateAttribute,...m,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(DU,{children:r}),o.jsx(NU,{scope:n,isInside:!0,children:o.jsx(CU,{id:h.contentId,role:"tooltip",children:s||r})})]})})});Y_.displayName=su;var Q_="TooltipArrow",X_=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Jp(n);return AU(Q_,n).isInside?null:o.jsx(Rf,{...s,...r,ref:t})});X_.displayName=Q_;function OU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function MU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function kU(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function IU(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],h=t[c],m=d.x,g=d.y,v=h.x,x=h.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function LU(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),PU(t)}function PU(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var UU=G_,FU=q_,zU=K_,VU=Z_,HU=Y_,$U=X_;function Ds({delayDuration:e=0,...t}){return o.jsx(UU,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function jt({...e}){return o.jsx(Ds,{children:o.jsx(FU,{"data-slot":"tooltip",...e})})}function _t({...e}){return o.jsx(zU,{"data-slot":"tooltip-trigger",...e})}function Nt({className:e,sideOffset:t=0,children:n,...r}){return o.jsx(VU,{children:o.jsxs(HU,{"data-slot":"tooltip-content",sideOffset:t,className:ie("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-md bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,o.jsx($U,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-black fill-black dark:bg-white dark:fill-white"})]})})}const BU="sidebar_state",GU=3600*24*7,qU="16rem",KU="18rem",ZU="3rem",YU="b",J_=p.createContext(null);function jf(){const e=p.useContext(J_);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function WU({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:l,...c}){const d=K8(),[h,m]=p.useState(!1),[g,v]=p.useState(e),x=t??g,b=p.useCallback(R=>{const T=typeof R=="function"?R(x):R;n?n(T):v(T),document.cookie=`${BU}=${T}; path=/; max-age=${GU}`},[n,x]),w=p.useCallback(()=>d?m(R=>!R):b(R=>!R),[d,b,m]);p.useEffect(()=>{const R=T=>{T.key===YU&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const C=x?"expanded":"collapsed",E=p.useMemo(()=>({state:C,open:x,setOpen:b,isMobile:d,openMobile:h,setOpenMobile:m,toggleSidebar:w}),[C,x,b,d,h,m,w]);return o.jsx(J_.Provider,{value:E,children:o.jsx(Ds,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":qU,"--sidebar-width-icon":ZU,...s},className:ie("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function QU({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...l}){const{isMobile:c,state:d,openMobile:h,setOpenMobile:m}=jf();return n==="none"?o.jsx("div",{"data-slot":"sidebar",className:ie("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:s}):c?o.jsx(Oi,{open:h,onOpenChange:m,...l,children:o.jsxs(Mi,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) min-w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":KU},side:e,children:[o.jsxs(ki,{className:"sr-only",children:[o.jsx(Ii,{children:"Sidebar"}),o.jsx(Fl,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:ie("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{"data-slot":"sidebar-container",className:ie("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function XU({className:e,onClick:t,...n}){const{toggleSidebar:r}=jf();return o.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:o.jsxs(we,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ie("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(f8,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function JU({className:e,...t}){const{toggleSidebar:n}=jf();return o.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ie("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function eF({className:e,...t}){return o.jsx("main",{"data-slot":"sidebar-inset",className:ie("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function tF({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ie("flex flex-col gap-2 p-2",e),...t})}function nF({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ie("flex flex-col gap-2 p-2",e),...t})}function rF({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ie("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function o2({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ie("relative flex w-full min-w-0 flex-col p-2",e),...t})}function i2({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ie("w-full text-sm",e),...t})}function aF({className:e,...t}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ie("flex w-full min-w-0 flex-col gap-1",e),...t})}function sF({className:e,...t}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ie("group/menu-item relative",e),...t})}const oF=yf("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground 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-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground 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:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function iF({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:l,...c}){const d=e?Lp:"button",{isMobile:h,state:m}=jf(),g=o.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:ie(oF({variant:n,size:r}),l),...c});return s?(typeof s=="string"&&(s={children:s}),o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:g}),o.jsx(Nt,{side:"right",align:"center",hidden:m!=="collapsed"||h,...s})]})):g}function eg(e){const t=e+"CollectionProvider",[n,r]=Ur(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,T=_e.useRef(null),j=_e.useRef(new Map).current;return o.jsx(s,{scope:E,itemMap:j,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",h=wi(d),m=_e.forwardRef((C,E)=>{const{scope:R,children:T}=C,j=l(d,R),O=vt(E,j.collectionRef);return o.jsx(h,{ref:O,children:T})});m.displayName=d;const g=e+"CollectionItemSlot",v="data-radix-collection-item",x=wi(g),b=_e.forwardRef((C,E)=>{const{scope:R,children:T,...j}=C,O=_e.useRef(null),D=vt(E,O),N=l(g,R);return _e.useEffect(()=>(N.itemMap.set(O,{ref:O,...j}),()=>void N.itemMap.delete(O))),o.jsx(x,{[v]:"",ref:D,children:T})});b.displayName=g;function w(C){const E=l(e+"CollectionConsumer",C);return _e.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const j=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((N,A)=>j.indexOf(N.ref.current)-j.indexOf(A.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},w,r]}var lF=p.createContext(void 0);function tg(e){const t=p.useContext(lF);return e||t||"ltr"}var hx="rovingFocusGroup.onEntryFocus",cF={bubbles:!1,cancelable:!0},_f="RovingFocusGroup",[c0,eN,uF]=eg(_f),[dF,tN]=Ur(_f,[uF]),[fF,hF]=dF(_f),nN=p.forwardRef((e,t)=>o.jsx(c0.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(c0.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(mF,{...e,ref:t})})}));nN.displayName=_f;var mF=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...v}=e,x=p.useRef(null),b=vt(t,x),w=tg(l),[C,E]=Xr({prop:c,defaultProp:d??null,onChange:h,caller:_f}),[R,T]=p.useState(!1),j=is(m),O=eN(n),D=p.useRef(!1),[N,A]=p.useState(0);return p.useEffect(()=>{const k=x.current;if(k)return k.addEventListener(hx,j),()=>k.removeEventListener(hx,j)},[j]),o.jsx(fF,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:C,onItemFocus:p.useCallback(k=>E(k),[E]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>A(k=>k-1),[]),children:o.jsx(Ye.div,{tabIndex:R||N===0?-1:0,"data-orientation":r,...v,ref:b,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{D.current=!0}),onFocus:je(e.onFocus,k=>{const V=!D.current;if(k.target===k.currentTarget&&V&&!R){const q=new CustomEvent(hx,cF);if(k.currentTarget.dispatchEvent(q),!q.defaultPrevented){const H=O().filter(I=>I.focusable),W=H.find(I=>I.active),re=H.find(I=>I.id===C),Q=[W,re,...H].filter(Boolean).map(I=>I.ref.current);sN(Q,g)}}D.current=!1}),onBlur:je(e.onBlur,()=>T(!1))})})}),rN="RovingFocusGroupItem",aN=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:c,...d}=e,h=Mn(),m=l||h,g=hF(rN,n),v=g.currentTabStopId===m,x=eN(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:C}=g;return p.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),o.jsx(c0.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:o.jsx(Ye.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:je(e.onMouseDown,E=>{r?g.onItemFocus(m):E.preventDefault()}),onFocus:je(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:je(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=vF(E,g.orientation,g.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let j=x().filter(O=>O.focusable).map(O=>O.ref.current);if(R==="last")j.reverse();else if(R==="prev"||R==="next"){R==="prev"&&j.reverse();const O=j.indexOf(E.currentTarget);j=g.loop?yF(j,O+1):j.slice(O+1)}setTimeout(()=>sN(j))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:C!=null}):c})})});aN.displayName=rN;var pF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gF(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vF(e,t,n){const r=gF(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pF[r]}function sN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function yF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xF=nN,bF=aN,u0=["Enter"," "],SF=["ArrowDown","PageUp","Home"],oN=["ArrowUp","PageDown","End"],CF=[...SF,...oN],wF={ltr:[...u0,"ArrowRight"],rtl:[...u0,"ArrowLeft"]},EF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Nf="Menu",[af,RF,TF]=eg(Nf),[zl,iN]=Ur(Nf,[TF,Hs,tN]),Af=Hs(),lN=tN(),[cN,Li]=zl(Nf),[jF,Df]=zl(Nf),uN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:c=!0}=e,d=Af(t),[h,m]=p.useState(null),g=p.useRef(!1),v=is(l),x=tg(s);return p.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),o.jsx(xu,{...d,children:o.jsx(cN,{scope:t,open:n,onOpenChange:v,content:h,onContentChange:m,children:o.jsx(jF,{scope:t,onClose:p.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:x,modal:c,children:r})})})};uN.displayName=Nf;var _F="MenuAnchor",Ob=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Af(n);return o.jsx(bu,{...s,...r,ref:t})});Ob.displayName=_F;var Mb="MenuPortal",[NF,dN]=zl(Mb,{forceMount:void 0}),fN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=Li(Mb,t);return o.jsx(NF,{scope:t,forceMount:n,children:o.jsx(_r,{present:n||l.open,children:o.jsx(Ul,{asChild:!0,container:s,children:r})})})};fN.displayName=Mb;var za="MenuContent",[AF,kb]=zl(za),hN=p.forwardRef((e,t)=>{const n=dN(za,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Li(za,e.__scopeMenu),c=Df(za,e.__scopeMenu);return o.jsx(af.Provider,{scope:e.__scopeMenu,children:o.jsx(_r,{present:r||l.open,children:o.jsx(af.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(DF,{...s,ref:t}):o.jsx(OF,{...s,ref:t})})})})}),DF=p.forwardRef((e,t)=>{const n=Li(za,e.__scopeMenu),r=p.useRef(null),s=vt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return Vp(l)},[]),o.jsx(Ib,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),OF=p.forwardRef((e,t)=>{const n=Li(za,e.__scopeMenu);return o.jsx(Ib,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),MF=wi("MenuContent.ScrollLock"),Ib=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,disableOutsideScroll:w,...C}=e,E=Li(za,n),R=Df(za,n),T=Af(n),j=lN(n),O=RF(n),[D,N]=p.useState(null),A=p.useRef(null),k=vt(t,A,E.onContentChange),V=p.useRef(0),q=p.useRef(""),H=p.useRef(0),W=p.useRef(null),re=p.useRef("right"),G=p.useRef(0),Q=w?Cf:p.Fragment,I=w?{as:MF,allowPinchZoom:!0}:void 0,Y=oe=>{var ue,Ae;const be=q.current+oe,L=O().filter(Re=>!Re.disabled),P=document.activeElement,K=(ue=L.find(Re=>Re.ref.current===P))==null?void 0:ue.textValue,ne=L.map(Re=>Re.textValue),fe=GF(ne,be,K),ge=(Ae=L.find(Re=>Re.textValue===fe))==null?void 0:Ae.ref.current;(function Re(xe){q.current=xe,window.clearTimeout(V.current),xe!==""&&(V.current=window.setTimeout(()=>Re(""),1e3))})(be),ge&&setTimeout(()=>ge.focus())};p.useEffect(()=>()=>window.clearTimeout(V.current),[]),Fp();const B=p.useCallback(oe=>{var L,P;return re.current===((L=W.current)==null?void 0:L.side)&&KF(oe,(P=W.current)==null?void 0:P.area)},[]);return o.jsx(AF,{scope:n,searchRef:q,onItemEnter:p.useCallback(oe=>{B(oe)&&oe.preventDefault()},[B]),onItemLeave:p.useCallback(oe=>{var be;B(oe)||((be=A.current)==null||be.focus(),N(null))},[B]),onTriggerLeave:p.useCallback(oe=>{B(oe)&&oe.preventDefault()},[B]),pointerGraceTimerRef:H,onPointerGraceIntentChange:p.useCallback(oe=>{W.current=oe},[]),children:o.jsx(Q,{...I,children:o.jsx(Sf,{asChild:!0,trapped:s,onMountAutoFocus:je(l,oe=>{var be;oe.preventDefault(),(be=A.current)==null||be.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(Pl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,children:o.jsx(xF,{asChild:!0,...j,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:N,onEntryFocus:je(h,oe=>{R.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Ef,{role:"menu","aria-orientation":"vertical","data-state":AN(E.open),"data-radix-menu-content":"",dir:R.dir,...T,...C,ref:k,style:{outline:"none",...C.style},onKeyDown:je(C.onKeyDown,oe=>{const L=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,P=oe.ctrlKey||oe.altKey||oe.metaKey,K=oe.key.length===1;L&&(oe.key==="Tab"&&oe.preventDefault(),!P&&K&&Y(oe.key));const ne=A.current;if(oe.target!==ne||!CF.includes(oe.key))return;oe.preventDefault();const ge=O().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);oN.includes(oe.key)&&ge.reverse(),$F(ge)}),onBlur:je(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(V.current),q.current="")}),onPointerMove:je(e.onPointerMove,sf(oe=>{const be=oe.target,L=G.current!==oe.clientX;if(oe.currentTarget.contains(be)&&L){const P=oe.clientX>G.current?"right":"left";re.current=P,G.current=oe.clientX}}))})})})})})})});hN.displayName=za;var kF="MenuGroup",Lb=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ye.div,{role:"group",...r,ref:t})});Lb.displayName=kF;var IF="MenuLabel",mN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ye.div,{...r,ref:t})});mN.displayName=IF;var ep="MenuItem",l2="menu.itemSelect",ng=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=p.useRef(null),c=Df(ep,e.__scopeMenu),d=kb(ep,e.__scopeMenu),h=vt(t,l),m=p.useRef(!1),g=()=>{const v=l.current;if(!n&&v){const x=new CustomEvent(l2,{bubbles:!0,cancelable:!0});v.addEventListener(l2,b=>r==null?void 0:r(b),{once:!0}),Bj(v,x),x.defaultPrevented?m.current=!1:c.onClose()}};return o.jsx(pN,{...s,ref:h,disabled:n,onClick:je(e.onClick,g),onPointerDown:v=>{var x;(x=e.onPointerDown)==null||x.call(e,v),m.current=!0},onPointerUp:je(e.onPointerUp,v=>{var x;m.current||(x=v.currentTarget)==null||x.click()}),onKeyDown:je(e.onKeyDown,v=>{const x=d.searchRef.current!=="";n||x&&v.key===" "||u0.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});ng.displayName=ep;var pN=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,c=kb(ep,n),d=lN(n),h=p.useRef(null),m=vt(t,h),[g,v]=p.useState(!1),[x,b]=p.useState("");return p.useEffect(()=>{const w=h.current;w&&b((w.textContent??"").trim())},[l.children]),o.jsx(af.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:o.jsx(bF,{asChild:!0,...d,focusable:!r,children:o.jsx(Ye.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:m,onPointerMove:je(e.onPointerMove,sf(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,sf(w=>c.onItemLeave(w))),onFocus:je(e.onFocus,()=>v(!0)),onBlur:je(e.onBlur,()=>v(!1))})})})}),LF="MenuCheckboxItem",gN=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsx(SN,{scope:e.__scopeMenu,checked:n,children:o.jsx(ng,{role:"menuitemcheckbox","aria-checked":tp(n)?"mixed":n,...s,ref:t,"data-state":Fb(n),onSelect:je(s.onSelect,()=>r==null?void 0:r(tp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});gN.displayName=LF;var vN="MenuRadioGroup",[PF,UF]=zl(vN,{value:void 0,onValueChange:()=>{}}),yN=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=is(r);return o.jsx(PF,{scope:e.__scopeMenu,value:n,onValueChange:l,children:o.jsx(Lb,{...s,ref:t})})});yN.displayName=vN;var xN="MenuRadioItem",bN=p.forwardRef((e,t)=>{const{value:n,...r}=e,s=UF(xN,e.__scopeMenu),l=n===s.value;return o.jsx(SN,{scope:e.__scopeMenu,checked:l,children:o.jsx(ng,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":Fb(l),onSelect:je(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});bN.displayName=xN;var Pb="MenuItemIndicator",[SN,FF]=zl(Pb,{checked:!1}),CN=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=FF(Pb,n);return o.jsx(_r,{present:r||tp(l.checked)||l.checked===!0,children:o.jsx(Ye.span,{...s,ref:t,"data-state":Fb(l.checked)})})});CN.displayName=Pb;var zF="MenuSeparator",wN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});wN.displayName=zF;var VF="MenuArrow",EN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Af(n);return o.jsx(Rf,{...s,...r,ref:t})});EN.displayName=VF;var Ub="MenuSub",[HF,RN]=zl(Ub),TN=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,l=Li(Ub,t),c=Af(t),[d,h]=p.useState(null),[m,g]=p.useState(null),v=is(s);return p.useEffect(()=>(l.open===!1&&v(!1),()=>v(!1)),[l.open,v]),o.jsx(xu,{...c,children:o.jsx(cN,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:g,children:o.jsx(HF,{scope:t,contentId:Mn(),triggerId:Mn(),trigger:d,onTriggerChange:h,children:n})})})};TN.displayName=Ub;var Pd="MenuSubTrigger",jN=p.forwardRef((e,t)=>{const n=Li(Pd,e.__scopeMenu),r=Df(Pd,e.__scopeMenu),s=RN(Pd,e.__scopeMenu),l=kb(Pd,e.__scopeMenu),c=p.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=l,m={__scopeMenu:e.__scopeMenu},g=p.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return p.useEffect(()=>g,[g]),p.useEffect(()=>{const v=d.current;return()=>{window.clearTimeout(v),h(null)}},[d,h]),o.jsx(Ob,{asChild:!0,...m,children:o.jsx(pN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":AN(n.open),...e,ref:Ro(t,s.onTriggerChange),onClick:v=>{var x;(x=e.onClick)==null||x.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,sf(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:je(e.onPointerLeave,sf(v=>{var b,w;g();const x=(b=n.content)==null?void 0:b.getBoundingClientRect();if(x){const C=(w=n.content)==null?void 0:w.dataset.side,E=C==="right",R=E?-5:5,T=x[E?"left":"right"],j=x[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+R,y:v.clientY},{x:T,y:x.top},{x:j,y:x.top},{x:j,y:x.bottom},{x:T,y:x.bottom}],side:C}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,v=>{var b;const x=l.searchRef.current!=="";e.disabled||x&&v.key===" "||wF[r.dir].includes(v.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),v.preventDefault())})})})});jN.displayName=Pd;var _N="MenuSubContent",NN=p.forwardRef((e,t)=>{const n=dN(za,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Li(za,e.__scopeMenu),c=Df(za,e.__scopeMenu),d=RN(_N,e.__scopeMenu),h=p.useRef(null),m=vt(t,h);return o.jsx(af.Provider,{scope:e.__scopeMenu,children:o.jsx(_r,{present:r||l.open,children:o.jsx(af.Slot,{scope:e.__scopeMenu,children:o.jsx(Ib,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var v;c.isUsingKeyboardRef.current&&((v=h.current)==null||v.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:je(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:je(e.onKeyDown,g=>{var b;const v=g.currentTarget.contains(g.target),x=EF[c.dir].includes(g.key);v&&x&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});NN.displayName=_N;function AN(e){return e?"open":"closed"}function tp(e){return e==="indeterminate"}function Fb(e){return tp(e)?"indeterminate":e?"checked":"unchecked"}function $F(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function BF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function GF(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=BF(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function qF(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],h=t[c],m=d.x,g=d.y,v=h.x,x=h.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function KF(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qF(n,t)}function sf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ZF=uN,YF=Ob,WF=fN,QF=hN,XF=Lb,JF=mN,ez=ng,tz=gN,nz=yN,rz=bN,az=CN,sz=wN,oz=EN,iz=TN,lz=jN,cz=NN,rg="DropdownMenu",[uz]=Ur(rg,[iN]),Nr=iN(),[dz,DN]=uz(rg),ON=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,h=Nr(t),m=p.useRef(null),[g,v]=Xr({prop:s,defaultProp:l??!1,onChange:c,caller:rg});return o.jsx(dz,{scope:t,triggerId:Mn(),triggerRef:m,contentId:Mn(),open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(x=>!x),[v]),modal:d,children:o.jsx(ZF,{...h,open:g,onOpenChange:v,dir:r,modal:d,children:n})})};ON.displayName=rg;var MN="DropdownMenuTrigger",kN=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,l=DN(MN,n),c=Nr(n);return o.jsx(YF,{asChild:!0,...c,children:o.jsx(Ye.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Ro(t,l.triggerRef),onPointerDown:je(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:je(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});kN.displayName=MN;var fz="DropdownMenuPortal",IN=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return o.jsx(WF,{...r,...n})};IN.displayName=fz;var LN="DropdownMenuContent",PN=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=DN(LN,n),l=Nr(n),c=p.useRef(!1);return o.jsx(QF,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...r,ref:t,onCloseAutoFocus:je(e.onCloseAutoFocus,d=>{var h;c.current||(h=s.triggerRef.current)==null||h.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:je(e.onInteractOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,g=h.button===2||m;(!s.modal||g)&&(c.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)"}})});PN.displayName=LN;var hz="DropdownMenuGroup",mz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(XF,{...s,...r,ref:t})});mz.displayName=hz;var pz="DropdownMenuLabel",gz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(JF,{...s,...r,ref:t})});gz.displayName=pz;var vz="DropdownMenuItem",UN=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(ez,{...s,...r,ref:t})});UN.displayName=vz;var yz="DropdownMenuCheckboxItem",xz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(tz,{...s,...r,ref:t})});xz.displayName=yz;var bz="DropdownMenuRadioGroup",Sz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(nz,{...s,...r,ref:t})});Sz.displayName=bz;var Cz="DropdownMenuRadioItem",wz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(rz,{...s,...r,ref:t})});wz.displayName=Cz;var Ez="DropdownMenuItemIndicator",Rz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(az,{...s,...r,ref:t})});Rz.displayName=Ez;var Tz="DropdownMenuSeparator",FN=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(sz,{...s,...r,ref:t})});FN.displayName=Tz;var jz="DropdownMenuArrow",_z=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(oz,{...s,...r,ref:t})});_z.displayName=jz;var Nz=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:l}=e,c=Nr(t),[d,h]=Xr({prop:r,defaultProp:l??!1,onChange:s,caller:"DropdownMenuSub"});return o.jsx(iz,{...c,open:d,onOpenChange:h,children:n})},Az="DropdownMenuSubTrigger",zN=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(lz,{...s,...r,ref:t})});zN.displayName=Az;var Dz="DropdownMenuSubContent",VN=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Nr(n);return o.jsx(cz,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});VN.displayName=Dz;var Oz=ON,Mz=kN,HN=IN,kz=PN,Iz=UN,Lz=FN,Pz=Nz,Uz=zN,Fz=VN;function Ar({...e}){return o.jsx(Oz,{"data-slot":"dropdown-menu",...e})}function zz({...e}){return o.jsx(HN,{"data-slot":"dropdown-menu-portal",...e})}function Dr({...e}){return o.jsx(Mz,{"data-slot":"dropdown-menu-trigger",...e})}function Or({className:e,sideOffset:t=4,...n}){return o.jsx(HN,{children:o.jsx(kz,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ie("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Tt({className:e,inset:t,variant:n="default",...r}){return o.jsx(Iz,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ie("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function $a({className:e,...t}){return o.jsx(Lz,{"data-slot":"dropdown-menu-separator",className:ie("bg-border -mx-1 my-1 h-px",e),...t})}function $N({...e}){return o.jsx(Pz,{"data-slot":"dropdown-menu-sub",...e})}function BN({className:e,inset:t,children:n,...r}){return o.jsxs(Uz,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:ie("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,o.jsx(hs,{className:"ml-auto size-4"})]})}function GN({className:e,...t}){return o.jsx(Fz,{"data-slot":"dropdown-menu-sub-content",className:ie("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...t})}const Vz="data:image/svg+xml,%3csvg%20width='45'%20height='36'%20viewBox='0%200%2045%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1026_9)'%3e%3cpath%20d='M41.0124%202.70808C42.5841%204.28086%2043.2307%206.93134%2043.2307%206.93134C43.2307%206.93134%2044.1924%2012.2686%2044.1924%2019.5152C44.1924%209.25778%2040.7126%207.4971%2028.6169%207.4971H17.4622C11.2702%207.4971%2011.689%2013.72%2011.2702%2016.6815L10.7614%2021.156C10.5171%2025.8635%2011.3345%2028.7805%2016.1644%2028.7805C6.09372%2028.7805%200.499987%2030.4294%200.5%2016.2326C0.499994%209.80708%201.46893%206.93134%201.46893%206.93134C1.46893%206.93134%202.11548%204.28086%203.69048%202.70808C5.26549%201.13349%207.5998%200.975453%207.5998%200.975453C7.5998%200.975453%2012.4195%200.25%2021.9403%200.25C31.4612%200.25%2036.84%200.975453%2036.84%200.975453C36.84%200.975453%2039.4359%201.13349%2041.0124%202.70808Z'%20fill='url(%23paint0_linear_1026_9)'/%3e%3cpath%20d='M44.1907%2019.8412C44.1913%2019.9695%2044.1916%2020.0989%2044.1916%2020.2295C44.1916%2026.3837%2043.2754%2028.779%2043.2754%2028.779C43.2754%2028.779%2042.5584%2031.6808%2041.3343%2032.9343C39.3918%2034.9233%2037.3144%2035.0343%2037.3144%2035.0343C37.3144%2035.0343%2032.8453%2035.75%2023.229%2035.75C14.0031%2035.75%207.85921%2035.0387%207.85921%2035.0387C7.85921%2035.0387%205.26504%2034.8795%203.69004%2033.3064C2.11504%2031.7307%201.46849%2028.779%201.46849%2028.779C1.46849%2028.779%200.5%2022.7163%200.5%2016.0794C0.499988%2028.8752%205.0442%2028.7984%2013.3149%2028.6587H13.3149C14.2204%2028.6434%2015.1706%2028.6273%2016.1644%2028.6273H27.318C32.2013%2028.6273%2033.3039%2025.0731%2033.5164%2021.0028L34.0267%2014.7934C34.1626%2012.2409%2033.8337%2010.4287%2033.0336%209.26241C32.1612%207.99016%2030.6747%207.3439%2028.6169%207.3439C41.4253%207.3439%2044.1022%209.05998%2044.1907%2019.8412Z'%20fill='url(%23paint1_linear_1026_9)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1026_9'%20x1='22.2878'%20y1='0.25'%20x2='22.4818'%20y2='30.5768'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2305D2FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.72248'%20stop-color='%231E6EE5'/%3e%3cstop%20offset='1'%20stop-color='%23182FFF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1026_9'%20x1='3.17783'%20y1='35.6937'%20x2='37.9386'%20y2='5.41095'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2324D8FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.749106'%20stop-color='%231E7AE5'/%3e%3cstop%20offset='1'%20stop-color='%230046F9'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1026_9'%3e%3crect%20width='45'%20height='36'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Hz=({width:e=45,height:t=36,className:n=""})=>o.jsx("img",{src:Vz,alt:"OWOX Logo",width:e,height:t,className:n}),qN=p.createContext(null),KN=p.createContext(()=>{});function $z(){return p.useContext(KN)}function np(e){const t=p.useContext(qN);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function ZN(){return np(e=>e.project)}function zb(){const{data:e,callState:t,error:n}=np(r=>r.flags);return{flags:e,callState:t,error:n}}function Bz({isOpen:e}){const{title:t}=ZN();return o.jsx(Dr,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 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",children:[o.jsx("div",{className:"text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:o.jsx(Hz,{width:24,height:24})}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),o.jsx(Ga,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Tr=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Tr||{});function YN(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gz}=Object.prototype,{getPrototypeOf:Vb}=Object,{iterator:ag,toStringTag:WN}=Symbol,sg=(e=>t=>{const n=Gz.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ps=e=>(e=e.toLowerCase(),t=>sg(t)===e),og=e=>t=>typeof t===e,{isArray:Su}=Array,ou=og("undefined");function Of(e){return e!==null&&!ou(e)&&e.constructor!==null&&!ou(e.constructor)&&Wr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const QN=ps("ArrayBuffer");function qz(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&QN(e.buffer),t}const Kz=og("string"),Wr=og("function"),XN=og("number"),Mf=e=>e!==null&&typeof e=="object",Zz=e=>e===!0||e===!1,Um=e=>{if(sg(e)!=="object")return!1;const t=Vb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(WN in e)&&!(ag in e)},Yz=e=>{if(!Mf(e)||Of(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Wz=ps("Date"),Qz=ps("File"),Xz=ps("Blob"),Jz=ps("FileList"),eV=e=>Mf(e)&&Wr(e.pipe),tV=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Wr(e.append)&&((t=sg(e))==="formdata"||t==="object"&&Wr(e.toString)&&e.toString()==="[object FormData]"))},nV=ps("URLSearchParams"),[rV,aV,sV,oV]=["ReadableStream","Request","Response","Headers"].map(ps),iV=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Su(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Of(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;let d;for(r=0;r<c;r++)d=l[r],t.call(null,e[d],d,e)}}function JN(e,t){if(Of(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const gl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,eA=e=>!ou(e)&&e!==gl;function d0(){const{caseless:e,skipUndefined:t}=eA(this)&&this||{},n={},r=(s,l)=>{const c=e&&JN(n,l)||l;Um(n[c])&&Um(s)?n[c]=d0(n[c],s):Um(s)?n[c]=d0({},s):Su(s)?n[c]=s.slice():(!t||!ou(s))&&(n[c]=s)};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&kf(arguments[s],r);return n}const lV=(e,t,n,{allOwnKeys:r}={})=>(kf(t,(s,l)=>{n&&Wr(s)?e[l]=YN(s,n):e[l]=s},{allOwnKeys:r}),e),cV=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),uV=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},dV=(e,t,n,r)=>{let s,l,c;const d={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)c=s[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&Vb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},fV=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},hV=e=>{if(!e)return null;if(Su(e))return e;let t=e.length;if(!XN(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},mV=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Vb(Uint8Array)),pV=(e,t)=>{const r=(e&&e[ag]).call(e);let s;for(;(s=r.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},gV=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},vV=ps("HTMLFormElement"),yV=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),c2=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xV=ps("RegExp"),tA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};kf(n,(s,l)=>{let c;(c=t(s,l,e))!==!1&&(r[l]=c||s)}),Object.defineProperties(e,r)},bV=e=>{tA(e,(t,n)=>{if(Wr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Wr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},SV=(e,t)=>{const n={},r=s=>{s.forEach(l=>{n[l]=!0})};return Su(e)?r(e):r(String(e).split(t)),n},CV=()=>{},wV=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function EV(e){return!!(e&&Wr(e.append)&&e[WN]==="FormData"&&e[ag])}const RV=e=>{const t=new Array(10),n=(r,s)=>{if(Mf(r)){if(t.indexOf(r)>=0)return;if(Of(r))return r;if(!("toJSON"in r)){t[s]=r;const l=Su(r)?[]:{};return kf(r,(c,d)=>{const h=n(c,s+1);!ou(h)&&(l[d]=h)}),t[s]=void 0,l}}return r};return n(e,0)},TV=ps("AsyncFunction"),jV=e=>e&&(Mf(e)||Wr(e))&&Wr(e.then)&&Wr(e.catch),nA=((e,t)=>e?setImmediate:t?((n,r)=>(gl.addEventListener("message",({source:s,data:l})=>{s===gl&&l===n&&r.length&&r.shift()()},!1),s=>{r.push(s),gl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wr(gl.postMessage)),_V=typeof queueMicrotask<"u"?queueMicrotask.bind(gl):typeof process<"u"&&process.nextTick||nA,NV=e=>e!=null&&Wr(e[ag]),le={isArray:Su,isArrayBuffer:QN,isBuffer:Of,isFormData:tV,isArrayBufferView:qz,isString:Kz,isNumber:XN,isBoolean:Zz,isObject:Mf,isPlainObject:Um,isEmptyObject:Yz,isReadableStream:rV,isRequest:aV,isResponse:sV,isHeaders:oV,isUndefined:ou,isDate:Wz,isFile:Qz,isBlob:Xz,isRegExp:xV,isFunction:Wr,isStream:eV,isURLSearchParams:nV,isTypedArray:mV,isFileList:Jz,forEach:kf,merge:d0,extend:lV,trim:iV,stripBOM:cV,inherits:uV,toFlatObject:dV,kindOf:sg,kindOfTest:ps,endsWith:fV,toArray:hV,forEachEntry:pV,matchAll:gV,isHTMLForm:vV,hasOwnProperty:c2,hasOwnProp:c2,reduceDescriptors:tA,freezeMethods:bV,toObjectSet:SV,toCamelCase:yV,noop:CV,toFiniteNumber:wV,findKey:JN,global:gl,isContextDefined:eA,isSpecCompliantForm:EV,toJSONObject:RV,isAsyncFn:TV,isThenable:jV,setImmediate:nA,asap:_V,isIterable:NV};function dt(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}le.inherits(dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:le.toJSONObject(this.config),code:this.code,status:this.status}}});const rA=dt.prototype,aA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{aA[e]={value:e}});Object.defineProperties(dt,aA);Object.defineProperty(rA,"isAxiosError",{value:!0});dt.from=(e,t,n,r,s,l)=>{const c=Object.create(rA);le.toFlatObject(e,c,function(g){return g!==Error.prototype},m=>m!=="isAxiosError");const d=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return dt.call(c,d,h,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",l&&Object.assign(c,l),c};const AV=null;function f0(e){return le.isPlainObject(e)||le.isArray(e)}function sA(e){return le.endsWith(e,"[]")?e.slice(0,-2):e}function u2(e,t,n){return e?e.concat(t).map(function(s,l){return s=sA(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function DV(e){return le.isArray(e)&&!e.some(f0)}const OV=le.toFlatObject(le,{},null,function(t){return/^is[A-Z]/.test(t)});function ig(e,t,n){if(!le.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=le.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,E){return!le.isUndefined(E[C])});const r=n.metaTokens,s=n.visitor||g,l=n.dots,c=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&le.isSpecCompliantForm(t);if(!le.isFunction(s))throw new TypeError("visitor must be a function");function m(w){if(w===null)return"";if(le.isDate(w))return w.toISOString();if(le.isBoolean(w))return w.toString();if(!h&&le.isBlob(w))throw new dt("Blob is not supported. Use a Buffer instead.");return le.isArrayBuffer(w)||le.isTypedArray(w)?h&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function g(w,C,E){let R=w;if(w&&!E&&typeof w=="object"){if(le.endsWith(C,"{}"))C=r?C:C.slice(0,-2),w=JSON.stringify(w);else if(le.isArray(w)&&DV(w)||(le.isFileList(w)||le.endsWith(C,"[]"))&&(R=le.toArray(w)))return C=sA(C),R.forEach(function(j,O){!(le.isUndefined(j)||j===null)&&t.append(c===!0?u2([C],O,l):c===null?C:C+"[]",m(j))}),!1}return f0(w)?!0:(t.append(u2(E,C,l),m(w)),!1)}const v=[],x=Object.assign(OV,{defaultVisitor:g,convertValue:m,isVisitable:f0});function b(w,C){if(!le.isUndefined(w)){if(v.indexOf(w)!==-1)throw Error("Circular reference detected in "+C.join("."));v.push(w),le.forEach(w,function(R,T){(!(le.isUndefined(R)||R===null)&&s.call(t,R,le.isString(T)?T.trim():T,C,x))===!0&&b(R,C?C.concat(T):[T])}),v.pop()}}if(!le.isObject(e))throw new TypeError("data must be an object");return b(e),t}function d2(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Hb(e,t){this._pairs=[],e&&ig(e,this,t)}const oA=Hb.prototype;oA.append=function(t,n){this._pairs.push([t,n])};oA.toString=function(t){const n=t?function(r){return t.call(this,r,d2)}:d2;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function MV(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iA(e,t,n){if(!t)return e;const r=n&&n.encode||MV;le.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=le.isURLSearchParams(t)?t.toString():new Hb(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class f2{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){le.forEach(this.handlers,function(r){r!==null&&t(r)})}}const lA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kV=typeof URLSearchParams<"u"?URLSearchParams:Hb,IV=typeof FormData<"u"?FormData:null,LV=typeof Blob<"u"?Blob:null,PV={isBrowser:!0,classes:{URLSearchParams:kV,FormData:IV,Blob:LV},protocols:["http","https","file","blob","url","data"]},$b=typeof window<"u"&&typeof document<"u",h0=typeof navigator=="object"&&navigator||void 0,UV=$b&&(!h0||["ReactNative","NativeScript","NS"].indexOf(h0.product)<0),FV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zV=$b&&window.location.href||"http://localhost",VV=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$b,hasStandardBrowserEnv:UV,hasStandardBrowserWebWorkerEnv:FV,navigator:h0,origin:zV},Symbol.toStringTag,{value:"Module"})),Rr={...VV,...PV};function HV(e,t){return ig(e,new Rr.classes.URLSearchParams,{visitor:function(n,r,s,l){return Rr.isNode&&le.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function $V(e){return le.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function BV(e){const t={},n=Object.keys(e);let r;const s=n.length;let l;for(r=0;r<s;r++)l=n[r],t[l]=e[l];return t}function cA(e){function t(n,r,s,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),h=l>=n.length;return c=!c&&le.isArray(s)?s.length:c,h?(le.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!d):((!s[c]||!le.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],l)&&le.isArray(s[c])&&(s[c]=BV(s[c])),!d)}if(le.isFormData(e)&&le.isFunction(e.entries)){const n={};return le.forEachEntry(e,(r,s)=>{t($V(r),s,n,0)}),n}return null}function GV(e,t,n){if(le.isString(e))try{return(t||JSON.parse)(e),le.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const If={transitional:lA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,l=le.isObject(t);if(l&&le.isHTMLForm(t)&&(t=new FormData(t)),le.isFormData(t))return s?JSON.stringify(cA(t)):t;if(le.isArrayBuffer(t)||le.isBuffer(t)||le.isStream(t)||le.isFile(t)||le.isBlob(t)||le.isReadableStream(t))return t;if(le.isArrayBufferView(t))return t.buffer;if(le.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return HV(t,this.formSerializer).toString();if((d=le.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ig(d?{"files[]":t}:t,h&&new h,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),GV(t)):t}],transformResponse:[function(t){const n=this.transitional||If.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(le.isResponse(t)||le.isReadableStream(t))return t;if(t&&le.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?dt.from(d,dt.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Rr.classes.FormData,Blob:Rr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};le.forEach(["delete","get","head","post","put","patch"],e=>{If.headers[e]={}});const qV=le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),KV=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
486
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&qV[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},h2=Symbol("internals");function _d(e){return e&&String(e).trim().toLowerCase()}function Fm(e){return e===!1||e==null?e:le.isArray(e)?e.map(Fm):String(e)}function ZV(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const YV=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mx(e,t,n,r,s){if(le.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!le.isString(t)){if(le.isString(r))return t.indexOf(r)!==-1;if(le.isRegExp(r))return r.test(t)}}function WV(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function QV(e,t){const n=le.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,l,c){return this[r].call(this,t,s,l,c)},configurable:!0})})}let Qr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function l(d,h,m){const g=_d(h);if(!g)throw new Error("header name must be a non-empty string");const v=le.findKey(s,g);(!v||s[v]===void 0||m===!0||m===void 0&&s[v]!==!1)&&(s[v||h]=Fm(d))}const c=(d,h)=>le.forEach(d,(m,g)=>l(m,g,h));if(le.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(le.isString(t)&&(t=t.trim())&&!YV(t))c(KV(t),n);else if(le.isObject(t)&&le.isIterable(t)){let d={},h,m;for(const g of t){if(!le.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[m=g[0]]=(h=d[m])?le.isArray(h)?[...h,g[1]]:[h,g[1]]:g[1]}c(d,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=_d(t),t){const r=le.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return ZV(s);if(le.isFunction(n))return n.call(this,s,r);if(le.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=_d(t),t){const r=le.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||mx(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function l(c){if(c=_d(c),c){const d=le.findKey(r,c);d&&(!n||mx(r,r[d],d,n))&&(delete r[d],s=!0)}}return le.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const l=n[r];(!t||mx(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,r={};return le.forEach(this,(s,l)=>{const c=le.findKey(r,l);if(c){n[c]=Fm(s),delete n[l];return}const d=t?WV(l):String(l).trim();d!==l&&delete n[l],n[d]=Fm(s),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return le.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&le.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
487
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[h2]=this[h2]={accessors:{}}).accessors,s=this.prototype;function l(c){const d=_d(c);r[d]||(QV(s,c),r[d]=!0)}return le.isArray(t)?t.forEach(l):l(t),this}};Qr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);le.reduceDescriptors(Qr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});le.freezeMethods(Qr);function px(e,t){const n=this||If,r=t||n,s=Qr.from(r.headers);let l=r.data;return le.forEach(e,function(d){l=d.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function uA(e){return!!(e&&e.__CANCEL__)}function Cu(e,t,n){dt.call(this,e??"canceled",dt.ERR_CANCELED,t,n),this.name="CanceledError"}le.inherits(Cu,dt,{__CANCEL__:!0});function dA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new dt("Request failed with status code "+n.status,[dt.ERR_BAD_REQUEST,dt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function XV(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function JV(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,l=0,c;return t=t!==void 0?t:1e3,function(h){const m=Date.now(),g=r[l];c||(c=m),n[s]=h,r[s]=m;let v=l,x=0;for(;v!==s;)x+=n[v++],v=v%e;if(s=(s+1)%e,s===l&&(l=(l+1)%e),m-c<t)return;const b=g&&m-g;return b?Math.round(x*1e3/b):void 0}}function eH(e,t){let n=0,r=1e3/t,s,l;const c=(m,g=Date.now())=>{n=g,s=null,l&&(clearTimeout(l),l=null),e(...m)};return[(...m)=>{const g=Date.now(),v=g-n;v>=r?c(m,g):(s=m,l||(l=setTimeout(()=>{l=null,c(s)},r-v)))},()=>s&&c(s)]}const rp=(e,t,n=3)=>{let r=0;const s=JV(50,250);return eH(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,h=c-r,m=s(h),g=c<=d;r=c;const v={loaded:c,total:d,progress:d?c/d:void 0,bytes:h,rate:m||void 0,estimated:m&&d&&g?(d-c)/m:void 0,event:l,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(v)},n)},m2=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},p2=e=>(...t)=>le.asap(()=>e(...t)),tH=Rr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Rr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Rr.origin),Rr.navigator&&/(msie|trident)/i.test(Rr.navigator.userAgent)):()=>!0,nH=Rr.hasStandardBrowserEnv?{write(e,t,n,r,s,l){const c=[e+"="+encodeURIComponent(t)];le.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),le.isString(r)&&c.push("path="+r),le.isString(s)&&c.push("domain="+s),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function rH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function aH(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function fA(e,t,n){let r=!rH(t);return e&&(r||n==!1)?aH(e,t):t}const g2=e=>e instanceof Qr?{...e}:e;function Tl(e,t){t=t||{};const n={};function r(m,g,v,x){return le.isPlainObject(m)&&le.isPlainObject(g)?le.merge.call({caseless:x},m,g):le.isPlainObject(g)?le.merge({},g):le.isArray(g)?g.slice():g}function s(m,g,v,x){if(le.isUndefined(g)){if(!le.isUndefined(m))return r(void 0,m,v,x)}else return r(m,g,v,x)}function l(m,g){if(!le.isUndefined(g))return r(void 0,g)}function c(m,g){if(le.isUndefined(g)){if(!le.isUndefined(m))return r(void 0,m)}else return r(void 0,g)}function d(m,g,v){if(v in t)return r(m,g);if(v in e)return r(void 0,m)}const h={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(m,g,v)=>s(g2(m),g2(g),v,!0)};return le.forEach(Object.keys({...e,...t}),function(g){const v=h[g]||s,x=v(e[g],t[g],g);le.isUndefined(x)&&v!==d||(n[g]=x)}),n}const hA=e=>{const t=Tl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:l,headers:c,auth:d}=t;if(t.headers=c=Qr.from(c),t.url=iA(fA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),le.isFormData(n)){if(Rr.hasStandardBrowserEnv||Rr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(le.isFunction(n.getHeaders)){const h=n.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([g,v])=>{m.includes(g.toLowerCase())&&c.set(g,v)})}}if(Rr.hasStandardBrowserEnv&&(r&&le.isFunction(r)&&(r=r(t)),r||r!==!1&&tH(t.url))){const h=s&&l&&nH.read(l);h&&c.set(s,h)}return t},sH=typeof XMLHttpRequest<"u",oH=sH&&function(e){return new Promise(function(n,r){const s=hA(e);let l=s.data;const c=Qr.from(s.headers).normalize();let{responseType:d,onUploadProgress:h,onDownloadProgress:m}=s,g,v,x,b,w;function C(){b&&b(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const j=Qr.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),D={data:!d||d==="text"||d==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:j,config:e,request:E};dA(function(A){n(A),C()},function(A){r(A),C()},D),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(r(new dt("Request aborted",dt.ECONNABORTED,e,E)),E=null)},E.onerror=function(O){const D=O&&O.message?O.message:"Network Error",N=new dt(D,dt.ERR_NETWORK,e,E);N.event=O||null,r(N),E=null},E.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||lA;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new dt(O,D.clarifyTimeoutError?dt.ETIMEDOUT:dt.ECONNABORTED,e,E)),E=null},l===void 0&&c.setContentType(null),"setRequestHeader"in E&&le.forEach(c.toJSON(),function(O,D){E.setRequestHeader(D,O)}),le.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),d&&d!=="json"&&(E.responseType=s.responseType),m&&([x,w]=rp(m,!0),E.addEventListener("progress",x)),h&&E.upload&&([v,b]=rp(h),E.upload.addEventListener("progress",v),E.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(g=j=>{E&&(r(!j||j.type?new Cu(null,e,E):j),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const T=XV(s.url);if(T&&Rr.protocols.indexOf(T)===-1){r(new dt("Unsupported protocol "+T+":",dt.ERR_BAD_REQUEST,e));return}E.send(l||null)})},iH=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const l=function(m){if(!s){s=!0,d();const g=m instanceof Error?m:this.reason;r.abort(g instanceof dt?g:new Cu(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new dt(`timeout ${t} of ms exceeded`,dt.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(l):m.removeEventListener("abort",l)}),e=null)};e.forEach(m=>m.addEventListener("abort",l));const{signal:h}=r;return h.unsubscribe=()=>le.asap(d),h}},lH=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},cH=async function*(e,t){for await(const n of uH(e))yield*lH(n,t)},uH=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},v2=(e,t,n,r)=>{const s=cH(e,t);let l=0,c,d=h=>{c||(c=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:g}=await s.next();if(m){d(),h.close();return}let v=g.byteLength;if(n){let x=l+=v;n(x)}h.enqueue(new Uint8Array(g))}catch(m){throw d(m),m}},cancel(h){return d(h),s.return()}},{highWaterMark:2})},y2=64*1024,{isFunction:ym}=le,dH=(({Request:e,Response:t})=>({Request:e,Response:t}))(le.global),{ReadableStream:x2,TextEncoder:b2}=le.global,S2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},fH=e=>{e=le.merge.call({skipUndefined:!0},dH,e);const{fetch:t,Request:n,Response:r}=e,s=t?ym(t):typeof fetch=="function",l=ym(n),c=ym(r);if(!s)return!1;const d=s&&ym(x2),h=s&&(typeof b2=="function"?(w=>C=>w.encode(C))(new b2):async w=>new Uint8Array(await new n(w).arrayBuffer())),m=l&&d&&S2(()=>{let w=!1;const C=new n(Rr.origin,{body:new x2,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!C}),g=c&&d&&S2(()=>le.isReadableStream(new r("").body)),v={stream:g&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!v[w]&&(v[w]=(C,E)=>{let R=C&&C[w];if(R)return R.call(C);throw new dt(`Response type '${w}' is not supported`,dt.ERR_NOT_SUPPORT,E)})});const x=async w=>{if(w==null)return 0;if(le.isBlob(w))return w.size;if(le.isSpecCompliantForm(w))return(await new n(Rr.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(le.isArrayBufferView(w)||le.isArrayBuffer(w))return w.byteLength;if(le.isURLSearchParams(w)&&(w=w+""),le.isString(w))return(await h(w)).byteLength},b=async(w,C)=>{const E=le.toFiniteNumber(w.getContentLength());return E??x(C)};return async w=>{let{url:C,method:E,data:R,signal:T,cancelToken:j,timeout:O,onDownloadProgress:D,onUploadProgress:N,responseType:A,headers:k,withCredentials:V="same-origin",fetchOptions:q}=hA(w),H=t||fetch;A=A?(A+"").toLowerCase():"text";let W=iH([T,j&&j.toAbortSignal()],O),re=null;const G=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let Q;try{if(N&&m&&E!=="get"&&E!=="head"&&(Q=await b(k,R))!==0){let L=new n(C,{method:"POST",body:R,duplex:"half"}),P;if(le.isFormData(R)&&(P=L.headers.get("content-type"))&&k.setContentType(P),L.body){const[K,ne]=m2(Q,rp(p2(N)));R=v2(L.body,y2,K,ne)}}le.isString(V)||(V=V?"include":"omit");const I=l&&"credentials"in n.prototype,Y={...q,signal:W,method:E.toUpperCase(),headers:k.normalize().toJSON(),body:R,duplex:"half",credentials:I?V:void 0};re=l&&new n(C,Y);let B=await(l?H(re,q):H(C,Y));const oe=g&&(A==="stream"||A==="response");if(g&&(D||oe&&G)){const L={};["status","statusText","headers"].forEach(fe=>{L[fe]=B[fe]});const P=le.toFiniteNumber(B.headers.get("content-length")),[K,ne]=D&&m2(P,rp(p2(D),!0))||[];B=new r(v2(B.body,y2,K,()=>{ne&&ne(),G&&G()}),L)}A=A||"text";let be=await v[le.findKey(v,A)||"text"](B,w);return!oe&&G&&G(),await new Promise((L,P)=>{dA(L,P,{data:be,headers:Qr.from(B.headers),status:B.status,statusText:B.statusText,config:w,request:re})})}catch(I){throw G&&G(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new dt("Network Error",dt.ERR_NETWORK,w,re),{cause:I.cause||I}):dt.from(I,I&&I.code,w,re)}}},hH=new Map,mA=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:s}=t,l=[r,s,n];let c=l.length,d=c,h,m,g=hH;for(;d--;)h=l[d],m=g.get(h),m===void 0&&g.set(h,m=d?new Map:fH(t)),g=m;return m};mA();const m0={http:AV,xhr:oH,fetch:{get:mA}};le.forEach(m0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const C2=e=>`- ${e}`,mH=e=>le.isFunction(e)||e===null||e===!1,pA={getAdapter:(e,t)=>{e=le.isArray(e)?e:[e];const{length:n}=e;let r,s;const l={};for(let c=0;c<n;c++){r=e[c];let d;if(s=r,!mH(r)&&(s=m0[(d=String(r)).toLowerCase()],s===void 0))throw new dt(`Unknown adapter '${d}'`);if(s&&(le.isFunction(s)||(s=s.get(t))))break;l[d||"#"+c]=s}if(!s){const c=Object.entries(l).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
|
|
488
|
-
`+c.map(C2).join(`
|
|
489
|
-
`):" "+C2(c[0]):"as no adapter specified";throw new dt("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return s},adapters:m0};function gx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cu(null,e)}function w2(e){return gx(e),e.headers=Qr.from(e.headers),e.data=px.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pA.getAdapter(e.adapter||If.adapter,e)(e).then(function(r){return gx(e),r.data=px.call(e,e.transformResponse,r),r.headers=Qr.from(r.headers),r},function(r){return uA(r)||(gx(e),r&&r.response&&(r.response.data=px.call(e,e.transformResponse,r.response),r.response.headers=Qr.from(r.response.headers))),Promise.reject(r)})}const gA="1.12.2",lg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const E2={};lg.transitional=function(t,n,r){function s(l,c){return"[Axios v"+gA+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new dt(s(c," has been removed"+(n?" in "+n:"")),dt.ERR_DEPRECATED);return n&&!E2[c]&&(E2[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};lg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function pH(e,t,n){if(typeof e!="object")throw new dt("options must be an object",dt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const l=r[s],c=t[l];if(c){const d=e[l],h=d===void 0||c(d,l,e);if(h!==!0)throw new dt("option "+l+" must be "+h,dt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new dt("Unknown option "+l,dt.ERR_BAD_OPTION)}}const zm={assertOptions:pH,validators:lg},Ts=zm.validators;let yl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new f2,response:new f2}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const l=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
490
|
-
`+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Tl(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:l}=n;r!==void 0&&zm.assertOptions(r,{silentJSONParsing:Ts.transitional(Ts.boolean),forcedJSONParsing:Ts.transitional(Ts.boolean),clarifyTimeoutError:Ts.transitional(Ts.boolean)},!1),s!=null&&(le.isFunction(s)?n.paramsSerializer={serialize:s}:zm.assertOptions(s,{encode:Ts.function,serialize:Ts.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zm.assertOptions(n,{baseUrl:Ts.spelling("baseURL"),withXsrfToken:Ts.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&le.merge(l.common,l[n.method]);l&&le.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=Qr.concat(c,l);const d=[];let h=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(h=h&&C.synchronous,d.unshift(C.fulfilled,C.rejected))});const m=[];this.interceptors.response.forEach(function(C){m.push(C.fulfilled,C.rejected)});let g,v=0,x;if(!h){const w=[w2.bind(this),void 0];for(w.unshift(...d),w.push(...m),x=w.length,g=Promise.resolve(n);v<x;)g=g.then(w[v++],w[v++]);return g}x=d.length;let b=n;for(;v<x;){const w=d[v++],C=d[v++];try{b=w(b)}catch(E){C.call(this,E);break}}try{g=w2.call(this,b)}catch(w){return Promise.reject(w)}for(v=0,x=m.length;v<x;)g=g.then(m[v++],m[v++]);return g}getUri(t){t=Tl(this.defaults,t);const n=fA(t.baseURL,t.url,t.allowAbsoluteUrls);return iA(n,t.params,t.paramsSerializer)}};le.forEach(["delete","get","head","options"],function(t){yl.prototype[t]=function(n,r){return this.request(Tl(r||{},{method:t,url:n,data:(r||{}).data}))}});le.forEach(["post","put","patch"],function(t){function n(r){return function(l,c,d){return this.request(Tl(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}yl.prototype[t]=n(),yl.prototype[t+"Form"]=n(!0)});let gH=class vA{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(s);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new Cu(l,c,d),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new vA(function(s){t=s}),cancel:t}}};function vH(e){return function(n){return e.apply(null,n)}}function yH(e){return le.isObject(e)&&e.isAxiosError===!0}const p0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(p0).forEach(([e,t])=>{p0[t]=e});function yA(e){const t=new yl(e),n=YN(yl.prototype.request,t);return le.extend(n,yl.prototype,t,{allOwnKeys:!0}),le.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return yA(Tl(e,s))},n}const En=yA(If);En.Axios=yl;En.CanceledError=Cu;En.CancelToken=gH;En.isCancel=uA;En.VERSION=gA;En.toFormData=ig;En.AxiosError=dt;En.Cancel=En.CanceledError;En.all=function(t){return Promise.all(t)};En.spread=vH;En.isAxiosError=yH;En.mergeConfig=Tl;En.AxiosHeaders=Qr;En.formToJSON=e=>cA(le.isHTMLForm(e)?new FormData(e):e);En.getAdapter=pA.getAdapter;En.HttpStatusCode=p0;En.default=En;const{Axios:Pae,AxiosError:R2,CanceledError:Uae,isCancel:Fae,CancelToken:zae,VERSION:Vae,all:Hae,Cancel:$ae,isAxiosError:Bae,spread:Gae,toFormData:qae,AxiosHeaders:xH,HttpStatusCode:Kae,formToJSON:Zae,getAdapter:Yae,mergeConfig:Wae}=En,iu={SIGN_IN:"/auth/sign-in",SIGN_OUT:"/auth/sign-out",ACCESS_TOKEN:"/auth/access-token",API_USER:"/auth/api/user",API_PROJECTS:"/auth/api/projects"};function bH(e){if(e&&typeof e=="object"&&"response"in e){const n=e,{status:r,data:s}=n.response;switch(r){case 401:return{message:(s==null?void 0:s.message)??"Invalid credentials or session expired",code:"UNAUTHORIZED",statusCode:401};case 403:return{message:(s==null?void 0:s.message)??"Access forbidden",code:"FORBIDDEN",statusCode:403};case 422:return{message:(s==null?void 0:s.message)??"Invalid request data",code:"VALIDATION_ERROR",statusCode:422};default:return{message:(s==null?void 0:s.message)??"Authentication error",code:"AUTH_ERROR",statusCode:r}}}return e&&typeof e=="object"&&"request"in e?{message:"Network error - please check your connection",code:"NETWORK_ERROR"}:{message:e instanceof Error?e.message:"Unknown authentication error",code:"UNKNOWN_ERROR"}}const Bb=En.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function SH(){const e=window.location.pathname+window.location.search,t=new URL(iu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function CH(){const e=new URL(iu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",iu.SIGN_IN),window.location.href=e.toString()}async function wH(){try{return(await Bb.post(iu.ACCESS_TOKEN,{})).data}catch(e){const t=bH(e);throw new Error(t.message)}}async function EH(e){return(await Bb.get(iu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}async function RH(e){return(await Bb.get(iu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const xA=p.createContext(null);class TH{constructor(t,n){Rs(this,"getToken");Rs(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let Gb=null;function jH(e){Gb=e}function qb(){return Gb}function xm(){Gb=null}function _H(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Tr.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Tr.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Tr.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Tr.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const NH={status:Tr.LOADING,session:null,user:null};function AH({children:e}){var g;const[t,n]=p.useReducer(_H,NH);p.useEffect(()=>{var v;if((v=t.session)!=null&&v.accessToken){const x=new TH(()=>{var b;return((b=t.session)==null?void 0:b.accessToken)??null},async()=>await s());jH(x)}else xm()},[(g=t.session)==null?void 0:g.accessToken]);const r=p.useCallback(()=>{SH()},[]);async function s(){try{const x=(await wH()).accessToken;if(!x)throw new Error("Invalid token received");const b={accessToken:x},w=await EH(x);return n({type:"SET_USER",payload:{user:w}}),n({type:"SET_AUTHENTICATED",payload:{session:b}}),x}catch(v){throw xm(),n({type:"SET_UNAUTHENTICATED"}),v}}const l=p.useCallback(async()=>{await s()},[]),c=p.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await l()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(v){console.error("Failed to initialize auth:",v),xm(),n({type:"SET_UNAUTHENTICATED"})}},[l,r]),d=p.useCallback(()=>{CH()},[]),h=p.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);p.useEffect(()=>{c()},[c]),p.useEffect(()=>{const v=()=>{d()};return window.addEventListener("auth:logout",v),()=>{window.removeEventListener("auth:logout",v),xm()}},[d]);const m={...t,signIn:r,signOut:d,refreshToken:l,clearError:h};return o.jsx(xA.Provider,{value:m,children:e})}function Pi(){const e=p.useContext(xA);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function bA(){const{status:e,session:t,user:n,error:r}=Pi();return{status:e,session:t,user:n,error:r,isLoading:e===Tr.LOADING,isAuthenticated:e===Tr.AUTHENTICATED,isUnauthenticated:e===Tr.UNAUTHENTICATED,hasError:e===Tr.ERROR}}function DH(){const{user:e}=Pi();return e}function Wc({fullScreen:e=!1,size:t="md",message:n}){const r={sm:"h-4 w-4 border-2",md:"h-8 w-8 border-4",lg:"h-12 w-12 border-4"},s=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return o.jsx("div",{className:s,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&o.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function T2({message:e}){return o.jsx(Wc,{fullScreen:!0,message:e})}function j2(){return o.jsx("div",{className:"flex h-screen items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),o.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),o.jsx(we,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function OH({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:l}=bA();return r?o.jsx(T2,{}):s?o.jsx(o.Fragment,{children:e}):l?n?(window.location.href=n,o.jsx(T2,{})):t?o.jsx(o.Fragment,{children:t}):o.jsx(j2,{}):t?o.jsx(o.Fragment,{children:t}):o.jsx(j2,{})}const SA=p.createContext(null);function CA(){const e=p.useContext(SA);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const MH="/ui",kH=()=>MH,ap=(e,t)=>{const n=kH(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function IH(){const{projects:e,loadProjects:t,error:n,isLoading:r}=CA(),{user:s}=Pi();return o.jsxs($N,{children:[o.jsx($a,{}),o.jsxs(BN,{className:"flex items-center gap-2",children:[o.jsx(tL,{className:"h-4 w-4"}),"Switch project"]}),o.jsx(zz,{children:o.jsxs(GN,{children:[r&&o.jsx(Tt,{disabled:!0,children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(mu,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&o.jsxs(o.Fragment,{children:[o.jsx(Tt,{disabled:!0,children:"Unable to load projects. Please try again."}),o.jsx(Tt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(l=>{const c=l.id===(s==null?void 0:s.projectId);return o.jsx(Tt,{asChild:!0,children:o.jsxs(vf,{to:ap(encodeURIComponent(l.id),"/"),className:"flex items-center gap-2",children:[c?o.jsx(ir,{className:"h-4 w-4"}):o.jsx("span",{className:"h-4 w-4"}),l.title]})},l.id)})]})})]})}function LH(){return o.jsx(IH,{})}const PH=({className:e,size:t=24})=>o.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),wA=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M10.6842 44.2221L0.419465 26.278C-0.139822 25.3001 -0.139822 23.6999 0.419465 22.722L10.6842 4.77786C11.2435 3.79993 12.6166 3 13.7355 3H34.265C35.3838 3 36.7567 3.79993 37.3163 4.77786L47.5801 22.722C48.14 23.6999 48.14 25.3001 47.5801 26.278L37.3163 44.2221C36.7567 45.2001 35.3838 46 34.265 46H13.7355C12.6166 46 11.2435 45.2001 10.6842 44.2221Z",fill:"#4486FA"}),o.jsx("path",{d:"M30.6154 18.3848L43.6923 32.8463L37.3828 43.85C36.8268 44.8118 35.4628 45.5986 34.3511 45.5986L17.5385 30.0771L30.6154 18.3848Z",fill:"#3778ED"}),o.jsx("path",{d:"M24.1539 33.1537C28.997 33.1537 32.9231 29.2276 32.9231 24.3845C32.9231 19.5414 28.997 15.6152 24.1539 15.6152C19.3108 15.6152 15.3846 19.5414 15.3846 24.3845C15.3846 29.2276 19.3108 33.1537 24.1539 33.1537Z",fill:"white"}),o.jsx("path",{d:"M31.2681 29.2331L34.3825 32.3476C34.7428 32.7079 34.7428 33.2925 34.3825 33.6528L33.7296 34.3057C33.3693 34.666 32.7847 34.666 32.4244 34.3057L29.3099 31.1913C28.9496 30.831 28.9496 30.2464 29.3099 29.886L29.9628 29.2331C30.3231 28.8728 30.9077 28.8728 31.2681 29.2331Z",fill:"white"}),o.jsx("path",{d:"M24.1538 31.0003C27.8074 31.0003 30.7692 28.0385 30.7692 24.3849C30.7692 20.7313 27.8074 17.7695 24.1538 17.7695C20.5003 17.7695 17.5385 20.7313 17.5385 24.3849C17.5385 28.0385 20.5003 31.0003 24.1538 31.0003Z",fill:"#4486FA"}),o.jsx("path",{d:"M24.1538 29.4615C26.9577 29.4615 29.2308 27.1884 29.2308 24.3845C29.2308 21.5806 26.9577 19.3076 24.1538 19.3076C21.3499 19.3076 19.0769 21.5806 19.0769 24.3845C19.0769 27.1884 21.3499 29.4615 24.1538 29.4615Z",fill:"#4486FA"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3846 21.4619H25.2308V29.4619H23.3846V21.4619ZM26.4615 24.8465H28.3077V28.5388H26.4615V24.8465ZM21.8462 23.6158H20V28.5388H21.8462V23.6158Z",fill:"white"})]}),EA=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),o.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),o.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),o.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),o.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),o.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),o.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),o.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),o.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),o.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),o.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),o.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),o.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),o.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),o.jsx("path",{d:"M24 1.134L27.7974 2.3466V29.6562L24 30.4332V1.134ZM36.8118 9.6L31.179 8.4588V29.0142L36.8118 27.873V9.6ZM43.2144 3.06L39.1344 1.4196V27.381L43.2144 26.5248V3.06ZM48 1.5618L44.901 0V26.1684L48 25.5978V1.5618Z",fill:"#F58534"})]}),RA=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0C19.7661 0 12 0 10 0C8.19719 0 6 2.18498 6 4V44C6 45.815 8.18947 47.9993 10 47.9993H38C39.8105 47.9993 42 45.815 42 44C42 44 42 25.6447 42 14L28 0Z",fill:"#00A65F"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),UH=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M23.7876 0C22.2395 0 20.8149 0.856389 20.0821 2.22332C19.3574 3.59024 19.4398 5.25361 20.3044 6.5382L22.0995 4.75131C22.0419 4.57015 22.009 4.38899 22.009 4.1996C22.009 3.21969 22.7995 2.42918 23.7794 2.42918C24.7593 2.42918 25.5498 3.21969 25.5498 4.1996C25.5498 5.1795 24.7593 5.97002 23.7794 5.97002C23.59 5.97002 23.4088 5.93708 23.2277 5.87944L21.4325 7.66632C22.923 8.67917 24.891 8.62153 26.3238 7.53457C27.7566 6.44762 28.3331 4.56192 27.7566 2.85737C27.1885 1.1446 25.5827 0 23.7876 0Z",fill:"#34A853"}),o.jsx("path",{d:"M22.1161 12.2282C22.1161 10.8118 21.6632 9.42842 20.8068 8.30029L18.4846 10.6224C19.2093 11.9564 18.954 13.6033 17.8506 14.6491L19.1187 17.737C20.9797 16.5266 22.1161 14.4515 22.1161 12.2282Z",fill:"#FBBC04"}),o.jsx("path",{d:"M15.6108 15.5637H15.5531C14.1286 15.5637 12.8604 14.6579 12.3993 13.3075C11.9382 11.957 12.3828 10.4666 13.511 9.58547C14.6391 8.70438 16.1954 8.64674 17.3894 9.43725L19.6951 7.13159C17.4553 5.31176 14.2932 5.17177 11.897 6.78574C9.50076 8.3997 8.44675 11.3806 9.28667 14.1392C10.1266 16.8977 12.671 18.7834 15.5531 18.7834C15.9978 18.7834 16.4425 18.7422 16.8789 18.6517L15.6108 15.5637Z",fill:"#EA4335"}),o.jsx("path",{d:"M23.87 18.231C22.4125 18.231 20.9632 18.4451 19.5716 18.8568L21.4161 23.3611C22.2148 23.1634 23.0383 23.0646 23.87 23.0646C28.6625 23.0646 32.7797 26.449 33.7184 31.1509C34.6489 35.8528 32.1374 40.5547 27.7155 42.3828C23.2936 44.2108 18.1882 42.6627 15.5284 38.6855C12.8687 34.7082 13.3792 29.3969 16.7636 26.0043C17.4718 25.2962 18.2787 24.7033 19.1598 24.2339L17.34 19.7461C10.5465 23.0728 7.32686 30.9697 9.86308 38.1008C12.3993 45.2319 19.8762 49.3244 27.2461 47.6117C34.616 45.9071 39.532 38.9407 38.6756 31.4226C37.8192 23.9045 31.454 18.231 23.8864 18.231H23.87Z",fill:"#4285F4"})]}),FH=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M6.10815 8C6.10815 6.89543 7.00358 6 8.10815 6H40.1082C41.2127 6 42.1082 6.89543 42.1082 8V40C42.1082 41.1046 41.2127 42 40.1082 42H8.10816C7.00359 42 6.10815 41.1046 6.10815 40V8Z",fill:"#FF9800"}),o.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),o.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),o.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),o.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),o.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),o.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),o.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),o.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),o.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),o.jsx("path",{d:"M13 35C13 32.7909 14.7909 31 17 31C19.2091 31 21 32.7909 21 35C21 37.2091 19.2091 39 17 39C14.7909 39 13 37.2091 13 35Z",fill:"white"})]}),zH=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M41.1492 36.5821L31.017 30.7288C29.5935 29.9092 27.7733 30.3966 26.9494 31.8201C26.6302 32.3808 26.5051 32.9976 26.5655 33.5972V45.0365C26.5655 46.6712 27.894 47.9998 29.5331 47.9998C31.1679 47.9998 32.4965 46.6712 32.4965 45.0365V38.4585L38.173 41.7367C39.5964 42.5605 41.421 42.0688 42.2405 40.6454C43.0644 39.2219 42.577 37.4017 41.1492 36.5821Z",fill:"#29B5E8"}),o.jsx("path",{d:"M15.949 24.039C15.9663 22.9822 15.4099 21.9987 14.4954 21.4682L4.36313 15.6192C3.92316 15.3647 3.41849 15.231 2.91381 15.231C1.87427 15.231 0.908061 15.7874 0.390448 16.6846C-0.411852 18.0735 0.0669408 19.855 1.45587 20.6573L7.29627 24.0261L1.45587 27.3992C0.782972 27.7874 0.299866 28.4128 0.101448 29.1634C-0.101284 29.9139 0.00223886 30.699 0.390448 31.3719C0.908061 32.2691 1.87427 32.8255 2.9095 32.8255C3.41849 32.8255 3.92316 32.6918 4.36313 32.4373L14.4954 26.5883C15.4012 26.062 15.9577 25.0872 15.949 24.039Z",fill:"#29B5E8"}),o.jsx("path",{d:"M6.6628 11.4738L16.7951 17.3228C17.977 18.0086 19.4349 17.7843 20.3666 16.8742C20.9576 16.3307 21.3242 15.5543 21.3242 14.6916V2.96765C21.3242 1.32854 19.9957 0 18.3609 0C16.7217 0 15.3932 1.32854 15.3932 2.96765V9.64054L9.63907 6.31919C8.21564 5.49532 6.39536 5.98274 5.5715 7.40618C4.74763 8.82962 5.23936 10.6499 6.6628 11.4738Z",fill:"#29B5E8"}),o.jsx("path",{d:"M29.4459 24.5131C29.4459 24.7374 29.3165 25.048 29.1569 25.2119L25.1411 29.2277C24.9815 29.3873 24.6666 29.5167 24.4423 29.5167H23.42C23.1957 29.5167 22.8808 29.3873 22.7212 29.2277L18.7011 25.2119C18.5415 25.048 18.4121 24.7374 18.4121 24.5131V23.4908C18.4121 23.2622 18.5415 22.9516 18.7011 22.792L22.7212 18.7719C22.8808 18.6123 23.1957 18.4829 23.42 18.4829H24.4423C24.6666 18.4829 24.9815 18.6123 25.1411 18.7719L29.1569 22.792C29.3165 22.9516 29.4459 23.2622 29.4459 23.4908V24.5131ZM25.8614 24.0214V23.9782C25.8614 23.8143 25.7665 23.5857 25.6501 23.4649L24.4639 22.2831C24.3474 22.1623 24.1188 22.0674 23.9506 22.0674H23.9074C23.7435 22.0674 23.5149 22.1623 23.3941 22.2831L22.2123 23.4649C22.0958 23.5814 22.0009 23.81 22.0009 23.9782V24.0214C22.0009 24.1896 22.0958 24.4182 22.2123 24.5347L23.3941 25.7209C23.5149 25.8373 23.7435 25.9322 23.9074 25.9322H23.9506C24.1188 25.9322 24.3474 25.8373 24.4639 25.7209L25.6501 24.5347C25.7665 24.4182 25.8614 24.1896 25.8614 24.0214Z",fill:"#29B5E8"}),o.jsx("path",{d:"M31.0158 17.3228L41.1481 11.4738C42.5715 10.6542 43.0632 8.82962 42.2394 7.40618C41.4155 5.98274 39.5952 5.49532 38.1718 6.31919L32.4953 9.59741V2.96765C32.4953 1.32854 31.1667 0 29.532 0C27.8928 0 26.5643 1.32854 26.5643 2.96765V14.4587C26.5082 15.0539 26.6247 15.675 26.9482 16.2358C27.7721 17.6592 29.5923 18.1467 31.0158 17.3228Z",fill:"#29B5E8"}),o.jsx("path",{d:"M18.8267 30.3841C18.1538 30.2546 17.4335 30.3625 16.7951 30.7291L6.6628 36.5825C5.23936 37.402 4.74763 39.2223 5.5715 40.6457C6.39536 42.0735 8.21564 42.5609 9.63907 41.737L15.3932 38.4157V45.0368C15.3932 46.6716 16.7217 48.0002 18.3609 48.0002C19.9957 48.0002 21.3242 46.6716 21.3242 45.0368V33.3129C21.3242 31.8334 20.2415 30.6083 18.8267 30.3841Z",fill:"#29B5E8"}),o.jsx("path",{d:"M47.4814 16.6501C46.6618 15.2223 44.8372 14.7349 43.4138 15.5588L33.2815 21.4078C32.311 21.9685 31.7761 22.9951 31.7934 24.039C31.7847 25.0785 32.3196 26.0922 33.2815 26.6443L43.4138 32.4977C44.8372 33.3172 46.6575 32.8298 47.4814 31.4064C48.3052 29.9829 47.8135 28.1626 46.3901 27.3388L40.6532 24.0261L46.3901 20.7133C47.8178 19.8938 48.3052 18.0735 47.4814 16.6501Z",fill:"#29B5E8"})]}),VH=({className:e,size:t=24})=>o.jsx("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:o.jsx("path",{d:"M45.8905 35.0619V26.9571L45.0149 26.4095L24 37.9095L4.0796 26.9571V22.2476L24 33.0905L46 21.1524V13.1571L45.1244 12.6095L24 24.219L4.84577 13.7048L24 3.19048L39.4328 11.6238L40.6368 10.9667V10.0905L24 1L2 12.9381V14.1429L24 26.1905L43.9204 15.2381V20.0571L24 31.0095L2.87562 19.4L2 19.9476V28.0524L24 39.9905L43.9204 29.1476V33.8571L24 44.8095L2.87562 33.3095L2 33.8571V35.0619L24 47L45.8905 35.0619Z",fill:"#FF3621"})}),HH=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),o.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),o.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),o.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),o.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),o.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),o.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),$H=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M23.9333 0L3 11.9733V35.8933L23.9333 48L44.8667 36.0267V12.0267L23.9333 0ZM41 33.52L23.9333 43.3867L6.86667 33.624V14.3467L23.9333 4.48L41 14.3733V33.52Z",fill:"#0078D4"}),o.jsx("path",{d:"M23.9333 0L3 11.9733L6.86667 14.3467L23.9333 4.48L41 14.3467L44.8667 11.9733L23.9333 0Z",fill:"url(#paint0_linear_19_1262)"}),o.jsx("path",{d:"M33.9068 27.9336C33.7031 27.5984 33.4028 27.3325 33.0454 27.1709C31.9608 24.8031 30.2991 22.7454 28.2128 21.1865C26.1265 19.6276 23.6822 18.6173 21.1041 18.2482L38.3761 8.26689L34.3601 5.96289L14.6908 17.3336C14.3087 17.5535 14.0099 17.8936 13.8411 18.3009C13.6722 18.7082 13.6426 19.1598 13.757 19.5857C13.8714 20.0115 14.1232 20.3876 14.4734 20.6554C14.8236 20.9233 15.2525 21.068 15.6934 21.0669C15.7747 21.0519 15.8549 21.0314 15.9334 21.0056L16.2668 22.4002C18.7745 21.8089 21.4081 22.0755 23.7464 23.1574C26.0848 24.2393 27.9928 26.074 29.1654 28.3682L9.56812 39.6936L13.5681 42.0029L33.1761 30.6669C33.4376 30.5106 33.6586 30.295 33.8214 30.0376L34.0214 29.9896C34.0028 29.9122 33.9734 29.8429 33.9548 29.7656C34.0967 29.4794 34.1665 29.1629 34.1581 28.8436C34.1497 28.5243 34.0634 28.2119 33.9068 27.9336Z",fill:"#50E6FF"}),o.jsx("path",{d:"M32.176 24.0347C31.2003 24.0347 30.2465 24.3241 29.4352 24.8662C28.6239 25.4082 27.9916 26.1787 27.6182 27.0802C27.2448 27.9816 27.1471 28.9735 27.3375 29.9305C27.5278 30.8875 27.9977 31.7665 28.6876 32.4565C29.3775 33.1464 30.2566 33.6163 31.2135 33.8066C32.1705 33.997 33.1625 33.8993 34.0639 33.5259C34.9653 33.1525 35.7358 32.5202 36.2779 31.7089C36.82 30.8976 37.1093 29.9438 37.1093 28.9681C37.1093 27.6597 36.5896 26.4049 35.6644 25.4797C34.7392 24.5545 33.4844 24.0347 32.176 24.0347ZM15.6907 14.0454C14.7149 14.0454 13.7611 14.3347 12.9498 14.8768C12.1386 15.4189 11.5062 16.1894 11.1329 17.0908C10.7595 17.9923 10.6618 18.9842 10.8521 19.9412C11.0425 20.8982 11.5123 21.7772 12.2023 22.4671C12.8922 23.1571 13.7712 23.6269 14.7282 23.8173C15.6852 24.0076 16.6771 23.9099 17.5786 23.5365C18.48 23.1632 19.2505 22.5308 19.7926 21.7196C20.3347 20.9083 20.624 19.9545 20.624 18.9787C20.624 17.6703 20.1042 16.4155 19.1791 15.4904C18.2539 14.5652 16.9991 14.0454 15.6907 14.0454Z",fill:"url(#paint1_linear_19_1262)"}),o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),o.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),o.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{"stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),Lf=({className:e,size:t=24,base64:n})=>o.jsx("img",{src:n??void 0,alt:"icon",className:e,style:{width:t,height:t}}),BH=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{fill:"currentColor",d:"M12.455 21.73c-4.585 0-7.749-.347-7.964-.371-.164-.013-1.55-.141-2.44-1.037-.9-.907-1.26-2.518-1.274-2.586-.01-.044-.29-1.267-.432-3.389a61.23 61.23 0 0 1-.078-2.403c0-3.559.49-5.744.511-5.835.016-.068.377-1.522 1.273-2.423.873-.88 2.11-1.02 2.296-1.036.244-.036 2.712-.38 7.444-.38 1.422 0 3.843.082 3.867.083 2.365.106 3.696.274 3.86.296.186.014 1.554.149 2.437 1.037.895.9 1.255 2.355 1.27 2.417.018.069.508 1.963.508 5.743 0 .89-.065 2.337-.068 2.399-.131 2.248-.405 3.447-.416 3.497-.043.174-.422 1.66-1.123 2.383-1.035 1.066-2.154 1.212-2.356 1.23-.248.039-2.558.375-7.315.375Zm-.664-18.502c-4.815 0-7.295.367-7.32.371a.446.446 0 0 1-.038.004c-.009 0-1.04.086-1.711.76-.705.709-1.016 1.955-1.02 1.967-.003.015-.485 2.174-.485 5.614 0 .836.076 2.331.077 2.347.135 2.028.407 3.222.41 3.234.004.02.317 1.413 1.018 2.12.67.673 1.831.758 1.843.759l.024.002c.031.004 3.198.366 7.866.366 4.848 0 7.161-.362 7.184-.365a.484.484 0 0 1 .05-.005c.033-.003.91-.074 1.757-.947.441-.455.784-1.552.879-1.937 0-.004.265-1.173.391-3.323 0-.01.067-1.48.067-2.349 0-3.636-.475-5.488-.48-5.507-.005-.021-.316-1.267-1.02-1.976-.67-.674-1.832-.759-1.844-.76a.391.391 0 0 1-.033-.003c-.013-.002-1.362-.182-3.785-.29-.02 0-2.424-.082-3.83-.082Z"}),o.jsx("path",{fill:"currentColor",d:"M5.415 17.057V6.247h7.074c2.212 0 3.318.925 3.318 2.776 0 .74-.142 1.316-.425 1.732a1.476 1.476 0 0 1-.768.609c.201.052.398.155.59.311.585.477.878 1.213.878 2.209 0 1.162-.284 1.99-.85 2.489-.521.456-1.353.684-2.496.684H5.415Zm.987-9.722v3.531h6.482c.686 0 1.171-.114 1.456-.344.32-.26.48-.718.48-1.374 0-.615-.142-1.063-.425-1.344-.312-.313-.815-.469-1.511-.469H6.402Zm0 4.62v4.013h6.718c.658 0 1.152-.165 1.481-.498.33-.331.493-.86.493-1.586 0-.684-.173-1.177-.52-1.478-.348-.3-.86-.45-1.536-.45l-6.636-.001ZM19.282 17.057h-1.067V6.247h1.067v10.81Z"}),o.jsx("path",{fill:"currentColor",d:"M23.467 11.846c0-3.756-.488-5.627-.5-5.673l-.001-.006a6.188 6.188 0 0 0-.292-.852c-.197-.47-.494-1.022-.906-1.438-.4-.401-.917-.64-1.37-.779a4.392 4.392 0 0 0-.9-.18h-.015c-.156-.021-1.48-.19-3.837-.295-.114-.004-2.465-.082-3.855-.082-4.717 0-7.172.342-7.406.376l-.008.002H4.37c-.176.015-1.328.15-2.131.958-.414.416-.711.97-.909 1.44a6.178 6.178 0 0 0-.292.855c-.025.105-.505 2.264-.505 5.771 0 .84.073 2.278.078 2.386l.059.747c.105 1.173.243 1.982.316 2.358l.05.24.002.004c.006.028.096.432.292.937.199.512.497 1.1.909 1.515.402.405.925.644 1.38.783.453.137.82.17.891.176h.01l.685.069c1.19.107 3.82.301 7.25.301 4.744 0 7.041-.335 7.275-.371l.008-.001h.009c.167-.015 1.215-.149 2.188-1.152.312-.321.567-.832.752-1.307a8.15 8.15 0 0 0 .303-.951c.019-.085.282-1.266.409-3.448.005-.107.068-1.514.068-2.383Zm-.95 0c0-3.598-.469-5.426-.471-5.436l-.001-.005s-.02-.077-.059-.202a5.943 5.943 0 0 0-.177-.49c-.14-.341-.34-.73-.599-1.034l-.114-.124c-.289-.29-.697-.464-1.053-.564a3.79 3.79 0 0 0-.577-.114l-.048-.004a.677.677 0 0 1-.05-.005l-.062-.009-.186-.021a33.921 33.921 0 0 0-.727-.074 60.204 60.204 0 0 0-2.78-.185c-.022 0-2.421-.08-3.822-.08-2.401 0-4.218.091-5.437.183a37.894 37.894 0 0 0-1.725.169l-.087.011-.03.005h-.003a.744.744 0 0 1-.06.005h.001c.007 0-.23.02-.547.117-.32.099-.701.271-.994.566-.316.317-.553.769-.714 1.158-.145.35-.221.63-.234.678 0 0-.478 2.138-.478 5.552 0 .828.077 2.317.077 2.334.134 1.992.399 3.168.404 3.189a6.681 6.681 0 0 0 .235.763c.163.43.4.911.71 1.223.289.29.696.464 1.052.564.35.098.621.119.621.119h.002l.037.003H4.63c.007.002.017.002.03.004l.112.013a62.06 62.06 0 0 0 2.03.167c1.373.09 3.326.18 5.653.18 4.78 0 7.082-.353 7.142-.362l.077-.009c.067-.006.833-.094 1.581-.865.182-.188.363-.533.514-.908.147-.366.252-.724.297-.905.012-.054.263-1.201.384-3.274.004-.086.067-1.495.067-2.333ZM15.54 9.024c0-.869-.257-1.477-.733-1.875-.485-.406-1.243-.632-2.318-.633H5.68v10.27h7.055c1.118 0 1.872-.224 2.321-.618.483-.424.758-1.16.758-2.285 0-.94-.275-1.586-.778-1.997a1.303 1.303 0 0 0-.49-.26l-.881-.229.864-.29a1.21 1.21 0 0 0 .632-.503v-.002c.242-.354.379-.87.379-1.578Zm4.007-3.048v11.351h-1.6V5.976h1.6Zm-1.067 10.81h.534V6.517h-.534v10.27Zm-3.653-2.902c0-.643-.163-1.043-.427-1.272l-.114-.086c-.28-.19-.687-.3-1.248-.3l-6.37-.001v3.473h6.45c.618 0 1.032-.155 1.293-.419.258-.26.416-.703.416-1.395Zm-.275-4.737c0-.579-.134-.941-.345-1.15v-.001c-.24-.24-.659-.391-1.324-.391H6.67v2.99h6.215c.673 0 1.08-.115 1.29-.284.227-.185.38-.543.38-1.164Zm.808 4.737c0 .76-.17 1.374-.571 1.778-.397.4-.971.577-1.67.577H6.135v-4.555l6.904.001c.71 0 1.293.157 1.708.516.43.373.614.959.614 1.683Zm7.689-2.038c0 .44-.017 1.029-.033 1.506l-.024.605-.008.182-.002.05v.022c-.127 2.161-.393 3.345-.399 3.37v.003c-.05.203-.164.586-.322.979-.154.383-.366.814-.625 1.082-.907.935-1.856 1.02-1.929 1.026h-.005a.241.241 0 0 0-.023.003c-.053.008-2.382.368-7.225.368-3.51 0-6.175-.204-7.305-.308l-.593-.059v-.001h-.011a4.034 4.034 0 0 1-.727-.137c-.395-.111-.903-.317-1.285-.701-.39-.394-.662-.963-.832-1.412a6.672 6.672 0 0 1-.258-.84l-.004-.017-.01-.046a17.864 17.864 0 0 1-.145-.816 28.269 28.269 0 0 1-.257-2.396v-.011l-.002-.013-.002-.052-.008-.185c-.008-.156-.018-.371-.027-.612-.02-.48-.039-1.069-.039-1.493 0-3.459.485-5.638.493-5.674v-.006l.003-.005.003-.014.012-.046.048-.162c.043-.135.107-.323.194-.533.172-.414.442-.94.831-1.331.378-.38.849-.588 1.214-.7.365-.113.645-.137.668-.139h.002l.015-.002c.089-.013 2.58-.373 7.358-.373.706 0 1.662.02 2.441.04.39.01.737.02.988.028l.297.01c.035 0 .063.002.082.003h.033c1.216.055 2.164.128 2.81.187l1 .106.008.001h.01l.018.003.045.004a4.322 4.322 0 0 1 .663.13c.394.111.903.317 1.286.702.388.39.657.918.829 1.333.165.399.249.717.26.764l.08.374c.14.717.409 2.458.409 5.203Zm.95 0c0 .897-.066 2.35-.069 2.41v.004c-.132 2.26-.407 3.475-.423 3.543v.005c-.023.093-.132.52-.326 1.018-.19.492-.477 1.086-.866 1.488-1.073 1.106-2.236 1.281-2.507 1.308-.265.04-2.589.378-7.354.378-4.598 0-7.772-.348-7.994-.373a4.92 4.92 0 0 1-.994-.196c-.439-.134-.964-.36-1.416-.743l-.189-.174c-.488-.492-.82-1.162-1.029-1.7a7.404 7.404 0 0 1-.316-1.019c-.023-.1-.298-1.332-.438-3.43v-.003C.075 14.289 0 12.81 0 11.943c0-3.578.493-5.782.519-5.895v-.003c.01-.044.11-.439.32-.941.21-.5.54-1.125 1.024-1.61l.18-.169c.925-.8 2.096-.929 2.281-.945C4.65 2.333 7.127 2 11.791 2c.714 0 1.678.02 2.464.041a215.63 215.63 0 0 1 1.297.038l.082.002.023.001h.013c2.311.104 3.641.268 3.867.297.104.008.516.048 1.016.202.498.153 1.107.426 1.59.913l.174.188c.389.451.664.984.848 1.42.202.482.3.865.316.93.025.092.519 2.01.519 5.814Zm-8.914-2.699c0 .69-.167 1.25-.58 1.586v.001c-.359.289-.922.402-1.622.402H6.135v-4.07l6.75-.002c.725 0 1.312.162 1.696.546l.124.142c.268.348.381.827.381 1.395Zm.988-.123c0 .77-.147 1.407-.472 1.884a1.905 1.905 0 0 1-.396.435l.165.12v.002c.666.543.977 1.369.977 2.418 0 1.199-.292 2.123-.942 2.694-.592.519-1.502.75-2.67.75H5.148V5.976h7.342c1.135 0 2.037.236 2.658.756.63.528.926 1.31.926 2.292Z"})]}),GH=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),qH=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]});function Ti({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:ie("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function KH({value:e,onChange:t,keysToMask:n=[],className:r,displayOnly:s=!1,showCopyButton:l=!1}){const c=(C,E)=>{if(!C||E.length===0)return!1;try{const R=JSON.parse(C),T=j=>typeof j!="object"||j===null?!1:Array.isArray(j)?j.some(O=>typeof O=="object"&&O!==null&&T(O)):Object.keys(j).some(O=>E.includes(O)||typeof j[O]=="object"&&j[O]!==null&&T(j[O]));return T(R)}catch{return!1}},d=s?!1:!e||n.length===0||!c(e,n),[h,m]=p.useState(d),[g,v]=p.useState(!1);p.useEffect(()=>{s?m(!1):(!e||n.length===0||!c(e,n))&&m(!0)},[e,n,s]),p.useEffect(()=>{if(g){const C=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(C)}}},[g]);const x=()=>{navigator.clipboard.writeText(e),v(!0)},b=C=>{if(!C)return"";try{const E=JSON.parse(C),R=O=>{if(typeof O!="object"||O===null)return O;const D=Array.isArray(O)?[...O]:{...O};return Array.isArray(D)?D.forEach((N,A)=>{typeof N=="object"&&N!==null&&(D[A]=R(N))}):Object.entries(D).forEach(([N,A])=>{if(n.includes(N))if(typeof A=="string"){const k=A.length;k>30?D[N]="*".repeat(Math.min(20,Math.ceil(k/3))):k>10?D[N]="*".repeat(Math.min(10,Math.ceil(k/2))):D[N]="*".repeat(k)}else D[N]="***";else typeof A=="object"&&A!==null&&(D[N]=R(A))}),D},j=R(typeof E=="object"?E:{});return JSON.stringify(j,null,2)}catch{return C}},w=e&&n.length>0&&c(e,n);return o.jsxs("div",{className:"relative",children:[!h&&w&&!s&&o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("div",{className:"absolute top-2 left-2 z-10",children:o.jsx(l8,{className:"h-4 w-4 text-gray-500"})})}),o.jsx(Nt,{children:o.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),s?o.jsx("div",{className:`p-2 font-mono ${r??""} min-h-[150px] cursor-not-allowed whitespace-pre-wrap opacity-70`,children:b(e)}):o.jsx(Ti,{value:h?e:b(e),onChange:C=>{(h||!w)&&t&&t(C.target.value)},onFocus:C=>{!h&&w&&C.target.blur()},readOnly:!!(!h&&w),className:`font-mono ${r??""} ${!h&&w?"cursor-not-allowed opacity-70":""} min-h-[150px]`,rows:8}),w&&!s&&o.jsx(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{m(!h)},children:h?o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(KL,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),o.jsx(Nt,{children:o.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Tj,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),o.jsx(Nt,{children:o.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),l&&o.jsx(we,{type:"button",variant:"ghost",className:`absolute ${w&&!s?"top-2 right-24":"top-2 right-2"}`,onClick:x,children:o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("div",{className:"flex items-center gap-1",children:g?o.jsxs(o.Fragment,{children:[o.jsx(ir,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copied!"})]}):o.jsxs(o.Fragment,{children:[o.jsx(Jd,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copy"})]})})}),o.jsx(Nt,{children:o.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var Ot;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),c={};for(const d of l)c[d]=s[d];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},e.find=(s,l)=>{for(const c of s)if(l(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ot||(Ot={}));var _2;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_2||(_2={}));const ze=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),li=e=>{switch(typeof e){case"undefined":return ze.undefined;case"string":return ze.string;case"number":return Number.isNaN(e)?ze.nan:ze.number;case"boolean":return ze.boolean;case"function":return ze.function;case"bigint":return ze.bigint;case"symbol":return ze.symbol;case"object":return Array.isArray(e)?ze.array:e===null?ze.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ze.promise:typeof Map<"u"&&e instanceof Map?ze.map:typeof Set<"u"&&e instanceof Set?ze.set:typeof Date<"u"&&e instanceof Date?ze.date:ze.object;default:return ze.unknown}},Se=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class _o extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(l){return l.message},r={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let d=r,h=0;for(;h<c.path.length;){const m=c.path[h];h===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(n(c))):d[m]=d[m]||{_errors:[]},d=d[m],h++}}};return s(this),r}static assert(t){if(!(t instanceof _o))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const l=s.path[0];n[l]=n[l]||[],n[l].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_o.create=e=>new _o(e);const g0=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===ze.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ot.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ot.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ot.assertNever(e)}return{message:n}};let ZH=g0;function YH(){return ZH}const WH=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let d="";const h=r.filter(m=>!!m).slice().reverse();for(const m of h)d=m(c,{data:t,defaultError:d}).message;return{...s,path:l,message:d}};function Oe(e,t){const n=YH(),r=WH({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===g0?void 0:g0].filter(s=>!!s)});e.common.issues.push(r)}class Pr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return ot;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const l=await s.key,c=await s.value;r.push({key:l,value:c})}return Pr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return ot;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const ot=Object.freeze({status:"aborted"}),Ud=e=>({status:"dirty",value:e}),Ka=e=>({status:"valid",value:e}),N2=e=>e.status==="aborted",A2=e=>e.status==="dirty",lu=e=>e.status==="valid",sp=e=>typeof Promise<"u"&&e instanceof Promise;var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ze||(Ze={}));class Us{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const D2=(e,t)=>{if(lu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new _o(e.common.issues);return this._error=n,this._error}}};function pt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(c,d)=>{const{message:h}=e;return c.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??r??d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:h??n??d.defaultError}},description:s}}class Et{get description(){return this._def.description}_getType(t){return li(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:li(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Pr,ctx:{common:t.parent.common,data:t.data,parsedType:li(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(sp(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:li(t)},s=this._parseSync({data:t,path:r.path,parent:r});return D2(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:li(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return lu(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>lu(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:li(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(sp(s)?s:Promise.resolve(s));return D2(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=t(s),d=()=>l.addIssue({code:Se.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Nl({schema:this,typeName:it.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return bo.create(this,this._def)}nullable(){return Al.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Is.create(this)}promise(){return hp.create(this,this._def)}or(t){return lp.create([this,t],this._def)}and(t){return cp.create(this,t,this._def)}transform(t){return new Nl({...pt(this._def),schema:this,typeName:it.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new mp({...pt(this._def),innerType:this,defaultValue:n,typeName:it.ZodDefault})}brand(){return new NA({typeName:it.ZodBranded,type:this,...pt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new pp({...pt(this._def),innerType:this,catchValue:n,typeName:it.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Zb.create(this,t)}readonly(){return gp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const QH=/^c[^\s-]{8,}$/i,XH=/^[0-9a-z]+$/,JH=/^[0-9A-HJKMNP-TV-Z]{26}$/i,e$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,t$=/^[a-z0-9_-]{21}$/i,n$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,r$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,a$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,s$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let vx;const o$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,i$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,l$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,c$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u$=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,d$=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,TA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",f$=new RegExp(`^${TA}$`);function jA(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function h$(e){return new RegExp(`^${jA(e)}$`)}function m$(e){let t=`${TA}T${jA(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function p$(e,t){return!!((t==="v4"||!t)&&o$.test(e)||(t==="v6"||!t)&&l$.test(e))}function g$(e,t){if(!n$.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function v$(e,t){return!!((t==="v4"||!t)&&i$.test(e)||(t==="v6"||!t)&&c$.test(e))}class xo extends Et{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ze.string){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_type,expected:ze.string,received:l.parsedType}),ot}const r=new Pr;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const c=t.data.length>l.value,d=t.data.length<l.value;(c||d)&&(s=this._getOrReturnCtx(t,s),c?Oe(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&Oe(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")a$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"email",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")vx||(vx=new RegExp(s$,"u")),vx.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"emoji",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")e$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"uuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")t$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"nanoid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")QH.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"cuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")XH.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"cuid2",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")JH.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"ulid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Oe(s,{validation:"url",code:Se.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"regex",code:Se.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?m$(l).test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?f$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?h$(l).test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?r$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"duration",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?p$(t.data,l.version)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"ip",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?g$(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"jwt",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?v$(t.data,l.version)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"cidr",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?u$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"base64",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?d$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"base64url",code:Se.invalid_string,message:l.message}),r.dirty()):Ot.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Se.invalid_string,...Ze.errToObj(r)})}_addCheck(t){return new xo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ze.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ze.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ze.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Ze.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ze.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ze.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}nonempty(t){return this.min(1,Ze.errToObj(t))}trim(){return new xo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}xo.create=e=>new xo({checks:[],typeName:it.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...pt(e)});function y$(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}class cu extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ze.number){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_type,expected:ze.number,received:l.parsedType}),ot}let r;const s=new Pr;for(const l of this._def.checks)l.kind==="int"?Ot.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?y$(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.not_finite,message:l.message}),s.dirty()):Ot.assertNever(l);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,s){return new cu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(t){return new cu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ot.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}cu.create=e=>new cu({checks:[],typeName:it.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...pt(e)});class of extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ze.bigint)return this._getInvalidInput(t);let r;const s=new Pr;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Ot.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Se.invalid_type,expected:ze.bigint,received:n.parsedType}),ot}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,s){return new of({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(t){return new of({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}of.create=e=>new of({checks:[],typeName:it.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...pt(e)});class v0 extends Et{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ze.boolean){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:ze.boolean,received:r.parsedType}),ot}return Ka(t.data)}}v0.create=e=>new v0({typeName:it.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...pt(e)});class op extends Et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ze.date){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_type,expected:ze.date,received:l.parsedType}),ot}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_date}),ot}const r=new Pr;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):Ot.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new op({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}op.create=e=>new op({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:it.ZodDate,...pt(e)});class O2 extends Et{_parse(t){if(this._getType(t)!==ze.symbol){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:ze.symbol,received:r.parsedType}),ot}return Ka(t.data)}}O2.create=e=>new O2({typeName:it.ZodSymbol,...pt(e)});class y0 extends Et{_parse(t){if(this._getType(t)!==ze.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:ze.undefined,received:r.parsedType}),ot}return Ka(t.data)}}y0.create=e=>new y0({typeName:it.ZodUndefined,...pt(e)});class ip extends Et{_parse(t){if(this._getType(t)!==ze.null){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:ze.null,received:r.parsedType}),ot}return Ka(t.data)}}ip.create=e=>new ip({typeName:it.ZodNull,...pt(e)});class M2 extends Et{constructor(){super(...arguments),this._any=!0}_parse(t){return Ka(t.data)}}M2.create=e=>new M2({typeName:it.ZodAny,...pt(e)});class x0 extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ka(t.data)}}x0.create=e=>new x0({typeName:it.ZodUnknown,...pt(e)});class ji extends Et{_parse(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Se.invalid_type,expected:ze.never,received:n.parsedType}),ot}}ji.create=e=>new ji({typeName:it.ZodNever,...pt(e)});class k2 extends Et{_parse(t){if(this._getType(t)!==ze.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:ze.void,received:r.parsedType}),ot}return Ka(t.data)}}k2.create=e=>new k2({typeName:it.ZodVoid,...pt(e)});class Is extends Et{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==ze.array)return Oe(n,{code:Se.invalid_type,expected:ze.array,received:n.parsedType}),ot;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,d=n.data.length<s.exactLength.value;(c||d)&&(Oe(n,{code:c?Se.too_big:Se.too_small,minimum:d?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Oe(n,{code:Se.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Oe(n,{code:Se.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>s.type._parseAsync(new Us(n,c,n.path,d)))).then(c=>Pr.mergeArray(r,c));const l=[...n.data].map((c,d)=>s.type._parseSync(new Us(n,c,n.path,d)));return Pr.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new Is({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new Is({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new Is({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}Is.create=(e,t)=>new Is({type:e,minLength:null,maxLength:null,exactLength:null,typeName:it.ZodArray,...pt(t)});function Pc(e){if(e instanceof zn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=bo.create(Pc(r))}return new zn({...e._def,shape:()=>t})}else return e instanceof Is?new Is({...e._def,type:Pc(e.element)}):e instanceof bo?bo.create(Pc(e.unwrap())):e instanceof Al?Al.create(Pc(e.unwrap())):e instanceof jl?jl.create(e.items.map(t=>Pc(t))):e}class zn extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ot.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ze.object){const m=this._getOrReturnCtx(t);return Oe(m,{code:Se.invalid_type,expected:ze.object,received:m.parsedType}),ot}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof ji&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||d.push(m);const h=[];for(const m of c){const g=l[m],v=s.data[m];h.push({key:{status:"valid",value:m},value:g._parse(new Us(s,v,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof ji){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of d)h.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(m==="strict")d.length>0&&(Oe(s,{code:Se.unrecognized_keys,keys:d}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const g of d){const v=s.data[g];h.push({key:{status:"valid",value:g},value:m._parse(new Us(s,v,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of h){const v=await g.key,x=await g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m}).then(m=>Pr.mergeObjectSync(r,m)):Pr.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new zn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const s=((c=(l=this._def).errorMap)==null?void 0:c.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ze.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new zn({...this._def,unknownKeys:"strip"})}passthrough(){return new zn({...this._def,unknownKeys:"passthrough"})}extend(t){return new zn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new zn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:it.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new zn({...this._def,catchall:t})}pick(t){const n={};for(const r of Ot.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Ot.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}deepPartial(){return Pc(this)}partial(t){const n={};for(const r of Ot.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new zn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Ot.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof bo;)l=l._def.innerType;n[r]=l}return new zn({...this._def,shape:()=>n})}keyof(){return _A(Ot.objectKeys(this.shape))}}zn.create=(e,t)=>new zn({shape:()=>e,unknownKeys:"strip",catchall:ji.create(),typeName:it.ZodObject,...pt(t)});zn.strictCreate=(e,t)=>new zn({shape:()=>e,unknownKeys:"strict",catchall:ji.create(),typeName:it.ZodObject,...pt(t)});zn.lazycreate=(e,t)=>new zn({shape:e,unknownKeys:"strip",catchall:ji.create(),typeName:it.ZodObject,...pt(t)});class lp extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new _o(d.ctx.common.issues));return Oe(n,{code:Se.invalid_union,unionErrors:c}),ot}if(n.common.async)return Promise.all(r.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const h of r){const m={...n,common:{...n.common,issues:[]},parent:null},g=h._parseSync({data:n.data,path:n.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!l&&(l={result:g,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(h=>new _o(h));return Oe(n,{code:Se.invalid_union,unionErrors:d}),ot}}get options(){return this._def.options}}lp.create=(e,t)=>new lp({options:e,typeName:it.ZodUnion,...pt(t)});const mo=e=>e instanceof S0?mo(e.schema):e instanceof Nl?mo(e.innerType()):e instanceof dp?[e.value]:e instanceof _l?e.options:e instanceof fp?Ot.objectValues(e.enum):e instanceof mp?mo(e._def.innerType):e instanceof y0?[void 0]:e instanceof ip?[null]:e instanceof bo?[void 0,...mo(e.unwrap())]:e instanceof Al?[null,...mo(e.unwrap())]:e instanceof NA||e instanceof gp?mo(e.unwrap()):e instanceof pp?mo(e._def.innerType):[];class Kb extends Et{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ze.object)return Oe(n,{code:Se.invalid_type,expected:ze.object,received:n.parsedType}),ot;const r=this.discriminator,s=n.data[r],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(Oe(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ot)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const l of n){const c=mo(l.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of c){if(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,l)}}return new Kb({typeName:it.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...pt(r)})}}function b0(e,t){const n=li(e),r=li(t);if(e===t)return{valid:!0,data:e};if(n===ze.object&&r===ze.object){const s=Ot.objectKeys(t),l=Ot.objectKeys(e).filter(d=>s.indexOf(d)!==-1),c={...e,...t};for(const d of l){const h=b0(e[d],t[d]);if(!h.valid)return{valid:!1};c[d]=h.data}return{valid:!0,data:c}}else if(n===ze.array&&r===ze.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],h=b0(c,d);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return n===ze.date&&r===ze.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class cp extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,c)=>{if(N2(l)||N2(c))return ot;const d=b0(l.value,c.value);return d.valid?((A2(l)||A2(c))&&n.dirty(),{status:n.value,value:d.data}):(Oe(r,{code:Se.invalid_intersection_types}),ot)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}cp.create=(e,t,n)=>new cp({left:e,right:t,typeName:it.ZodIntersection,...pt(n)});class jl extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.array)return Oe(r,{code:Se.invalid_type,expected:ze.array,received:r.parsedType}),ot;if(r.data.length<this._def.items.length)return Oe(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ot;!this._def.rest&&r.data.length>this._def.items.length&&(Oe(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((c,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new Us(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>Pr.mergeArray(n,c)):Pr.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new jl({...this._def,rest:t})}}jl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jl({items:e,typeName:it.ZodTuple,rest:null,...pt(t)})};class up extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.object)return Oe(r,{code:Se.invalid_type,expected:ze.object,received:r.parsedType}),ot;const s=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)s.push({key:l._parse(new Us(r,d,r.path,d)),value:c._parse(new Us(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?Pr.mergeObjectAsync(n,s):Pr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Et?new up({keyType:t,valueType:n,typeName:it.ZodRecord,...pt(r)}):new up({keyType:xo.create(),valueType:t,typeName:it.ZodRecord,...pt(n)})}}class I2 extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.map)return Oe(r,{code:Se.invalid_type,expected:ze.map,received:r.parsedType}),ot;const s=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,h],m)=>({key:s._parse(new Us(r,d,r.path,[m,"key"])),value:l._parse(new Us(r,h,r.path,[m,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of c){const m=await h.key,g=await h.value;if(m.status==="aborted"||g.status==="aborted")return ot;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const h of c){const m=h.key,g=h.value;if(m.status==="aborted"||g.status==="aborted")return ot;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}}}}I2.create=(e,t,n)=>new I2({valueType:t,keyType:e,typeName:it.ZodMap,...pt(n)});class lf extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.set)return Oe(r,{code:Se.invalid_type,expected:ze.set,received:r.parsedType}),ot;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Oe(r,{code:Se.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Oe(r,{code:Se.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(h){const m=new Set;for(const g of h){if(g.status==="aborted")return ot;g.status==="dirty"&&n.dirty(),m.add(g.value)}return{status:n.value,value:m}}const d=[...r.data.values()].map((h,m)=>l._parse(new Us(r,h,r.path,m)));return r.common.async?Promise.all(d).then(h=>c(h)):c(d)}min(t,n){return new lf({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new lf({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}lf.create=(e,t)=>new lf({valueType:e,minSize:null,maxSize:null,typeName:it.ZodSet,...pt(t)});class S0 extends Et{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}S0.create=(e,t)=>new S0({getter:e,typeName:it.ZodLazy,...pt(t)});class dp extends Et{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Oe(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),ot}return{status:"valid",value:t.data}}get value(){return this._def.value}}dp.create=(e,t)=>new dp({value:e,typeName:it.ZodLiteral,...pt(t)});function _A(e,t){return new _l({values:e,typeName:it.ZodEnum,...pt(t)})}class _l extends Et{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{expected:Ot.joinValues(r),received:n.parsedType,code:Se.invalid_type}),ot}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{received:n.data,code:Se.invalid_enum_value,options:r}),ot}return Ka(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return _l.create(t,{...this._def,...n})}exclude(t,n=this._def){return _l.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}_l.create=_A;class fp extends Et{_parse(t){const n=Ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ze.string&&r.parsedType!==ze.number){const s=Ot.objectValues(n);return Oe(r,{expected:Ot.joinValues(s),received:r.parsedType,code:Se.invalid_type}),ot}if(this._cache||(this._cache=new Set(Ot.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ot.objectValues(n);return Oe(r,{received:r.data,code:Se.invalid_enum_value,options:s}),ot}return Ka(t.data)}get enum(){return this._def.values}}fp.create=(e,t)=>new fp({values:e,typeName:it.ZodNativeEnum,...pt(t)});class hp extends Et{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ze.promise&&n.common.async===!1)return Oe(n,{code:Se.invalid_type,expected:ze.promise,received:n.parsedType}),ot;const r=n.parsedType===ze.promise?n.data:Promise.resolve(n.data);return Ka(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}hp.create=(e,t)=>new hp({type:e,typeName:it.ZodPromise,...pt(t)});class Nl extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===it.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:c=>{Oe(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return ot;const h=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return h.status==="aborted"?ot:h.status==="dirty"||n.value==="dirty"?Ud(h.value):h});{if(n.value==="aborted")return ot;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?ot:d.status==="dirty"||n.value==="dirty"?Ud(d.value):d}}if(s.type==="refinement"){const c=d=>{const h=s.refinement(d,l);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?ot:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?ot:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(s.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!lu(c))return ot;const d=s.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>lu(c)?Promise.resolve(s.transform(c.value,l)).then(d=>({status:n.value,value:d})):ot);Ot.assertNever(s)}}Nl.create=(e,t,n)=>new Nl({schema:e,typeName:it.ZodEffects,effect:t,...pt(n)});Nl.createWithPreprocess=(e,t,n)=>new Nl({schema:t,effect:{type:"preprocess",transform:e},typeName:it.ZodEffects,...pt(n)});class bo extends Et{_parse(t){return this._getType(t)===ze.undefined?Ka(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bo.create=(e,t)=>new bo({innerType:e,typeName:it.ZodOptional,...pt(t)});class Al extends Et{_parse(t){return this._getType(t)===ze.null?Ka(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Al.create=(e,t)=>new Al({innerType:e,typeName:it.ZodNullable,...pt(t)});class mp extends Et{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}mp.create=(e,t)=>new mp({innerType:e,typeName:it.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...pt(t)});class pp extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sp(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new _o(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new _o(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}pp.create=(e,t)=>new pp({innerType:e,typeName:it.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...pt(t)});class L2 extends Et{_parse(t){if(this._getType(t)!==ze.nan){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:ze.nan,received:r.parsedType}),ot}return{status:"valid",value:t.data}}}L2.create=e=>new L2({typeName:it.ZodNaN,...pt(e)});class NA extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Zb extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?ot:l.status==="dirty"?(n.dirty(),Ud(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ot:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Zb({in:t,out:n,typeName:it.ZodPipeline})}}class gp extends Et{_parse(t){const n=this._def.innerType._parse(t),r=s=>(lu(s)&&(s.value=Object.freeze(s.value)),s);return sp(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}gp.create=(e,t)=>new gp({innerType:e,typeName:it.ZodReadonly,...pt(t)});var it;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(it||(it={}));const tn=xo.create,x$=cu.create,b$=v0.create,S$=ip.create,C$=x0.create;ji.create;const P2=Is.create,en=zn.create,w$=lp.create,AA=Kb.create;cp.create;jl.create;const E$=up.create,$s=dp.create;_l.create;const Yb=fp.create;hp.create;bo.create;const R$=Al.create,yx=ot,DA=en({serviceAccount:tn().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON object"}),yx):n.client_email?e:(t.addIssue({code:Se.custom,message:"Service Account must contain a client_email field"}),yx)}catch(n){return console.error(n),t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON string"}),yx}})}),T$=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:PH,visible:{flagKey:"MENU_GITHUB_COMMUNITY_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Discover Upgrade Options",href:"https://www.owox.com/pricing/?utm_source=bi_owox_com&utm_medium=community_edition&utm_campaign=pricing&utm_keyword=upgrade_options&utm_content=header_dropdown",icon:AR,visible:{flagKey:"MENU_UPGRADE_OPTIONS_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Project settings",href:"https://platform.owox.com/ui/p/none/settings/general",icon:Dj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Credits consumption",href:"https://platform.owox.com/ui/p/none/settings/consumption",icon:AR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:pL,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:DR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:DR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Lr,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Lr,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:g8,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:iL,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:GH,visible:{flagKey:"MENU_SLACK_COMMUNITY_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:M8,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:BH,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function U2(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function j$(){const{flags:e}=zb(),{loadProjects:t,projects:n}=CA(),{id:r}=ZN(),s=U2("IDP_PROVIDER","owox",e);p.useEffect(()=>{s&&t()},[t,s]);const l=n.length>1;return{visibleMenuItems:p.useMemo(()=>{const h=T$.filter(x=>typeof x.visible=="boolean"?x.visible:U2(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const b=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:b}}catch{return x}return x}),m=new Map;h.forEach(x=>{const b=x.group||"default";m.has(b)||m.set(b,[]);const w=m.get(b);w&&w.push(x)});const g=[],v=Array.from(m.entries()).filter(([,x])=>x.length>0);return v.forEach(([,x],b)=>{g.push(...x),b<v.length-1&&g.push({type:"separator",visible:!0})}),g},[e,r]),canSwitchProject:l}}function _$(){const{visibleMenuItems:e,canSwitchProject:t}=j$();return o.jsxs(Or,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return o.jsx($a,{},`separator-${String(r)}`);const s=n.icon;return o.jsx(Tt,{asChild:!0,children:o.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[o.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&o.jsx(LH,{},"switch-project")]})}var jr=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(jr||{});let N$={data:""},A$=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||N$},D$=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,O$=/\/\*[^]*?\*\/| +/g,F2=/\n+/g,fi=(e,t)=>{let n="",r="",s="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?fi(c,l):l+"{"+fi(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=fi(c,t?t.replace(/([^,])+/g,d=>l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,h=>/&/.test(h)?h.replace(/&/g,d):d?d+" "+h:h)):l):c!=null&&(l=/^--/.test(l)?l:l.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=fi.p?fi.p(l,c):l+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},uo={},OA=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+OA(e[n]);return t}return e},M$=(e,t,n,r,s)=>{let l=OA(e),c=uo[l]||(uo[l]=(h=>{let m=0,g=11;for(;m<h.length;)g=101*g+h.charCodeAt(m++)>>>0;return"go"+g})(l));if(!uo[c]){let h=l!==e?e:(m=>{let g,v,x=[{}];for(;g=D$.exec(m.replace(O$,""));)g[4]?x.shift():g[3]?(v=g[3].replace(F2," ").trim(),x.unshift(x[0][v]=x[0][v]||{})):x[0][g[1]]=g[2].replace(F2," ").trim();return x[0]})(e);uo[c]=fi(s?{["@keyframes "+c]:h}:h,n?"":"."+c)}let d=n&&uo.g?uo.g:null;return n&&(uo.g=uo[c]),((h,m,g,v)=>{v?m.data=m.data.replace(v,h):m.data.indexOf(h)===-1&&(m.data=g?h+m.data:m.data+h)})(uo[c],t,r,d),c},k$=(e,t,n)=>e.reduce((r,s,l)=>{let c=t[l];if(c&&c.call){let d=c(n),h=d&&d.props&&d.props.className||/^go/.test(d)&&d;c=h?"."+h:d&&typeof d=="object"?d.props?"":fi(d,""):d===!1?"":d}return r+s+(c??"")},"");function cg(e){let t=this||{},n=e.call?e(t.p):e;return M$(n.unshift?n.raw?k$(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,A$(t.target),t.g,t.o,t.k)}let MA,C0,w0;cg.bind({g:1});let No=cg.bind({k:1});function I$(e,t,n,r){fi.p=t,MA=e,C0=n,w0=r}function Ui(e,t){let n=this||{};return function(){let r=arguments;function s(l,c){let d=Object.assign({},l),h=d.className||s.className;n.p=Object.assign({theme:C0&&C0()},d),n.o=/ *go\d+/.test(h),d.className=cg.apply(n,r)+(h?" "+h:"");let m=e;return e[0]&&(m=d.as||e,delete d.as),w0&&m[0]&&w0(d),MA(m,d)}return s}}var L$=e=>typeof e=="function",vp=(e,t)=>L$(e)?e(t):e,P$=(()=>{let e=0;return()=>(++e).toString()})(),kA=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),U$=20,Wb="default",IA=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(c=>c.id===t.toast.id?{...c,...t.toast}:c)};case 2:let{toast:r}=t;return IA(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(c=>c.id===s||s===void 0?{...c,dismissed:!0,visible:!1}:c)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(c=>c.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let l=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+l}))}}},Vm=[],LA={toasts:[],pausedAt:void 0,settings:{toastLimit:U$}},Os={},PA=(e,t=Wb)=>{Os[t]=IA(Os[t]||LA,e),Vm.forEach(([n,r])=>{n===t&&r(Os[t])})},UA=e=>Object.keys(Os).forEach(t=>PA(e,t)),F$=e=>Object.keys(Os).find(t=>Os[t].toasts.some(n=>n.id===e)),ug=(e=Wb)=>t=>{PA(t,e)},z$={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$=(e={},t=Wb)=>{let[n,r]=p.useState(Os[t]||LA),s=p.useRef(Os[t]);p.useEffect(()=>(s.current!==Os[t]&&r(Os[t]),Vm.push([t,r]),()=>{let c=Vm.findIndex(([d])=>d===t);c>-1&&Vm.splice(c,1)}),[t]);let l=n.toasts.map(c=>{var d,h,m;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((d=e[c.type])==null?void 0:d.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((h=e[c.type])==null?void 0:h.duration)||(e==null?void 0:e.duration)||z$[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:l}},H$=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||P$()}),Pf=e=>(t,n)=>{let r=H$(t,e,n);return ug(r.toasterId||F$(r.id))({type:2,toast:r}),r.id},Jt=(e,t)=>Pf("blank")(e,t);Jt.error=Pf("error");Jt.success=Pf("success");Jt.loading=Pf("loading");Jt.custom=Pf("custom");Jt.dismiss=(e,t)=>{let n={type:3,toastId:e};t?ug(t)(n):UA(n)};Jt.dismissAll=e=>Jt.dismiss(void 0,e);Jt.remove=(e,t)=>{let n={type:4,toastId:e};t?ug(t)(n):UA(n)};Jt.removeAll=e=>Jt.remove(void 0,e);Jt.promise=(e,t,n)=>{let r=Jt.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let l=t.success?vp(t.success,s):void 0;return l?Jt.success(l,{id:r,...n,...n==null?void 0:n.success}):Jt.dismiss(r),s}).catch(s=>{let l=t.error?vp(t.error,s):void 0;l?Jt.error(l,{id:r,...n,...n==null?void 0:n.error}):Jt.dismiss(r)}),e};var $$=1e3,B$=(e,t="default")=>{let{toasts:n,pausedAt:r}=V$(e,t),s=p.useRef(new Map).current,l=p.useCallback((v,x=$$)=>{if(s.has(v))return;let b=setTimeout(()=>{s.delete(v),c({type:4,toastId:v})},x);s.set(v,b)},[]);p.useEffect(()=>{if(r)return;let v=Date.now(),x=n.map(b=>{if(b.duration===1/0)return;let w=(b.duration||0)+b.pauseDuration-(v-b.createdAt);if(w<0){b.visible&&Jt.dismiss(b.id);return}return setTimeout(()=>Jt.dismiss(b.id,t),w)});return()=>{x.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=p.useCallback(ug(t),[t]),d=p.useCallback(()=>{c({type:5,time:Date.now()})},[c]),h=p.useCallback((v,x)=>{c({type:1,toast:{id:v,height:x}})},[c]),m=p.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=p.useCallback((v,x)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:C}=x||{},E=n.filter(j=>(j.position||C)===(v.position||C)&&j.height),R=E.findIndex(j=>j.id===v.id),T=E.filter((j,O)=>O<R&&j.visible).length;return E.filter(j=>j.visible).slice(...b?[T+1]:[0,T]).reduce((j,O)=>j+(O.height||0)+w,0)},[n]);return p.useEffect(()=>{n.forEach(v=>{if(v.dismissed)l(v.id,v.removeDelay);else{let x=s.get(v.id);x&&(clearTimeout(x),s.delete(v.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:h,startPause:d,endPause:m,calculateOffset:g}}},G$=No`
|
|
491
|
-
from {
|
|
492
|
-
transform: scale(0) rotate(45deg);
|
|
493
|
-
opacity: 0;
|
|
494
|
-
}
|
|
495
|
-
to {
|
|
496
|
-
transform: scale(1) rotate(45deg);
|
|
497
|
-
opacity: 1;
|
|
498
|
-
}`,q$=No`
|
|
499
|
-
from {
|
|
500
|
-
transform: scale(0);
|
|
501
|
-
opacity: 0;
|
|
502
|
-
}
|
|
503
|
-
to {
|
|
504
|
-
transform: scale(1);
|
|
505
|
-
opacity: 1;
|
|
506
|
-
}`,K$=No`
|
|
507
|
-
from {
|
|
508
|
-
transform: scale(0) rotate(90deg);
|
|
509
|
-
opacity: 0;
|
|
510
|
-
}
|
|
511
|
-
to {
|
|
512
|
-
transform: scale(1) rotate(90deg);
|
|
513
|
-
opacity: 1;
|
|
514
|
-
}`,Z$=Ui("div")`
|
|
515
|
-
width: 20px;
|
|
516
|
-
opacity: 0;
|
|
517
|
-
height: 20px;
|
|
518
|
-
border-radius: 10px;
|
|
519
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
520
|
-
position: relative;
|
|
521
|
-
transform: rotate(45deg);
|
|
522
|
-
|
|
523
|
-
animation: ${G$} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
524
|
-
forwards;
|
|
525
|
-
animation-delay: 100ms;
|
|
526
|
-
|
|
527
|
-
&:after,
|
|
528
|
-
&:before {
|
|
529
|
-
content: '';
|
|
530
|
-
animation: ${q$} 0.15s ease-out forwards;
|
|
531
|
-
animation-delay: 150ms;
|
|
532
|
-
position: absolute;
|
|
533
|
-
border-radius: 3px;
|
|
534
|
-
opacity: 0;
|
|
535
|
-
background: ${e=>e.secondary||"#fff"};
|
|
536
|
-
bottom: 9px;
|
|
537
|
-
left: 4px;
|
|
538
|
-
height: 2px;
|
|
539
|
-
width: 12px;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
&:before {
|
|
543
|
-
animation: ${K$} 0.15s ease-out forwards;
|
|
544
|
-
animation-delay: 180ms;
|
|
545
|
-
transform: rotate(90deg);
|
|
546
|
-
}
|
|
547
|
-
`,Y$=No`
|
|
548
|
-
from {
|
|
549
|
-
transform: rotate(0deg);
|
|
550
|
-
}
|
|
551
|
-
to {
|
|
552
|
-
transform: rotate(360deg);
|
|
553
|
-
}
|
|
554
|
-
`,W$=Ui("div")`
|
|
555
|
-
width: 12px;
|
|
556
|
-
height: 12px;
|
|
557
|
-
box-sizing: border-box;
|
|
558
|
-
border: 2px solid;
|
|
559
|
-
border-radius: 100%;
|
|
560
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
561
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
562
|
-
animation: ${Y$} 1s linear infinite;
|
|
563
|
-
`,Q$=No`
|
|
564
|
-
from {
|
|
565
|
-
transform: scale(0) rotate(45deg);
|
|
566
|
-
opacity: 0;
|
|
567
|
-
}
|
|
568
|
-
to {
|
|
569
|
-
transform: scale(1) rotate(45deg);
|
|
570
|
-
opacity: 1;
|
|
571
|
-
}`,X$=No`
|
|
572
|
-
0% {
|
|
573
|
-
height: 0;
|
|
574
|
-
width: 0;
|
|
575
|
-
opacity: 0;
|
|
576
|
-
}
|
|
577
|
-
40% {
|
|
578
|
-
height: 0;
|
|
579
|
-
width: 6px;
|
|
580
|
-
opacity: 1;
|
|
581
|
-
}
|
|
582
|
-
100% {
|
|
583
|
-
opacity: 1;
|
|
584
|
-
height: 10px;
|
|
585
|
-
}`,J$=Ui("div")`
|
|
586
|
-
width: 20px;
|
|
587
|
-
opacity: 0;
|
|
588
|
-
height: 20px;
|
|
589
|
-
border-radius: 10px;
|
|
590
|
-
background: ${e=>e.primary||"#61d345"};
|
|
591
|
-
position: relative;
|
|
592
|
-
transform: rotate(45deg);
|
|
593
|
-
|
|
594
|
-
animation: ${Q$} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
595
|
-
forwards;
|
|
596
|
-
animation-delay: 100ms;
|
|
597
|
-
&:after {
|
|
598
|
-
content: '';
|
|
599
|
-
box-sizing: border-box;
|
|
600
|
-
animation: ${X$} 0.2s ease-out forwards;
|
|
601
|
-
opacity: 0;
|
|
602
|
-
animation-delay: 200ms;
|
|
603
|
-
position: absolute;
|
|
604
|
-
border-right: 2px solid;
|
|
605
|
-
border-bottom: 2px solid;
|
|
606
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
607
|
-
bottom: 6px;
|
|
608
|
-
left: 6px;
|
|
609
|
-
height: 10px;
|
|
610
|
-
width: 6px;
|
|
611
|
-
}
|
|
612
|
-
`,eB=Ui("div")`
|
|
613
|
-
position: absolute;
|
|
614
|
-
`,tB=Ui("div")`
|
|
615
|
-
position: relative;
|
|
616
|
-
display: flex;
|
|
617
|
-
justify-content: center;
|
|
618
|
-
align-items: center;
|
|
619
|
-
min-width: 20px;
|
|
620
|
-
min-height: 20px;
|
|
621
|
-
`,nB=No`
|
|
622
|
-
from {
|
|
623
|
-
transform: scale(0.6);
|
|
624
|
-
opacity: 0.4;
|
|
625
|
-
}
|
|
626
|
-
to {
|
|
627
|
-
transform: scale(1);
|
|
628
|
-
opacity: 1;
|
|
629
|
-
}`,rB=Ui("div")`
|
|
630
|
-
position: relative;
|
|
631
|
-
transform: scale(0.6);
|
|
632
|
-
opacity: 0.4;
|
|
633
|
-
min-width: 20px;
|
|
634
|
-
animation: ${nB} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
635
|
-
forwards;
|
|
636
|
-
`,aB=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?p.createElement(rB,null,t):t:n==="blank"?null:p.createElement(tB,null,p.createElement(W$,{...r}),n!=="loading"&&p.createElement(eB,null,n==="error"?p.createElement(Z$,{...r}):p.createElement(J$,{...r})))},sB=e=>`
|
|
637
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
638
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
639
|
-
`,oB=e=>`
|
|
640
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
641
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
642
|
-
`,iB="0%{opacity:0;} 100%{opacity:1;}",lB="0%{opacity:1;} 100%{opacity:0;}",cB=Ui("div")`
|
|
643
|
-
display: flex;
|
|
644
|
-
align-items: center;
|
|
645
|
-
background: #fff;
|
|
646
|
-
color: #363636;
|
|
647
|
-
line-height: 1.3;
|
|
648
|
-
will-change: transform;
|
|
649
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
650
|
-
max-width: 350px;
|
|
651
|
-
pointer-events: auto;
|
|
652
|
-
padding: 8px 10px;
|
|
653
|
-
border-radius: 8px;
|
|
654
|
-
`,uB=Ui("div")`
|
|
655
|
-
display: flex;
|
|
656
|
-
justify-content: center;
|
|
657
|
-
margin: 4px 10px;
|
|
658
|
-
color: inherit;
|
|
659
|
-
flex: 1 1 auto;
|
|
660
|
-
white-space: pre-line;
|
|
661
|
-
`,dB=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=kA()?[iB,lB]:[sB(n),oB(n)];return{animation:t?`${No(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${No(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},fB=p.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?dB(e.position||t||"top-center",e.visible):{opacity:0},l=p.createElement(aB,{toast:e}),c=p.createElement(uB,{...e.ariaProps},vp(e.message,e));return p.createElement(cB,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):p.createElement(p.Fragment,null,l,c))});I$(p.createElement);var hB=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let l=p.useCallback(c=>{if(c){let d=()=>{let h=c.getBoundingClientRect().height;r(e,h)};d(),new MutationObserver(d).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return p.createElement("div",{ref:l,className:t,style:n},s)},mB=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:kA()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},pB=cg`
|
|
662
|
-
z-index: 9999;
|
|
663
|
-
> * {
|
|
664
|
-
pointer-events: auto;
|
|
665
|
-
}
|
|
666
|
-
`,bm=16,gB=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:h,handlers:m}=B$(n,l);return p.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:bm,left:bm,right:bm,bottom:bm,pointerEvents:"none",...c},className:d,onMouseEnter:m.startPause,onMouseLeave:m.endPause},h.map(g=>{let v=g.position||t,x=m.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),b=mB(v,x);return p.createElement(hB,{id:g.id,key:g.id,onHeightUpdate:m.updateHeight,className:g.visible?pB:"",style:b},g.type==="custom"?vp(g.message,g):s?s(g):p.createElement(fB,{toast:g,position:v}))}))},fn=Jt;const mn=e=>{var n;return(n=e.response)==null?void 0:n.data};function z2(e,t="Something went wrong"){var s,l;const n=mn(e);let r=n.message.trim()||t;(l=(s=n.errorDetails)==null?void 0:s.error)!=null&&l.trim()&&(r=`${r}. ${n.errorDetails.error}`),fn.error(r)}class vB{constructor(){Rs(this,"isRefreshingToken",!1);Rs(this,"refreshTokenPromise",null);Rs(this,"accessToken",null)}getAccessToken(){return this.accessToken}setAccessToken(t){this.accessToken=t}isRefreshing(){return this.isRefreshingToken}async refreshToken(t){if(this.isRefreshingToken&&this.refreshTokenPromise)return await this.refreshTokenPromise;this.isRefreshingToken=!0,this.refreshTokenPromise=this.performRefresh(t);try{const n=await this.refreshTokenPromise;return this.setAccessToken(n),n}finally{this.isRefreshingToken=!1,this.refreshTokenPromise=null}}clear(){this.accessToken=null,this.isRefreshingToken=!1,this.refreshTokenPromise=null}async performRefresh(t){try{return await t()}catch(n){throw this.clear(),n}}}const yB={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},fa=En.create(yB),E0=new vB;fa.interceptors.request.use(e=>{if(e.skipAuthHeader||new xH(e.headers).has("X-OWOX-Authorization"))return e;const n=qb(),r=(n==null?void 0:n.getAccessToken())??E0.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));fa.interceptors.response.use(e=>e,async e=>{var n,r,s;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const l=qb();if(!l)throw new Error("No token provider available");const c=await E0.refreshToken(()=>l.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await fa(t)}catch{return E0.clear(),window.dispatchEvent(new CustomEvent("auth:logout",{detail:{reason:"token_refresh_failed"}})),Promise.reject(new Error("Token refresh failed"))}}return((r=e.response)==null?void 0:r.status)===403&&z2(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&z2(e,"Bad request"),Promise.reject(e)});const FA={projects:[],callState:jr.IDLE,error:null};function xB(e,t){switch(t.type){case"LOADING":return{...e,callState:jr.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:jr.LOADED,error:null};case"ERROR":return{...e,callState:jr.ERROR,error:t.payload};case"RESET":return{...FA};default:return e}}function bB({children:e}){const[t,n]=p.useReducer(xB,FA),r=p.useCallback(async()=>{n({type:"LOADING"});try{const d=qb();if(!d){n({type:"ERROR",payload:mn(new R2("No token provider"))});return}const h=d.getAccessToken();if(!h){n({type:"ERROR",payload:mn(new R2("Unable to obtain access token"))});return}const m=await RH(h);n({type:"SUCCESS",payload:m})}catch(d){n({type:"ERROR",payload:mn(d)})}},[]),s=p.useCallback(()=>{n({type:"RESET"})},[]),l=t.callState===jr.LOADING,c={...t,loadProjects:r,reset:s,isLoading:l};return o.jsx(SA.Provider,{value:c,children:e})}function SB(){const[e,t]=p.useState(!1);return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(Ar,{open:e,onOpenChange:t,children:[o.jsx(Bz,{isOpen:e}),o.jsx(bB,{children:o.jsx(_$,{})})]})})})})}var CB=(e,t,n,r,s,l,c,d)=>{let h=document.documentElement,m=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",E=C&&l?s.map(R=>l[R]||R):s;C?(h.classList.remove(...E),h.classList.add(l&&l[b]?l[b]:b)):h.setAttribute(w,b)}),v(b)}function v(b){d&&m.includes(b)&&(h.style.colorScheme=b)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let b=localStorage.getItem(t)||n,w=c&&b==="system"?x():b;g(w)}catch{}},V2=["light","dark"],zA="(prefers-color-scheme: dark)",wB=typeof window>"u",Qb=p.createContext(void 0),EB={setTheme:e=>{},themes:[]},VA=()=>{var e;return(e=p.useContext(Qb))!=null?e:EB},RB=e=>p.useContext(Qb)?p.createElement(p.Fragment,null,e.children):p.createElement(jB,{...e}),TB=["light","dark"],jB=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:l=TB,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:h,children:m,nonce:g,scriptProps:v})=>{let[x,b]=p.useState(()=>NB(s,c)),[w,C]=p.useState(()=>x==="system"?xx():x),E=h?Object.values(h):l,R=p.useCallback(D=>{let N=D;if(!N)return;D==="system"&&n&&(N=xx());let A=h?h[N]:N,k=t?AB(g):null,V=document.documentElement,q=H=>{H==="class"?(V.classList.remove(...E),A&&V.classList.add(A)):H.startsWith("data-")&&(A?V.setAttribute(H,A):V.removeAttribute(H))};if(Array.isArray(d)?d.forEach(q):q(d),r){let H=V2.includes(c)?c:null,W=V2.includes(N)?N:H;V.style.colorScheme=W}k==null||k()},[g]),T=p.useCallback(D=>{let N=typeof D=="function"?D(x):D;b(N);try{localStorage.setItem(s,N)}catch{}},[x]),j=p.useCallback(D=>{let N=xx(D);C(N),x==="system"&&n&&!e&&R("system")},[x,e]);p.useEffect(()=>{let D=window.matchMedia(zA);return D.addListener(j),j(D),()=>D.removeListener(j)},[j]),p.useEffect(()=>{let D=N=>{N.key===s&&(N.newValue?b(N.newValue):T(c))};return window.addEventListener("storage",D),()=>window.removeEventListener("storage",D)},[T]),p.useEffect(()=>{R(e??x)},[e,x]);let O=p.useMemo(()=>({theme:x,setTheme:T,forcedTheme:e,resolvedTheme:x==="system"?w:x,themes:n?[...l,"system"]:l,systemTheme:n?w:void 0}),[x,T,e,w,n,l]);return p.createElement(Qb.Provider,{value:O},p.createElement(_B,{forcedTheme:e,storageKey:s,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:h,themes:l,nonce:g,scriptProps:v}),m)},_B=p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:l,value:c,themes:d,nonce:h,scriptProps:m})=>{let g=JSON.stringify([n,t,l,e,d,c,r,s]).slice(1,-1);return p.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${CB.toString()})(${g})`}})}),NB=(e,t)=>{if(wB)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},AB=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},xx=e=>(e||(e=window.matchMedia(zA)),e.matches?"dark":"light");const DB=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:OB(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:jj},{value:"light",label:"Light",icon:Oj},{value:"dark",label:"Dark",icon:_j}]}},{type:"separator"},{type:"item",title:"Sign out",icon:u8,onClick:n,className:"text-red-600 focus:text-red-600"}];function OB(e){switch(e){case"light":return Oj;case"dark":return _j;case"system":default:return jj}}function MB({avatar:e,initials:t,displayName:n}){return o.jsx("div",{className:"text-muted-foreground flex aspect-square size-8 items-center justify-center rounded-full border bg-white text-sm font-medium dark:bg-white/10",children:e?o.jsx("img",{src:e,alt:n,className:"size-full rounded-full object-cover"}):o.jsx("span",{children:t})})}function kB({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return o.jsx(Dr,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:rounded-full group-data-[collapsible=icon]:p-0! focus-visible:ring-2 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",children:[o.jsx(MB,{avatar:r,initials:s,displayName:t}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[o.jsx("span",{className:"truncate font-medium",children:t}),n&&o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),o.jsx(Ga,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function IB({items:e}){return o.jsx(Or,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return o.jsx($a,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return o.jsxs($N,{children:[o.jsxs(BN,{className:"flex items-center gap-2 px-2 py-1.5",children:[o.jsx(t.icon,{className:"size-4"}),t.title]}),o.jsx(GN,{children:r.options.map(s=>o.jsxs(Tt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&o.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&o.jsx(ir,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return o.jsxs(Tt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[o.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function LB(e,t){var n,r,s,l;if(e){const c=e.trim().split(" ").filter(Boolean);return c.length>=2?`${((n=c[0])==null?void 0:n[0])??""}${((r=c[1])==null?void 0:r[0])??""}`.toUpperCase():((l=(s=c[0])==null?void 0:s[0])==null?void 0:l.toUpperCase())||""}if(t!=null&&t.includes("@")){const c=t.split("@")[0];return c.length>1?`${c[0]}${c[1]}`.toUpperCase():c[0].toUpperCase()}return"U"}function PB(){const{user:e,signOut:t}=Pi(),{setTheme:n,theme:r}=VA(),[s,l]=p.useState(!1);if(!e)return null;const{fullName:c,email:d,avatar:h}=e,m=c??d??"Unknown User",g=LB(c,d);return o.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(Ar,{open:s,onOpenChange:l,children:[o.jsx(kB,{isOpen:s,displayName:m,email:d,avatar:h,initials:g}),o.jsx(IB,{items:DB({theme:r,setTheme:n,signOut:t})})]})})}function UB(){const{user:e,status:t}=Pi();return t===Tr.LOADING||t===Tr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function Oo(){const e=sb(),t=UB(),n=p.useCallback((l,c)=>{if(!t){e("/",{replace:!0});return}const d=ap(t,l);e(d,c)},[e,t]),r=p.useCallback(l=>t?ap(t,l):l,[t]);return p.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function FB(){const{scope:e}=Oo();return o.jsxs(vf,{to:e("/data-marts/create"),"data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 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",children:[o.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:o.jsx(Jr,{className:"size-4 shrink-0"})}),o.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:o.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const zB=[{title:"Data Marts",url:"/data-marts",icon:hL},{title:"Storages",url:"/data-storages",icon:Zm},{title:"Destinations",url:"/data-destinations",icon:ub}];function VB(){const{scope:e}=Oo();return o.jsx(aF,{children:zB.map(t=>{const n=t.icon;return o.jsx(sF,{children:o.jsx(vf,{to:e(t.url),className:({isActive:r})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${r?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:({isActive:r})=>o.jsxs(jt,{delayDuration:500,children:[o.jsx(_t,{asChild:!0,children:o.jsxs(iF,{className:`${r?"hover:bg-transparent":""}`,children:[o.jsx(n,{className:"size-4 shrink-0 transition-all"}),o.jsx("span",{children:t.title}),t.badge&&o.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),o.jsx(Nt,{side:"right",children:t.title})]})})},t.title)})})}function HB({variant:e="inset",collapsible:t="icon"}){return o.jsxs(QU,{variant:e,collapsible:t,children:[o.jsx(tF,{children:o.jsx(SB,{})}),o.jsxs(rF,{children:[o.jsx(o2,{children:o.jsx(i2,{children:o.jsx(FB,{})})}),o.jsx(o2,{children:o.jsx(i2,{children:o.jsx(VB,{})})})]}),o.jsx(nF,{children:o.jsx(PB,{})}),o.jsx(JU,{})]})}function $B({children:e,...t}){return o.jsx(RB,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class Vl{constructor(t){Rs(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await fa.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await fa.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await fa.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await fa.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await fa.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class BB{set(t,n){try{const r=typeof n=="object"?JSON.stringify(n):String(n);localStorage.setItem(t,r)}catch(r){console.error(`Error setting localStorage key "${t}":`,r)}}get(t,n){try{const r=localStorage.getItem(t);if(r===null)return null;switch(n){case"boolean":return r==="true";case"json":{const s=JSON.parse(r);return typeof s=="object"?s:null}default:return r}}catch(r){return console.error(`Error getting localStorage key "${t}":`,r),null}}remove(t){try{localStorage.removeItem(t)}catch(n){console.error(`Error removing localStorage key "${t}":`,n)}}has(t){try{return localStorage.getItem(t)!==null}catch(n){return console.error(`Error checking localStorage key "${t}":`,n),!1}}clear(){try{localStorage.clear()}catch(t){console.error("Error clearing localStorage:",t)}}}const hi=new BB;class GB{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),l=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:s,offsetString:l,isDST:c}})}getTimezoneOffset(t,n=new Date){try{const r=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),s=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-l.getTime())/(1e3*60))}catch(r){return console.warn(`Failed to get offset for timezone ${t}:`,r),0}}formatOffset(t){const n=t>=0?"+":"-",r=Math.abs(t),s=Math.floor(r/60),l=r%60;return`${n}${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),s=new Date(n.getFullYear(),6,1),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),d=this.getTimezoneOffset(t,n),h=Math.min(l,c);return d>h}catch(r){return console.warn(`Failed to check DST for timezone ${t}:`,r),!1}}getDisplayName(t,n){return`${t} (${n})`}getBrowserTimezone(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date,r=this.getTimezoneOffset(t,n),s=this.formatOffset(r),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const qB=new GB;function KB({isLoading:e,className:t}){const[n,r]=p.useState(0),[s,l]=p.useState(!1);return p.useEffect(()=>{let c,d;return e?(l(!0),r(0),c=setInterval(()=>{r(h=>h<90?h+(90-h)/10:h)},200)):(r(100),d=setTimeout(()=>{l(!1)},300)),()=>{clearInterval(c),clearTimeout(d)}},[e]),o.jsx("div",{className:ie("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:o.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const HA=p.createContext({isLoading:!1});function ZB({children:e}){const[t,n]=p.useState(0),r=t>0;return p.useEffect(()=>{const s=fa.interceptors.request.use(c=>(c.skipLoadingIndicator||n(d=>d+1),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c))),l=fa.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c)));return()=>{fa.interceptors.request.eject(s),fa.interceptors.response.eject(l)}},[]),o.jsx(HA.Provider,{value:{isLoading:r},children:e})}function YB(){return p.useContext(HA)}function WB(){return o.jsx(gB,{position:"top-center",toastOptions:{duration:3e3,style:{borderRadius:"32px",boxShadow:"none",padding:"0.4rem 1rem",maxWidth:"800px",fontSize:"0.875rem",borderBottomWidth:"1px",borderBottomStyle:"solid"},success:{style:{background:"#ECFDF5",color:"#166534",borderBottomColor:"#D6DFE6"}},error:{style:{background:"#FEE2E2",color:"#991B1B",borderBottomColor:"#EAD1D1"},duration:6e3},loading:{style:{background:"#E8EDFB",color:"#1D4ED8",borderBottomColor:"#CAD5F6",borderBottomWidth:"1px",borderBottomStyle:"solid"}}}})}function QB({children:e}){const{isLoading:t}=bA(),n=DH(),r=fj(),s=Ao();return p.useEffect(()=>{if(t)return;const l=r.projectId,c=n==null?void 0:n.projectId;if(l&&!s.pathname.startsWith("/auth")&&n&&c&&c!==l){const d=new URLSearchParams({projectId:l}).toString();window.location.href=`/auth/sign-in?${d}`}},[t,n,r.projectId,s.pathname]),o.jsx(o.Fragment,{children:e})}const H2="sidebar_state";function XB(){const{state:e,isMobile:t}=jf(),r=t||e==="collapsed",{isLoading:s}=YB();return o.jsxs(o.Fragment,{children:[o.jsx(WB,{}),o.jsx(KB,{isLoading:s}),o.jsxs(OH,{redirectTo:"/auth/sign-in",children:[o.jsx(HB,{variant:"inset",collapsible:"icon"}),o.jsxs(eF,{children:[r&&o.jsx(XU,{}),o.jsx(QB,{children:o.jsx(mj,{})})]})]})]})}function JB(){const[e,t]=p.useState(()=>hi.get(H2,"boolean")??!0),n=r=>{t(r),hi.set(H2,r)};return o.jsx($B,{children:o.jsx(ZB,{children:o.jsx(WU,{open:e,onOpenChange:n,children:o.jsx(XB,{})})})})}function eG(){return o.jsxs("div",{className:"app-container",children:[o.jsx("h1",{children:"About OWOX"}),o.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function $2(){return o.jsxs("div",{className:"dm-empty-state-404page",children:[o.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[o.jsx(z8,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),o.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",o.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",o.jsx("i",{children:"yesterday"}),".",o.jsx("br",{}),"Escape while you can!"]}),o.jsx(we,{variant:"default",asChild:!0,children:o.jsxs(Ha,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",o.jsx(hs,{className:"h-4 w-4"})]})})]}),o.jsx("div",{className:"dm-empty-state-404page-background"})]})}const tG={items:[],loading:!1,error:null};function nG(e,t){switch(t.type){case"SET_ITEMS":return{...e,items:t.payload,loading:!1,error:null};case"SET_LOADING":return{...e,loading:!0,error:null};case"SET_ERROR":return{...e,loading:!1,error:t.payload};default:return e}}const $A=p.createContext(void 0);function rG({children:e}){const[t,n]=p.useReducer(nG,tG);return o.jsx($A.Provider,{value:{state:t,dispatch:n},children:e})}function aG(){const e=p.useContext($A);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class sG extends Vl{constructor(){super("/data-marts")}async getDataMarts(){return this.get("/")}async getDataMartById(t){return this.get(`/${t}`)}async createDataMart(t){return this.post("",t)}async updateDataMart(t,n){return this.patch(`/${t}`,n)}async deleteDataMart(t){return this.delete(`/${t}`)}async updateDataMartDescription(t,n){return this.put(`/${t}/description`,{description:n})}async updateDataMartTitle(t,n){return this.put(`/${t}/title`,{title:n})}async updateDataMartDefinition(t,n){return this.put(`/${t}/definition`,n,{timeout:18e4})}async publishDataMart(t){return this.put(`/${t}/publish`,void 0,{timeout:18e4})}async runDataMart(t,n){return this.post(`/${t}/manual-run`,{payload:n})}async cancelDataMartRun(t,n){await this.post(`/${t}/runs/${n}/cancel`)}async actualizeDataMartSchema(t){return this.post(`/${t}/actualize-schema`,void 0,{timeout:18e4})}async updateDataMartSchema(t,n){return this.put(`/${t}/schema`,n,{timeout:18e4})}async validateSql(t,n,r,s=!0){const l={sql:n},c={...r?{signal:r.signal}:{},skipLoadingIndicator:s,timeout:18e4};return this.post(`/${t}/sql-dry-run`,l,c)}async getDataMartRuns(t,n=5,r=0){return(await this.get(`/${t}/runs`,{limit:n,offset:r})).runs}}const vr=new sG;var or=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(or||{}),We=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(We||{}),Hm=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION_TYPE="MISSING_DEFINITION_TYPE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Hm||{});const oG={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION_TYPE:"Data mart must have an input source configured",MISSING_DEFINITION:"Data mart must have a valid definition"},BA={statuses:{[or.DRAFT]:{code:or.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[or.PUBLISHED]:{code:or.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},GA=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,qA=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,iG=e=>e?GA(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",lG=e=>e?qA(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",KA=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/;return t.test(e)||n.test(e)},ZA=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/;return t.test(e)||n.test(e)},cG=e=>e?KA(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",uG=e=>e?ZA(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",dG=[{value:"US",label:"US (multiple regions)",group:"North America"},{value:"northamerica-northeast1",label:"northamerica-northeast1 (Montréal)",group:"North America"},{value:"northamerica-northeast2",label:"northamerica-northeast2 (Toronto)",group:"North America"},{value:"us-central1",label:"us-central1 (Iowa)",group:"North America"},{value:"us-east1",label:"us-east1 (South Carolina)",group:"North America"},{value:"us-east4",label:"us-east4 (Northern Virginia)",group:"North America"},{value:"us-east5",label:"us-east5 (Columbus)",group:"North America"},{value:"us-west1",label:"us-west1 (Oregon)",group:"North America"},{value:"us-west2",label:"us-west2 (Los Angeles)",group:"North America"},{value:"us-west3",label:"us-west3 (Salt Lake City)",group:"North America"},{value:"us-west4",label:"us-west4 (Las Vegas)",group:"North America"},{value:"EU",label:"EU (multiple regions)",group:"Europe"},{value:"europe-central2",label:"europe-central2 (Warsaw)",group:"Europe"},{value:"europe-north1",label:"europe-north1 (Finland)",group:"Europe"},{value:"europe-southwest1",label:"europe-southwest1 (Madrid)",group:"Europe"},{value:"europe-west1",label:"europe-west1 (Belgium)",group:"Europe"},{value:"europe-west2",label:"europe-west2 (London)",group:"Europe"},{value:"europe-west3",label:"europe-west3 (Frankfurt)",group:"Europe"},{value:"europe-west4",label:"europe-west4 (Netherlands)",group:"Europe"},{value:"europe-west6",label:"europe-west6 (Zurich)",group:"Europe"},{value:"europe-west8",label:"europe-west8 (Milan)",group:"Europe"},{value:"europe-west9",label:"europe-west9 (Paris)",group:"Europe"},{value:"europe-west12",label:"europe-west12 (Turin)",group:"Europe"},{value:"asia-east1",label:"asia-east1 (Taiwan)",group:"Asia Pacific"},{value:"asia-east2",label:"asia-east2 (Hong Kong)",group:"Asia Pacific"},{value:"asia-northeast1",label:"asia-northeast1 (Tokyo)",group:"Asia Pacific"},{value:"asia-northeast2",label:"asia-northeast2 (Osaka)",group:"Asia Pacific"},{value:"asia-northeast3",label:"asia-northeast3 (Seoul)",group:"Asia Pacific"},{value:"asia-south1",label:"asia-south1 (Mumbai)",group:"Asia Pacific"},{value:"asia-south2",label:"asia-south2 (Delhi)",group:"Asia Pacific"},{value:"asia-southeast1",label:"asia-southeast1 (Singapore)",group:"Asia Pacific"},{value:"asia-southeast2",label:"asia-southeast2 (Jakarta)",group:"Asia Pacific"},{value:"australia-southeast1",label:"australia-southeast1 (Sydney)",group:"Asia Pacific"},{value:"australia-southeast2",label:"australia-southeast2 (Melbourne)",group:"Asia Pacific"},{value:"southamerica-east1",label:"southamerica-east1 (São Paulo)",group:"Other"},{value:"southamerica-west1",label:"southamerica-west1 (Santiago)",group:"Other"},{value:"me-central1",label:"me-central1 (Doha)",group:"Other"},{value:"me-central2",label:"me-central2 (Dammam)",group:"Other"},{value:"me-west1",label:"me-west1 (Tel Aviv)",group:"Other"},{value:"africa-south1",label:"africa-south1 (Johannesburg)",group:"Other"}];function fG(e){return"projectId"in e}function hG(e){return"outputBucket"in e}var Pe=(e=>(e.GOOGLE_BIGQUERY="GOOGLE_BIGQUERY",e.AWS_ATHENA="AWS_ATHENA",e.SNOWFLAKE="SNOWFLAKE",e.DATABRICKS="DATABRICKS",e.AWS_REDSHIFT="AWS_REDSHIFT",e.AZURE_SYNAPSE="AZURE_SYNAPSE",e))(Pe||{}),vo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(vo||{});const mG=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return o.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[o.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?o.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):o.jsx("span",{className:"text-sm",children:s||r===void 0?o.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},pG=({type:e,config:t})=>{const n={[Pe.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Pe.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Pe.SNOWFLAKE]:[],[Pe.DATABRICKS]:[],[Pe.AWS_REDSHIFT]:[],[Pe.AZURE_SYNAPSE]:[]},r=t&&(e===Pe.GOOGLE_BIGQUERY&&fG(t)||e===Pe.AWS_ATHENA&&hG(t));return o.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:l})=>{let c;return r&&(c=(e===Pe.GOOGLE_BIGQUERY,t[l])),o.jsx(mG,{label:s,value:c},l)})})},gG=({type:e,config:t})=>o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),o.jsx(pG,{type:e,config:t})]})}),vG=yf("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Er({className:e,variant:t,asChild:n=!1,...r}){const s=n?Lp:"span";return o.jsx(s,{"data-slot":"badge",className:ie(vG({variant:t}),e),...r})}function YA(e){return e.type===Pe.GOOGLE_BIGQUERY}function WA(e){return e.type===Pe.AWS_ATHENA}const Fi={types:{[Pe.GOOGLE_BIGQUERY]:{type:Pe.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:wA,status:vo.ACTIVE},[Pe.AWS_ATHENA]:{type:Pe.AWS_ATHENA,displayName:"AWS Athena",icon:EA,status:vo.ACTIVE},[Pe.SNOWFLAKE]:{type:Pe.SNOWFLAKE,displayName:"Snowflake",icon:zH,status:vo.COMING_SOON},[Pe.DATABRICKS]:{type:Pe.DATABRICKS,displayName:"Databricks",icon:VH,status:vo.COMING_SOON},[Pe.AWS_REDSHIFT]:{type:Pe.AWS_REDSHIFT,displayName:"AWS Redshift",icon:HH,status:vo.COMING_SOON},[Pe.AZURE_SYNAPSE]:{type:Pe.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:$H,status:vo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function yG({dataStorage:e,isLoading:t=!1}){if(t)return o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(ts,{className:"h-5 w-24"}),o.jsx(ts,{className:"h-6 w-40"})]},d))})});if(!e)return o.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:l}=e;return o.jsx("div",{className:"space-y-2",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:e.title}),o.jsx(Er,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=Fi.getInfo(n);return o.jsxs(o.Fragment,{children:[o.jsx(d,{}),c]})})()})]}),o.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:o.jsx(gG,{type:n,config:r})}),o.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(s))]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(l))]})]})]})})}function xG(e){const t=e.split(".");return t.length!==2?(console.error("Invalid fully qualified name format:",e),null):{dataset:t[0],table:t[1]}}function bG(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${l}`}function SG(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function CG(e,t){const n=xG(t);if(!n)return null;const{dataset:r,table:s}=n;return YA(e)?bG(e.config.projectId,r,s):WA(e)?SG(e.config.region):null}function wG(e,t){const n=CG(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function EG(e){return YA(e)?"Open table in Google BigQuery":WA(e)?"Open region in AWS Athena":"Open data in storage"}const RG=en({accessKeyId:tn().min(1,"Access Key ID is required"),secretAccessKey:tn().min(1,"Secret Access Key is required")}),TG=en({projectId:tn().min(1,"Project ID is required"),location:tn().min(1,"Location is required")}),jG=en({region:tn().min(1,"Region is required"),outputBucket:tn().min(1,"Output Bucket is required")}),QA=en({title:tn().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),_G=QA.extend({type:$s(Pe.GOOGLE_BIGQUERY),credentials:DA,config:TG}),NG=QA.extend({type:$s(Pe.AWS_ATHENA),credentials:RG,config:jG}),AG=AA("type",[_G,NG]),DG=(e,t)=>{if(!e)return!1;switch(t){case Pe.GOOGLE_BIGQUERY:return GA(e);case Pe.AWS_ATHENA:return KA(e);default:return!1}},OG=(e,t)=>{if(!e)return!1;switch(t){case Pe.GOOGLE_BIGQUERY:return qA(e);case Pe.AWS_ATHENA:return ZA(e);default:return!1}},MG=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Pe.GOOGLE_BIGQUERY:return iG(e);case Pe.AWS_ATHENA:return cG(e);default:return"Unsupported storage type"}},kG=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Pe.GOOGLE_BIGQUERY:return lG(e);case Pe.AWS_ATHENA:return uG(e);default:return"Unsupported storage type"}},XA=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"project.dataset.table";case Pe.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},IG=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Pe.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},JA=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Pe.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},LG=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Pe.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var Cn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Cn||{});const PG={solid:"px-2.5 py-0.5 rounded-full",subtle:"px-2.5 py-0.5 rounded-full",outline:"px-2.5 py-0.5 rounded-full border",ghost:""},UG=e=>PG[e],FG={[Cn.SUCCESS]:{icon:Pp,colors:{solid:"bg-green-500 text-white",subtle:"bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-400",outline:"border-green-500 text-green-700 dark:text-green-400",ghost:"text-green-500 dark:text-green-400"}},[Cn.ERROR]:{icon:E8,colors:{solid:"bg-red-500 text-white",subtle:"bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-400",outline:"border-red-500 text-red-700 dark:text-red-400",ghost:"text-red-500 dark:text-red-400"}},[Cn.WARNING]:{icon:Up,colors:{solid:"bg-yellow-500 text-white",subtle:"bg-yellow-50 text-yellow-700 dark:bg-yellow-950 dark:text-yellow-400",outline:"border-yellow-500 text-yellow-700 dark:text-yellow-400",ghost:"text-yellow-500 dark:text-yellow-400"}},[Cn.INFO]:{icon:Lr,colors:{solid:"bg-blue-500 text-white",subtle:"bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-400",outline:"border-blue-500 text-blue-700 dark:text-blue-400",ghost:"text-blue-500 dark:text-blue-400"}},[Cn.NEUTRAL]:{icon:Lr,colors:{solid:"bg-gray-500 text-white",subtle:"bg-gray-50 text-gray-700 dark:bg-gray-950 dark:text-gray-400",outline:"border-gray-500 text-gray-700 dark:text-gray-400",ghost:"text-muted-foreground"}}};function Uf({type:e=Cn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:l,colors:c}=FG[e],d=h=>{const m="inline-flex items-center gap-1 text-sm",g=UG(h),v=c[h];return ie(m,g,v,s)};return o.jsxs("span",{className:d(t),children:[n&&o.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}var Ir=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(Ir||{}),wn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e))(wn||{}),es=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(es||{});const e4=e=>{if(!e)return"—";let t;if(typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))return"—"}else if(t=e,isNaN(t.getTime()))return"—";const r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),s=new Map(r.map(v=>[v.type,v.value])),l=s.get("year")??"",c=s.get("month")??"",d=s.get("day")??"",h=s.get("hour")??"",m=s.get("minute")??"",g=s.get("second")??"";return`${l}-${c}-${d} ${h}:${m}:${g}`},zG=e=>{const t=e.trim();if(t.includes("T")||t.includes("Z")){const s=new Date(t);if(!isNaN(s.getTime()))return s}let n=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t);if(n)return new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));if(n=/^(\d{1,2})[./](\d{1,2})[./](\d{4})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t),n)return new Date(Date.UTC(parseInt(n[3],10),parseInt(n[2],10)-1,parseInt(n[1],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));const r=new Date(t);return isNaN(r.getTime())?(console.warn(`Failed to parse date string: "${e}", using current date as fallback`),new Date):r},dl=e=>e4(zG(e).toISOString()),B2=(e,t,n=!1)=>{var c,d,h,m;const r=e.split(`
|
|
667
|
-
`).filter(g=>g.trim()!=="");if(r.length>=3){const g=r[0],v=r[1],x=r.slice(2).join(`
|
|
668
|
-
`);if(g.includes("T")&&g.includes("Z")){const b=bx(x);return{id:`log-${t.toString()}`,timestamp:dl(g),level:n?Ir.ERROR:Ir.INFO,message:b.message,metadata:{at:(c=b.metadata)!=null&&c.at?dl(b.metadata.at):dl(g),type:((d=b.metadata)==null?void 0:d.type)??(v!=="unknown"?v:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const g=bx(s[3]);return{id:`log-${t.toString()}`,timestamp:dl(s[1]),level:n?Ir.ERROR:s[2],message:g.message,metadata:(h=g.metadata)!=null&&h.at?{...g.metadata,at:dl(g.metadata.at)}:g.metadata}}const l=bx(e);return{id:`log-${t.toString()}`,timestamp:dl(new Date().toISOString()),level:n?Ir.ERROR:Ir.INFO,message:l.message,metadata:(m=l.metadata)!=null&&m.at?{...l.metadata,at:dl(l.metadata.at)}:l.metadata}},bx=e=>{try{const t=JSON.parse(e);if(typeof t=="object"){const n={},r={...t};"type"in r&&(n.type=r.type,delete r.type),"at"in r&&(n.at=r.at,delete r.at);const s=Object.keys(r);if(s.length===1){const l=s[0],c=r[l];return{message:typeof c=="string"?c:JSON.stringify(c),metadata:Object.keys(n).length>0?n:void 0}}return{message:JSON.stringify(r,null,2),metadata:Object.keys(n).length>0?n:void 0}}}catch{}return{message:e}},t4=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},VG=e=>{const t=e.logs.length,n=e.errors.length,r=t+n,s=[`Run #${e.id.slice(-8)}`,`${String(r)} messages`];return n>0&&s.push(`${String(n)} errors`),s.join(" • ")},HG=e=>{const t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`datamart-run-${e.id.slice(0,8)}-logs.json`,r.click(),URL.revokeObjectURL(n)};function $G(e){return o.jsx("div",{className:"flex items-center gap-2",children:(()=>{switch(e){case wn.SUCCESS:return o.jsx(Rj,{className:"h-4 w-4 text-green-500"});case wn.FAILED:return o.jsx(Xd,{className:"h-4 w-4 text-red-500"});case wn.RUNNING:return o.jsx(mu,{className:"text-primary h-4 w-4 animate-spin"});case wn.CANCELLED:return o.jsx(cL,{className:"h-4 w-4 text-gray-500"});case wn.INTERRUPTED:return o.jsx(NL,{className:"h-4 w-4 text-gray-500"});default:return o.jsx(OL,{className:"h-4 w-4 text-gray-500"})}})()})}function BG(e){switch(e){case Ir.INFO:return o.jsx(Lr,{className:"h-3 w-3 text-blue-500"});case Ir.WARNING:return o.jsx(Up,{className:"h-3 w-3 text-yellow-500"});case Ir.ERROR:return o.jsx(Xd,{className:"h-3 w-3 text-red-500"});case Ir.SYSTEM:return o.jsx(xf,{className:"text-muted-foreground h-3 w-3"});default:return o.jsx(Lr,{className:"text-muted-foreground h-3 w-3"})}}function GG(e){switch(e){case Ir.INFO:return"text-blue-600 dark:text-blue-400";case Ir.WARNING:return"text-yellow-600 dark:text-yellow-400";case Ir.ERROR:return"text-red-600 dark:text-red-400";case Ir.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function qG({status:e}){switch(e){case wn.RUNNING:return o.jsx(Er,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case wn.SUCCESS:return o.jsx(Er,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case wn.FAILED:return o.jsx(Er,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case wn.CANCELLED:return o.jsx(Er,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case wn.INTERRUPTED:return o.jsx(Er,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});default:return o.jsx(Er,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}function KG({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},h=async g=>{if(g.stopPropagation(),c)try{await l(c,s.id),Jt.success("Data mart run cancelled successfully")}catch(v){Jt.error(v instanceof Error?v.message:"Failed to cancel data mart run")}},m=g=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${g?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return o.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[o.jsx("button",{onClick:g=>{g.stopPropagation(),t(es.STRUCTURED)},className:`${m(e===es.STRUCTURED)} rounded-l-lg`,children:"Structured"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(es.RAW)},className:`${m(e===es.RAW)} rounded-none`,children:"Raw"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(es.CONFIGURATION)},className:`${m(e===es.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==es.CONFIGURATION&&o.jsxs("div",{className:"relative",children:[o.jsx(Ll,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),o.jsx(Bt,{type:"text",placeholder:"Search logs...",value:n,onChange:g=>{r(g.target.value)},onClick:d,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring rounded-md border py-2 pr-4 pl-8 text-xs focus:border-transparent focus:ring-2 focus:outline-none"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[s.status===wn.RUNNING&&o.jsxs(we,{variant:"destructive",size:"sm",onClick:g=>void h(g),children:[o.jsx(ru,{className:"h-4 w-4"}),"Cancel"]}),o.jsxs(we,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),HG(s)},className:"flex items-center gap-2",children:[o.jsx(VL,{className:"h-4 w-4"}),"JSON"]})]})]})}function ZG({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var s;return(s=r.metadata)!=null&&s.at?r.metadata.at:r.timestamp};return e.length===0?o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No logs found"})}):o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>o.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-sm text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[o.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),o.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[BG(r.level),o.jsx("span",{className:`text-xs font-medium ${GG(r.level)}`,children:t4(r)})]}),o.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===Ir.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
669
|
-
`)?o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):o.jsx("span",{children:r.message})})]},r.id))})})}var yp=(e=>(e.ERROR="error",e.DEFAULT="default",e))(yp||{});function xp({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:l=!1}){const c=n==="error",d=r===t,h="flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors cursor-pointer",m=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return o.jsx("button",{onClick:g=>{s(e,t),g.stopPropagation()},className:`${h} ${m}`,title:`Copy ${t} to clipboard`,children:l?o.jsx(o.Fragment,{children:d?o.jsx(ir,{className:"h-3 w-3"}):o.jsx(Jd,{className:"h-3 w-3"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(ir,{className:"h-3 w-3"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(Jd,{className:"h-3 w-3"}),"Copy"]})})}function Xb(){const[e,t]=p.useState(null),n=async(s,l)=>{try{await navigator.clipboard.writeText(s),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,l)=>{n(s,l)}}}function YG({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=Xb(),s=l=>{l.stopPropagation()};return o.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[o.jsx(xf,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),o.jsx(xp,{text:t.join(`
|
|
670
|
-
`),section:"errors",variant:yp.ERROR,copiedSection:n,onCopy:r})]}),o.jsx("div",{className:"max-h-96 overflow-y-auto rounded-md bg-red-50 p-3 font-mono text-xs dark:border-red-800 dark:bg-red-950/40",children:t.map((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[o.jsx(Lr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),o.jsx(xp,{text:e.join(`
|
|
671
|
-
`),section:"logs",variant:yp.DEFAULT,copiedSection:n,onCopy:r})]}),o.jsx("div",{className:"bg-muted max-h-96 overflow-y-auto rounded-md p-3 font-mono text-xs dark:bg-white/3",children:e.map((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function WG({definitionRun:e}){const{copiedSection:t,handleCopy:n}=Xb(),r=s=>{s.stopPropagation()};return o.jsx("div",{className:"border-border rounded-lg border",onClick:r,children:e!=null?o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[o.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),o.jsx(xp,{text:JSON.stringify(e,null,2),section:"configuration",variant:yp.DEFAULT,copiedSection:t,onCopy:n})]}),o.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(e,null,2)})]}):o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}function QG({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:h}){const{copiedSection:m,handleCopy:g}=Xb(),v=()=>{if(e.logs.length===0&&e.errors.length===0)return[];const b=e.logs.map((E,R)=>B2(E,R)),w=e.errors.map((E,R)=>B2(E,e.logs.length+R,!0));return[...b,...w].filter(E=>{const R=t4(E);return l===""||E.message.toLowerCase().includes(l.toLowerCase())||R.toLowerCase().includes(l.toLowerCase())})},x=()=>{if(r===es.STRUCTURED){const b=v();return o.jsx(ZG,{logs:b})}else return r===es.RAW?o.jsx(YG,{logs:e.logs,errors:e.errors}):o.jsx(WG,{definitionRun:e.definitionRun})};return o.jsxs("div",{className:"dm-card-block",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[$G(e.status),o.jsx("div",{className:"text-foreground font-mono text-sm font-medium",children:e4(e.createdAt instanceof Date?e.createdAt.toISOString():e.createdAt)}),o.jsxs("div",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[o.jsx(y8,{className:"h-3 w-3"}),VG(e)]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(qG,{status:e.status}),o.jsx(hs,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&o.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),o.jsx(xp,{text:e.id,section:"run-id",onCopy:g,copiedSection:m,iconOnly:!0})]}),o.jsx(KG,{logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:h}),x()]})]})}const n4=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,XG=/[#&]gid=([0-9]+)/;function r4(e){return n4.test(e)}function JG(e){const t=n4.exec(e);return t?t[2]:""}function eq(e){const t=XG.exec(e);return t?t[1]:"0"}function tq(e){return{spreadsheetId:JG(e),sheetId:parseInt(eq(e),10)}}function Jb(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function nq(e,t,n){try{const r=JSON.parse(e);return t in r?r[t]:n}catch(r){return console.error(`Error parsing service account JSON: ${String(r)}`),n}}function Sx(e){return nq(e,"client_email")}const a4=p.createContext(void 0);var tt=(e=>(e.FETCH_REPORTS_START="FETCH_REPORTS_START",e.FETCH_REPORTS_SUCCESS="FETCH_REPORTS_SUCCESS",e.FETCH_REPORTS_ERROR="FETCH_REPORTS_ERROR",e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_REPORT_START="FETCH_REPORT_START",e.FETCH_REPORT_SUCCESS="FETCH_REPORT_SUCCESS",e.FETCH_REPORT_ERROR="FETCH_REPORT_ERROR",e.CLEAR_CURRENT_REPORT="CLEAR_CURRENT_REPORT",e.CREATE_REPORT_START="CREATE_REPORT_START",e.CREATE_REPORT_SUCCESS="CREATE_REPORT_SUCCESS",e.CREATE_REPORT_ERROR="CREATE_REPORT_ERROR",e.UPDATE_REPORT_START="UPDATE_REPORT_START",e.UPDATE_REPORT_SUCCESS="UPDATE_REPORT_SUCCESS",e.UPDATE_REPORT_ERROR="UPDATE_REPORT_ERROR",e.DELETE_REPORT_START="DELETE_REPORT_START",e.DELETE_REPORT_SUCCESS="DELETE_REPORT_SUCCESS",e.DELETE_REPORT_ERROR="DELETE_REPORT_ERROR",e.START_POLLING_REPORT="START_POLLING_REPORT",e.STOP_POLLING_REPORT="STOP_POLLING_REPORT",e.UPDATE_POLLED_REPORT="UPDATE_POLLED_REPORT",e.STOP_ALL_POLLING="STOP_ALL_POLLING",e.CLEAR_ERROR="CLEAR_ERROR",e))(tt||{}),pa=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e))(pa||{}),an=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(an||{}),Vn=(e=>(e.EDIT="edit",e.CREATE="create",e))(Vn||{});const rq={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function aq(e,t){switch(t.type){case tt.FETCH_REPORTS_START:case tt.FETCH_REPORT_START:case tt.CREATE_REPORT_START:case tt.UPDATE_REPORT_START:case tt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case tt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case tt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case tt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case tt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case tt.UPDATE_REPORT_SUCCESS:return{...e,currentReport:t.payload,reports:e.reports.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case tt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case tt.FETCH_REPORTS_ERROR:case tt.FETCH_REPORT_ERROR:case tt.FETCH_DESTINATIONS_ERROR:case tt.CREATE_REPORT_ERROR:case tt.UPDATE_REPORT_ERROR:case tt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case tt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case tt.CLEAR_ERROR:return{...e,error:null};case tt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case tt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case tt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case tt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==an.RUNNING||(n==null?void 0:n.lastRunStatus)!==an.RUNNING?{...e,reports:e.reports.map(r=>r.id===t.payload.id?{...r,lastRunStatus:t.payload.lastRunStatus}:r),polledReportIds:e.polledReportIds.filter(r=>r!==t.payload.id)}:e}default:return e}}function s4({children:e}){const[t,n]=p.useReducer(aq,rq);return o.jsx(a4.Provider,{value:{state:t,dispatch:n},children:e})}function sq(){const e=p.useContext(a4);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class oq extends Vl{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t){return this.get(`/data-mart/${t}`)}async getReportsByProject(){return this.get("/")}async updateReport(t,n){return this.put(`/${t}`,n)}async deleteReport(t){return this.delete(`/${t}`)}async runReport(t){return this.post(`/${t}/run`)}}const po=new oq,iq={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class lq{constructor(){Rs(this,"pollingTimers",new Map);Rs(this,"pollCounters",new Map);Rs(this,"config",iq)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const s=this.pollCounters.get(t)??0;this.pollCounters.set(t,s+1);const l=await po.getReportById(t);if(n(l),l.lastRunStatus!==an.RUNNING){this.stopPolling(t);return}const d=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,h=setTimeout(()=>{r()},d);this.pollingTimers.set(t,h)}catch(s){console.error(`Error polling report status for ${t}:`,s),this.stopPolling(t)}};return r(),()=>{this.stopPolling(t)}}stopPolling(t){const n=this.pollingTimers.get(t);n&&(clearTimeout(n),this.pollingTimers.delete(t),this.pollCounters.delete(t))}stopAllPolling(){for(const t of this.pollingTimers.keys())this.stopPolling(t)}isPolling(t){return this.pollingTimers.has(t)}}const Sm=new lq;class cq extends Vl{constructor(){super("/data-destinations")}async getDataDestinations(){return this.get("/")}async getDataDestinationById(t){return this.get(`/${t}`)}async createDataDestination(t){return this.post("",t)}async updateDataDestination(t,n){return this.put(`/${t}`,n)}async deleteDataDestination(t){return this.delete(`/${t}`)}async rotateSecretKey(t){return this.post(`/${t}/rotate-secret-key`)}}const hl=new cq;var It=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e))(It||{}),Qc=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e))(Qc||{}),xl=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e))(xl||{});class uq{mapFromDto(t){let n="";try{t.credentials.type===xl.GOOGLE_SHEETS_CREDENTIALS&&(n=JSON.stringify(t.credentials.serviceAccountKey,null,2))}catch(r){console.error(r,"Error parsing service account key")}return{id:t.id,title:t.title,type:It.GOOGLE_SHEETS,projectId:t.projectId,credentials:{serviceAccount:n},createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};return n.credentials&&(r.credentials={serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:xl.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:It.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:xl.GOOGLE_SHEETS_CREDENTIALS}}}}class dq{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:It.LOOKER_STUDIO,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){return{title:t.title??"",credentials:{type:xl.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:It.LOOKER_STUDIO,credentials:{type:xl.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===xl.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const o4={getMapper(e){switch(e){case It.GOOGLE_SHEETS:return new uq;case It.LOOKER_STUDIO:return new dq;default:throw new Error(`Unknown destination type: ${e}`)}}};function Uc(e){return o4.getMapper(e.type).mapFromDto(e)}class fq{mapFromDto(t){if(t.type!==pa.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:pa.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class hq{mapFromDto(t){if(t.type!==pa.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:pa.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const mq={getMapper(e){switch(e){case pa.GOOGLE_SHEETS_CONFIG:return new fq;case pa.LOOKER_STUDIO_CONFIG:return new hq;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function pq(e){return mq.getMapper(e.type).mapFromDto(e)}function ml(e){const t=pq(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:Uc(e.dataDestinationAccess),destinationConfig:t,lastRunDate:e.lastRunAt?new Date(e.lastRunAt):null,lastRunStatus:e.lastRunStatus,lastRunError:e.lastRunError,runsCount:e.runsCount,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Hl(){const{state:e,dispatch:t}=sq(),n=p.useCallback(async()=>{t({type:tt.FETCH_DESTINATIONS_START});try{const E=await hl.getDataDestinations();t({type:tt.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){t({type:tt.FETCH_DESTINATIONS_ERROR,payload:E instanceof Error?E.message:"Failed to fetch destinations"})}},[t]),r=p.useCallback(async()=>{t({type:tt.FETCH_REPORTS_START});try{const R=(await po.getReportsByProject()).map(ml);t({type:tt.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){t({type:tt.FETCH_REPORTS_ERROR,payload:E instanceof Error?E.message:"Failed to fetch reports"})}},[t]),s=p.useCallback(async E=>{t({type:tt.FETCH_REPORTS_START});try{const T=(await po.getReportsByDataMartId(E)).map(ml);t({type:tt.FETCH_REPORTS_SUCCESS,payload:T})}catch(R){t({type:tt.FETCH_REPORTS_ERROR,payload:R instanceof Error?R.message:"Failed to fetch reports"})}},[t]),l=p.useCallback(async E=>{t({type:tt.FETCH_REPORT_START});try{const R=await po.getReportById(E),T=ml(R);t({type:tt.FETCH_REPORT_SUCCESS,payload:T})}catch(R){t({type:tt.FETCH_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to fetch report"})}},[t]),c=p.useCallback(async E=>{t({type:tt.CREATE_REPORT_START});try{const R=await po.createReport(E),T=ml(R);return t({type:tt.CREATE_REPORT_SUCCESS,payload:T}),fn.success("Report created"),T}catch(R){return t({type:tt.CREATE_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to create report"}),null}},[t]),d=p.useCallback(async(E,R)=>{t({type:tt.UPDATE_REPORT_START});try{const T=await po.updateReport(E,R),j=ml(T);return t({type:tt.UPDATE_REPORT_SUCCESS,payload:j}),fn.success("Report updated"),j}catch(T){return t({type:tt.UPDATE_REPORT_ERROR,payload:T instanceof Error?T.message:"Failed to update report"}),null}},[t]),h=p.useCallback(async E=>{t({type:tt.DELETE_REPORT_START});try{await po.deleteReport(E),t({type:tt.DELETE_REPORT_SUCCESS,payload:E}),fn.success("Report deleted")}catch(R){t({type:tt.DELETE_REPORT_ERROR,payload:R instanceof Error?R.message:"Failed to delete report"})}},[t]),m=p.useCallback(()=>{t({type:tt.CLEAR_CURRENT_REPORT})},[t]),g=p.useCallback(()=>{t({type:tt.CLEAR_ERROR})},[t]),v=p.useCallback(E=>{Sm.stopPolling(E),t({type:tt.STOP_POLLING_REPORT,payload:E})},[t]),x=p.useCallback(E=>{e.polledReportIds.includes(E)&&v(E),t({type:tt.START_POLLING_REPORT,payload:E}),Sm.startPolling(E,R=>{const T=ml(R);t({type:tt.UPDATE_POLLED_REPORT,payload:T})})},[t,e.polledReportIds,v]),b=p.useCallback(()=>{Sm.stopAllPolling(),t({type:tt.STOP_ALL_POLLING})},[t]),w=p.useCallback(E=>{Sm.setConfig(E)},[]),C=p.useCallback(async E=>{try{v(E),await po.runReport(E),await l(E),x(E),fn.success("Report run started")}catch(R){console.error("Failed to run report:",R)}},[l,x,v]);return p.useEffect(()=>()=>{b()},[b]),{destinations:e.destinations,reports:e.reports,currentReport:e.currentReport,loading:e.loading,error:e.error,polledReportIds:e.polledReportIds,fetchDestinations:n,fetchReports:r,fetchReportsByDataMartId:s,fetchReportById:l,createReport:c,updateReport:d,deleteReport:h,runReport:C,startPollingReport:x,stopPollingReport:v,stopAllPolling:b,setPollingConfig:w,clearCurrentReport:m,clearError:g}}an.SUCCESS+"",an.SUCCESS,an.RUNNING+"",an.RUNNING,an.ERROR+"",an.ERROR,an.CANCELLED+"",an.CANCELLED;var Cx,dg="HoverCard",[i4]=Ur(dg,[Hs]),fg=Hs(),[gq,hg]=i4(dg),l4=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,h=fg(t),m=p.useRef(0),g=p.useRef(0),v=p.useRef(!1),x=p.useRef(!1),[b,w]=Xr({prop:r,defaultProp:s??!1,onChange:l,caller:dg}),C=p.useCallback(()=>{clearTimeout(g.current),m.current=window.setTimeout(()=>w(!0),c)},[c,w]),E=p.useCallback(()=>{clearTimeout(m.current),!v.current&&!x.current&&(g.current=window.setTimeout(()=>w(!1),d))},[d,w]),R=p.useCallback(()=>w(!1),[w]);return p.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(g.current)},[]),o.jsx(gq,{scope:t,open:b,onOpenChange:w,onOpen:C,onClose:E,onDismiss:R,hasSelectionRef:v,isPointerDownOnContentRef:x,children:o.jsx(xu,{...h,children:n})})};l4.displayName=dg;var c4="HoverCardTrigger",u4=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=hg(c4,n),l=fg(n);return o.jsx(bu,{asChild:!0,...l,children:o.jsx(Ye.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:je(e.onPointerEnter,Sp(s.onOpen)),onPointerLeave:je(e.onPointerLeave,Sp(s.onClose)),onFocus:je(e.onFocus,s.onOpen),onBlur:je(e.onBlur,s.onClose),onTouchStart:je(e.onTouchStart,c=>c.preventDefault())})})});u4.displayName=c4;var eS="HoverCardPortal",[vq,yq]=i4(eS,{forceMount:void 0}),d4=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,l=hg(eS,t);return o.jsx(vq,{scope:t,forceMount:n,children:o.jsx(_r,{present:n||l.open,children:o.jsx(Ul,{asChild:!0,container:s,children:r})})})};d4.displayName=eS;var bp="HoverCardContent",f4=p.forwardRef((e,t)=>{const n=yq(bp,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,l=hg(bp,e.__scopeHoverCard);return o.jsx(_r,{present:r||l.open,children:o.jsx(xq,{"data-state":l.open?"open":"closed",...s,onPointerEnter:je(e.onPointerEnter,Sp(l.onOpen)),onPointerLeave:je(e.onPointerLeave,Sp(l.onClose)),ref:t})})});f4.displayName=bp;var xq=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,...d}=e,h=hg(bp,n),m=fg(n),g=p.useRef(null),v=vt(t,g),[x,b]=p.useState(!1);return p.useEffect(()=>{if(x){const w=document.body;return Cx=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=Cx,w.style.webkitUserSelect=Cx}}},[x]),p.useEffect(()=>{if(g.current){const w=()=>{b(!1),h.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.toString())!==""&&(h.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointerup",w),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!1}}},[h.isPointerDownOnContentRef,h.hasSelectionRef]),p.useEffect(()=>{g.current&&Cq(g.current).forEach(C=>C.setAttribute("tabindex","-1"))}),o.jsx(Pl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:je(l,w=>{w.preventDefault()}),onDismiss:h.onDismiss,children:o.jsx(Ef,{...m,...d,onPointerDown:je(d.onPointerDown,w=>{w.currentTarget.contains(w.target)&&b(!0),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!0}),ref:v,style:{...d.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"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)"}})})}),bq="HoverCardArrow",Sq=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=fg(n);return o.jsx(Rf,{...s,...r,ref:t})});Sq.displayName=bq;function Sp(e){return t=>t.pointerType==="touch"?void 0:e()}function Cq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var wq=l4,Eq=u4,Rq=d4,Tq=f4;const tS=({...e})=>o.jsx(wq,{"data-slot":"hover-card",...e});tS.displayName="HoverCard";const nS=p.forwardRef(({...e},t)=>o.jsx(Eq,{"data-slot":"hover-card-trigger",ref:t,...e}));nS.displayName="HoverCardTrigger";const rS=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return o.jsx(Rq,{children:o.jsx(Tq,{ref:l,align:t,sideOffset:n,className:ie("bg-popover text-popover-foreground z-50 w-110 rounded-lg border px-6 py-4 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),onClick:c,...s})})});rS.displayName="HoverCardContent";const aS=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ie("border-border flex gap-4 border-b pb-4",e),...t}));aS.displayName="HoverCardHeader";const sS=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ie("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));sS.displayName="HoverCardHeaderIcon";const oS=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ie("flex flex-col space-y-1",e),...t}));oS.displayName="HoverCardHeaderText";const iS=p.forwardRef(({className:e,...t},n)=>o.jsx("h2",{ref:n,className:ie("text-md pt-1 leading-snug font-semibold",e),...t}));iS.displayName="HoverCardHeaderTitle";const lS=p.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:ie("text-muted-foreground text-sm",e),...t}));lS.displayName="HoverCardHeaderDescription";const cS=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ie("flex flex-col",e),...t}));cS.displayName="HoverCardBody";const mi=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ie("border-border flex items-center justify-between border-b py-4",e),...t}));mi.displayName="HoverCardItem";const pi=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:ie("text-muted-foreground text-sm",e),...t}));pi.displayName="HoverCardItemLabel";const gi=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:ie("text-sm",e),...t}));gi.displayName="HoverCardItemValue";const uS=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ie("pt-4 pb-2",e),...t}));uS.displayName="HoverCardFooter";const cf={types:{[It.GOOGLE_SHEETS]:{type:It.GOOGLE_SHEETS,displayName:"Google Sheets",icon:RA,status:Qc.ACTIVE},[It.LOOKER_STUDIO]:{type:It.LOOKER_STUDIO,displayName:"Looker Studio",icon:UH,status:Qc.ACTIVE},[It.ODATA]:{type:It.ODATA,displayName:"OData",icon:FH,status:Qc.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},jq=en({deploymentUrl:tn().optional(),destinationId:tn().optional(),destinationSecretKey:tn().optional()}),h4=en({title:tn().min(1,"Title is required"),type:Yb(It)}),_q=h4.extend({type:$s(It.GOOGLE_SHEETS),credentials:DA}),Nq=h4.extend({type:$s(It.LOOKER_STUDIO),credentials:jq.optional()}),Aq=AA("type",[_q,Nq]),m4=p.createContext(void 0);var At=(e=>(e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_DESTINATION_START="FETCH_DESTINATION_START",e.FETCH_DESTINATION_SUCCESS="FETCH_DESTINATION_SUCCESS",e.FETCH_DESTINATION_ERROR="FETCH_DESTINATION_ERROR",e.CLEAR_CURRENT_DESTINATION="CLEAR_CURRENT_DESTINATION",e.CREATE_DESTINATION_START="CREATE_DESTINATION_START",e.CREATE_DESTINATION_SUCCESS="CREATE_DESTINATION_SUCCESS",e.CREATE_DESTINATION_ERROR="CREATE_DESTINATION_ERROR",e.UPDATE_DESTINATION_START="UPDATE_DESTINATION_START",e.UPDATE_DESTINATION_SUCCESS="UPDATE_DESTINATION_SUCCESS",e.UPDATE_DESTINATION_ERROR="UPDATE_DESTINATION_ERROR",e.DELETE_DESTINATION_START="DELETE_DESTINATION_START",e.DELETE_DESTINATION_SUCCESS="DELETE_DESTINATION_SUCCESS",e.DELETE_DESTINATION_ERROR="DELETE_DESTINATION_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(At||{});const Dq={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function Oq(e,t){switch(t.type){case At.FETCH_DESTINATIONS_START:case At.FETCH_DESTINATION_START:case At.CREATE_DESTINATION_START:case At.UPDATE_DESTINATION_START:case At.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case At.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case At.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case At.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case At.UPDATE_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,dataDestinations:e.dataDestinations.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case At.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case At.FETCH_DESTINATIONS_ERROR:case At.FETCH_DESTINATION_ERROR:case At.CREATE_DESTINATION_ERROR:case At.UPDATE_DESTINATION_ERROR:case At.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case At.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case At.CLEAR_ERROR:return{...e,error:null};default:return e}}function mg({children:e}){const[t,n]=p.useReducer(Oq,Dq);return o.jsx(m4.Provider,{value:{state:t,dispatch:n},children:e})}function Mq(){const e=p.useContext(m4);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}function pg(){const{state:e,dispatch:t}=Mq(),n=p.useCallback(async()=>{t({type:At.FETCH_DESTINATIONS_START});try{const g=(await hl.getDataDestinations()).map(Uc);t({type:At.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(m){t({type:At.FETCH_DESTINATIONS_ERROR,payload:m instanceof Error?m.message:"Failed to load destinations"})}},[t]),r=p.useCallback(async m=>{try{const g=await hl.getDataDestinationById(m),v=Uc(g);t({type:At.FETCH_DESTINATION_SUCCESS,payload:v})}catch(g){t({type:At.FETCH_DESTINATION_ERROR,payload:g instanceof Error?g.message:"Failed to load destination"})}},[t]),s=p.useCallback(async m=>{t({type:At.CREATE_DESTINATION_START});try{const g=await hl.createDataDestination(m),v=Uc(g);return t({type:At.CREATE_DESTINATION_SUCCESS,payload:v}),fn.success("Destination created"),v}catch(g){return t({type:At.CREATE_DESTINATION_ERROR,payload:g instanceof Error?g.message:"Failed to create destination"}),null}},[t]),l=p.useCallback(async(m,g)=>{t({type:At.UPDATE_DESTINATION_START});try{const v=await hl.updateDataDestination(m,g),x=Uc(v);return t({type:At.UPDATE_DESTINATION_SUCCESS,payload:x}),fn.success("Destination updated"),x}catch(v){return t({type:At.UPDATE_DESTINATION_ERROR,payload:v instanceof Error?v.message:"Failed to update destination"}),null}},[t]),c=p.useCallback(async m=>{t({type:At.DELETE_DESTINATION_START});try{await hl.deleteDataDestination(m),t({type:At.DELETE_DESTINATION_SUCCESS,payload:m}),fn.success("Destination deleted")}catch(g){throw t({type:At.DELETE_DESTINATION_ERROR,payload:g instanceof Error?g.message:"Failed to delete destination"}),g}},[t]),d=p.useCallback(()=>{t({type:At.CLEAR_CURRENT_DESTINATION})},[t]),h=p.useCallback(async m=>{try{const g=await hl.rotateSecretKey(m);return Uc(g)}catch(g){throw console.error("Failed to rotate secret key:",g),g}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:h}}function kq(e){const t=cf.getInfo(e.type),n=t.status===Qc.ACTIVE;return{destinationInfo:t,isVisible:n}}function Iq(){const{dataMart:e}=fs(),{fetchReportsByDataMartId:t}=Hl(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=pg(),[l,c]=p.useState(!0);return p.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(m){console.error("Failed to fetch Data Mart destinations or reports:",m)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:l||s}}function dS(e){return JSON.stringify(e,null,2)}function gg(e){return e.type===pa.GOOGLE_SHEETS_CONFIG}function p4(e){return e.type===pa.LOOKER_STUDIO_CONFIG}function Dl({date:e,className:t=""}){const n=p.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),l=Math.abs(s),c=s<0,d=Math.floor(l/(1e3*60)),h=Math.floor(l/(1e3*60*60)),m=Math.floor(l/(1e3*60*60*24)),g=Math.floor(m/7),v=Math.floor(m/30),x=Math.floor(m/365),b=C=>C.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=C=>C.toLocaleDateString("en-US",{weekday:"long"});if(d<1)return c?"Just now":"In a moment";if(d<60)return c?d===1?"1 minute ago":`${d} minutes ago`:d===1?"In 1 minute":`In ${d} minutes`;if(h<24)return c?h===1?"1 hour ago":`${h} hours ago`:h===1?"In 1 hour":`In ${h} hours`;if(m===1){const C=b(e);return c?`Yesterday at ${C}`:`Tomorrow at ${C}`}if(m<7){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`This ${C} at ${E}`}if(m<14){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`Next ${C} at ${E}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":v<12?c?v===1?"1 month ago":`${v} months ago`:v===1?"In 1 month":`In ${v} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return o.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const Lq=()=>{const e=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},Pq=_e.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=Lq(),l=p.useMemo(()=>t.lastRunStatus?{statusType:zq(t.lastRunStatus),statusText:Hq(t.lastRunStatus)}:null,[t.lastRunStatus]),c=p.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),d=p.useMemo(()=>gg(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),h=p.useCallback(()=>{if(!d.isGoogleSheets||!d.spreadsheetId||!d.sheetId)return;const m=Jb(d.spreadsheetId,d.sheetId);window.open(m,"_blank","noopener,noreferrer")},[d]);return o.jsxs(tS,{children:[o.jsx(nS,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(rS,{children:[o.jsxs(aS,{children:[o.jsx(sS,{children:o.jsx(RA,{size:20})}),o.jsxs(oS,{children:[o.jsx(iS,{children:t.title||"Unnamed Report"}),o.jsxs(lS,{children:["Last modified ",o.jsx(Dl,{date:new Date(t.modifiedAt)})]})]})]}),o.jsxs(cS,{children:[o.jsxs(mi,{children:[o.jsx(pi,{children:"Last run status:"}),o.jsx(gi,{children:l?o.jsx(Uf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),o.jsxs(mi,{children:[o.jsx(pi,{children:"Last run date:"}),o.jsx(gi,{children:t.lastRunDate?o.jsx(Dl,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&o.jsxs(mi,{children:[o.jsx(pi,{children:"Error message:"}),o.jsx(gi,{children:t.lastRunError})]}),o.jsxs(mi,{children:[o.jsx(pi,{children:"Total runs:"}),o.jsxs(gi,{children:[t.runsCount||0," runs",c.createdAt&&o.jsxs(o.Fragment,{children:[", since ",c.createdAt]})]})]})]}),d.isGoogleSheets&&o.jsx(uS,{children:o.jsxs(we,{className:"w-full",variant:"default",onClick:h,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",o.jsx(wl,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.report.id===t.report.id&&e.report.title===t.report.title&&e.report.modifiedAt===t.report.modifiedAt&&e.report.lastRunStatus===t.report.lastRunStatus&&e.report.lastRunDate===t.report.lastRunDate&&e.report.lastRunError===t.report.lastRunError&&e.report.runsCount===t.report.runsCount&&e.report.createdAt===t.report.createdAt&&JSON.stringify(e.report.destinationConfig)===JSON.stringify(t.report.destinationConfig)),Uq=e=>{switch(e){case or.DRAFT:return Cn.NEUTRAL;case or.PUBLISHED:return Cn.SUCCESS;default:return Cn.NEUTRAL}},Fq=e=>{switch(e){case wn.SUCCESS:return Cn.SUCCESS;case wn.RUNNING:return Cn.INFO;case wn.FAILED:case wn.CANCELLED:case wn.INTERRUPTED:return Cn.ERROR;default:return Cn.NEUTRAL}},zq=e=>{switch(e){case an.SUCCESS:return Cn.SUCCESS;case an.RUNNING:return Cn.INFO;case an.ERROR:return Cn.ERROR;default:return Cn.NEUTRAL}},Vq=e=>{switch(e){case wn.SUCCESS:return"Success";case wn.RUNNING:return"Running";case wn.FAILED:return"Failed";case wn.CANCELLED:return"Cancelled";case wn.INTERRUPTED:return"Interrupted";default:return"Unknown"}},Hq=e=>{switch(e){case an.SUCCESS:return"Success";case an.RUNNING:return"Running";case an.ERROR:return"Failed";default:return"Unknown"}},g4=e=>en({fullyQualifiedName:tn().min(1,"Fully qualified name is required").refine(t=>DG(t,e),t=>({message:MG(t,e)}))}),$q=e=>en({pattern:tn().min(1,"Table pattern is required").refine(t=>OG(t,e),t=>({message:kG(t,e)}))}),Bq=e=>{const t=[];return e.status.code===or.PUBLISHED&&t.push(Hm.ALREADY_PUBLISHED),e.definitionType||t.push(Hm.MISSING_DEFINITION_TYPE),e.definition||t.push(Hm.MISSING_DEFINITION),t},Gq=e=>e.map(t=>oG[t]);function qq(e){return e.map(t=>({id:t.id,title:t.title,status:BA.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function v4(){const{state:e,dispatch:t}=aG(),n=p.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await vr.getDataMarts(),c=qq(l);t({type:"SET_ITEMS",payload:c})}catch(l){t({type:"SET_ERROR",payload:l instanceof Error?l.message:"Failed to load data marts"})}},[t]),r=p.useCallback(async l=>{t({type:"SET_LOADING"});try{await vr.deleteDataMart(l)}catch(c){throw t({type:"SET_ERROR",payload:c instanceof Error?c.message:"Failed to delete data mart"}),c}},[t]),s=p.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
|
|
672
|
-
* table-core
|
|
673
|
-
*
|
|
674
|
-
* Copyright (c) TanStack
|
|
675
|
-
*
|
|
676
|
-
* This source code is licensed under the MIT license found in the
|
|
677
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
678
|
-
*
|
|
679
|
-
* @license MIT
|
|
680
|
-
*/function vi(e,t){return typeof e=="function"?e(t):e}function ga(e,t){return n=>{t.setState(r=>({...r,[e]:vi(n,r[e])}))}}function vg(e){return e instanceof Function}function Kq(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Zq(e,t){const n=[],r=s=>{s.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function nt(e,t,n){let r=[],s;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((g,v)=>r[v]!==g)))return s;r=d;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...d),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-m)*100)/100,x=v/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(v,5)} /${b(g,5)} ms`,`
|
|
681
|
-
font-size: .6rem;
|
|
682
|
-
font-weight: bold;
|
|
683
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function rt(e,t,n,r){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function Yq(e,t,n,r){const s=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:nt(()=>[e,n,t,l],(c,d,h,m)=>({table:c,column:d,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),rt(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function Wq(e,t,n,r){var s,l;const d={...e._getDefaultColumnDef(),...t},h=d.accessorKey;let m=(s=(l=d.id)!=null?l:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:h&&(h.includes(".")?g=x=>{let b=x;for(const C of h.split(".")){var w;b=(w=b)==null?void 0:w[C]}return b}:g=x=>x[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:g,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:nt(()=>[!0],()=>{var x;return[v,...(x=v.columns)==null?void 0:x.flatMap(b=>b.getFlatColumns())]},rt(e.options,"debugColumns")),getLeafColumns:nt(()=>[e._getOrderColumnsFn()],x=>{var b;if((b=v.columns)!=null&&b.length){let w=v.columns.flatMap(C=>C.getLeafColumns());return x(w)}return[v]},rt(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(v,e);return v}const wr="debugHeaders";function G2(e,t,n){var r;let l={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],d=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(d),c.push(h)};return d(l),c},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const Qq={createTable:e=>{e.getHeaderGroups=nt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var l,c;const d=(l=r==null?void 0:r.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?l:[],h=(c=s==null?void 0:s.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?c:[],m=n.filter(v=>!(r!=null&&r.includes(v.id))&&!(s!=null&&s.includes(v.id)));return Cm(t,[...d,...m,...h],e)},rt(e.options,wr)),e.getCenterHeaderGroups=nt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id))),Cm(t,n,e,"center")),rt(e.options,wr)),e.getLeftHeaderGroups=nt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Cm(t,l,e,"left")},rt(e.options,wr)),e.getRightHeaderGroups=nt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Cm(t,l,e,"right")},rt(e.options,wr)),e.getFooterGroups=nt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),rt(e.options,wr)),e.getLeftFooterGroups=nt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),rt(e.options,wr)),e.getCenterFooterGroups=nt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),rt(e.options,wr)),e.getRightFooterGroups=nt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),rt(e.options,wr)),e.getFlatHeaders=nt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),rt(e.options,wr)),e.getLeftFlatHeaders=nt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),rt(e.options,wr)),e.getCenterFlatHeaders=nt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),rt(e.options,wr)),e.getRightFlatHeaders=nt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),rt(e.options,wr)),e.getCenterLeafHeaders=nt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),rt(e.options,wr)),e.getLeftLeafHeaders=nt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),rt(e.options,wr)),e.getRightLeafHeaders=nt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),rt(e.options,wr)),e.getLeafHeaders=nt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,l,c,d,h,m;return[...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(h=(m=r[0])==null?void 0:m.headers)!=null?h:[]].map(g=>g.getLeafHeaders()).flat()},rt(e.options,wr))}};function Cm(e,t,n,r){var s,l;let c=0;const d=function(x,b){b===void 0&&(b=1),c=Math.max(c,b),x.filter(w=>w.getIsVisible()).forEach(w=>{var C;(C=w.columns)!=null&&C.length&&d(w.columns,b+1)},0)};d(e);let h=[];const m=(x,b)=>{const w={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},C=[];x.forEach(E=>{const R=[...C].reverse()[0],T=E.column.depth===w.depth;let j,O=!1;if(T&&E.column.parent?j=E.column.parent:(j=E.column,O=!0),R&&(R==null?void 0:R.column)===j)R.subHeaders.push(E);else{const D=G2(n,j,{id:[r,b,j.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${C.filter(N=>N.column===j).length}`:void 0,depth:b,index:C.length});D.subHeaders.push(E),C.push(D)}w.headers.push(E),E.headerGroup=w}),h.push(w),b>0&&m(C,b-1)},g=t.map((x,b)=>G2(n,x,{depth:c,index:b}));m(g,c-1),h.reverse();const v=x=>x.filter(w=>w.column.getIsVisible()).map(w=>{let C=0,E=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],v(w.subHeaders).forEach(j=>{let{colSpan:O,rowSpan:D}=j;C+=O,R.push(D)})):C=1;const T=Math.min(...R);return E=E+T,w.colSpan=C,w.rowSpan=E,{colSpan:C,rowSpan:E}});return v((s=(l=h[0])==null?void 0:l.headers)!=null?s:[]),h}const fS=(e,t,n,r,s,l,c)=>{let d={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(d._valuesCache.hasOwnProperty(h))return d._valuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return d._valuesCache[h]=m.accessorFn(d.original,r),d._valuesCache[h]},getUniqueValues:h=>{if(d._uniqueValuesCache.hasOwnProperty(h))return d._uniqueValuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[h]=m.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[h]):(d._uniqueValuesCache[h]=[d.getValue(h)],d._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=d.getValue(h))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Zq(d.subRows,h=>h.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let h=[],m=d;for(;;){const g=m.getParentRow();if(!g)break;h.push(g),m=g}return h.reverse()},getAllCells:nt(()=>[e.getAllLeafColumns()],h=>h.map(m=>Yq(e,d,m,m.id)),rt(e.options,"debugRows")),_getAllCellsByColumnId:nt(()=>[d.getAllCells()],h=>h.reduce((m,g)=>(m[g.column.id]=g,m),{}),rt(e.options,"debugRows"))};for(let h=0;h<e._features.length;h++){const m=e._features[h];m==null||m.createRow==null||m.createRow(d,e)}return d},Xq={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},y4=(e,t,n)=>{var r,s;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};y4.autoRemove=e=>ss(e);const x4=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};x4.autoRemove=e=>ss(e);const b4=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};b4.autoRemove=e=>ss(e);const S4=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};S4.autoRemove=e=>ss(e);const C4=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});C4.autoRemove=e=>ss(e)||!(e!=null&&e.length);const w4=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});w4.autoRemove=e=>ss(e)||!(e!=null&&e.length);const E4=(e,t,n)=>e.getValue(t)===n;E4.autoRemove=e=>ss(e);const R4=(e,t,n)=>e.getValue(t)==n;R4.autoRemove=e=>ss(e);const hS=(e,t,n)=>{let[r,s]=n;const l=e.getValue(t);return l>=r&&l<=s};hS.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};hS.autoRemove=e=>ss(e)||ss(e[0])&&ss(e[1]);const go={includesString:y4,includesStringSensitive:x4,equalsString:b4,arrIncludes:S4,arrIncludesAll:C4,arrIncludesSome:w4,equals:E4,weakEquals:R4,inNumberRange:hS};function ss(e){return e==null||e===""}const Jq={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ga("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?go.includesString:typeof r=="number"?go.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?go.equals:Array.isArray(r)?go.arrIncludes:go.weakEquals},e.getFilterFn=()=>{var n,r;return vg(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:go[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),l=r==null?void 0:r.find(g=>g.id===e.id),c=vi(n,l?l.value:void 0);if(q2(s,c,e)){var d;return(d=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?d:[]}const h={id:e.id,value:c};if(l){var m;return(m=r==null?void 0:r.map(g=>g.id===e.id?h:g))!=null?m:[]}return r!=null&&r.length?[...r,h]:[h]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var l;return(l=vi(t,s))==null?void 0:l.filter(c=>{const d=n.find(h=>h.id===c.id);if(d){const h=d.getFilterFn();if(q2(h,c.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function q2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const eK=(e,t,n)=>n.reduce((r,s)=>{const l=s.getValue(e);return r+(typeof l=="number"?l:0)},0),tK=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},nK=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},rK=(e,t,n)=>{let r,s;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},aK=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},sK=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!Kq(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((l,c)=>l-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},oK=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),iK=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,lK=(e,t)=>t.length,wx={sum:eK,min:tK,max:nK,extent:rK,mean:aK,median:sK,unique:oK,uniqueCount:iK,count:lK},cK={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:ga("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return wx.sum;if(Object.prototype.toString.call(r)==="[object Date]")return wx.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return vg(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:wx[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function uK(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(l=>!t.includes(l.id));return n==="remove"?r:[...t.map(l=>e.find(c=>c.id===l)).filter(Boolean),...r]}const dK={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ga("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=nt(n=>[Hd(t,n)],n=>n.findIndex(r=>r.id===e.id),rt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Hd(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Hd(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=nt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let l=[];if(!(t!=null&&t.length))l=s;else{const c=[...t],d=[...s];for(;d.length&&c.length;){const h=c.shift(),m=d.findIndex(g=>g.id===h);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return uK(l,n,r)},rt(e.options,"debugTable"))}},Ex=()=>({left:[],right:[]}),fK={getInitialState:e=>({columnPinning:Ex(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ga("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var l,c;if(n==="right"){var d,h;return{left:((d=s==null?void 0:s.left)!=null?d:[]).filter(v=>!(r!=null&&r.includes(v))),right:[...((h=s==null?void 0:s.right)!=null?h:[]).filter(v=>!(r!=null&&r.includes(v))),...r]}}if(n==="left"){var m,g;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(v=>!(r!=null&&r.includes(v))),...r],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(v=>!(r!=null&&r.includes(v)))}}return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(v=>!(r!=null&&r.includes(v))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(v=>!(r!=null&&r.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,l,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((l=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(d=>d.id),{left:r,right:s}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=nt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const l=[...r??[],...s??[]];return n.filter(c=>!l.includes(c.column.id))},rt(t.options,"debugRows")),e.getLeftVisibleCells=nt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),rt(t.options,"debugRows")),e.getRightVisibleCells=nt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),rt(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Ex():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Ex())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,l;return!!((s=r.left)!=null&&s.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=nt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),rt(e.options,"debugColumns")),e.getRightLeafColumns=nt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),rt(e.options,"debugColumns")),e.getCenterLeafColumns=nt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(l=>!s.includes(l.id))},rt(e.options,"debugColumns"))}};function hK(e){return e||(typeof document<"u"?document:null)}const wm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Rx=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),mK={getDefaultColumnDef:()=>wm,getInitialState:e=>({columnSizing:{},columnSizingInfo:Rx(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ga("columnSizing",e),onColumnSizingInfoChange:ga("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:wm.minSize,(r=l??e.columnDef.size)!=null?r:wm.size),(s=e.columnDef.maxSize)!=null?s:wm.maxSize)},e.getStart=nt(n=>[n,Hd(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,l)=>s+l.getSize(),0),rt(t.options,"debugColumns")),e.getAfter=nt(n=>[n,Hd(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,l)=>s+l.getSize(),0),rt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var l;n+=(l=s.column.getSize())!=null?l:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return l=>{if(!r||!s||(l.persist==null||l.persist(),Tx(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],h=Tx(l)?Math.round(l.touches[0].clientX):l.clientX,m={},g=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(j=>{var O,D;const N=t.options.columnResizeDirection==="rtl"?-1:1,A=(T-((O=j==null?void 0:j.startOffset)!=null?O:0))*N,k=Math.max(A/((D=j==null?void 0:j.startSize)!=null?D:0),-.999999);return j.columnSizingStart.forEach(V=>{let[q,H]=V;m[q]=Math.round(Math.max(H+H*k,0)*100)/100}),{...j,deltaOffset:A,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(j=>({...j,...m})))},v=R=>g("move",R),x=R=>{g("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=hK(n),w={moveHandler:R=>v(R.clientX),upHandler:R=>{b==null||b.removeEventListener("mousemove",w.moveHandler),b==null||b.removeEventListener("mouseup",w.upHandler),x(R.clientX)}},C={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),v(R.touches[0].clientX),!1),upHandler:R=>{var T;b==null||b.removeEventListener("touchmove",C.moveHandler),b==null||b.removeEventListener("touchend",C.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((T=R.touches[0])==null?void 0:T.clientX)}},E=pK()?{passive:!1}:!1;Tx(l)?(b==null||b.addEventListener("touchmove",C.moveHandler,E),b==null||b.addEventListener("touchend",C.upHandler,E)):(b==null||b.addEventListener("mousemove",w.moveHandler,E),b==null||b.addEventListener("mouseup",w.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:h,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Rx():(n=e.initialState.columnSizingInfo)!=null?n:Rx())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let Em=null;function pK(){if(typeof Em=="boolean")return Em;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Em=e,Em}function Tx(e){return e.type==="touchstart"}const gK={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ga("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(l=>l.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=nt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),rt(t.options,"debugRows")),e.getVisibleCells=nt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],rt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>nt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),rt(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Hd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const vK={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},yK={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ga("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>go.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return vg(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:go[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},xK={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ga("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,l;e.setExpanded(r?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const c=l.split(".");r=Math.max(r,c.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const l=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=r,n=(s=n)!=null?s:!l,!l&&n)return{...c,[e.id]:!0};if(l&&!n){const{[e.id]:d,...h}=c;return h}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},R0=0,T0=10,jx=()=>({pageIndex:R0,pageSize:T0}),bK={getInitialState:e=>({...e,pagination:{...jx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:ga("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=l=>vi(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?jx():(s=e.initialState.pagination)!=null?s:jx())},e.setPageIndex=r=>{e.setPagination(s=>{let l=vi(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...s,pageIndex:l}})},e.resetPageIndex=r=>{var s,l;e.setPageIndex(r?R0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:R0)},e.resetPageSize=r=>{var s,l;e.setPageSize(r?T0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:T0)},e.setPageSize=r=>{e.setPagination(s=>{const l=Math.max(1,vi(r,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(s=>{var l;let c=vi(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=nt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((l,c)=>c)),s},rt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},_x=()=>({top:[],bottom:[]}),SK={getInitialState:e=>({rowPinning:_x(),...e}),getDefaultOptions:e=>({onRowPinningChange:ga("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const l=r?e.getLeafRows().map(h=>{let{id:m}=h;return m}):[],c=s?e.getParentRows().map(h=>{let{id:m}=h;return m}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(h=>{var m,g;if(n==="bottom"){var v,x;return{top:((v=h==null?void 0:h.top)!=null?v:[]).filter(C=>!(d!=null&&d.has(C))),bottom:[...((x=h==null?void 0:h.bottom)!=null?x:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)]}}if(n==="top"){var b,w;return{top:[...((b=h==null?void 0:h.top)!=null?b:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)],bottom:((w=h==null?void 0:h.bottom)!=null?w:[]).filter(C=>!(d!=null&&d.has(C)))}}return{top:((m=h==null?void 0:h.top)!=null?m:[]).filter(C=>!(d!=null&&d.has(C))),bottom:((g=h==null?void 0:h.bottom)!=null?g:[]).filter(C=>!(d!=null&&d.has(C)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const l=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:d}=c;return d});return(r=l==null?void 0:l.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?_x():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:_x())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,l;return!!((s=r.top)!=null&&s.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(c=>{const d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(n??[]).map(c=>t.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=nt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),rt(e.options,"debugRows")),e.getBottomRows=nt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),rt(e.options,"debugRows")),e.getCenterRows=nt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(l=>!s.has(l.id))},rt(e.options,"debugRows"))}},CK={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ga("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):s.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(l=>{j0(s,l.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=nt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Nx(e,n):{rows:[],flatRows:[],rowsById:{}},rt(e.options,"debugTable")),e.getFilteredSelectedRowModel=nt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Nx(e,n):{rows:[],flatRows:[],rowsById:{}},rt(e.options,"debugTable")),e.getGroupedSelectedRowModel=nt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Nx(e,n):{rows:[],flatRows:[],rowsById:{}},rt(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return l;const d={...l};return j0(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return mS(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return _0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return _0(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},j0=(e,t,n,r,s)=>{var l;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>j0(e,d.id,n,r,s))};function Nx(e,t){const n=e.getState().rowSelection,r=[],s={},l=function(c,d){return c.map(h=>{var m;const g=mS(h,n);if(g&&(r.push(h),s[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:l(h.subRows)}),g)return h}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:s}}function mS(e,t){var n;return(n=t[e.id])!=null?n:!1}function _0(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(mS(c,t)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=_0(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const N0=/([0-9]+)/gm,wK=(e,t,n)=>T4(_i(e.getValue(n)).toLowerCase(),_i(t.getValue(n)).toLowerCase()),EK=(e,t,n)=>T4(_i(e.getValue(n)),_i(t.getValue(n))),RK=(e,t,n)=>pS(_i(e.getValue(n)).toLowerCase(),_i(t.getValue(n)).toLowerCase()),TK=(e,t,n)=>pS(_i(e.getValue(n)),_i(t.getValue(n))),jK=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},_K=(e,t,n)=>pS(e.getValue(n),t.getValue(n));function pS(e,t){return e===t?0:e>t?1:-1}function _i(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function T4(e,t){const n=e.split(N0).filter(Boolean),r=t.split(N0).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),l=r.shift(),c=parseInt(s,10),d=parseInt(l,10),h=[c,d].sort();if(isNaN(h[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(h[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return n.length-r.length}const Nd={alphanumeric:wK,alphanumericCaseSensitive:EK,text:RK,textCaseSensitive:TK,datetime:jK,basic:_K},NK={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ga("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const l=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Nd.datetime;if(typeof l=="string"&&(r=!0,l.split(N0).length>1))return Nd.alphanumeric}return r?Nd.text:Nd.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return vg(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Nd[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),l=typeof n<"u"&&n!==null;t.setSorting(c=>{const d=c==null?void 0:c.find(b=>b.id===e.id),h=c==null?void 0:c.findIndex(b=>b.id===e.id);let m=[],g,v=l?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?d?g="toggle":g="add":c!=null&&c.length&&h!==c.length-1?g="replace":d?g="toggle":g="replace",g==="toggle"&&(l||s||(g="remove")),g==="add"){var x;m=[...c,{id:e.id,desc:v}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=c.map(b=>b.id===e.id?{...b,desc:v}:b):g==="remove"?m=c.filter(b=>b.id!==e.id):m=[{id:e.id,desc:v}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":l},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},AK=[Qq,gK,dK,fK,Xq,Jq,vK,yK,NK,cK,xK,bK,SK,CK,mK];function DK(e){var t,n;const r=[...AK,...(t=e._features)!=null?t:[]];let s={_features:r};const l=s._features.reduce((x,b)=>Object.assign(x,b.getDefaultOptions==null?void 0:b.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(l,x):{...l,...x};let h={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var b;h=(b=x.getInitialState==null?void 0:x.getInitialState(h))!=null?b:h});const m=[];let g=!1;const v={_features:r,options:{...l,...e},initialState:h,_queue:x=>{m.push(x),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const b=vi(x,s.options);s.options=c(b)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,b,w)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(x,b,w))!=null?C:`${w?[w.id,b].join("."):b}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,b)=>{let w=(b?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!w&&(w=s.getCoreRowModel().rowsById[x],!w))throw new Error;return w},_getDefaultColumnDef:nt(()=>[s.options.defaultColumn],x=>{var b;return x=(b=x)!=null?b:{},{header:w=>{const C=w.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:w=>{var C,E;return(C=(E=w.renderValue())==null||E.toString==null?void 0:E.toString())!=null?C:null},...s._features.reduce((w,C)=>Object.assign(w,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...x}},rt(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:nt(()=>[s._getColumnDefs()],x=>{const b=function(w,C,E){return E===void 0&&(E=0),w.map(R=>{const T=Wq(s,R,E,C),j=R;return T.columns=j.columns?b(j.columns,T,E+1):[],T})};return b(x)},rt(e,"debugColumns")),getAllFlatColumns:nt(()=>[s.getAllColumns()],x=>x.flatMap(b=>b.getFlatColumns()),rt(e,"debugColumns")),_getAllFlatColumnsById:nt(()=>[s.getAllFlatColumns()],x=>x.reduce((b,w)=>(b[w.id]=w,b),{}),rt(e,"debugColumns")),getAllLeafColumns:nt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,b)=>{let w=x.flatMap(C=>C.getLeafColumns());return b(w)},rt(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,v);for(let x=0;x<s._features.length;x++){const b=s._features[x];b==null||b.createTable==null||b.createTable(s)}return s}function wu(){return e=>nt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,l,c){l===void 0&&(l=0);const d=[];for(let m=0;m<s.length;m++){const g=fS(e,e._getRowId(s[m],m,c),s[m],m,l,void 0,c==null?void 0:c.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,d.push(g),e.options.getSubRows){var h;g.originalSubRows=e.options.getSubRows(s[m],m),(h=g.originalSubRows)!=null&&h.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},rt(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function OK(e){const t=[],n=r=>{var s;t.push(r),(s=r.subRows)!=null&&s.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function MK(e,t,n){return n.options.filterFromLeafRows?kK(e,t,n):IK(e,t,n)}function kK(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(h,m){m===void 0&&(m=0);const g=[];for(let x=0;x<h.length;x++){var v;let b=h[x];const w=fS(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(w.columnFilters=b.columnFilters,(v=b.subRows)!=null&&v.length&&m<c){if(w.subRows=d(b.subRows,m+1),b=w,t(b)&&!w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}if(t(b)||w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}}else b=w,t(b)&&(g.push(b),l[b.id]=b,s.push(b))}return g};return{rows:d(e),flatRows:s,rowsById:l}}function IK(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(h,m){m===void 0&&(m=0);const g=[];for(let x=0;x<h.length;x++){let b=h[x];if(t(b)){var v;if((v=b.subRows)!=null&&v.length&&m<c){const C=fS(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);C.subRows=d(b.subRows,m+1),b=C}g.push(b),s.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:s,rowsById:l}}function Ff(){return e=>nt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let x=0;x<t.flatRows.length;x++)t.flatRows[x].columnFilters={},t.flatRows[x].columnFiltersMeta={};return t}const s=[],l=[];(n??[]).forEach(x=>{var b;const w=e.getColumn(x.id);if(!w)return;const C=w.getFilterFn();C&&s.push({id:x.id,filterFn:C,resolvedValue:(b=C.resolveFilterValue==null?void 0:C.resolveFilterValue(x.value))!=null?b:x.value})});const c=(n??[]).map(x=>x.id),d=e.getGlobalFilterFn(),h=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&d&&h.length&&(c.push("__global__"),h.forEach(x=>{var b;l.push({id:x.id,filterFn:d,resolvedValue:(b=d.resolveFilterValue==null?void 0:d.resolveFilterValue(r))!=null?b:r})}));let m,g;for(let x=0;x<t.flatRows.length;x++){const b=t.flatRows[x];if(b.columnFilters={},s.length)for(let w=0;w<s.length;w++){m=s[w];const C=m.id;b.columnFilters[C]=m.filterFn(b,C,m.resolvedValue,E=>{b.columnFiltersMeta[C]=E})}if(l.length){for(let w=0;w<l.length;w++){g=l[w];const C=g.id;if(g.filterFn(b,C,g.resolvedValue,E=>{b.columnFiltersMeta[C]=E})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const v=x=>{for(let b=0;b<c.length;b++)if(x.columnFilters[c[b]]===!1)return!1;return!0};return MK(t.rows,v,e)},rt(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function yg(e){return t=>nt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:l}=n;let{rows:c,flatRows:d,rowsById:h}=r;const m=s*l,g=m+s;c=c.slice(m,g);let v;t.options.paginateExpandedRows?v={rows:c,flatRows:d,rowsById:h}:v=OK({rows:c,flatRows:d,rowsById:h}),v.flatRows=[];const x=b=>{v.flatRows.push(b),b.subRows.length&&b.subRows.forEach(x)};return v.rows.forEach(x),v},rt(t.options,"debugTable"))}function zf(){return e=>nt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],l=r.filter(h=>{var m;return(m=e.getColumn(h.id))==null?void 0:m.getCanSort()}),c={};l.forEach(h=>{const m=e.getColumn(h.id);m&&(c[h.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=h=>{const m=h.map(g=>({...g}));return m.sort((g,v)=>{for(let b=0;b<l.length;b+=1){var x;const w=l[b],C=c[w.id],E=C.sortUndefined,R=(x=w==null?void 0:w.desc)!=null?x:!1;let T=0;if(E){const j=g.getValue(w.id),O=v.getValue(w.id),D=j===void 0,N=O===void 0;if(D||N){if(E==="first")return D?-1:1;if(E==="last")return D?1:-1;T=D&&N?0:D?E:-E}}if(T===0&&(T=C.sortingFn(g,v,w.id)),T!==0)return R&&(T*=-1),C.invertSorting&&(T*=-1),T}return g.index-v.index}),m.forEach(g=>{var v;s.push(g),(v=g.subRows)!=null&&v.length&&(g.subRows=d(g.subRows))}),m};return{rows:d(n.rows),flatRows:s,rowsById:n.rowsById}},rt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
684
|
-
* react-table
|
|
685
|
-
*
|
|
686
|
-
* Copyright (c) TanStack
|
|
687
|
-
*
|
|
688
|
-
* This source code is licensed under the MIT license found in the
|
|
689
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
690
|
-
*
|
|
691
|
-
* @license MIT
|
|
692
|
-
*/function uu(e,t){return e?LK(e)?p.createElement(e,t):e:null}function LK(e){return PK(e)||typeof e=="function"||UK(e)}function PK(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function UK(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Eu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:DK(t)})),[r,s]=p.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function Ru({className:e,...t}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:ie("w-full caption-bottom text-sm",e),...t})})}function Tu({className:e,...t}){return o.jsx("thead",{"data-slot":"table-header",className:ie("[&_tr]:border-b",e),...t})}function ju({className:e,...t}){return o.jsx("tbody",{"data-slot":"table-body",className:ie("[&_tr:last-child]:border-0",e),...t})}function tr({className:e,...t}){return o.jsx("tr",{"data-slot":"table-row",className:ie("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function _u({className:e,...t}){return o.jsx("th",{"data-slot":"table-head",className:ie("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function va({className:e,...t}){return o.jsx("td",{"data-slot":"table-cell",className:ie("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var j4="AlertDialog",[FK]=Ur(j4,[s_]),Mo=s_(),_4=e=>{const{__scopeAlertDialog:t,...n}=e,r=Mo(t);return o.jsx($p,{...r,...n,modal:!0})};_4.displayName=j4;var zK="AlertDialogTrigger",VK=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Mo(n);return o.jsx(eP,{...s,...r,ref:t})});VK.displayName=zK;var HK="AlertDialogPortal",N4=e=>{const{__scopeAlertDialog:t,...n}=e,r=Mo(t);return o.jsx(Bp,{...r,...n})};N4.displayName=HK;var $K="AlertDialogOverlay",A4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Mo(n);return o.jsx(Gp,{...s,...r,ref:t})});A4.displayName=$K;var Xc="AlertDialogContent",[BK,GK]=FK(Xc),qK=Sj("AlertDialogContent"),D4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,l=Mo(n),c=p.useRef(null),d=vt(t,c),h=p.useRef(null);return o.jsx(W7,{contentName:Xc,titleName:O4,docsSlug:"alert-dialog",children:o.jsx(BK,{scope:n,cancelRef:h,children:o.jsxs(qp,{role:"alertdialog",...l,...s,ref:d,onOpenAutoFocus:je(s.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=h.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[o.jsx(qK,{children:r}),o.jsx(ZK,{contentRef:c})]})})})});D4.displayName=Xc;var O4="AlertDialogTitle",M4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Mo(n);return o.jsx(xb,{...s,...r,ref:t})});M4.displayName=O4;var k4="AlertDialogDescription",I4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Mo(n);return o.jsx(bb,{...s,...r,ref:t})});I4.displayName=k4;var KK="AlertDialogAction",L4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Mo(n);return o.jsx(Kp,{...s,...r,ref:t})});L4.displayName=KK;var P4="AlertDialogCancel",U4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=GK(P4,n),l=Mo(n),c=vt(t,s);return o.jsx(Kp,{...l,...r,ref:c})});U4.displayName=P4;var ZK=({contentRef:e})=>{const t=`\`${Xc}\` requires a description for the component to be accessible for screen reader users.
|
|
693
|
-
|
|
694
|
-
You can add a description to the \`${Xc}\` by passing a \`${k4}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
695
|
-
|
|
696
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Xc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
697
|
-
|
|
698
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},YK=_4,WK=N4,QK=A4,XK=D4,JK=L4,eZ=U4,tZ=M4,nZ=I4;function rZ({...e}){return o.jsx(YK,{"data-slot":"alert-dialog",...e})}function aZ({...e}){return o.jsx(WK,{"data-slot":"alert-dialog-portal",...e})}function sZ({className:e,...t}){return o.jsx(QK,{"data-slot":"alert-dialog-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function oZ({className:e,...t}){return o.jsxs(aZ,{children:[o.jsx(sZ,{}),o.jsx(XK,{"data-slot":"alert-dialog-content",className:ie("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function iZ({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function lZ({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function cZ({className:e,...t}){return o.jsx(tZ,{"data-slot":"alert-dialog-title",className:ie("text-lg font-semibold",e),...t})}function uZ({className:e,...t}){return o.jsx(nZ,{"data-slot":"alert-dialog-description",className:ie("text-muted-foreground text-sm",e),...t})}function dZ({className:e,...t}){return o.jsx(JK,{className:ie(pb(),e),...t})}function fZ({className:e,...t}){return o.jsx(eZ,{className:ie(pb({variant:"outline"}),e),...t})}function hZ(){const{scope:e}=Oo();return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(qH,{className:"dm-empty-state-ico"}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Data Mart"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"Data Marts help you organize and analyze your data effectively."}),o.jsx(Ha,{to:e("/data-marts/create"),children:o.jsxs(we,{variant:"outline",children:[o.jsx(Jr,{className:"h-4 w-4"}),"New Data Mart"]})})]})}function mZ(){return o.jsx(ts,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Oc={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},pZ={extractColumnIds:e=>e.map(t=>{if(t.id)return t.id;if("accessorKey"in t&&typeof t.accessorKey=="string")return t.accessorKey}).filter(t=>t!==void 0)};function Vf({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Oc.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=Oc.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=Oc.DEFAULT_EXCLUDED_COLUMNS}){const c=p.useMemo(()=>({SORTING:`${t}${Oc.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Oc.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=p.useMemo(()=>pZ.extractColumnIds(e),[e]),h=p.useMemo(()=>d.filter(C=>!s.includes(C)),[d,s]),m=p.useCallback(()=>{const C=hi.get(c.SORTING,"json");return C&&Array.isArray(C)&&C.length>0?C:[{id:h.includes(n)?n:h[0]??Oc.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,h,n]),g=p.useCallback(()=>{const C=hi.get(c.COLUMN_VISIBILITY,"json");if(C&&typeof C=="object"&&!Array.isArray(C)){const E={};for(const R of d)l.includes(R)||(E[R]=C[R]);return E}return r},[c.COLUMN_VISIBILITY,d,l,r]),[v,x]=p.useState(m),[b,w]=p.useState(g);return p.useEffect(()=>{v.length>0&&h.includes(v[0].id)&&hi.set(c.SORTING,v)},[v,h,c.SORTING]),p.useEffect(()=>{const C={};for(const E of d){if(l.includes(E))continue;const R=b[E];typeof R=="boolean"&&(C[E]=R)}hi.set(c.COLUMN_VISIBILITY,C)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:v,setSorting:x,columnVisibility:b,setColumnVisibility:w}}function gZ({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var N;const{navigate:l,scope:c}=Oo(),{sorting:d,setSorting:h,columnVisibility:m,setColumnVisibility:g}=Vf({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[v,x]=p.useState([]),[b,w]=p.useState({}),[C,E]=p.useState(!1),[R,T]=p.useState(!1),j=async()=>{try{T(!0);const k=D.getSelectedRowModel().rows.map(V=>V.original.id);for(const V of k)await n(V);Jt.success(`Successfully deleted ${String(k.length)} data mart${k.length!==1?"s":""}`),w({}),await r()}catch(A){console.error("Error deleting data marts:",A),Jt.error("Failed to delete some data marts. Please try again.")}finally{T(!1),E(!1)}},O=Object.keys(b).length>0,D=Eu({data:t,columns:[{id:"select",size:40,header:({table:A})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":A.getIsAllRowsSelected(),"data-state":A.getIsAllRowsSelected()?"checked":"unchecked","aria-label":"Select all rows",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:A.getToggleAllRowsSelectedHandler(),children:A.getIsAllRowsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),cell:({row:A})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":A.getIsSelected(),"data-state":A.getIsSelected()?"checked":"unchecked","aria-label":"Select row",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:A.getToggleSelectedHandler(),children:A.getIsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:wu(),getPaginationRowModel:yg(),onSortingChange:h,getSortedRowModel:zf(),onColumnFiltersChange:x,getFilteredRowModel:Ff(),onColumnVisibilityChange:g,onRowSelectionChange:w,state:{sorting:d,columnFilters:v,columnVisibility:m,rowSelection:b},enableRowSelection:!0});return s?o.jsx("div",{children:o.jsx(mZ,{})}):t.length?o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsxs("div",{className:"dm-card-toolbar-left",children:[O&&o.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:R,children:o.jsx(Do,{className:"h-4 w-4"})}),o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Ll,{className:"dm-card-toolbar-search-icon"}),o.jsx(Bt,{placeholder:"Search by title",value:(N=D.getColumn("title"))==null?void 0:N.getFilterValue(),onChange:A=>{var k;return(k=D.getColumn("title"))==null?void 0:k.setFilterValue(A.target.value)},className:"dm-card-toolbar-search-input"})]})]}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsx(Ha,{to:c("/data-marts/create"),children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[o.jsx(Jr,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ru,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[o.jsx(Tu,{className:"dm-card-table-header",children:D.getHeaderGroups().map(A=>o.jsx(tr,{className:"dm-card-table-header-row",children:A.headers.map(k=>o.jsx(_u,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:k.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:k.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(k.getSize())}%`},children:k.isPlaceholder?null:uu(k.column.columnDef.header,k.getContext())},k.id))},A.id))}),o.jsx(ju,{className:"dm-card-table-body",children:D.getRowModel().rows.length?D.getRowModel().rows.map(A=>o.jsx(tr,{"data-state":A.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:k=>{if(k.target instanceof HTMLElement&&(k.target.closest('[role="checkbox"]')||k.target.closest(".actions-cell")||k.target.closest('[role="menuitem"]')||k.target.closest('[data-state="open"]')))return;const V=A.original.id;l(`/data-marts/${V}/data-setup`)},children:A.getVisibleCells().map(k=>o.jsx(va,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${k.column.id==="actions"?"actions-cell":""} ${k.column.id==="createdAt"?"whitespace-nowrap":""}`,style:k.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:k.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(k.column.getSize())}%`},children:uu(k.column.columnDef.cell,k.getContext())},k.id))},A.id)):o.jsx(tr,{children:o.jsx(va,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{D.previousPage()},disabled:!D.getCanPreviousPage(),children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{D.nextPage()},disabled:!D.getCanNextPage(),children:"Next"})]}),o.jsx(rZ,{open:C,onOpenChange:E,children:o.jsxs(oZ,{children:[o.jsxs(iZ,{children:[o.jsx(cZ,{children:"Are you sure?"}),o.jsxs(uZ,{children:["You're about to delete ",Object.keys(b).length," selected data mart",Object.keys(b).length!==1?"s":"",". This action cannot be undone."]})]}),o.jsxs(lZ,{children:[o.jsx(fZ,{disabled:R,children:"Cancel"}),o.jsx(dZ,{onClick:()=>{j()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):o.jsx("div",{className:"dm-card",children:o.jsx(hZ,{})})}function fl({column:e,children:t}){return o.jsxs(we,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Ls,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Ga,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Ls,{className:"text-muted-foreground h-4 w-4"})})]})]})}function gS({...e}){return o.jsx($p,{"data-slot":"dialog",...e})}function vZ({...e}){return o.jsx(Bp,{"data-slot":"dialog-portal",...e})}function yZ({className:e,...t}){return o.jsx(Gp,{"data-slot":"dialog-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function vS({className:e,children:t,showCloseButton:n=!0,...r}){return o.jsxs(vZ,{"data-slot":"dialog-portal",children:[o.jsx(yZ,{}),o.jsxs(qp,{"data-slot":"dialog-content",className:ie("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&o.jsxs(Kp,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(ru,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yS({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function xZ({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function xS({className:e,...t}){return o.jsx(xb,{"data-slot":"dialog-title",className:ie("text-lg leading-none font-semibold",e),...t})}function bS({className:e,...t}){return o.jsx(bb,{"data-slot":"dialog-description",className:ie("text-muted-foreground text-sm",e),...t})}const bZ=yf("",{variants:{variant:{brand:"bg-primary text-white shadow-xs hover:bg-primary-hover focus-visible:ring-brand-blue-200 dark:focus-visible:ring-brand-blue-400"}}});function Jc({className:e,variant:t,...n}){return t==="brand"?o.jsx(we,{variant:"default",className:ie(bZ({variant:t}),e),...n}):o.jsx(we,{variant:t,className:e,...n})}const ya=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:h="destructive",children:m})=>{const g=()=>{t(!1),d==null||d()};return o.jsx(gS,{open:e,onOpenChange:t,children:o.jsxs(vS,{children:[o.jsxs(yS,{children:[o.jsx(xS,{children:n}),o.jsx(bS,{children:r})]}),m,o.jsxs(xZ,{children:[l&&o.jsx(Jc,{variant:"secondary",onClick:g,children:l}),o.jsx(Jc,{variant:h,onClick:c,children:s})]})]})})},SZ=({row:e,onDeleteSuccess:t})=>{const{scope:n}=Oo(),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{deleteDataMart:d,refreshList:h}=v4(),m=async()=>{try{await d(e.original.id),s(!1),await h(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return o.jsxs("div",{className:"text-right",children:[o.jsxs(Ar,{open:l,onOpenChange:c,children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Or,{align:"end",children:[o.jsx(Tt,{children:o.jsxs(Ha,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[o.jsx(bf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]})}),o.jsx($a,{}),o.jsxs(Tt,{onClick:()=>{s(!0)},children:[o.jsx(Do,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),o.jsx(ya,{open:r,onOpenChange:s,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void m(),variant:"destructive"})]})};var bn=(e=>(e.TITLE="title",e.DEFINITION_TYPE="definitionType",e.STORAGE_TYPE="storageType",e.STATUS="status",e.TRIGGERS_COUNT="triggersCount",e.REPORTS_COUNT="reportsCount",e.CREATED_AT="createdAt",e))(bn||{});const ii={[bn.TITLE]:"Title",[bn.DEFINITION_TYPE]:"Input Source",[bn.STORAGE_TYPE]:"Storage",[bn.STATUS]:"Status",[bn.TRIGGERS_COUNT]:"Triggers",[bn.REPORTS_COUNT]:"Reports",[bn.CREATED_AT]:"Created at"};function CZ({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Or,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=ii[t.id]||t.id;return o.jsx(Tt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const K2={types:{[We.SQL]:{type:We.SQL,displayName:"SQL",icon:fb},[We.TABLE]:{type:We.TABLE,displayName:"Table",icon:U8},[We.VIEW]:{type:We.VIEW,displayName:"View",icon:t8},[We.TABLE_PATTERN]:{type:We.TABLE_PATTERN,displayName:"Pattern",icon:sL},[We.CONNECTOR]:{type:We.CONNECTOR,displayName:"Connector",icon:Nj}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},wZ=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:bn.TITLE,size:40,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.TITLE]}),cell:({row:n})=>o.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===We.CONNECTOR){const s=n.definition,l=t.find(c=>c.name===s.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:s}=K2.getInfo(r);return s}},id:bn.DEFINITION_TYPE,size:15,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case We.CONNECTOR:{const s=n.original.definition,l=t.find(c=>c.name===s.connector.source.name);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&o.jsx(Lf,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:s,icon:l}=K2.getInfo(r);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(l,{className:"h-4 w-4"}),s]})}}}},{accessorKey:bn.STORAGE_TYPE,size:15,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:l,icon:c}=Fi.getInfo(r),d=s??l;return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),d]})}},{accessorKey:bn.CREATED_AT,size:15,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return o.jsx("div",{className:"text-muted-foreground",children:s})}},{accessorKey:bn.STATUS,size:15,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return o.jsx(Uf,{type:Uq(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:bn.TRIGGERS_COUNT,size:15,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:bn.REPORTS_COUNT,size:15,header:({column:n})=>o.jsx(fl,{column:n,children:ii[bn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>o.jsx(CZ,{table:n}),cell:({row:n})=>o.jsx(SZ,{row:n,onDeleteSuccess:e})}];var Xn=(e=>(e.FETCH_CONNECTORS_START="FETCH_CONNECTORS_START",e.FETCH_CONNECTORS_SUCCESS="FETCH_CONNECTORS_SUCCESS",e.FETCH_CONNECTORS_ERROR="FETCH_CONNECTORS_ERROR",e.FETCH_CONNECTOR_SPECIFICATION_START="FETCH_CONNECTOR_SPECIFICATION_START",e.FETCH_CONNECTOR_SPECIFICATION_SUCCESS="FETCH_CONNECTOR_SPECIFICATION_SUCCESS",e.FETCH_CONNECTOR_SPECIFICATION_ERROR="FETCH_CONNECTOR_SPECIFICATION_ERROR",e.FETCH_CONNECTOR_FIELDS_START="FETCH_CONNECTOR_FIELDS_START",e.FETCH_CONNECTOR_FIELDS_SUCCESS="FETCH_CONNECTOR_FIELDS_SUCCESS",e.FETCH_CONNECTOR_FIELDS_ERROR="FETCH_CONNECTOR_FIELDS_ERROR",e))(Xn||{});const EZ={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function RZ(e,t){switch(t.type){case Xn.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case Xn.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case Xn.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case Xn.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case Xn.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case Xn.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case Xn.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case Xn.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case Xn.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const F4=p.createContext(void 0);function du({children:e}){const[t,n]=p.useReducer(RZ,EZ);return o.jsx(F4.Provider,{value:{state:t,dispatch:n},children:e})}function TZ(){const e=p.useContext(F4);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var _s=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(_s||{});class Ax extends Vl{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}}function jZ(e){return e.map(t=>({name:t.name,displayName:t.title??t.name,description:t.description??"",logoBase64:t.logo,docUrl:t.docUrl})).sort((t,n)=>t.displayName.localeCompare(n.displayName))}function $l(){const{state:e,dispatch:t}=TZ(),n=p.useMemo(()=>jZ(e.connectors),[e.connectors]),r=p.useCallback(async()=>{t({type:Xn.FETCH_CONNECTORS_START});try{const d=await new Ax().getAvailableConnectors();t({type:Xn.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){t({type:Xn.FETCH_CONNECTORS_ERROR,payload:c instanceof Error?c.message:"Unknown error"})}},[t]),s=p.useCallback(async c=>{t({type:Xn.FETCH_CONNECTOR_SPECIFICATION_START});try{const h=await new Ax().getConnectorSpecification(c);t({type:Xn.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:h})}catch(d){t({type:Xn.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:d instanceof Error?d.message:"Unknown error"})}},[t]),l=p.useCallback(async c=>{t({type:Xn.FETCH_CONNECTOR_FIELDS_START});try{const h=await new Ax().getConnectorFields(c);t({type:Xn.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:h})}catch(d){t({type:Xn.FETCH_CONNECTOR_FIELDS_ERROR,payload:d instanceof Error?d.message:"Unknown error"})}},[t]);return{connectors:n,connectorSpecification:e.connectorSpecification,connectorFields:e.connectorFields,loading:e.loading,loadingSpecification:e.loadingSpecification,loadingFields:e.loadingFields,error:e.error,fetchAvailableConnectors:r,fetchConnectorSpecification:s,fetchConnectorFields:l}}const _Z=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=v4(),{connectors:l,fetchAvailableConnectors:c}=$l();return p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t()},[t]),o.jsx(gZ,{columns:wZ({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function Z2(){return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(rG,{children:o.jsx(du,{children:o.jsx(_Z,{})})})})]})}const z4=p.createContext(void 0),Ad=e=>{const t=Bq(e);return{...e,canPublish:t.length===0,validationErrors:t}},V4={dataMart:null,isLoading:!1,error:null,runs:[]};function NZ(e,t){switch(t.type){case"FETCH_DATA_MART_START":case"CREATE_DATA_MART_START":case"UPDATE_DATA_MART_START":case"UPDATE_DATA_MART_TITLE_START":case"UPDATE_DATA_MART_DESCRIPTION_START":case"UPDATE_DATA_MART_DEFINITION_START":case"DELETE_DATA_MART_START":case"PUBLISH_DATA_MART_START":case"RUN_DATA_MART_START":case"ACTUALIZE_DATA_MART_SCHEMA_START":case"UPDATE_DATA_MART_SCHEMA_START":case"FETCH_DATA_MART_RUNS_START":case"LOAD_MORE_DATA_MART_RUNS_START":return{...e,isLoading:!0,error:null};case"CREATE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_SUCCESS":case"UPDATE_DATA_MART_SUCCESS":case"PUBLISH_DATA_MART_SUCCESS":case"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS":case"UPDATE_DATA_MART_SCHEMA_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:Ad(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Ad({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Ad({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Ad({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Ad({...e.dataMart,definitionType:t.payload.definitionType,definition:t.payload.definition,modifiedAt:new Date})}:e;case"DELETE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:null};case"RUN_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:t.payload};case"LOAD_MORE_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:[...e.runs,...t.payload]};case"FETCH_DATA_MART_ERROR":case"CREATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_TITLE_ERROR":case"UPDATE_DATA_MART_DESCRIPTION_ERROR":case"UPDATE_DATA_MART_DEFINITION_ERROR":case"DELETE_DATA_MART_ERROR":case"PUBLISH_DATA_MART_ERROR":case"RUN_DATA_MART_ERROR":case"ACTUALIZE_DATA_MART_SCHEMA_ERROR":case"UPDATE_DATA_MART_SCHEMA_ERROR":case"FETCH_DATA_MART_RUNS_ERROR":case"LOAD_MORE_DATA_MART_RUNS_ERROR":return{...e,isLoading:!1,error:t.payload};case"RESET":return V4;default:return e}}function zi(){const e=p.useContext(z4);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class AZ{mapFromDto(t){const n=t.config,r=t.credentials;let s="";return r&&Object.keys(r).length>0&&(s=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:Pe.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:s},config:{projectId:(n==null?void 0:n.projectId)??"",location:(n==null?void 0:n.location)??""}}}mapToUpdateRequest(t){const n={config:{projectId:t.config.projectId,location:t.config.location}};return t.credentials&&(n.credentials={...JSON.parse(t.credentials.serviceAccount)}),n}}class DZ{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Pe.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(r==null?void 0:r.accessKeyId)??"",secretAccessKey:(r==null?void 0:r.secretAccessKey)??""},config:{region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){const n={config:{region:t.config.region,outputBucket:t.config.outputBucket}};return t.credentials&&(n.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),n}}const H4={getMapper(e){switch(e){case Pe.GOOGLE_BIGQUERY:return new AZ;case Pe.AWS_ATHENA:return new DZ;default:throw new Error(`Unknown storage type: ${e}`)}}};function $m(e){return H4.getMapper(e.type).mapFromDto(e)}function OZ(e){const t=H4.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function MZ(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function kZ(e){return{type:e}}function IZ(e){return{sqlQuery:e.sqlQuery}}function LZ(e){return{sqlQuery:e.sqlQuery}}function PZ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function UZ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function FZ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function zZ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function VZ(e){return{pattern:e.pattern}}function HZ(e){return{pattern:e.pattern}}function $Z(e){return{connector:{source:{name:e.connector.source.name,configuration:e.connector.source.configuration,node:e.connector.source.node,fields:e.connector.source.fields},storage:{fullyQualifiedName:e.connector.storage.fullyQualifiedName}}}}function BZ(e){const t=e.connector;return{connector:{source:{name:t.source.name,configuration:t.source.configuration,node:t.source.node,fields:t.source.fields},storage:{fullyQualifiedName:t.storage.fullyQualifiedName}}}}function GZ(e,t){if(!e||!t)return null;switch(e){case We.SQL:return LZ(t);case We.TABLE:return UZ(t);case We.VIEW:return zZ(t);case We.TABLE_PATTERN:return HZ(t);case We.CONNECTOR:return BZ(t);default:return console.warn(`Unknown definition type: ${String(e)}`),null}}function Mc(e){return{id:e.id,title:e.title,description:e.description,status:BA.getInfo(e.status),storage:$m(e.storage),definitionType:e.definitionType,definition:GZ(e.definitionType,e.definition),schema:e.schema,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,validationErrors:[]}}function qZ(e){return{id:e.id,title:e.title}}function $4({children:e}){const[t,n]=p.useReducer(NZ,V4),r=p.useCallback(async D=>{try{n({type:"FETCH_DATA_MART_START"});const N=await vr.getDataMartById(D),A=Mc(N);n({type:"FETCH_DATA_MART_SUCCESS",payload:A})}catch(N){n({type:"FETCH_DATA_MART_ERROR",payload:mn(N)})}},[]),s=async D=>{try{n({type:"CREATE_DATA_MART_START"});const N=await vr.createDataMart(D),A=qZ(N);return n({type:"CREATE_DATA_MART_SUCCESS",payload:A}),fn.success("Data Mart created"),A}catch(N){throw n({type:"CREATE_DATA_MART_ERROR",payload:mn(N)}),N}},l=async(D,N)=>{try{n({type:"UPDATE_DATA_MART_START"});const A=await vr.updateDataMart(D,N),k=Mc(A);n({type:"UPDATE_DATA_MART_SUCCESS",payload:k})}catch(A){n({type:"UPDATE_DATA_MART_ERROR",payload:mn(A)})}},c=async D=>{try{n({type:"DELETE_DATA_MART_START"}),await vr.deleteDataMart(D),n({type:"DELETE_DATA_MART_SUCCESS"}),fn.success("Data Mart deleted")}catch(N){n({type:"DELETE_DATA_MART_ERROR",payload:mn(N)})}},d=async(D,N)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await vr.updateDataMartTitle(D,N),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:N}),fn.success("Title updated")}catch(A){n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:mn(A)})}},h=async(D,N)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await vr.updateDataMartDescription(D,N),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:N??""}),fn.success("Description updated")}catch(A){n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:mn(A)})}},m=p.useCallback(D=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:D})},[]),g=async(D,N,A)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let k;switch(N){case We.SQL:k={definitionType:N,definition:IZ(A)};break;case We.TABLE:k={definitionType:N,definition:PZ(A)};break;case We.VIEW:k={definitionType:N,definition:FZ(A)};break;case We.TABLE_PATTERN:k={definitionType:N,definition:VZ(A)};break;case We.CONNECTOR:{k={definitionType:We.CONNECTOR,definition:$Z(A)};break}default:throw new Error(`Unsupported definition type: ${String(N)}`)}const V=await vr.updateDataMartDefinition(D,k),q=Mc(V);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:N,definition:A}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:q})}catch(k){n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:mn(k)})}},v=async D=>{try{n({type:"PUBLISH_DATA_MART_START"});const N=await vr.publishDataMart(D),A=Mc(N);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:A}),fn.success("Data Mart published")}catch(N){throw n({type:"PUBLISH_DATA_MART_ERROR",payload:mn(N)}),N}},x=async D=>{try{n({type:"RUN_DATA_MART_START"}),fn.loading("Manual run started"),await vr.runDataMart(D.id,D.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(N){n({type:"RUN_DATA_MART_ERROR",payload:mn(N)})}},b=async(D,N)=>{try{await vr.cancelDataMartRun(D,N),await E(D),fn.success("Data Mart run canceled")}catch(A){n({type:"RUN_DATA_MART_ERROR",payload:mn(A)})}},w=async D=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const N=await vr.actualizeDataMartSchema(D),A=Mc(N);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:A}),fn.success("Output schema actualized")}catch(N){n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:mn(N)})}},C=async(D,N)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const A=await vr.updateDataMartSchema(D,{schema:N}),k=Mc(A);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:k}),fn.success("Output schema updated")}catch(A){n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:mn(A)})}},E=p.useCallback(async(D,N=5,A=0)=>{try{n({type:"FETCH_DATA_MART_RUNS_START"});const k=await vr.getDataMartRuns(D,N,A);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:k}),k}catch(k){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:mn(k)}),k}},[]),R=p.useCallback(async(D,N,A=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const k=await vr.getDataMartRuns(D,A,N);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:k}),k}catch(k){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:mn(k)}),k}},[]),T=p.useCallback(()=>{n({type:"RESET"})},[]),j=p.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:h,updateDataMartStorage:m,updateDataMartDefinition:g,publishDataMart:v,runDataMart:x,cancelDataMartRun:b,actualizeDataMartSchema:w,updateDataMartSchema:C,getDataMartRuns:E,loadMoreDataMartRuns:R,getErrorMessage:j,reset:T};return o.jsx(z4.Provider,{value:O,children:e})}var Hf=e=>e.type==="checkbox",vl=e=>e instanceof Date,Zr=e=>e==null;const B4=e=>typeof e=="object";var $n=e=>!Zr(e)&&!Array.isArray(e)&&B4(e)&&!vl(e),G4=e=>$n(e)&&e.target?Hf(e.target)?e.target.checked:e.target.value:e,KZ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,q4=(e,t)=>e.has(KZ(t)),ZZ=e=>{const t=e.constructor&&e.constructor.prototype;return $n(t)&&t.hasOwnProperty("isPrototypeOf")},SS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(SS&&(e instanceof Blob||r))&&(n||$n(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!ZZ(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Qn(e[s]));else return e;return t}var xg=e=>/^\w*$/.test(e),Sn=e=>e===void 0,CS=e=>Array.isArray(e)?e.filter(Boolean):[],wS=e=>CS(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!$n(e))return n;const r=(xg(t)?[t]:wS(t)).reduce((s,l)=>Zr(s)?s:s[l],e);return Sn(r)||r===e?Sn(e[t])?n:e[t]:r},ca=e=>typeof e=="boolean",$t=(e,t,n)=>{let r=-1;const s=xg(t)?[t]:wS(t),l=s.length,c=l-1;for(;++r<l;){const d=s[r];let h=n;if(r!==c){const m=e[d];h=$n(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=h,e=e[d]}};const Cp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ns={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ES=_e.createContext(null);ES.displayName="HookFormContext";const Nu=()=>_e.useContext(ES),K4=e=>{const{children:t,...n}=e;return _e.createElement(ES.Provider,{value:n},t)};var Z4=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return t._proxyFormState[c]!==ns.all&&(t._proxyFormState[c]=!r||ns.all),n&&(n[c]=!0),e[c]}});return s};const RS=typeof window<"u"?_e.useLayoutEffect:_e.useEffect;function Y4(e){const t=Nu(),{control:n=t.control,disabled:r,name:s,exact:l}=e||{},[c,d]=_e.useState(n._formState),h=_e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return RS(()=>n._subscribe({name:s,formState:h.current,exact:l,callback:m=>{!r&&d({...n._formState,...m})}}),[s,r,l]),_e.useEffect(()=>{h.current.isValid&&n._setValid(!0)},[n]),_e.useMemo(()=>Z4(c,n,h.current,!1),[c,n])}var ha=e=>typeof e=="string",W4=(e,t,n,r,s)=>ha(e)?(r&&t.watch.add(e),De(n,e,s)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),De(n,l))):(r&&(t.watchAll=!0),n),A0=e=>Zr(e)||!B4(e);function yo(e,t,n=new WeakSet){if(A0(e)||A0(t))return e===t;if(vl(e)&&vl(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const l of r){const c=e[l];if(!s.includes(l))return!1;if(l!=="ref"){const d=t[l];if(vl(c)&&vl(d)||$n(c)&&$n(d)||Array.isArray(c)&&Array.isArray(d)?!yo(c,d,n):c!==d)return!1}}return!0}function YZ(e){const t=Nu(),{control:n=t.control,name:r,defaultValue:s,disabled:l,exact:c,compute:d}=e||{},h=_e.useRef(s),m=_e.useRef(d),g=_e.useRef(void 0);m.current=d;const v=_e.useMemo(()=>n._getWatch(r,h.current),[n,r]),[x,b]=_e.useState(m.current?m.current(v):v);return RS(()=>n._subscribe({name:r,formState:{values:!0},exact:c,callback:w=>{if(!l){const C=W4(r,n._names,w.values||n._formValues,!1,h.current);if(m.current){const E=m.current(C);yo(E,g.current)||(b(E),g.current=E)}else b(C)}}}),[n,l,r,c]),_e.useEffect(()=>n._removeUnmounted()),x}function WZ(e){const t=Nu(),{name:n,disabled:r,control:s=t.control,shouldUnregister:l,defaultValue:c}=e,d=q4(s._names.array,n),h=_e.useMemo(()=>De(s._formValues,n,De(s._defaultValues,n,c)),[s,n,c]),m=YZ({control:s,name:n,defaultValue:h,exact:!0}),g=Y4({control:s,name:n,exact:!0}),v=_e.useRef(e),x=_e.useRef(void 0),b=_e.useRef(s.register(n,{...e.rules,value:m,...ca(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const w=_e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(g.validatingFields,n)},error:{enumerable:!0,get:()=>De(g.errors,n)}}),[g,n]),C=_e.useCallback(j=>b.current.onChange({target:{value:G4(j),name:n},type:Cp.CHANGE}),[n]),E=_e.useCallback(()=>b.current.onBlur({target:{value:De(s._formValues,n),name:n},type:Cp.BLUR}),[n,s._formValues]),R=_e.useCallback(j=>{const O=De(s._fields,n);O&&j&&(O._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:D=>j.setCustomValidity(D),reportValidity:()=>j.reportValidity()})},[s._fields,n]),T=_e.useMemo(()=>({name:n,value:m,...ca(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:C,onBlur:E,ref:R}),[n,r,g.disabled,C,E,R,m]);return _e.useEffect(()=>{const j=s._options.shouldUnregister||l,O=x.current;O&&O!==n&&!d&&s.unregister(O),s.register(n,{...v.current.rules,...ca(v.current.disabled)?{disabled:v.current.disabled}:{}});const D=(N,A)=>{const k=De(s._fields,N);k&&k._f&&(k._f.mount=A)};if(D(n,!0),j){const N=Qn(De(s._options.defaultValues,n,v.current.defaultValue));$t(s._defaultValues,n,N),Sn(De(s._formValues,n))&&$t(s._formValues,n,N)}return!d&&s.register(n),x.current=n,()=>{(d?j&&!s._state.action:j)?s.unregister(n):D(n,!1)}},[n,s,d,l]),_e.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),_e.useMemo(()=>({field:T,formState:g,fieldState:w}),[T,g,w])}const QZ=e=>e.render(WZ(e));var TS=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},$d=e=>Array.isArray(e)?e:[e],Y2=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function Q4(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],l=t[r];if(s&&$n(s)&&l){const c=Q4(s,l);$n(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Kr=e=>$n(e)&&!Object.keys(e).length,jS=e=>e.type==="file",rs=e=>typeof e=="function",wp=e=>{if(!SS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},X4=e=>e.type==="select-multiple",_S=e=>e.type==="radio",XZ=e=>_S(e)||Hf(e),Dx=e=>wp(e)&&e.isConnected;function JZ(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Sn(e)?r++:e[t[r++]];return e}function eY(e){for(const t in e)if(e.hasOwnProperty(t)&&!Sn(e[t]))return!1;return!0}function Fn(e,t){const n=Array.isArray(t)?t:xg(t)?[t]:wS(t),r=n.length===1?e:JZ(e,n),s=n.length-1,l=n[s];return r&&delete r[l],s!==0&&($n(r)&&Kr(r)||Array.isArray(r)&&eY(r))&&Fn(e,n.slice(0,-1)),e}var tY=e=>{for(const t in e)if(rs(e[t]))return!0;return!1};function J4(e){return Array.isArray(e)||$n(e)&&!tY(e)}function D0(e,t={}){for(const n in e)J4(e[n])?(t[n]=Array.isArray(e[n])?[]:{},D0(e[n],t[n])):Sn(e[n])||(t[n]=!0);return t}function Fc(e,t,n){n||(n=D0(t));for(const r in e)J4(e[r])?Sn(t)||A0(n[r])?n[r]=D0(e[r],Array.isArray(e[r])?[]:{}):Fc(e[r],Zr(t)?{}:t[r],n[r]):n[r]=!yo(e[r],t[r]);return n}const W2={value:!1,isValid:!1},Q2={value:!0,isValid:!0};var eD=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Sn(e[0].attributes.value)?Sn(e[0].value)||e[0].value===""?Q2:{value:e[0].value,isValid:!0}:Q2:W2}return W2},tD=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Sn(e)?e:t?e===""?NaN:e&&+e:n&&ha(e)?new Date(e):r?r(e):e;const X2={isValid:!1,value:null};var nD=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,X2):X2;function J2(e){const t=e.ref;return jS(t)?t.files:_S(t)?nD(e.refs).value:X4(t)?[...t.selectedOptions].map(({value:n})=>n):Hf(t)?eD(e.refs).value:tD(Sn(t.value)?e.ref.value:t.value,e)}var nY=(e,t,n,r)=>{const s={};for(const l of e){const c=De(t,l);c&&$t(s,l,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Ep=e=>e instanceof RegExp,Dd=e=>Sn(e)?e:Ep(e)?e.source:$n(e)?Ep(e.value)?e.value.source:e.value:e,eT=e=>({isOnSubmit:!e||e===ns.onSubmit,isOnBlur:e===ns.onBlur,isOnChange:e===ns.onChange,isOnAll:e===ns.all,isOnTouch:e===ns.onTouched});const tT="AsyncFunction";var rY=e=>!!e&&!!e.validate&&!!(rs(e.validate)&&e.validate.constructor.name===tT||$n(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===tT)),aY=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),nT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Bd=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const l=De(e,s);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],s)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(Bd(d,t))break}else if($n(d)&&Bd(d,t))break}}};function rT(e,t,n){const r=De(e,n);if(r||xg(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const l=s.join("."),c=De(t,l),d=De(e,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:n}}var sY=(e,t,n,r)=>{n(e);const{name:s,...l}=e;return Kr(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||ns.all))},oY=(e,t,n)=>!e||!t||e===t||$d(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),iY=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,lY=(e,t)=>!CS(De(e,t)).length&&Fn(e,t),cY=(e,t,n)=>{const r=$d(De(e,n));return $t(r,"root",t[n]),$t(e,n,r),e};function aT(e,t,n="validate"){if(ha(e)||Array.isArray(e)&&e.every(ha)||ca(e)&&!e)return{type:n,message:ha(e)?e:"",ref:t}}var kc=e=>$n(e)&&!Ep(e)?e:{value:e,message:""},sT=async(e,t,n,r,s,l)=>{const{ref:c,refs:d,required:h,maxLength:m,minLength:g,min:v,max:x,pattern:b,validate:w,name:C,valueAsNumber:E,mount:R}=e._f,T=De(n,C);if(!R||t.has(C))return{};const j=d?d[0]:c,O=W=>{s&&j.reportValidity&&(j.setCustomValidity(ca(W)?"":W||""),j.reportValidity())},D={},N=_S(c),A=Hf(c),k=N||A,V=(E||jS(c))&&Sn(c.value)&&Sn(T)||wp(c)&&c.value===""||T===""||Array.isArray(T)&&!T.length,q=TS.bind(null,C,r,D),H=(W,re,G,Q=fo.maxLength,I=fo.minLength)=>{const Y=W?re:G;D[C]={type:W?Q:I,message:Y,ref:c,...q(W?Q:I,Y)}};if(l?!Array.isArray(T)||!T.length:h&&(!k&&(V||Zr(T))||ca(T)&&!T||A&&!eD(d).isValid||N&&!nD(d).isValid)){const{value:W,message:re}=ha(h)?{value:!!h,message:h}:kc(h);if(W&&(D[C]={type:fo.required,message:re,ref:j,...q(fo.required,re)},!r))return O(re),D}if(!V&&(!Zr(v)||!Zr(x))){let W,re;const G=kc(x),Q=kc(v);if(!Zr(T)&&!isNaN(T)){const I=c.valueAsNumber||T&&+T;Zr(G.value)||(W=I>G.value),Zr(Q.value)||(re=I<Q.value)}else{const I=c.valueAsDate||new Date(T),Y=be=>new Date(new Date().toDateString()+" "+be),B=c.type=="time",oe=c.type=="week";ha(G.value)&&T&&(W=B?Y(T)>Y(G.value):oe?T>G.value:I>new Date(G.value)),ha(Q.value)&&T&&(re=B?Y(T)<Y(Q.value):oe?T<Q.value:I<new Date(Q.value))}if((W||re)&&(H(!!W,G.message,Q.message,fo.max,fo.min),!r))return O(D[C].message),D}if((m||g)&&!V&&(ha(T)||l&&Array.isArray(T))){const W=kc(m),re=kc(g),G=!Zr(W.value)&&T.length>+W.value,Q=!Zr(re.value)&&T.length<+re.value;if((G||Q)&&(H(G,W.message,re.message),!r))return O(D[C].message),D}if(b&&!V&&ha(T)){const{value:W,message:re}=kc(b);if(Ep(W)&&!T.match(W)&&(D[C]={type:fo.pattern,message:re,ref:c,...q(fo.pattern,re)},!r))return O(re),D}if(w){if(rs(w)){const W=await w(T,n),re=aT(W,j);if(re&&(D[C]={...re,...q(fo.validate,re.message)},!r))return O(re.message),D}else if($n(w)){let W={};for(const re in w){if(!Kr(W)&&!r)break;const G=aT(await w[re](T,n),j,re);G&&(W={...G,...q(re,G.message)},O(G.message),r&&(D[C]=W))}if(!Kr(W)&&(D[C]={ref:j,...W},!r))return D}}return O(!0),D};const uY={mode:ns.onSubmit,reValidateMode:ns.onChange,shouldFocusError:!0};function dY(e={}){let t={...uY,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:rs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=$n(t.defaultValues)||$n(t.values)?Qn(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:Qn(s),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},h,m=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...g};const x={array:Y2(),state:Y2()},b=t.criteriaMode===ns.all,w=z=>J=>{clearTimeout(m),m=setTimeout(z,J)},C=async z=>{if(!t.disabled&&(g.isValid||v.isValid||z)){const J=t.resolver?Kr((await A()).errors):await V(r,!0);J!==n.isValid&&x.state.next({isValid:J})}},E=(z,J)=>{!t.disabled&&(g.isValidating||g.validatingFields||v.isValidating||v.validatingFields)&&((z||Array.from(d.mount)).forEach(de=>{de&&(J?$t(n.validatingFields,de,J):Fn(n.validatingFields,de))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Kr(n.validatingFields)}))},R=(z,J=[],de,Ne,ye=!0,Ce=!0)=>{if(Ne&&de&&!t.disabled){if(c.action=!0,Ce&&Array.isArray(De(r,z))){const Le=de(De(r,z),Ne.argA,Ne.argB);ye&&$t(r,z,Le)}if(Ce&&Array.isArray(De(n.errors,z))){const Le=de(De(n.errors,z),Ne.argA,Ne.argB);ye&&$t(n.errors,z,Le),lY(n.errors,z)}if((g.touchedFields||v.touchedFields)&&Ce&&Array.isArray(De(n.touchedFields,z))){const Le=de(De(n.touchedFields,z),Ne.argA,Ne.argB);ye&&$t(n.touchedFields,z,Le)}(g.dirtyFields||v.dirtyFields)&&(n.dirtyFields=Fc(s,l)),x.state.next({name:z,isDirty:H(z,J),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $t(l,z,J)},T=(z,J)=>{$t(n.errors,z,J),x.state.next({errors:n.errors})},j=z=>{n.errors=z,x.state.next({errors:n.errors,isValid:!1})},O=(z,J,de,Ne)=>{const ye=De(r,z);if(ye){const Ce=De(l,z,Sn(de)?De(s,z):de);Sn(Ce)||Ne&&Ne.defaultChecked||J?$t(l,z,J?Ce:J2(ye._f)):G(z,Ce),c.mount&&C()}},D=(z,J,de,Ne,ye)=>{let Ce=!1,Le=!1;const at={name:z};if(!t.disabled){if(!de||Ne){(g.isDirty||v.isDirty)&&(Le=n.isDirty,n.isDirty=at.isDirty=H(),Ce=Le!==at.isDirty);const ht=yo(De(s,z),J);Le=!!De(n.dirtyFields,z),ht?Fn(n.dirtyFields,z):$t(n.dirtyFields,z,!0),at.dirtyFields=n.dirtyFields,Ce=Ce||(g.dirtyFields||v.dirtyFields)&&Le!==!ht}if(de){const ht=De(n.touchedFields,z);ht||($t(n.touchedFields,z,de),at.touchedFields=n.touchedFields,Ce=Ce||(g.touchedFields||v.touchedFields)&&ht!==de)}Ce&&ye&&x.state.next(at)}return Ce?at:{}},N=(z,J,de,Ne)=>{const ye=De(n.errors,z),Ce=(g.isValid||v.isValid)&&ca(J)&&n.isValid!==J;if(t.delayError&&de?(h=w(()=>T(z,de)),h(t.delayError)):(clearTimeout(m),h=null,de?$t(n.errors,z,de):Fn(n.errors,z)),(de?!yo(ye,de):ye)||!Kr(Ne)||Ce){const Le={...Ne,...Ce&&ca(J)?{isValid:J}:{},errors:n.errors,name:z};n={...n,...Le},x.state.next(Le)}},A=async z=>{E(z,!0);const J=await t.resolver(l,t.context,nY(z||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(z),J},k=async z=>{const{errors:J}=await A(z);if(z)for(const de of z){const Ne=De(J,de);Ne?$t(n.errors,de,Ne):Fn(n.errors,de)}else n.errors=J;return J},V=async(z,J,de={valid:!0})=>{for(const Ne in z){const ye=z[Ne];if(ye){const{_f:Ce,...Le}=ye;if(Ce){const at=d.array.has(Ce.name),ht=ye._f&&rY(ye._f);ht&&g.validatingFields&&E([Ce.name],!0);const gn=await sT(ye,d.disabled,l,b,t.shouldUseNativeValidation&&!J,at);if(ht&&g.validatingFields&&E([Ce.name]),gn[Ce.name]&&(de.valid=!1,J))break;!J&&(De(gn,Ce.name)?at?cY(n.errors,gn,Ce.name):$t(n.errors,Ce.name,gn[Ce.name]):Fn(n.errors,Ce.name))}!Kr(Le)&&await V(Le,J,de)}}return de.valid},q=()=>{for(const z of d.unMount){const J=De(r,z);J&&(J._f.refs?J._f.refs.every(de=>!Dx(de)):!Dx(J._f.ref))&&ue(z)}d.unMount=new Set},H=(z,J)=>!t.disabled&&(z&&J&&$t(l,z,J),!yo(be(),s)),W=(z,J,de)=>W4(z,d,{...c.mount?l:Sn(J)?s:ha(z)?{[z]:J}:J},de,J),re=z=>CS(De(c.mount?l:s,z,t.shouldUnregister?De(s,z,[]):[])),G=(z,J,de={})=>{const Ne=De(r,z);let ye=J;if(Ne){const Ce=Ne._f;Ce&&(!Ce.disabled&&$t(l,z,tD(J,Ce)),ye=wp(Ce.ref)&&Zr(J)?"":J,X4(Ce.ref)?[...Ce.ref.options].forEach(Le=>Le.selected=ye.includes(Le.value)):Ce.refs?Hf(Ce.ref)?Ce.refs.forEach(Le=>{(!Le.defaultChecked||!Le.disabled)&&(Array.isArray(ye)?Le.checked=!!ye.find(at=>at===Le.value):Le.checked=ye===Le.value||!!ye)}):Ce.refs.forEach(Le=>Le.checked=Le.value===ye):jS(Ce.ref)?Ce.ref.value="":(Ce.ref.value=ye,Ce.ref.type||x.state.next({name:z,values:Qn(l)})))}(de.shouldDirty||de.shouldTouch)&&D(z,ye,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&oe(z)},Q=(z,J,de)=>{for(const Ne in J){if(!J.hasOwnProperty(Ne))return;const ye=J[Ne],Ce=z+"."+Ne,Le=De(r,Ce);(d.array.has(z)||$n(ye)||Le&&!Le._f)&&!vl(ye)?Q(Ce,ye,de):G(Ce,ye,de)}},I=(z,J,de={})=>{const Ne=De(r,z),ye=d.array.has(z),Ce=Qn(J);$t(l,z,Ce),ye?(x.array.next({name:z,values:Qn(l)}),(g.isDirty||g.dirtyFields||v.isDirty||v.dirtyFields)&&de.shouldDirty&&x.state.next({name:z,dirtyFields:Fc(s,l),isDirty:H(z,Ce)})):Ne&&!Ne._f&&!Zr(Ce)?Q(z,Ce,de):G(z,Ce,de),nT(z,d)&&x.state.next({...n,name:z}),x.state.next({name:c.mount?z:void 0,values:Qn(l)})},Y=async z=>{c.mount=!0;const J=z.target;let de=J.name,Ne=!0;const ye=De(r,de),Ce=ht=>{Ne=Number.isNaN(ht)||vl(ht)&&isNaN(ht.getTime())||yo(ht,De(l,de,ht))},Le=eT(t.mode),at=eT(t.reValidateMode);if(ye){let ht,gn;const Fr=J.type?J2(ye._f):G4(z),Rn=z.type===Cp.BLUR||z.type===Cp.FOCUS_OUT,xr=!aY(ye._f)&&!t.resolver&&!De(n.errors,de)&&!ye._f.deps||iY(Rn,De(n.touchedFields,de),n.isSubmitted,at,Le),zr=nT(de,d,Rn);$t(l,de,Fr),Rn?(!J||!J.readOnly)&&(ye._f.onBlur&&ye._f.onBlur(z),h&&h(0)):ye._f.onChange&&ye._f.onChange(z);const vn=D(de,Fr,Rn),dr=!Kr(vn)||zr;if(!Rn&&x.state.next({name:de,type:z.type,values:Qn(l)}),xr)return(g.isValid||v.isValid)&&(t.mode==="onBlur"?Rn&&C():Rn||C()),dr&&x.state.next({name:de,...zr?{}:vn});if(!Rn&&zr&&x.state.next({...n}),t.resolver){const{errors:Tn}=await A([de]);if(Ce(Fr),Ne){const ko=rT(n.errors,r,de),Ra=rT(Tn,r,ko.name||de);ht=Ra.error,de=Ra.name,gn=Kr(Tn)}}else E([de],!0),ht=(await sT(ye,d.disabled,l,b,t.shouldUseNativeValidation))[de],E([de]),Ce(Fr),Ne&&(ht?gn=!1:(g.isValid||v.isValid)&&(gn=await V(r,!0)));Ne&&(ye._f.deps&&(!Array.isArray(ye._f.deps)||ye._f.deps.length>0)&&oe(ye._f.deps),N(de,gn,ht,vn))}},B=(z,J)=>{if(De(n.errors,J)&&z.focus)return z.focus(),1},oe=async(z,J={})=>{let de,Ne;const ye=$d(z);if(t.resolver){const Ce=await k(Sn(z)?z:ye);de=Kr(Ce),Ne=z?!ye.some(Le=>De(Ce,Le)):de}else z?(Ne=(await Promise.all(ye.map(async Ce=>{const Le=De(r,Ce);return await V(Le&&Le._f?{[Ce]:Le}:Le)}))).every(Boolean),!(!Ne&&!n.isValid)&&C()):Ne=de=await V(r);return x.state.next({...!ha(z)||(g.isValid||v.isValid)&&de!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:de}:{},errors:n.errors}),J.shouldFocus&&!Ne&&Bd(r,B,z?ye:d.mount),Ne},be=(z,J)=>{let de={...c.mount?l:s};return J&&(de=Q4(J.dirtyFields?n.dirtyFields:n.touchedFields,de)),Sn(z)?de:ha(z)?De(de,z):z.map(Ne=>De(de,Ne))},L=(z,J)=>({invalid:!!De((J||n).errors,z),isDirty:!!De((J||n).dirtyFields,z),error:De((J||n).errors,z),isValidating:!!De(n.validatingFields,z),isTouched:!!De((J||n).touchedFields,z)}),P=z=>{z&&$d(z).forEach(J=>Fn(n.errors,J)),x.state.next({errors:z?n.errors:{}})},K=(z,J,de)=>{const Ne=(De(r,z,{_f:{}})._f||{}).ref,ye=De(n.errors,z)||{},{ref:Ce,message:Le,type:at,...ht}=ye;$t(n.errors,z,{...ht,...J,ref:Ne}),x.state.next({name:z,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&Ne&&Ne.focus&&Ne.focus()},ne=(z,J)=>rs(z)?x.state.subscribe({next:de=>"values"in de&&z(W(void 0,J),de)}):W(z,J,!0),fe=z=>x.state.subscribe({next:J=>{oY(z.name,J.name,z.exact)&&sY(J,z.formState||g,sn,z.reRenderRoot)&&z.callback({values:{...l},...n,...J,defaultValues:s})}}).unsubscribe,ge=z=>(c.mount=!0,v={...v,...z.formState},fe({...z,formState:v})),ue=(z,J={})=>{for(const de of z?$d(z):d.mount)d.mount.delete(de),d.array.delete(de),J.keepValue||(Fn(r,de),Fn(l,de)),!J.keepError&&Fn(n.errors,de),!J.keepDirty&&Fn(n.dirtyFields,de),!J.keepTouched&&Fn(n.touchedFields,de),!J.keepIsValidating&&Fn(n.validatingFields,de),!t.shouldUnregister&&!J.keepDefaultValue&&Fn(s,de);x.state.next({values:Qn(l)}),x.state.next({...n,...J.keepDirty?{isDirty:H()}:{}}),!J.keepIsValid&&C()},Ae=({disabled:z,name:J})=>{(ca(z)&&c.mount||z||d.disabled.has(J))&&(z?d.disabled.add(J):d.disabled.delete(J))},Re=(z,J={})=>{let de=De(r,z);const Ne=ca(J.disabled)||ca(t.disabled);return $t(r,z,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:z}},name:z,mount:!0,...J}}),d.mount.add(z),de?Ae({disabled:ca(J.disabled)?J.disabled:t.disabled,name:z}):O(z,!0,J.value),{...Ne?{disabled:J.disabled||t.disabled}:{},...t.progressive?{required:!!J.required,min:Dd(J.min),max:Dd(J.max),minLength:Dd(J.minLength),maxLength:Dd(J.maxLength),pattern:Dd(J.pattern)}:{},name:z,onChange:Y,onBlur:Y,ref:ye=>{if(ye){Re(z,J),de=De(r,z);const Ce=Sn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Le=XZ(Ce),at=de._f.refs||[];if(Le?at.find(ht=>ht===Ce):Ce===de._f.ref)return;$t(r,z,{_f:{...de._f,...Le?{refs:[...at.filter(Dx),Ce,...Array.isArray(De(s,z))?[{}]:[]],ref:{type:Ce.type,name:z}}:{ref:Ce}}}),O(z,!1,void 0,Ce)}else de=De(r,z,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||J.shouldUnregister)&&!(q4(d.array,z)&&c.action)&&d.unMount.add(z)}}},xe=()=>t.shouldFocusError&&Bd(r,B,d.mount),Je=z=>{ca(z)&&(x.state.next({disabled:z}),Bd(r,(J,de)=>{const Ne=De(r,de);Ne&&(J.disabled=Ne._f.disabled||z,Array.isArray(Ne._f.refs)&&Ne._f.refs.forEach(ye=>{ye.disabled=Ne._f.disabled||z}))},0,!1))},Qe=(z,J)=>async de=>{let Ne;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let ye=Qn(l);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Ce,values:Le}=await A();n.errors=Ce,ye=Qn(Le)}else await V(r);if(d.disabled.size)for(const Ce of d.disabled)Fn(ye,Ce);if(Fn(n.errors,"root"),Kr(n.errors)){x.state.next({errors:{}});try{await z(ye,de)}catch(Ce){Ne=Ce}}else J&&await J({...n.errors},de),xe(),setTimeout(xe);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Kr(n.errors)&&!Ne,submitCount:n.submitCount+1,errors:n.errors}),Ne)throw Ne},zt=(z,J={})=>{De(r,z)&&(Sn(J.defaultValue)?I(z,Qn(De(s,z))):(I(z,J.defaultValue),$t(s,z,Qn(J.defaultValue))),J.keepTouched||Fn(n.touchedFields,z),J.keepDirty||(Fn(n.dirtyFields,z),n.isDirty=J.defaultValue?H(z,Qn(De(s,z))):H()),J.keepError||(Fn(n.errors,z),g.isValid&&C()),x.state.next({...n}))},Te=(z,J={})=>{const de=z?Qn(z):s,Ne=Qn(de),ye=Kr(z),Ce=ye?s:Ne;if(J.keepDefaultValues||(s=de),!J.keepValues){if(J.keepDirtyValues){const Le=new Set([...d.mount,...Object.keys(Fc(s,l))]);for(const at of Array.from(Le))De(n.dirtyFields,at)?$t(Ce,at,De(l,at)):I(at,De(Ce,at))}else{if(SS&&Sn(z))for(const Le of d.mount){const at=De(r,Le);if(at&&at._f){const ht=Array.isArray(at._f.refs)?at._f.refs[0]:at._f.ref;if(wp(ht)){const gn=ht.closest("form");if(gn){gn.reset();break}}}}if(J.keepFieldsRef)for(const Le of d.mount)I(Le,De(Ce,Le));else r={}}l=t.shouldUnregister?J.keepDefaultValues?Qn(s):{}:Qn(Ce),x.array.next({values:{...Ce}}),x.state.next({values:{...Ce}})}d={mount:J.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!J.keepIsValid||!!J.keepDirtyValues,c.watch=!!t.shouldUnregister,x.state.next({submitCount:J.keepSubmitCount?n.submitCount:0,isDirty:ye?!1:J.keepDirty?n.isDirty:!!(J.keepDefaultValues&&!yo(z,s)),isSubmitted:J.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ye?{}:J.keepDirtyValues?J.keepDefaultValues&&l?Fc(s,l):n.dirtyFields:J.keepDefaultValues&&z?Fc(s,z):J.keepDirty?n.dirtyFields:{},touchedFields:J.keepTouched?n.touchedFields:{},errors:J.keepErrors?n.errors:{},isSubmitSuccessful:J.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},ft=(z,J)=>Te(rs(z)?z(l):z,J),lt=(z,J={})=>{const de=De(r,z),Ne=de&&de._f;if(Ne){const ye=Ne.refs?Ne.refs[0]:Ne.ref;ye.focus&&(ye.focus(),J.shouldSelect&&rs(ye.select)&&ye.select())}},sn=z=>{n={...n,...z}},ur={control:{register:Re,unregister:ue,getFieldState:L,handleSubmit:Qe,setError:K,_subscribe:fe,_runSchema:A,_focusError:xe,_getWatch:W,_getDirty:H,_setValid:C,_setFieldArray:R,_setDisabledField:Ae,_setErrors:j,_getFieldArray:re,_reset:Te,_resetDefaultValues:()=>rs(t.defaultValues)&&t.defaultValues().then(z=>{ft(z,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:q,_disableForm:Je,_subjects:x,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(z){c=z},get _defaultValues(){return s},get _names(){return d},set _names(z){d=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:ge,trigger:oe,register:Re,handleSubmit:Qe,watch:ne,setValue:I,getValues:be,reset:ft,resetField:zt,clearErrors:P,unregister:ue,setError:K,setFocus:lt,getFieldState:L};return{...ur,formControl:ur}}function Vi(e={}){const t=_e.useRef(void 0),n=_e.useRef(void 0),[r,s]=_e.useState({isDirty:!1,isValidating:!1,isLoading:rs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:rs(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!rs(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=dY(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,RS(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>s({...l._formState}),reRenderRoot:!0});return s(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),_e.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),_e.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),_e.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),_e.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),_e.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),_e.useEffect(()=>{e.values&&!yo(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,s(c=>({...c}))):l._resetDefaultValues()},[l,e.values]),_e.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=Z4(r,l),t.current}var fY="Label",rD=p.forwardRef((e,t)=>o.jsx(Ye.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));rD.displayName=fY;var hY=rD;function xa({className:e,...t}){return o.jsx(hY,{"data-slot":"label",className:ie("flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Bl=K4,aD=p.createContext({}),Zt=({...e})=>o.jsx(aD.Provider,{value:{name:e.name},children:o.jsx(QZ,{...e})}),$f=()=>{const e=p.useContext(aD),t=p.useContext(sD),{getFieldState:n}=Nu(),r=Y4({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...s}},sD=p.createContext({});function Yt({className:e="",...t}){const n=p.useId();return o.jsx(sD.Provider,{value:{id:n},children:o.jsx("div",{"data-slot":"form-item",className:ie("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",e),...t})})}function Wt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:l,formItemId:c}=$f();return o.jsxs(xa,{"data-slot":"form-label","data-error":!!l,className:ie("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[o.jsx("span",{children:r}),t&&o.jsxs(jt,{...n,children:[o.jsx(_t,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:o.jsx(Lr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(Nt,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function Qt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=$f();return o.jsx(Lp,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function er({className:e,...t}){const{formDescriptionId:n}=$f();return o.jsx("div",{"data-slot":"form-description",id:n,className:ie("text-muted-foreground text-sm",e),...t})}function nn({className:e,...t}){const{error:n,formMessageId:r}=$f(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?o.jsx("p",{"data-slot":"form-message",id:r,className:ie("text-destructive text-sm",e),...t,children:s}):null}function Gl({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return o.jsx("div",{className:r,children:o.jsx("div",{className:ie("flex min-h-full flex-col gap-4",t),children:e})})}function ql({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return o.jsx("div",{className:ie(r,e),children:t})}function Fs({title:e,children:t}){return o.jsxs("section",{className:"mb-4",children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function mY({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=$f();return o.jsxs("label",{htmlFor:`${d}-${e}`,className:ie("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",l==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[o.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:ie("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),o.jsx("span",{className:ie("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function pY({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return o.jsx("div",{tabIndex:-1,className:ie(r==="horizontal"?"flex gap-6":"flex flex-col gap-2","border-input rounded-md border bg-transparent px-1 py-1 transition-colors","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]","text-foreground selection:bg-primary selection:text-primary-foreground","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",s),children:e.map(l=>o.jsx(mY,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const Hi=p.forwardRef(({children:e,className:t="",...n},r)=>o.jsx("form",{ref:r,className:ie("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Hi.displayName="AppForm";function oT(e,[t,n]){return Math.min(n,Math.max(t,e))}function NS(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var gY=[" ","Enter","ArrowUp","ArrowDown"],vY=[" ","Enter"],Ol="Select",[bg,Sg,yY]=eg(Ol),[Au]=Ur(Ol,[yY,Hs]),Cg=Hs(),[xY,$i]=Au(Ol),[bY,SY]=Au(Ol),oD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:h,dir:m,name:g,autoComplete:v,disabled:x,required:b,form:w}=e,C=Cg(t),[E,R]=p.useState(null),[T,j]=p.useState(null),[O,D]=p.useState(!1),N=tg(m),[A,k]=Xr({prop:r,defaultProp:s??!1,onChange:l,caller:Ol}),[V,q]=Xr({prop:c,defaultProp:d,onChange:h,caller:Ol}),H=p.useRef(null),W=E?w||!!E.closest("form"):!0,[re,G]=p.useState(new Set),Q=Array.from(re).map(I=>I.props.value).join(";");return o.jsx(xu,{...C,children:o.jsxs(xY,{required:b,scope:t,trigger:E,onTriggerChange:R,valueNode:T,onValueNodeChange:j,valueNodeHasChildren:O,onValueNodeHasChildrenChange:D,contentId:Mn(),value:V,onValueChange:q,open:A,onOpenChange:k,dir:N,triggerPointerDownPosRef:H,disabled:x,children:[o.jsx(bg.Provider,{scope:t,children:o.jsx(bY,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(I=>{G(Y=>new Set(Y).add(I))},[]),onNativeOptionRemove:p.useCallback(I=>{G(Y=>{const B=new Set(Y);return B.delete(I),B})},[]),children:n})}),W?o.jsxs(AD,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:v,value:V,onChange:I=>q(I.target.value),disabled:x,form:w,children:[V===void 0?o.jsx("option",{value:""}):null,Array.from(re)]},Q):null]})})};oD.displayName=Ol;var iD="SelectTrigger",lD=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=Cg(n),c=$i(iD,n),d=c.disabled||r,h=vt(t,c.onTriggerChange),m=Sg(n),g=p.useRef("touch"),[v,x,b]=OD(C=>{const E=m().filter(j=>!j.disabled),R=E.find(j=>j.value===c.value),T=MD(E,C,R);T!==void 0&&c.onValueChange(T.value)}),w=C=>{d||(c.onOpenChange(!0),b()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return o.jsx(bu,{asChild:!0,...l,children:o.jsx(Ye.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":DD(c.value)?"":void 0,...s,ref:h,onClick:je(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&w(C)}),onPointerDown:je(s.onPointerDown,C=>{g.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:je(s.onKeyDown,C=>{const E=v.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(E&&C.key===" ")&&gY.includes(C.key)&&(w(),C.preventDefault())})})})});lD.displayName=iD;var cD="SelectValue",uD=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:c="",...d}=e,h=$i(cD,n),{onValueNodeHasChildrenChange:m}=h,g=l!==void 0,v=vt(t,h.onValueNodeChange);return yr(()=>{m(g)},[m,g]),o.jsx(Ye.span,{...d,ref:v,style:{pointerEvents:"none"},children:DD(h.value)?o.jsx(o.Fragment,{children:c}):l})});uD.displayName=cD;var CY="SelectIcon",dD=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(Ye.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});dD.displayName=CY;var wY="SelectPortal",fD=e=>o.jsx(Ul,{asChild:!0,...e});fD.displayName=wY;var Ml="SelectContent",hD=p.forwardRef((e,t)=>{const n=$i(Ml,e.__scopeSelect),[r,s]=p.useState();if(yr(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?as.createPortal(o.jsx(mD,{scope:e.__scopeSelect,children:o.jsx(bg.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),l):null}return o.jsx(pD,{...e,ref:t})});hD.displayName=Ml;var Ja=10,[mD,Bi]=Au(Ml),EY="SelectContentImpl",RY=wi("SelectContent.RemoveScroll"),pD=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:h,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E,...R}=e,T=$i(Ml,n),[j,O]=p.useState(null),[D,N]=p.useState(null),A=vt(t,ue=>O(ue)),[k,V]=p.useState(null),[q,H]=p.useState(null),W=Sg(n),[re,G]=p.useState(!1),Q=p.useRef(!1);p.useEffect(()=>{if(j)return Vp(j)},[j]),Fp();const I=p.useCallback(ue=>{const[Ae,...Re]=W().map(Qe=>Qe.ref.current),[xe]=Re.slice(-1),Je=document.activeElement;for(const Qe of ue)if(Qe===Je||(Qe==null||Qe.scrollIntoView({block:"nearest"}),Qe===Ae&&D&&(D.scrollTop=0),Qe===xe&&D&&(D.scrollTop=D.scrollHeight),Qe==null||Qe.focus(),document.activeElement!==Je))return},[W,D]),Y=p.useCallback(()=>I([k,j]),[I,k,j]);p.useEffect(()=>{re&&Y()},[re,Y]);const{onOpenChange:B,triggerPointerDownPosRef:oe}=T;p.useEffect(()=>{if(j){let ue={x:0,y:0};const Ae=xe=>{var Je,Qe;ue={x:Math.abs(Math.round(xe.pageX)-(((Je=oe.current)==null?void 0:Je.x)??0)),y:Math.abs(Math.round(xe.pageY)-(((Qe=oe.current)==null?void 0:Qe.y)??0))}},Re=xe=>{ue.x<=10&&ue.y<=10?xe.preventDefault():j.contains(xe.target)||B(!1),document.removeEventListener("pointermove",Ae),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",Re,{capture:!0})}}},[j,B,oe]),p.useEffect(()=>{const ue=()=>B(!1);return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[B]);const[be,L]=OD(ue=>{const Ae=W().filter(Je=>!Je.disabled),Re=Ae.find(Je=>Je.ref.current===document.activeElement),xe=MD(Ae,ue,Re);xe&&setTimeout(()=>xe.ref.current.focus())}),P=p.useCallback((ue,Ae,Re)=>{const xe=!Q.current&&!Re;(T.value!==void 0&&T.value===Ae||xe)&&(V(ue),xe&&(Q.current=!0))},[T.value]),K=p.useCallback(()=>j==null?void 0:j.focus(),[j]),ne=p.useCallback((ue,Ae,Re)=>{const xe=!Q.current&&!Re;(T.value!==void 0&&T.value===Ae||xe)&&H(ue)},[T.value]),fe=r==="popper"?O0:gD,ge=fe===O0?{side:d,sideOffset:h,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E}:{};return o.jsx(mD,{scope:n,content:j,viewport:D,onViewportChange:N,itemRefCallback:P,selectedItem:k,onItemLeave:K,itemTextRefCallback:ne,focusSelectedItem:Y,selectedItemText:q,position:r,isPositioned:re,searchRef:be,children:o.jsx(Cf,{as:RY,allowPinchZoom:!0,children:o.jsx(Sf,{asChild:!0,trapped:T.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:je(s,ue=>{var Ae;(Ae=T.trigger)==null||Ae.focus({preventScroll:!0}),ue.preventDefault()}),children:o.jsx(Pl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(fe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ue=>ue.preventDefault(),...R,...ge,onPlaced:()=>G(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:je(R.onKeyDown,ue=>{const Ae=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!Ae&&ue.key.length===1&&L(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let xe=W().filter(Je=>!Je.disabled).map(Je=>Je.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const Je=ue.target,Qe=xe.indexOf(Je);xe=xe.slice(Qe+1)}setTimeout(()=>I(xe)),ue.preventDefault()}})})})})})})});pD.displayName=EY;var TY="SelectItemAlignedPosition",gD=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=$i(Ml,n),c=Bi(Ml,n),[d,h]=p.useState(null),[m,g]=p.useState(null),v=vt(t,A=>g(A)),x=Sg(n),b=p.useRef(!1),w=p.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=c,j=p.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&C&&E&&R){const A=l.trigger.getBoundingClientRect(),k=m.getBoundingClientRect(),V=l.valueNode.getBoundingClientRect(),q=R.getBoundingClientRect();if(l.dir!=="rtl"){const Je=q.left-k.left,Qe=V.left-Je,zt=A.left-Qe,Te=A.width+zt,ft=Math.max(Te,k.width),lt=window.innerWidth-Ja,sn=oT(Qe,[Ja,Math.max(Ja,lt-ft)]);d.style.minWidth=Te+"px",d.style.left=sn+"px"}else{const Je=k.right-q.right,Qe=window.innerWidth-V.right-Je,zt=window.innerWidth-A.right-Qe,Te=A.width+zt,ft=Math.max(Te,k.width),lt=window.innerWidth-Ja,sn=oT(Qe,[Ja,Math.max(Ja,lt-ft)]);d.style.minWidth=Te+"px",d.style.right=sn+"px"}const H=x(),W=window.innerHeight-Ja*2,re=C.scrollHeight,G=window.getComputedStyle(m),Q=parseInt(G.borderTopWidth,10),I=parseInt(G.paddingTop,10),Y=parseInt(G.borderBottomWidth,10),B=parseInt(G.paddingBottom,10),oe=Q+I+re+B+Y,be=Math.min(E.offsetHeight*5,oe),L=window.getComputedStyle(C),P=parseInt(L.paddingTop,10),K=parseInt(L.paddingBottom,10),ne=A.top+A.height/2-Ja,fe=W-ne,ge=E.offsetHeight/2,ue=E.offsetTop+ge,Ae=Q+I+ue,Re=oe-Ae;if(Ae<=ne){const Je=H.length>0&&E===H[H.length-1].ref.current;d.style.bottom="0px";const Qe=m.clientHeight-C.offsetTop-C.offsetHeight,zt=Math.max(fe,ge+(Je?K:0)+Qe+Y),Te=Ae+zt;d.style.height=Te+"px"}else{const Je=H.length>0&&E===H[0].ref.current;d.style.top="0px";const zt=Math.max(ne,Q+C.offsetTop+(Je?P:0)+ge)+Re;d.style.height=zt+"px",C.scrollTop=Ae-ne+C.offsetTop}d.style.margin=`${Ja}px 0`,d.style.minHeight=be+"px",d.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[x,l.trigger,l.valueNode,d,m,C,E,R,l.dir,r]);yr(()=>j(),[j]);const[O,D]=p.useState();yr(()=>{m&&D(window.getComputedStyle(m).zIndex)},[m]);const N=p.useCallback(A=>{A&&w.current===!0&&(j(),T==null||T(),w.current=!1)},[j,T]);return o.jsx(_Y,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:N,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:o.jsx(Ye.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});gD.displayName=TY;var jY="SelectPopperPosition",O0=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ja,...l}=e,c=Cg(n);return o.jsx(Ef,{...c,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.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)"}})});O0.displayName=jY;var[_Y,AS]=Au(Ml,{}),M0="SelectViewport",vD=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=Bi(M0,n),c=AS(M0,n),d=vt(t,l.onViewportChange),h=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(bg.Slot,{scope:n,children:o.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:je(s.onScroll,m=>{const g=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&v){const b=Math.abs(h.current-g.scrollTop);if(b>0){const w=window.innerHeight-Ja*2,C=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(C,E);if(R<w){const T=R+b,j=Math.min(w,T),O=T-j;v.style.height=j+"px",v.style.bottom==="0px"&&(g.scrollTop=O>0?O:0,v.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});vD.displayName=M0;var yD="SelectGroup",[NY,AY]=Au(yD),xD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Mn();return o.jsx(NY,{scope:n,id:s,children:o.jsx(Ye.div,{role:"group","aria-labelledby":s,...r,ref:t})})});xD.displayName=yD;var bD="SelectLabel",DY=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=AY(bD,n);return o.jsx(Ye.div,{id:s.id,...r,ref:t})});DY.displayName=bD;var Rp="SelectItem",[OY,SD]=Au(Rp),CD=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...c}=e,d=$i(Rp,n),h=Bi(Rp,n),m=d.value===r,[g,v]=p.useState(l??""),[x,b]=p.useState(!1),w=vt(t,T=>{var j;return(j=h.itemRefCallback)==null?void 0:j.call(h,T,r,s)}),C=Mn(),E=p.useRef("touch"),R=()=>{s||(d.onValueChange(r),d.onOpenChange(!1))};if(r==="")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 o.jsx(OY,{scope:n,value:r,disabled:s,textId:C,isSelected:m,onItemTextChange:p.useCallback(T=>{v(j=>j||((T==null?void 0:T.textContent)??"").trim())},[]),children:o.jsx(bg.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:o.jsx(Ye.div,{role:"option","aria-labelledby":C,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:w,onFocus:je(c.onFocus,()=>b(!0)),onBlur:je(c.onBlur,()=>b(!1)),onClick:je(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:je(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:je(c.onPointerDown,T=>{E.current=T.pointerType}),onPointerMove:je(c.onPointerMove,T=>{var j;E.current=T.pointerType,s?(j=h.onItemLeave)==null||j.call(h):E.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(c.onPointerLeave,T=>{var j;T.currentTarget===document.activeElement&&((j=h.onItemLeave)==null||j.call(h))}),onKeyDown:je(c.onKeyDown,T=>{var O;((O=h.searchRef)==null?void 0:O.current)!==""&&T.key===" "||(vY.includes(T.key)&&R(),T.key===" "&&T.preventDefault())})})})})});CD.displayName=Rp;var Fd="SelectItemText",wD=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,c=$i(Fd,n),d=Bi(Fd,n),h=SD(Fd,n),m=SY(Fd,n),[g,v]=p.useState(null),x=vt(t,R=>v(R),h.onItemTextChange,R=>{var T;return(T=d.itemTextRefCallback)==null?void 0:T.call(d,R,h.value,h.disabled)}),b=g==null?void 0:g.textContent,w=p.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=m;return yr(()=>(C(w),()=>E(w)),[C,E,w]),o.jsxs(o.Fragment,{children:[o.jsx(Ye.span,{id:h.textId,...l,ref:x}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?as.createPortal(l.children,c.valueNode):null]})});wD.displayName=Fd;var ED="SelectItemIndicator",RD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return SD(ED,n).isSelected?o.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});RD.displayName=ED;var k0="SelectScrollUpButton",TD=p.forwardRef((e,t)=>{const n=Bi(k0,e.__scopeSelect),r=AS(k0,e.__scopeSelect),[s,l]=p.useState(!1),c=vt(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=h.scrollTop>0;l(m)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(_D,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});TD.displayName=k0;var I0="SelectScrollDownButton",jD=p.forwardRef((e,t)=>{const n=Bi(I0,e.__scopeSelect),r=AS(I0,e.__scopeSelect),[s,l]=p.useState(!1),c=vt(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<m;l(g)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(_D,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});jD.displayName=I0;var _D=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=Bi("SelectScrollButton",n),c=p.useRef(null),d=Sg(n),h=p.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return p.useEffect(()=>()=>h(),[h]),yr(()=>{var g;const m=d().find(v=>v.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),o.jsx(Ye.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:je(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:je(s.onPointerMove,()=>{var m;(m=l.onItemLeave)==null||m.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:je(s.onPointerLeave,()=>{h()})})}),MY="SelectSeparator",ND=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});ND.displayName=MY;var L0="SelectArrow",kY=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Cg(n),l=$i(L0,n),c=Bi(L0,n);return l.open&&c.position==="popper"?o.jsx(Rf,{...s,...r,ref:t}):null});kY.displayName=L0;var IY="SelectBubbleInput",AD=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=p.useRef(null),l=vt(r,s),c=NS(t);return p.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&g){const v=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(v)}},[c,t]),o.jsx(Ye.select,{...n,style:{...H_,...n.style},ref:l,defaultValue:t})});AD.displayName=IY;function DD(e){return e===""||e===void 0}function OD(e){const t=is(e),n=p.useRef(""),r=p.useRef(0),s=p.useCallback(c=>{const d=n.current+c;t(d),(function h(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(d)},[t]),l=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function MD(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=LY(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function LY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PY=oD,UY=lD,FY=uD,zY=dD,VY=fD,HY=hD,$Y=vD,BY=xD,GY=CD,qY=wD,KY=RD,ZY=TD,YY=jD,WY=ND;function ba({...e}){return o.jsx(PY,{"data-slot":"select",...e})}function wg({...e}){return o.jsx(BY,{"data-slot":"select-group",...e})}function Sa({...e}){return o.jsx(FY,{"data-slot":"select-value",...e})}function Ca({className:e,size:t="default",children:n,...r}){return o.jsxs(UY,{"data-slot":"select-trigger","data-size":t,className:ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,o.jsx(zY,{asChild:!0,children:o.jsx(Ga,{className:"size-4 opacity-50"})})]})}function wa({className:e,children:t,position:n="popper",...r}){return o.jsx(VY,{children:o.jsxs(HY,{"data-slot":"select-content",className:ie("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx(XY,{}),o.jsx($Y,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o.jsx(JY,{})]})})}function Hn({className:e,children:t,...n}){return o.jsxs(GY,{"data-slot":"select-item",className:ie("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(KY,{children:o.jsx(ir,{className:"size-4"})})}),o.jsx(qY,{children:t})]})}function QY({className:e,...t}){return o.jsx(WY,{"data-slot":"select-separator",className:ie("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function XY({className:e,...t}){return o.jsx(ZY,{"data-slot":"select-scroll-up-button",className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Ls,{className:"size-4"})})}function JY({className:e,...t}){return o.jsx(YY,{"data-slot":"select-scroll-down-button",className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Ga,{className:"size-4"})})}const eW=en({title:tn().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:tn().min(1,"Storage is required")});function tW(){const{createDataMart:e,isLoading:t,error:n}=zi();return{handleCreate:p.useCallback(async s=>{try{return await e(s)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function nW(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:h,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,reset:b,dataMart:w,isLoading:C,error:E,getErrorMessage:R,runs:T}=zi();return p.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:w,isLoading:C,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:h,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,runs:T}}const iT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},P0=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?iT(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>iT(s,n,e))}},lT=(e,t)=>{t.shouldUseNativeValidation&&P0(e,t);const n={};for(const r in e){const s=De(t.fields,r),l=Object.assign(e[r]||{},{ref:s&&s.ref});if(rW(t.names||Object.keys(e),r)){const c=Object.assign({},De(n,r));$t(c,"root",l),$t(n,r,c)}else $t(n,r,l)}return n},rW=(e,t)=>{const n=cT(t);return e.some(r=>cT(r).match(`^${n}\\.\\d+`))};function cT(e){return e.replace(/\]|\[/g,"")}function kD(e,t,n){function r(d,h){var m;Object.defineProperty(d,"_zod",{value:d._zod??{},enumerable:!1}),(m=d._zod).traits??(m.traits=new Set),d._zod.traits.add(e),t(d,h);for(const g in c.prototype)g in d||Object.defineProperty(d,g,{value:c.prototype[g].bind(d)});d._zod.constr=c,d._zod.def=h}const s=(n==null?void 0:n.Parent)??Object;class l extends s{}Object.defineProperty(l,"name",{value:e});function c(d){var h;const m=n!=null&&n.Parent?new l:this;r(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var h,m;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(m=(h=d==null?void 0:d._zod)==null?void 0:h.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class aW extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const sW={};function ID(e){return sW}function oW(e,t){return typeof t=="bigint"?t.toString():t}const LD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Rm(e){return typeof e=="string"?e:e==null?void 0:e.message}function PD(e,t,n){var s,l,c,d,h,m;const r={...e,path:e.path??[]};if(!e.message){const g=Rm((c=(l=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??Rm((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Rm((h=n.customError)==null?void 0:h.call(n,e))??Rm((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const UD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,oW,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iW=kD("$ZodError",UD),FD=kD("$ZodError",UD,{Parent:Error}),lW=e=>(t,n,r,s)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new aW;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>PD(h,l,ID())));throw LD(d,s==null?void 0:s.callee),d}return c.value},cW=lW(FD),uW=e=>async(t,n,r,s)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>PD(h,l,ID())));throw LD(d,s==null?void 0:s.callee),d}return c.value},dW=uW(FD);function uT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function fW(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var d=r.unionErrors[0].errors[0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(g){return g.errors.forEach(function(v){return e.push(v)})}),t){var h=n[c].types,m=h&&h[r.code];n[c]=TS(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function hW(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var d=r.errors[0][0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(g){return g.forEach(function(v){return e.push(v)})}),t){var h=n[c].types,m=h&&h[r.code];n[c]=TS(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Kl(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,l){try{return Promise.resolve(uT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&P0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return Array.isArray(d==null?void 0:d.issues)})(c))return{values:{},errors:lT(fW(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,l){try{return Promise.resolve(uT(function(){return Promise.resolve((n.mode==="sync"?cW:dW)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&P0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof iW})(c))return{values:{},errors:lT(hW(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const zD=p.createContext(void 0);function mW(){const e=p.useContext(zD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Dt=(e=>(e.FETCH_STORAGES_START="FETCH_STORAGES_START",e.FETCH_STORAGES_SUCCESS="FETCH_STORAGES_SUCCESS",e.FETCH_STORAGES_ERROR="FETCH_STORAGES_ERROR",e.FETCH_STORAGE_START="FETCH_STORAGE_START",e.FETCH_STORAGE_SUCCESS="FETCH_STORAGE_SUCCESS",e.FETCH_STORAGE_ERROR="FETCH_STORAGE_ERROR",e.CLEAR_CURRENT_STORAGE="CLEAR_CURRENT_STORAGE",e.CREATE_STORAGE_START="CREATE_STORAGE_START",e.CREATE_STORAGE_SUCCESS="CREATE_STORAGE_SUCCESS",e.CREATE_STORAGE_ERROR="CREATE_STORAGE_ERROR",e.UPDATE_STORAGE_START="UPDATE_STORAGE_START",e.UPDATE_STORAGE_SUCCESS="UPDATE_STORAGE_SUCCESS",e.UPDATE_STORAGE_ERROR="UPDATE_STORAGE_ERROR",e.DELETE_STORAGE_START="DELETE_STORAGE_START",e.DELETE_STORAGE_SUCCESS="DELETE_STORAGE_SUCCESS",e.DELETE_STORAGE_ERROR="DELETE_STORAGE_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(Dt||{});const pW={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function gW(e,t){switch(t.type){case Dt.FETCH_STORAGES_START:case Dt.FETCH_STORAGE_START:case Dt.CREATE_STORAGE_START:case Dt.UPDATE_STORAGE_START:return{...e,error:null};case Dt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Dt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Dt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Dt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Dt.UPDATE_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,dataStorages:e.dataStorages.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case Dt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Dt.FETCH_STORAGES_ERROR:case Dt.FETCH_STORAGE_ERROR:case Dt.CREATE_STORAGE_ERROR:case Dt.UPDATE_STORAGE_ERROR:case Dt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Dt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Dt.CLEAR_ERROR:return{...e,error:null};default:return e}}function DS({children:e}){const[t,n]=p.useReducer(gW,pW);return o.jsx(zD.Provider,{value:{state:t,dispatch:n},children:e})}class vW extends Vl{constructor(){super("/data-storages")}async getDataStorages(){return this.get("/")}async getDataStorageById(t){return this.get(`/${t}`)}async createDataStorage(t){return this.post("",t)}async updateDataStorage(t,n){return this.put(`/${t}`,n)}async deleteDataStorage(t){return this.delete(`/${t}`)}}const Od=new vW;function Eg(){const{state:e,dispatch:t}=mW(),n=p.useCallback(async()=>{t({type:Dt.FETCH_STORAGES_START});try{const h=await Od.getDataStorages();t({type:Dt.FETCH_STORAGES_SUCCESS,payload:h.map(MZ)})}catch(h){throw t({type:Dt.FETCH_STORAGES_ERROR,payload:mn(h)}),h}},[t]),r=p.useCallback(async h=>{try{const m=await Od.getDataStorageById(h),g=$m(m);t({type:Dt.FETCH_STORAGE_SUCCESS,payload:g})}catch(m){throw t({type:Dt.FETCH_STORAGE_ERROR,payload:mn(m)}),m}},[t]),s=p.useCallback(async h=>{t({type:Dt.CREATE_STORAGE_START});try{const m=kZ(h),g=await Od.createDataStorage(m),v=$m(g);return t({type:Dt.CREATE_STORAGE_SUCCESS,payload:v}),fn.success("Storage created"),v}catch(m){return t({type:Dt.CREATE_STORAGE_ERROR,payload:mn(m)}),null}},[t]),l=p.useCallback(async(h,m)=>{t({type:Dt.UPDATE_STORAGE_START});try{const g=OZ(m),v=await Od.updateDataStorage(h,g),x=$m(v);return t({type:Dt.UPDATE_STORAGE_SUCCESS,payload:x}),fn.success("Storage updated"),x}catch(g){return t({type:Dt.UPDATE_STORAGE_ERROR,payload:mn(g)}),null}},[t]),c=p.useCallback(async h=>{t({type:Dt.DELETE_STORAGE_START});try{await Od.deleteDataStorage(h),t({type:Dt.DELETE_STORAGE_SUCCESS,payload:h}),fn.success("Storage deleted")}catch(m){throw t({type:Dt.DELETE_STORAGE_ERROR,payload:mn(m)}),m}},[t]),d=p.useCallback(()=>{t({type:Dt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}const VD=({isOpen:e,onClose:t,onSelect:n})=>o.jsx(gS,{open:e,onOpenChange:t,children:o.jsxs(vS,{className:"sm:max-w-sm",children:[o.jsxs(yS,{children:[o.jsx(xS,{children:"New Storage"}),o.jsx(bS,{children:"Choose the type of storage you want to create"})]}),o.jsx("div",{className:"flex flex-col gap-4 py-4",children:Fi.getAllTypes().map(r=>{const s=r.icon,l=r.status===vo.ACTIVE;return o.jsxs(we,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[o.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[o.jsx(s,{size:24}),o.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&o.jsx(Er,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})});function yW({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=tW(),{dataStorages:l,loading:c,fetchDataStorages:d,createDataStorage:h,getDataStorageById:m}=Eg(),[g,v]=p.useState(!1);p.useEffect(()=>{d()},[d]);const x=Vi({resolver:Kl(eW),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async E=>{const R=await n(E);R&&t&&t(R)},w=()=>{v(!0)},C=async E=>{try{const R=await h(E);R!=null&&R.id&&(await m(R.id),x.setValue("storageId",R.id))}catch(R){console.error("Failed to create storage:",R)}v(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(Bl,{...x,children:o.jsxs(Hi,{onSubmit:E=>{x.handleSubmit(b)(E)},children:[o.jsxs(Gl,{variant:"light",children:[s&&o.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),o.jsx(Zt,{control:x.control,name:"title",render:({field:E})=>o.jsxs(Yt,{children:[o.jsx(Wt,{children:"Title"}),o.jsx(Qt,{children:o.jsx(Bt,{id:"title",placeholder:"Enter title",...E,disabled:r})}),o.jsx(nn,{})]})}),o.jsx(Zt,{control:x.control,name:"storageId",render:({field:E})=>o.jsxs(Yt,{children:[o.jsx(Wt,{children:"Storage"}),o.jsx(Qt,{children:o.jsxs(ba,{onValueChange:R=>{R==="create_new"?w():E.onChange(R)},value:E.value,disabled:r||c,children:[o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{placeholder:"Select a storage"})}),o.jsx(wa,{children:o.jsxs(wg,{children:[c&&o.jsx(Hn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.map(R=>{const T=Fi.getInfo(R.type).icon;return o.jsx(Hn,{value:R.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T,{size:20}),o.jsx("span",{children:R.title})]})},R.id)}),!c&&l.length>0&&o.jsx(QY,{}),o.jsx(Hn,{value:"create_new",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:o.jsx(Jr,{size:20})}),o.jsx("span",{children:"Create new storage"})]})})]})})]})}),o.jsx(nn,{})]})})]}),o.jsxs(ql,{variant:"light",children:[o.jsx(we,{type:"submit",children:"Create Data Mart"}),o.jsx(we,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),o.jsx(VD,{isOpen:g,onClose:()=>{v(!1)},onSelect:E=>C(E)})]})}function xW({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[l,c]=p.useState(e),[d,h]=p.useState(!1),m=p.useRef(null);p.useEffect(()=>{c(e)},[e]),p.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[l]);const g=async()=>{if(l.trim()===""){c(e);return}if(l.trim()!==e)try{h(!0),await t(l.trim())}catch(x){c(e),console.error(x)}finally{h(!1)}},v=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),l.trim()===""){fn.error(r),c(e);return}g()}else x.key==="Escape"&&c(e)};return o.jsx("h2",{className:ie("m-0 cursor-pointer p-0 hover:opacity-80",n),children:o.jsx(Ti,{ref:m,value:l,onChange:x=>{c(x.target.value);const b=x.target;b.style.height="auto",b.style.height=`${String(b.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:v,className:ie("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":d}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:d})})}var zc=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(zc||{}),HD=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(HD||{});function bW({configuration:e,onClose:t,onSubmit:n}){const[r,s]=p.useState(new Set),l=p.useId(),c=Vi({defaultValues:{runType:zc.INCREMENTAL}}),{loading:d,loadingSpecification:h,connectorSpecification:m,fetchConnectorSpecification:g}=$l(),v=p.useCallback(async C=>{!r.has(C)&&!h&&(s(E=>new Set(E).add(C)),await g(C))},[r,h,g]);p.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const x=C=>{n&&n(C)},b=()=>{t&&t()},w=C=>{if(!C)return"text";switch(C){case _s.DATE:return"date";case _s.NUMBER:return"number";default:return"text"}};return h?o.jsx("div",{children:"Loading..."}):m?o.jsx(Bl,{...c,children:o.jsxs(Hi,{id:l,noValidate:!0,onSubmit:C=>void c.handleSubmit(x)(C),children:[o.jsxs(Gl,{children:[o.jsx(Fs,{title:"General",children:o.jsx(Zt,{control:c.control,name:"runType",render:({field:C})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),o.jsx(Qt,{children:o.jsxs(o.Fragment,{children:[o.jsx(pY,{options:[{value:zc.INCREMENTAL,label:"Incremental load"},{value:zc.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:C.value,onChange:C.onChange,orientation:"horizontal"}),o.jsx(er,{children:c.watch("runType")===zc.MANUAL_BACKFILL?"Reloads all data for a specific time range from the source, replacing existing records for that period. Use when you need to correct or update historical data.":"Adds only new or updated records since the last run, using the current state of your Data Mart as a reference. Ideal for keeping data fresh without reloading what`s already there."})]})})]})})}),c.watch("runType")===zc.MANUAL_BACKFILL&&o.jsx(Fs,{title:"Run configuration",children:m.filter(C=>{var E;return(E=C.attributes)==null?void 0:E.includes(HD.MANUAL_BACKFILL)}).map(C=>o.jsx(Zt,{control:c.control,name:`data.${C.name}`,render:()=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:C.description,children:C.title??C.name}),o.jsx(Qt,{children:o.jsx(Bt,{id:C.name,placeholder:C.description,type:w(C.requiredType),defaultValue:typeof C.default=="string"||typeof C.default=="number"?C.default.toString():void 0,...c.register(`data.${C.name}`,{required:!0})})}),o.jsx(nn,{})]},C.name)}))})]}),o.jsxs(ql,{children:[o.jsx(we,{type:"submit",disabled:!c.formState.isValid||h,children:"Run"}),o.jsx(we,{type:"button",variant:"outline",onClick:b,children:"Cancel"})]})]})}):o.jsx("div",{children:"No connector specification found"})}function SW({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return o.jsx(Oi,{open:e,onOpenChange:t,children:o.jsxs(Mi,{children:[o.jsx(ki,{children:o.jsx(Ii,{children:"Manual Run"})}),o.jsx(bW,{configuration:n,onClose:t,onSubmit:r})]})})}function $D({children:e,configuration:t,onManualRun:n,open:r}){const[s,l]=p.useState(r??!1),c=()=>{l(!0)},d=m=>{n(m),l(!1)},h=()=>e?o.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return o.jsxs(o.Fragment,{children:[h(),s&&o.jsx(du,{children:o.jsx(SW,{isOpen:s,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}function CW({id:e}){const{navigate:t}=Oo(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:s,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:h,publishDataMart:m,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,isLoading:w,error:C,getErrorMessage:E,runs:R}=nW(e),[T,j]=p.useState(!1),[O,D]=p.useState(!1),N=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],A=async q=>{n&&await s(n.id,q)},k=async()=>{if(n){D(!0);try{await m(n.id)}catch(q){console.log(q instanceof Error?q.message:"Failed to publish Data Mart")}finally{D(!1)}}},V=async q=>{if(n){if(n.status.code!==or.PUBLISHED){Jt.error("Manual run is only available for published Data Marts");return}await g({id:n.id,payload:q})}};return n?o.jsxs("div",{className:"px-12 py-6",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[o.jsx(Jc,{onClick:()=>{t("/data-marts")},variant:"ghost",size:"sm","aria-label":"Back to Data Marts",title:"Back to Data Marts",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:o.jsx(J6,{className:"h-5 w-5"})}),o.jsx(xW,{title:n.title,onUpdate:A,className:"text-2xl font-medium"})]}),o.jsxs("div",{className:"flex items-center gap-2"+(O?" opacity-50":""),style:{minWidth:"120px"},children:[o.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("div",{children:o.jsx(Uf,{type:n.status.code===or.PUBLISHED?Cn.SUCCESS:Cn.NEUTRAL,variant:"subtle",children:n.status.displayName})})}),o.jsx(Nt,{children:n.status.code===or.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),n.status.code===or.DRAFT&&o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("div",{children:o.jsxs(Jc,{variant:"default",onClick:()=>{k()},disabled:O||!n.canPublish,className:"ml-2 flex items-center gap-1",children:[o.jsx(Pp,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!n.canPublish&&o.jsxs(Nt,{children:[o.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),n.validationErrors.length>0&&o.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:Gq(n.validationErrors).map((q,H)=>o.jsx("li",{children:q},H))})]})]})]}),o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(Jc,{variant:"ghost",children:o.jsx($L,{className:"h-5 w-5"})})}),o.jsxs(Or,{align:"end",children:[n.definitionType===We.CONNECTOR&&o.jsxs(o.Fragment,{children:[o.jsx($D,{configuration:n.definition??null,onManualRun:q=>{V({runType:q.runType,data:q.data})},children:o.jsxs(Tt,{onClick:q=>{q.preventDefault()},children:[o.jsx(hb,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})}),o.jsx($a,{})]}),o.jsxs(Tt,{onClick:()=>{j(!0)},children:[o.jsx(Do,{className:"h-4 w-4 text-red-600"}),o.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),o.jsx("div",{children:o.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:N.map(q=>o.jsx(vf,{to:q.path,className:({isActive:H})=>ie("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",H?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:border-gray-200 dark:hover:text-gray-200"),children:q.name},q.name))})}),o.jsx("div",{className:"pt-4",children:o.jsx(mj,{context:{dataMart:n,isLoading:w,error:C,getErrorMessage:E,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:h,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,runs:R}})}),o.jsx(ya,{open:T,onOpenChange:j,title:"Delete Data Mart",description:o.jsxs(o.Fragment,{children:["Are you sure you want to delete ",o.jsxs("strong",{children:['"',n.title,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(n.id),j(!1),t("/data-marts")}catch(q){console.error("Failed to delete Data Mart:",q)}})()}})]}):o.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[o.jsx(ts,{className:"h-16 w-full"},0),Array.from({length:3}).map((q,H)=>o.jsx(ts,{className:"h-48 w-full"},H+1))]})}function wW({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:l="100px"}){const[c,d]=p.useState(e??""),[h,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useRef(null);p.useEffect(()=>{d(e??"")},[e]),p.useEffect(()=>{if(x.current&&h){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),b(x.current)}},[h]);const b=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},w=R=>{d(R.target.value),b(R.target)},C=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{v(!0),await t(R===""?null:R),m(!1)}catch(j){console.error("Failed to update description:",j),d(e??"")}finally{v(!1)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),C()):R.key==="Escape"&&(R.preventDefault(),d(e??""),m(!1))};return h?o.jsxs("div",{className:"w-full",children:[o.jsx(Ti,{ref:x,value:c,onChange:w,onBlur:()=>void C(),onKeyDown:E,placeholder:r,className:ie("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":g}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:l,minWidth:s},disabled:g}),o.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[o.jsxs("span",{children:["Press"," ",o.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Ctrl+Enter"})," ","to save •"," "]}),o.jsxs("span",{children:[o.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Esc"})," ","to cancel •"," "]}),o.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):o.jsx("div",{className:"flex w-full items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:o.jsx("div",{onClick:()=>{m(!0)},className:ie("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:s},children:e??r})})}function EW(){const{dataMart:e,updateDataMartDescription:t}=fs(),n=async r=>{await t(e.id,r)};return o.jsx("div",{children:o.jsx(wW,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function dT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RW(e){if(Array.isArray(e))return e}function TW(e,t,n){return(t=MW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jW(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,l,c,d=[],h=!0,m=!1;try{if(l=(n=n.call(e)).next,t!==0)for(;!(h=(r=l.call(n)).done)&&(d.push(r.value),d.length!==t);h=!0);}catch(g){m=!0,s=g}finally{try{if(!h&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return d}}function _W(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
699
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function hT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fT(Object(n),!0).forEach(function(r){TW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NW(e,t){if(e==null)return{};var n,r,s=AW(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function AW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function DW(e,t){return RW(e)||jW(e,t)||kW(e,t)||_W()}function OW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MW(e){var t=OW(e,"string");return typeof t=="symbol"?t:t+""}function kW(e,t){if(e){if(typeof e=="string")return dT(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dT(e,t):void 0}}function IW(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function pT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mT(Object(n),!0).forEach(function(r){IW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LW(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,l){return l(s)},r)}}function zd(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];return t.apply(n,[].concat(s,d))}}}function Tp(e){return{}.toString.call(e).includes("Object")}function PW(e){return!Object.keys(e).length}function uf(e){return typeof e=="function"}function UW(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function FW(e,t){return Tp(t)||xi("changeType"),Object.keys(t).some(function(n){return!UW(e,n)})&&xi("changeField"),t}function zW(e){uf(e)||xi("selectorType")}function VW(e){uf(e)||Tp(e)||xi("handlerType"),Tp(e)&&Object.values(e).some(function(t){return!uf(t)})&&xi("handlersType")}function HW(e){e||xi("initialIsRequired"),Tp(e)||xi("initialType"),PW(e)&&xi("initialContent")}function $W(e,t){throw new Error(e[t]||e.default)}var BW={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},xi=zd($W)(BW),Tm={changes:FW,selector:zW,handler:VW,initial:HW};function GW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Tm.initial(e),Tm.handler(t);var n={current:e},r=zd(ZW)(n,t),s=zd(KW)(n),l=zd(Tm.changes)(e),c=zd(qW)(n);function d(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Tm.selector(m),m(n.current)}function h(m){LW(r,s,l,c)(m)}return[d,h]}function qW(e,t){return uf(t)?t(e.current):t}function KW(e,t){return e.current=pT(pT({},e.current),t),t}function ZW(e,t,n){return uf(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var YW={create:GW},WW={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function QW(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];return t.apply(n,[].concat(s,d))}}}function XW(e){return{}.toString.call(e).includes("Object")}function JW(e){return e||gT("configIsRequired"),XW(e)||gT("configType"),e.urls?(eQ(),{paths:{vs:e.urls.monacoBase}}):e}function eQ(){console.warn(BD.deprecation)}function tQ(e,t){throw new Error(e[t]||e.default)}var BD={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
700
|
-
You are using deprecated way of configuration.
|
|
701
|
-
|
|
702
|
-
Instead of using
|
|
703
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
704
|
-
use
|
|
705
|
-
monaco.config({ paths: { vs: '...' } })
|
|
706
|
-
|
|
707
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
708
|
-
`},gT=QW(tQ)(BD),nQ={config:JW},rQ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(l,c){return c(l)},s)}};function GD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],GD(e[n],t[n]))}),hT(hT({},e),t)}var aQ={type:"cancelation",msg:"operation is manually canceled"};function Ox(e){var t=!1,n=new Promise(function(r,s){e.then(function(l){return t?s(aQ):r(l)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var sQ=["monaco"],oQ=YW.create({config:WW,isInitialized:!1,resolve:null,reject:null,monaco:null}),qD=DW(oQ,2),Bf=qD[0],Rg=qD[1];function iQ(e){var t=nQ.config(e),n=t.monaco,r=NW(t,sQ);Rg(function(s){return{config:GD(s.config,r),monaco:n}})}function lQ(){var e=Bf(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Rg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ox(Mx);if(window.monaco&&window.monaco.editor)return KD(window.monaco),e.resolve(window.monaco),Ox(Mx);rQ(cQ,dQ)(fQ)}return Ox(Mx)}function cQ(e){return document.body.appendChild(e)}function uQ(e){var t=document.createElement("script");return e&&(t.src=e),t}function dQ(e){var t=Bf(function(r){var s=r.config,l=r.reject;return{config:s,reject:l}}),n=uQ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function fQ(){var e=Bf(function(n){var r=n.config,s=n.resolve,l=n.reject;return{config:r,resolve:s,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;KD(r),e.resolve(r)},function(n){e.reject(n)})}function KD(e){Bf().monaco||Rg({monaco:e})}function hQ(){return Bf(function(e){var t=e.monaco;return t})}var Mx=new Promise(function(e,t){return Rg({resolve:e,reject:t})}),ZD={config:iQ,init:lQ,__getMonacoInstance:hQ},mQ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},kx=mQ,pQ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},gQ=pQ;function vQ({children:e}){return _e.createElement("div",{style:gQ.container},e)}var yQ=vQ,xQ=yQ;function bQ({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:l,wrapperProps:c}){return _e.createElement("section",{style:{...kx.wrapper,width:e,height:t},...c},!n&&_e.createElement(xQ,null,r),_e.createElement("div",{ref:s,style:{...kx.fullWidth,...!n&&kx.hide},className:l}))}var SQ=bQ,YD=p.memo(SQ);function CQ(e){p.useEffect(e,[])}var WD=CQ;function wQ(e,t,n=!0){let r=p.useRef(!0);p.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ua=wQ;function Gd(){}function Bc(e,t,n,r){return EQ(e,r)||RQ(e,t,n,r)}function EQ(e,t){return e.editor.getModel(QD(e,t))}function RQ(e,t,n,r){return e.editor.createModel(t,n,r?QD(e,r):void 0)}function QD(e,t){return e.Uri.parse(t)}function TQ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:l,modifiedModelPath:c,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:h=!1,theme:m="light",loading:g="Loading...",options:v={},height:x="100%",width:b="100%",className:w,wrapperProps:C={},beforeMount:E=Gd,onMount:R=Gd}){let[T,j]=p.useState(!1),[O,D]=p.useState(!0),N=p.useRef(null),A=p.useRef(null),k=p.useRef(null),V=p.useRef(R),q=p.useRef(E),H=p.useRef(!1);WD(()=>{let Q=ZD.init();return Q.then(I=>(A.current=I)&&D(!1)).catch(I=>(I==null?void 0:I.type)!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>N.current?G():Q.cancel()}),ua(()=>{if(N.current&&A.current){let Q=N.current.getOriginalEditor(),I=Bc(A.current,e||"",r||n||"text",l||"");I!==Q.getModel()&&Q.setModel(I)}},[l],T),ua(()=>{if(N.current&&A.current){let Q=N.current.getModifiedEditor(),I=Bc(A.current,t||"",s||n||"text",c||"");I!==Q.getModel()&&Q.setModel(I)}},[c],T),ua(()=>{let Q=N.current.getModifiedEditor();Q.getOption(A.current.editor.EditorOption.readOnly)?Q.setValue(t||""):t!==Q.getValue()&&(Q.executeEdits("",[{range:Q.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),Q.pushUndoStop())},[t],T),ua(()=>{var Q,I;(I=(Q=N.current)==null?void 0:Q.getModel())==null||I.original.setValue(e||"")},[e],T),ua(()=>{let{original:Q,modified:I}=N.current.getModel();A.current.editor.setModelLanguage(Q,r||n||"text"),A.current.editor.setModelLanguage(I,s||n||"text")},[n,r,s],T),ua(()=>{var Q;(Q=A.current)==null||Q.editor.setTheme(m)},[m],T),ua(()=>{var Q;(Q=N.current)==null||Q.updateOptions(v)},[v],T);let W=p.useCallback(()=>{var Y;if(!A.current)return;q.current(A.current);let Q=Bc(A.current,e||"",r||n||"text",l||""),I=Bc(A.current,t||"",s||n||"text",c||"");(Y=N.current)==null||Y.setModel({original:Q,modified:I})},[n,t,s,e,r,l,c]),re=p.useCallback(()=>{var Q;!H.current&&k.current&&(N.current=A.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...v}),W(),(Q=A.current)==null||Q.editor.setTheme(m),j(!0),H.current=!0)},[v,m,W]);p.useEffect(()=>{T&&V.current(N.current,A.current)},[T]),p.useEffect(()=>{!O&&!T&&re()},[O,T,re]);function G(){var I,Y,B,oe;let Q=(I=N.current)==null?void 0:I.getModel();d||((Y=Q==null?void 0:Q.original)==null||Y.dispose()),h||((B=Q==null?void 0:Q.modified)==null||B.dispose()),(oe=N.current)==null||oe.dispose()}return _e.createElement(YD,{width:b,height:x,isEditorReady:T,loading:g,_ref:k,className:w,wrapperProps:C})}var jQ=TQ;p.memo(jQ);function _Q(e){let t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var NQ=_Q,jm=new Map;function AQ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:l,theme:c="light",line:d,loading:h="Loading...",options:m={},overrideServices:g={},saveViewState:v=!0,keepCurrentModel:x=!1,width:b="100%",height:w="100%",className:C,wrapperProps:E={},beforeMount:R=Gd,onMount:T=Gd,onChange:j,onValidate:O=Gd}){let[D,N]=p.useState(!1),[A,k]=p.useState(!0),V=p.useRef(null),q=p.useRef(null),H=p.useRef(null),W=p.useRef(T),re=p.useRef(R),G=p.useRef(),Q=p.useRef(r),I=NQ(l),Y=p.useRef(!1),B=p.useRef(!1);WD(()=>{let L=ZD.init();return L.then(P=>(V.current=P)&&k(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>q.current?be():L.cancel()}),ua(()=>{var P,K,ne,fe;let L=Bc(V.current,e||r||"",t||s||"",l||n||"");L!==((P=q.current)==null?void 0:P.getModel())&&(v&&jm.set(I,(K=q.current)==null?void 0:K.saveViewState()),(ne=q.current)==null||ne.setModel(L),v&&((fe=q.current)==null||fe.restoreViewState(jm.get(l))))},[l],D),ua(()=>{var L;(L=q.current)==null||L.updateOptions(m)},[m],D),ua(()=>{!q.current||r===void 0||(q.current.getOption(V.current.editor.EditorOption.readOnly)?q.current.setValue(r):r!==q.current.getValue()&&(B.current=!0,q.current.executeEdits("",[{range:q.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),q.current.pushUndoStop(),B.current=!1))},[r],D),ua(()=>{var P,K;let L=(P=q.current)==null?void 0:P.getModel();L&&s&&((K=V.current)==null||K.editor.setModelLanguage(L,s))},[s],D),ua(()=>{var L;d!==void 0&&((L=q.current)==null||L.revealLine(d))},[d],D),ua(()=>{var L;(L=V.current)==null||L.editor.setTheme(c)},[c],D);let oe=p.useCallback(()=>{var L;if(!(!H.current||!V.current)&&!Y.current){re.current(V.current);let P=l||n,K=Bc(V.current,r||e||"",t||s||"",P||"");q.current=(L=V.current)==null?void 0:L.editor.create(H.current,{model:K,automaticLayout:!0,...m},g),v&&q.current.restoreViewState(jm.get(P)),V.current.editor.setTheme(c),d!==void 0&&q.current.revealLine(d),N(!0),Y.current=!0}},[e,t,n,r,s,l,m,g,v,c,d]);p.useEffect(()=>{D&&W.current(q.current,V.current)},[D]),p.useEffect(()=>{!A&&!D&&oe()},[A,D,oe]),Q.current=r,p.useEffect(()=>{var L,P;D&&j&&((L=G.current)==null||L.dispose(),G.current=(P=q.current)==null?void 0:P.onDidChangeModelContent(K=>{B.current||j(q.current.getValue(),K)}))},[D,j]),p.useEffect(()=>{if(D){let L=V.current.editor.onDidChangeMarkers(P=>{var ne;let K=(ne=q.current.getModel())==null?void 0:ne.uri;if(K&&P.find(fe=>fe.path===K.path)){let fe=V.current.editor.getModelMarkers({resource:K});O==null||O(fe)}});return()=>{L==null||L.dispose()}}return()=>{}},[D,O]);function be(){var L,P;(L=G.current)==null||L.dispose(),x?v&&jm.set(l,q.current.saveViewState()):(P=q.current.getModel())==null||P.dispose(),q.current.dispose()}return _e.createElement(YD,{width:b,height:w,isEditorReady:D,loading:h,_ref:H,className:C,wrapperProps:E})}var DQ=AQ,OQ=p.memo(DQ);function MQ({initialValue:e,onChange:t}){const[n,r]=p.useState((e==null?void 0:e.sqlQuery)??""),{theme:s}=VA();p.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function l(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return o.jsx("div",{className:"shadow-xs",children:o.jsx(OQ,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function U0({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:l}){const c=e;return o.jsxs("div",{className:ie("group flex items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",s&&"cursor-pointer dark:hover:bg-white/5",l),onClick:s,children:[o.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(c,{className:"h-6 w-6"})}),o.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[o.jsx("div",{className:"text-md font-medium",children:t}),n&&o.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:o.jsx(hs,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var vT=1,kQ=.9,IQ=.8,LQ=.17,Ix=.1,Lx=.999,PQ=.9999,UQ=.99,FQ=/[\\\/_+.#"@\[\(\{&]/,zQ=/[\\\/_+.#"@\[\(\{&]/g,VQ=/[\s-]/,XD=/[\s-]/g;function F0(e,t,n,r,s,l,c){if(l===t.length)return s===e.length?vT:UQ;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var h=r.charAt(l),m=n.indexOf(h,s),g=0,v,x,b,w;m>=0;)v=F0(e,t,n,r,m+1,l+1,c),v>g&&(m===s?v*=vT:FQ.test(e.charAt(m-1))?(v*=IQ,b=e.slice(s,m-1).match(zQ),b&&s>0&&(v*=Math.pow(Lx,b.length))):VQ.test(e.charAt(m-1))?(v*=kQ,w=e.slice(s,m-1).match(XD),w&&s>0&&(v*=Math.pow(Lx,w.length))):(v*=LQ,s>0&&(v*=Math.pow(Lx,m-s))),e.charAt(m)!==t.charAt(l)&&(v*=PQ)),(v<Ix&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(x=F0(e,t,n,r,m+1,l+2,c),x*Ix>v&&(v=x*Ix)),v>g&&(g=v),m=n.indexOf(h,m+1);return c[d]=g,g}function yT(e){return e.toLowerCase().replace(XD," ")}function HQ(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,F0(e,t,yT(e),yT(t),0,0,{})}var Md='[cmdk-group=""]',Px='[cmdk-group-items=""]',$Q='[cmdk-group-heading=""]',JD='[cmdk-item=""]',xT=`${JD}:not([aria-disabled="true"])`,z0="cmdk-item-select",Vc="data-value",BQ=(e,t,n)=>HQ(e,t,n),eO=p.createContext(void 0),Gf=()=>p.useContext(eO),tO=p.createContext(void 0),OS=()=>p.useContext(tO),nO=p.createContext(void 0),rO=p.forwardRef((e,t)=>{let n=Hc(()=>{var P,K;return{search:"",value:(K=(P=e.value)!=null?P:e.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Hc(()=>new Set),s=Hc(()=>new Map),l=Hc(()=>new Map),c=Hc(()=>new Set),d=aO(e),{label:h,children:m,value:g,onValueChange:v,filter:x,shouldFilter:b,loop:w,disablePointerSelection:C=!1,vimBindings:E=!0,...R}=e,T=Mn(),j=Mn(),O=Mn(),D=p.useRef(null),N=tX();kl(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,A.emit()}},[g]),kl(()=>{N(6,re)},[]);let A=p.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,K,ne)=>{var fe,ge,ue,Ae;if(!Object.is(n.current[P],K)){if(n.current[P]=K,P==="search")W(),q(),N(1,H);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Re=document.getElementById(O);Re?Re.focus():(fe=document.getElementById(T))==null||fe.focus()}if(N(7,()=>{var Re;n.current.selectedItemId=(Re=G())==null?void 0:Re.id,A.emit()}),ne||N(5,re),((ge=d.current)==null?void 0:ge.value)!==void 0){let Re=K??"";(Ae=(ue=d.current).onValueChange)==null||Ae.call(ue,Re);return}}A.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),k=p.useMemo(()=>({value:(P,K,ne)=>{var fe;K!==((fe=l.current.get(P))==null?void 0:fe.value)&&(l.current.set(P,{value:K,keywords:ne}),n.current.filtered.items.set(P,V(K,ne)),N(2,()=>{q(),A.emit()}))},item:(P,K)=>(r.current.add(P),K&&(s.current.has(K)?s.current.get(K).add(P):s.current.set(K,new Set([P]))),N(3,()=>{W(),q(),n.current.value||H(),A.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let ne=G();N(4,()=>{W(),(ne==null?void 0:ne.getAttribute("id"))===P&&H(),A.emit()})}),group:P=>(s.current.has(P)||s.current.set(P,new Set),()=>{l.current.delete(P),s.current.delete(P)}),filter:()=>d.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:O,labelId:j,listInnerRef:D}),[]);function V(P,K){var ne,fe;let ge=(fe=(ne=d.current)==null?void 0:ne.filter)!=null?fe:BQ;return P?ge(P,n.current.search,K):0}function q(){if(!n.current.search||d.current.shouldFilter===!1)return;let P=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(fe=>{let ge=s.current.get(fe),ue=0;ge.forEach(Ae=>{let Re=P.get(Ae);ue=Math.max(Re,ue)}),K.push([fe,ue])});let ne=D.current;Q().sort((fe,ge)=>{var ue,Ae;let Re=fe.getAttribute("id"),xe=ge.getAttribute("id");return((ue=P.get(xe))!=null?ue:0)-((Ae=P.get(Re))!=null?Ae:0)}).forEach(fe=>{let ge=fe.closest(Px);ge?ge.appendChild(fe.parentElement===ge?fe:fe.closest(`${Px} > *`)):ne.appendChild(fe.parentElement===ne?fe:fe.closest(`${Px} > *`))}),K.sort((fe,ge)=>ge[1]-fe[1]).forEach(fe=>{var ge;let ue=(ge=D.current)==null?void 0:ge.querySelector(`${Md}[${Vc}="${encodeURIComponent(fe[0])}"]`);ue==null||ue.parentElement.appendChild(ue)})}function H(){let P=Q().find(ne=>ne.getAttribute("aria-disabled")!=="true"),K=P==null?void 0:P.getAttribute(Vc);A.setState("value",K||void 0)}function W(){var P,K,ne,fe;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ge=0;for(let ue of r.current){let Ae=(K=(P=l.current.get(ue))==null?void 0:P.value)!=null?K:"",Re=(fe=(ne=l.current.get(ue))==null?void 0:ne.keywords)!=null?fe:[],xe=V(Ae,Re);n.current.filtered.items.set(ue,xe),xe>0&&ge++}for(let[ue,Ae]of s.current)for(let Re of Ae)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(ue);break}n.current.filtered.count=ge}function re(){var P,K,ne;let fe=G();fe&&(((P=fe.parentElement)==null?void 0:P.firstChild)===fe&&((ne=(K=fe.closest(Md))==null?void 0:K.querySelector($Q))==null||ne.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function G(){var P;return(P=D.current)==null?void 0:P.querySelector(`${JD}[aria-selected="true"]`)}function Q(){var P;return Array.from(((P=D.current)==null?void 0:P.querySelectorAll(xT))||[])}function I(P){let K=Q()[P];K&&A.setState("value",K.getAttribute(Vc))}function Y(P){var K;let ne=G(),fe=Q(),ge=fe.findIndex(Ae=>Ae===ne),ue=fe[ge+P];(K=d.current)!=null&&K.loop&&(ue=ge+P<0?fe[fe.length-1]:ge+P===fe.length?fe[0]:fe[ge+P]),ue&&A.setState("value",ue.getAttribute(Vc))}function B(P){let K=G(),ne=K==null?void 0:K.closest(Md),fe;for(;ne&&!fe;)ne=P>0?JQ(ne,Md):eX(ne,Md),fe=ne==null?void 0:ne.querySelector(xT);fe?A.setState("value",fe.getAttribute(Vc)):Y(P)}let oe=()=>I(Q().length-1),be=P=>{P.preventDefault(),P.metaKey?oe():P.altKey?B(1):Y(1)},L=P=>{P.preventDefault(),P.metaKey?I(0):P.altKey?B(-1):Y(-1)};return p.createElement(Ye.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:P=>{var K;(K=R.onKeyDown)==null||K.call(R,P);let ne=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||ne))switch(P.key){case"n":case"j":{E&&P.ctrlKey&&be(P);break}case"ArrowDown":{be(P);break}case"p":case"k":{E&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),I(0);break}case"End":{P.preventDefault(),oe();break}case"Enter":{P.preventDefault();let fe=G();if(fe){let ge=new Event(z0);fe.dispatchEvent(ge)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:rX},h),Tg(e,P=>p.createElement(tO.Provider,{value:A},p.createElement(eO.Provider,{value:k},P))))}),GQ=p.forwardRef((e,t)=>{var n,r;let s=Mn(),l=p.useRef(null),c=p.useContext(nO),d=Gf(),h=aO(e),m=(r=(n=h.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;kl(()=>{if(!m)return d.item(s,c==null?void 0:c.id)},[m]);let g=sO(s,l,[e.value,e.children,l],e.keywords),v=OS(),x=Ni(N=>N.value&&N.value===g.current),b=Ni(N=>m||d.filter()===!1?!0:N.search?N.filtered.items.get(s)>0:!0);p.useEffect(()=>{let N=l.current;if(!(!N||e.disabled))return N.addEventListener(z0,w),()=>N.removeEventListener(z0,w)},[b,e.onSelect,e.disabled]);function w(){var N,A;C(),(A=(N=h.current).onSelect)==null||A.call(N,g.current)}function C(){v.setState("value",g.current,!0)}if(!b)return null;let{disabled:E,value:R,onSelect:T,forceMount:j,keywords:O,...D}=e;return p.createElement(Ye.div,{ref:Ro(l,t),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||d.getDisablePointerSelection()?void 0:C,onClick:E?void 0:w},e.children)}),qQ=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...l}=e,c=Mn(),d=p.useRef(null),h=p.useRef(null),m=Mn(),g=Gf(),v=Ni(b=>s||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);kl(()=>g.group(c),[]),sO(c,d,[e.value,e.heading,h]);let x=p.useMemo(()=>({id:c,forceMount:s}),[s]);return p.createElement(Ye.div,{ref:Ro(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},n&&p.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Tg(e,b=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},p.createElement(nO.Provider,{value:x},b))))}),KQ=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),l=Ni(c=>!c.search);return!n&&!l?null:p.createElement(Ye.div,{ref:Ro(s,t),...r,"cmdk-separator":"",role:"separator"})}),ZQ=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,l=OS(),c=Ni(m=>m.search),d=Ni(m=>m.selectedItemId),h=Gf();return p.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),p.createElement(Ye.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":d,id:h.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||l.setState("search",m.target.value),n==null||n(m.target.value)}})}),YQ=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,l=p.useRef(null),c=p.useRef(null),d=Ni(m=>m.selectedItemId),h=Gf();return p.useEffect(()=>{if(c.current&&l.current){let m=c.current,g=l.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let b=m.offsetHeight;g.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(v),x.unobserve(m)}}},[]),p.createElement(Ye.div,{ref:Ro(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:h.listId},Tg(e,m=>p.createElement("div",{ref:Ro(c,h.listInnerRef),"cmdk-list-sizer":""},m)))}),WQ=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:l,container:c,...d}=e;return p.createElement($p,{open:n,onOpenChange:r},p.createElement(Bp,{container:c},p.createElement(Gp,{"cmdk-overlay":"",className:s}),p.createElement(qp,{"aria-label":e.label,"cmdk-dialog":"",className:l},p.createElement(rO,{ref:t,...d}))))}),QQ=p.forwardRef((e,t)=>Ni(n=>n.filtered.count===0)?p.createElement(Ye.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),XQ=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...l}=e;return p.createElement(Ye.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Tg(e,c=>p.createElement("div",{"aria-hidden":!0},c)))}),Du=Object.assign(rO,{List:YQ,Item:GQ,Input:ZQ,Group:qQ,Separator:KQ,Dialog:WQ,Empty:QQ,Loading:XQ});function JQ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function eX(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function aO(e){let t=p.useRef(e);return kl(()=>{t.current=e}),t}var kl=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Hc(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Ni(e){let t=OS(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function sO(e,t,n,r=[]){let s=p.useRef(),l=Gf();return kl(()=>{var c;let d=(()=>{var m;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(m=g.current.textContent)==null?void 0:m.trim():s.current}})(),h=r.map(m=>m.trim());l.value(e,d,h),(c=t.current)==null||c.setAttribute(Vc,d),s.current=d}),s}var tX=()=>{let[e,t]=p.useState(),n=Hc(()=>new Map);return kl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function nX(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Tg({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(nX(t),{ref:t.ref},n(t.props.children)):n(t)}var rX={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function oO({className:e,...t}){return o.jsx(Du,{"data-slot":"command",className:ie("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function iO({className:e,...t}){return o.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o.jsx(Ll,{className:"size-4 shrink-0 opacity-50"}),o.jsx(Du.Input,{"data-slot":"command-input",className:ie("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function aX({className:e,...t}){return o.jsx(Du.List,{"data-slot":"command-list",className:ie("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function lO({...e}){return o.jsx(Du.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function cO({className:e,...t}){return o.jsx(Du.Group,{"data-slot":"command-group",className:ie("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function uO({className:e,...t}){return o.jsx(Du.Item,{"data-slot":"command-item",className:ie("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var jg="Popover",[dO]=Ur(jg,[Hs]),qf=Hs(),[sX,Gi]=dO(jg),fO=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!1}=e,d=qf(t),h=p.useRef(null),[m,g]=p.useState(!1),[v,x]=Xr({prop:r,defaultProp:s??!1,onChange:l,caller:jg});return o.jsx(xu,{...d,children:o.jsx(sX,{scope:t,contentId:Mn(),triggerRef:h,open:v,onOpenChange:x,onOpenToggle:p.useCallback(()=>x(b=>!b),[x]),hasCustomAnchor:m,onCustomAnchorAdd:p.useCallback(()=>g(!0),[]),onCustomAnchorRemove:p.useCallback(()=>g(!1),[]),modal:c,children:n})})};fO.displayName=jg;var hO="PopoverAnchor",oX=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Gi(hO,n),l=qf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=s;return p.useEffect(()=>(c(),()=>d()),[c,d]),o.jsx(bu,{...l,...r,ref:t})});oX.displayName=hO;var mO="PopoverTrigger",pO=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Gi(mO,n),l=qf(n),c=vt(t,s.triggerRef),d=o.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":bO(s.open),...r,ref:c,onClick:je(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:o.jsx(bu,{asChild:!0,...l,children:d})});pO.displayName=mO;var MS="PopoverPortal",[iX,lX]=dO(MS,{forceMount:void 0}),gO=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=Gi(MS,t);return o.jsx(iX,{scope:t,forceMount:n,children:o.jsx(_r,{present:n||l.open,children:o.jsx(Ul,{asChild:!0,container:s,children:r})})})};gO.displayName=MS;var fu="PopoverContent",vO=p.forwardRef((e,t)=>{const n=lX(fu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=Gi(fu,e.__scopePopover);return o.jsx(_r,{present:r||l.open,children:l.modal?o.jsx(uX,{...s,ref:t}):o.jsx(dX,{...s,ref:t})})});vO.displayName=fu;var cX=wi("PopoverContent.RemoveScroll"),uX=p.forwardRef((e,t)=>{const n=Gi(fu,e.__scopePopover),r=p.useRef(null),s=vt(t,r),l=p.useRef(!1);return p.useEffect(()=>{const c=r.current;if(c)return Vp(c)},[]),o.jsx(Cf,{as:cX,allowPinchZoom:!0,children:o.jsx(yO,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,m=d.button===2||h;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:je(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),dX=p.forwardRef((e,t)=>{const n=Gi(fu,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(yO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),yO=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,...v}=e,x=Gi(fu,n),b=qf(n);return Fp(),o.jsx(Sf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(Pl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(Ef,{"data-state":bO(x.open),role:"dialog",id:x.contentId,...b,...v,ref:t,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xO="PopoverClose",fX=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Gi(xO,n);return o.jsx(Ye.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>s.onOpenChange(!1))})});fX.displayName=xO;var hX="PopoverArrow",mX=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=qf(n);return o.jsx(Rf,{...s,...r,ref:t})});mX.displayName=hX;function bO(e){return e?"open":"closed"}var pX=fO,gX=pO,vX=gO,yX=vO;function kS({...e}){return o.jsx(pX,{"data-slot":"popover",...e})}function IS({...e}){return o.jsx(gX,{"data-slot":"popover-trigger",...e})}function LS({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(vX,{children:o.jsx(yX,{"data-slot":"popover-content",align:t,sideOffset:n,className:ie("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function PS({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:l,disabled:c=!1}){const[d,h]=p.useState(!1),[m,g]=p.useState(""),v=p.useMemo(()=>{const w={};return e.forEach(C=>{const E=C.group??"";Object.prototype.hasOwnProperty.call(w,E)||(w[E]=[]),w[E].push(C)}),w},[e]),x=e.find(w=>w.value===t),b=p.useCallback(w=>{n(w),requestAnimationFrame(()=>{g(""),h(!1)})},[n]);return o.jsxs(kS,{open:d,onOpenChange:h,modal:!0,children:[o.jsx(IS,{asChild:!0,children:o.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":d,className:ie("w-full justify-between",!t&&"text-muted-foreground",l),disabled:c,children:[x?x.label:r,o.jsx(db,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(LS,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:o.jsxs(oO,{children:[o.jsx(iO,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:g}),o.jsx(lO,{children:s}),Object.entries(v).map(([w,C])=>o.jsx(cO,{heading:w,children:C.map(E=>o.jsxs(uO,{value:E.value,onSelect:()=>{b(E.value)},keywords:[E.label],children:[o.jsx(ir,{className:ie("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},w||"default"))]})})]})}var _g="Collapsible",[xX,SO]=Ur(_g),[bX,US]=xX(_g),CO=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:l,onOpenChange:c,...d}=e,[h,m]=Xr({prop:r,defaultProp:s??!1,onChange:c,caller:_g});return o.jsx(bX,{scope:n,disabled:l,contentId:Mn(),open:h,onOpenToggle:p.useCallback(()=>m(g=>!g),[m]),children:o.jsx(Ye.div,{"data-state":zS(h),"data-disabled":l?"":void 0,...d,ref:t})})});CO.displayName=_g;var wO="CollapsibleTrigger",EO=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=US(wO,n);return o.jsx(Ye.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":zS(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:je(e.onClick,s.onOpenToggle)})});EO.displayName=wO;var FS="CollapsibleContent",RO=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=US(FS,e.__scopeCollapsible);return o.jsx(_r,{present:n||s.open,children:({present:l})=>o.jsx(SX,{...r,ref:t,present:l})})});RO.displayName=FS;var SX=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...l}=e,c=US(FS,n),[d,h]=p.useState(r),m=p.useRef(null),g=vt(t,m),v=p.useRef(0),x=v.current,b=p.useRef(0),w=b.current,C=c.open||d,E=p.useRef(C),R=p.useRef(void 0);return p.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),yr(()=>{const T=m.current;if(T){R.current=R.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const j=T.getBoundingClientRect();v.current=j.height,b.current=j.width,E.current||(T.style.transitionDuration=R.current.transitionDuration,T.style.animationName=R.current.animationName),h(r)}},[c.open,r]),o.jsx(Ye.div,{"data-state":zS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!C,...l,ref:g,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:C&&s})});function zS(e){return e?"open":"closed"}var CX=CO,wX=EO,EX=RO,gs="Accordion",RX=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[VS,TX,jX]=eg(gs),[Ng]=Ur(gs,[jX,SO]),HS=SO(),TO=_e.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,l=r;return o.jsx(VS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(DX,{...l,ref:t}):o.jsx(AX,{...s,ref:t})})});TO.displayName=gs;var[jO,_X]=Ng(gs),[_O,NX]=Ng(gs,{collapsible:!1}),AX=_e.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:l=!1,...c}=e,[d,h]=Xr({prop:n,defaultProp:r??"",onChange:s,caller:gs});return o.jsx(jO,{scope:e.__scopeAccordion,value:_e.useMemo(()=>d?[d]:[],[d]),onItemOpen:h,onItemClose:_e.useCallback(()=>l&&h(""),[l,h]),children:o.jsx(_O,{scope:e.__scopeAccordion,collapsible:l,children:o.jsx(NO,{...c,ref:t})})})}),DX=_e.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...l}=e,[c,d]=Xr({prop:n,defaultProp:r??[],onChange:s,caller:gs}),h=_e.useCallback(g=>d((v=[])=>[...v,g]),[d]),m=_e.useCallback(g=>d((v=[])=>v.filter(x=>x!==g)),[d]);return o.jsx(jO,{scope:e.__scopeAccordion,value:c,onItemOpen:h,onItemClose:m,children:o.jsx(_O,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(NO,{...l,ref:t})})})}),[OX,Ag]=Ng(gs),NO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:l="vertical",...c}=e,d=_e.useRef(null),h=vt(d,t),m=TX(n),v=tg(s)==="ltr",x=je(e.onKeyDown,b=>{var k;if(!RX.includes(b.key))return;const w=b.target,C=m().filter(V=>{var q;return!((q=V.ref.current)!=null&&q.disabled)}),E=C.findIndex(V=>V.ref.current===w),R=C.length;if(E===-1)return;b.preventDefault();let T=E;const j=0,O=R-1,D=()=>{T=E+1,T>O&&(T=j)},N=()=>{T=E-1,T<j&&(T=O)};switch(b.key){case"Home":T=j;break;case"End":T=O;break;case"ArrowRight":l==="horizontal"&&(v?D():N());break;case"ArrowDown":l==="vertical"&&D();break;case"ArrowLeft":l==="horizontal"&&(v?N():D());break;case"ArrowUp":l==="vertical"&&N();break}const A=T%R;(k=C[A].ref.current)==null||k.focus()});return o.jsx(OX,{scope:n,disabled:r,direction:s,orientation:l,children:o.jsx(VS.Slot,{scope:n,children:o.jsx(Ye.div,{...c,"data-orientation":l,ref:h,onKeyDown:r?void 0:x})})})}),jp="AccordionItem",[MX,$S]=Ng(jp),AO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,l=Ag(jp,n),c=_X(jp,n),d=HS(n),h=Mn(),m=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return o.jsx(MX,{scope:n,open:m,disabled:g,triggerId:h,children:o.jsx(CX,{"data-orientation":l.orientation,"data-state":LO(m),...d,...s,ref:t,disabled:g,open:m,onOpenChange:v=>{v?c.onItemOpen(r):c.onItemClose(r)}})})});AO.displayName=jp;var DO="AccordionHeader",OO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ag(gs,n),l=$S(DO,n);return o.jsx(Ye.h3,{"data-orientation":s.orientation,"data-state":LO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});OO.displayName=DO;var V0="AccordionTrigger",MO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ag(gs,n),l=$S(V0,n),c=NX(V0,n),d=HS(n);return o.jsx(VS.ItemSlot,{scope:n,children:o.jsx(wX,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:l.triggerId,...d,...r,ref:t})})});MO.displayName=V0;var kO="AccordionContent",IO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ag(gs,n),l=$S(kO,n),c=HS(n);return o.jsx(EX,{role:"region","aria-labelledby":l.triggerId,"data-orientation":s.orientation,...c,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});IO.displayName=kO;function LO(e){return e?"open":"closed"}var kX=TO,IX=AO,LX=OO,PX=MO,UX=IO;const BS={default:{itemClass:"border-b last:border-b-0",triggerClass:"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",icon:null,chevronClass:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",contentInnerClass:"pt-0 pb-4",headerClass:"flex"},common:{itemClass:"overflow-hidden",triggerClass:"group focus-visible:ring-primary hover:bg-muted [&[data-state=open]]:bg-muted flex items-center gap-1 rounded-sm px-2 py-1 transition-all outline-none focus-visible:ring-2 [&[data-state=open]]:rounded-br-none [&[data-state=open]]:rounded-bl-none [&[data-state=open]]:font-semibold",icon:o.jsx(m8,{className:"size-4 shrink-0","aria-hidden":"true"}),chevronClass:"size-3.5 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down bg-muted overflow-hidden rounded-sm rounded-tl-none py-0 pr-2 pl-7 text-sm",contentInnerClass:"pt-2 pb-4",headerClass:void 0}},PO=p.createContext("default");function cr({variant:e="default",...t}){return o.jsx(PO.Provider,{value:e,children:o.jsx(kX,{"data-slot":"accordion",...t})})}function GS(e){const t=p.useContext(PO);return e??t??"default"}function Bn({className:e,variant:t,...n}){const r=GS(t),{itemClass:s}=BS[r];return o.jsx(IX,{"data-slot":"accordion-item",className:ie(s,e),...n})}function Gn({className:e,children:t,variant:n,...r}){const s=GS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:h}=BS[s];return o.jsx(LX,{className:h,children:o.jsxs(PX,{"data-slot":"accordion-trigger",className:ie(l,e),...r,children:[c,t,o.jsx(Ga,{className:d,"aria-hidden":"true"})]})})}function qn({className:e,children:t,variant:n,...r}){const s=GS(n),{contentClass:l,contentInnerClass:c}=BS[s];return o.jsx(UX,{"data-slot":"accordion-content",className:ie(l,e),...r,children:o.jsx("div",{className:c,children:t})})}function lr({href:e,children:t,className:n,...r}){return o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:ie("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,o.jsx(wl,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function FX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"service-account-details",children:[o.jsx(Gn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(lr,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Assign the ",o.jsx("strong",{children:"bigquery.dataEditor"})," and ",o.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function zX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"project-id-details",children:[o.jsx(Gn,{children:"How do I find my Project ID?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),o.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),o.jsxs("li",{children:["Find your project in the list. The ",o.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),o.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function VX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"gbq-location-details",children:[o.jsx(Gn,{children:"How do I find my dataset location?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"BigQuery data is stored in specific regions. To avoid query errors, your SQL queries must process data stored in the same location."}),o.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),o.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),o.jsxs("li",{children:["Click each dataset name to open its details. The ",o.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",o.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),o.jsx("li",{children:"Make sure all your datasets are stored in the same location. If they are in different locations, select the location where most of your data is stored or create separate Storage for each location."}),o.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const UO=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:s}=t;return!n||!r||!s?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:s}}catch{return null}},HX=({form:e})=>{const[t,n]=p.useState(!1);if(e.watch("type")!==Pe.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?UO(l):null;return o.jsxs(o.Fragment,{children:[o.jsxs(Fs,{title:"Connection Settings",children:[o.jsx(Zt,{control:e.control,name:"config.projectId",render:({field:d})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),o.jsx(Qt,{children:o.jsx(Bt,{...d,placeholder:"Enter a Project Id"})}),o.jsx(er,{children:o.jsx(zX,{})}),o.jsx(nn,{})]})}),o.jsx(Zt,{control:e.control,name:"config.location",render:({field:d})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),o.jsx(Qt,{children:o.jsx(PS,{options:dG,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),o.jsx(er,{children:o.jsx(VX,{})}),o.jsx(nn,{})]})})]}),o.jsx(Fs,{title:"Authentication",children:o.jsx(Zt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Yt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Wt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&o.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(Qt,{children:!t&&c?o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(lr,{href:c.url,children:c.email})}),o.jsx(Nt,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(Ti,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(er,{children:o.jsx(FX,{})}),o.jsx(nn,{})]})})})]})};function $X(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"athena-region-details",children:[o.jsx(Gn,{children:"How do I find my Athena region?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"Athena queries run in a specific AWS region. You must select the region where your Athena service and data are located."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),o.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),o.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function BX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"athena-output-bucket-details",children:[o.jsx(Gn,{children:"How do I find a bucket?"}),o.jsxs(qn,{children:[o.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",o.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),o.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),o.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),o.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function GX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"athena-access-key-id-details",children:[o.jsx(Gn,{children:"How do I get my AWS Access Key ID?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user with the necessary permissions to use Athena and Glue in your AWS account."}),o.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",o.jsx(lr,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/?utm_source=owox_data_marts&utm_medium=storage_enity&utm_campaign=tooltip_aws",children:"in documentation"}),"."]}),o.jsx(qj,{className:"my-4"}),o.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),o.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function qX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"athena-secret-access-key-details",children:[o.jsx(Gn,{children:"How do I get my AWS Secret Access Key?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"The Secret Access Key is part of your AWS credentials needed to connect and authenticate. It is only shown when you create a new key."}),o.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),o.jsx("li",{children:"When you create a new key, copy and securely store the Secret Access Key — you won't be able to see it again."})]})]})]})})}const KX=({form:e})=>{const[t,n]=p.useState("");return p.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const s="_".repeat(r.length);n(s),e.setValue("credentials.secretAccessKey",s,{shouldDirty:!1})}},[e]),e.watch("type")!==Pe.AWS_ATHENA?null:o.jsxs(o.Fragment,{children:[o.jsxs(Fs,{title:"Connection Settings",children:[o.jsx(Zt,{control:e.control,name:"config.region",render:({field:r})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),o.jsx(Qt,{children:o.jsx(Bt,{...r,placeholder:"Enter a region"})}),o.jsx(er,{children:o.jsx($X,{})}),o.jsx(nn,{})]})}),o.jsx(Zt,{control:e.control,name:"config.outputBucket",render:({field:r})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),o.jsx(Qt,{children:o.jsx(Bt,{...r,placeholder:"Enter an output bucket"})}),o.jsx(er,{children:o.jsx(BX,{})}),o.jsx(nn,{})]})})]}),o.jsxs(Fs,{title:"Authentication",children:[o.jsx(Zt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),o.jsx(Qt,{children:o.jsx(Bt,{...r,placeholder:"Enter an access key id"})}),o.jsx(er,{children:o.jsx(GX,{})}),o.jsx(nn,{})]})}),o.jsx(Zt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),o.jsx(Qt,{children:o.jsx(Bt,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),o.jsx(er,{children:o.jsx(qX,{})}),o.jsx(nn,{})]})})]})]})};function ZX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"bigquery-api-details",children:[o.jsx(Gn,{children:"How do I enable the BigQuery API?"}),o.jsxs(qn,{children:[o.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",o.jsx(lr,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function YX(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"athena-api-details",children:[o.jsx(Gn,{children:"How do I activate Athena API?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"AWS Athena is a serverless interactive query service. To use it, you need to activate Athena in your AWS account."}),o.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(lr,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),o.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),o.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function FO(e){return JSON.parse(JSON.stringify(e))}function WX({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Vi({resolver:Kl(AG),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:h}}=s,m=l("type");_e.useEffect(()=>{r==null||r(d)},[d,r]);const g=async v=>{const{dirtyFields:x}=s.formState,b=FO(v);return x.credentials||delete b.credentials,t(b)};return o.jsx(Bl,{...s,children:o.jsxs(Hi,{onSubmit:v=>{s.handleSubmit(g)(v)},noValidate:!0,children:[o.jsxs(Gl,{children:[o.jsxs(Fs,{title:"General",children:[o.jsx(Zt,{control:c,name:"title",render:({field:v})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),o.jsx(Qt,{children:o.jsx(Bt,{...v,placeholder:"Storage title"})}),o.jsx(nn,{})]})}),o.jsx(Zt,{control:c,name:"type",render:({field:v})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),o.jsx(Qt,{children:o.jsxs(ba,{value:v.value,onValueChange:v.onChange,disabled:!!e,children:[o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{placeholder:"Select a storage type"})}),o.jsx(wa,{children:o.jsx(wg,{children:Fi.getAllTypes().map(({type:x,displayName:b,icon:w,status:C})=>o.jsx(Hn,{value:x,disabled:C===vo.COMING_SOON,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(w,{size:20}),b]})},x))})})]})}),o.jsxs(er,{children:[m===Pe.GOOGLE_BIGQUERY&&o.jsx(ZX,{}),m===Pe.AWS_ATHENA&&o.jsx(YX,{})]}),o.jsx(nn,{})]})})]}),m===Pe.GOOGLE_BIGQUERY&&o.jsx(HX,{form:s}),m===Pe.AWS_ATHENA&&o.jsx(KX,{form:s})]}),o.jsxs(ql,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||h,children:"Save"}),o.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function zO({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Eg(),[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=async b=>{if(n){const w=await s(n.id,b);w&&(r(w),t())}};return o.jsxs(o.Fragment,{children:[o.jsx(Oi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(Mi,{children:[o.jsxs(ki,{children:[o.jsx(Ii,{children:"Configure Storage Provider"}),o.jsx(Fl,{children:"Customize settings for your storage provider"})]}),o.jsx(WX,{initialData:n??void 0,onSubmit:x,onCancel:m,onDirtyChange:v})]})}),o.jsx(ya,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const QX=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=p.useState(!1),s=Fi.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!(()=>{switch(e.type){case Pe.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Pe.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}})())return o.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[o.jsx(Up,{className:"h-4 w-4 text-red-500"}),o.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(v,x)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),g=(v,x,b)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx(lr,{href:b,onClick:w=>{w.stopPropagation()},children:x})]});switch(e.type){case Pe.GOOGLE_BIGQUERY:{const v=e.config.projectId,x=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",v,b),o.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case Pe.AWS_ATHENA:{const v=e.config.region,x=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",v),o.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",x,b)]})}default:return"Unknown storage type configuration"}};return o.jsxs(o.Fragment,{children:[o.jsx(U0,{title:e.title,icon:s.icon,subtitle:d(),onClick:l}),o.jsx(DS,{children:o.jsx(zO,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:h=>{t&&t(h)}})})]})};function XX({initialType:e,onTypeSelect:t}){var c;const[n,r]=p.useState(e??null),s=d=>{r(d),t(d)},l=[{type:We.SQL,label:"SQL",description:"SQL query"},{type:We.TABLE,label:"Table",description:"Existing table"},{type:We.VIEW,label:"View",description:"Existing view"},{type:We.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:We.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return o.jsxs("div",{className:"dm-card-block",children:[o.jsx(xa,{className:"text-foreground",children:"Definition Type"}),o.jsxs(ba,{value:n??"",onValueChange:d=>{s(d)},children:[o.jsx(Ca,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:o.jsx(Sa,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),o.jsx(wa,{children:o.jsx(wg,{children:l.map(d=>o.jsxs(Hn,{value:d.type,children:[d.label,o.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const JX=en({definitionType:$s(We.SQL),definition:en({sqlQuery:tn().min(1,"SQL query is required")})}),eJ=e=>{const t=g4(e);return en({definitionType:$s(We.TABLE),definition:t})},tJ=e=>{const t=g4(e);return en({definitionType:$s(We.VIEW),definition:t})},nJ=e=>{const t=$q(e);return en({definitionType:$s(We.TABLE_PATTERN),definition:t})},rJ=en({definitionType:$s(We.CONNECTOR),definition:en({connector:en({source:en({name:tn().min(1,"Connector name is required"),configuration:P2(E$(C$())).min(1,"At least one configuration is required"),node:tn().min(1,"Node is required"),fields:P2(tn()).min(1,"At least one field is required")}),storage:en({fullyQualifiedName:tn().min(1,"fully qualified name is required")})})})}),aJ=(e,t)=>{if(!e)return en({definitionType:R$(Yb(We)),definition:en({}).optional()});switch(e){case We.SQL:return JX;case We.TABLE:return eJ(t);case We.VIEW:return tJ(t);case We.TABLE_PATTERN:return nJ(t);case We.CONNECTOR:return rJ;default:return en({})}};function sJ({control:e}){return o.jsx(Zt,{control:e,name:"definition.sqlQuery",render:({field:t})=>o.jsxs(Yt,{className:"dm-card-block",children:[o.jsx(Wt,{className:"text-foreground",children:"SQL Query"}),o.jsx(Qt,{children:o.jsx(MQ,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),o.jsx(nn,{})]})})}function oJ({control:e,storageType:t}){const n=XA(t),r=JA(t);return o.jsx(Zt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Yt,{className:"dm-card-block",children:[o.jsx(Wt,{children:"Fully Qualified Table Name"}),o.jsx(Qt,{children:o.jsx(Bt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(er,{className:"text-muted-foreground/75",children:r}),o.jsx(nn,{})]})})}function iJ({control:e,storageType:t}){const n=XA(t),r=JA(t);return o.jsx(Zt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Yt,{className:"dm-card-block",children:[o.jsx(Wt,{children:"Fully Qualified View Name"}),o.jsx(Qt,{children:o.jsx(Bt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(er,{className:"text-muted-foreground/75",children:r}),o.jsx(nn,{})]})})}function lJ({control:e,storageType:t}){const n=IG(t),r=LG(t);return o.jsx(Zt,{control:e,name:"definition.pattern",render:({field:s})=>o.jsxs(Yt,{className:"dm-card-block",children:[o.jsx(Wt,{children:"Table Pattern"}),o.jsx(Qt,{children:o.jsx(Bt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(er,{className:"text-muted-foreground/75",children:r}),o.jsx(nn,{})]})})}const VO=e=>{switch(e){case We.SQL:return{sqlQuery:""};case We.TABLE:return{fullyQualifiedName:""};case We.VIEW:return{fullyQualifiedName:""};case We.TABLE_PATTERN:return{pattern:""};case We.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},cJ=yf("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function qS({className:e,variant:t,...n}){return o.jsx("div",{"data-slot":"alert",role:"alert",className:ie(cJ({variant:t}),e),...n})}function HO({className:e,...t}){return o.jsx("div",{"data-slot":"alert-title",className:ie("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function KS({className:e,...t}){return o.jsx("div",{"data-slot":"alert-description",className:ie("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function uJ({children:e,className:t="",...n}){return o.jsx("div",{className:ie("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function dJ({children:e,className:t="",...n}){return o.jsx("div",{className:ie("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:o.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function fJ({children:e,className:t="",variant:n="horizontal",...r}){const s=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return o.jsx("div",{className:ie(s,t),...r,children:e})}function Vd({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step-item",className:ie("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",t),...n,children:e})}function Gc({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...l}){return o.jsxs(xa,{"data-slot":"wizard-step-label",className:ie("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...l,children:[t?o.jsxs(jt,{...r,children:[o.jsx(_t,{asChild:!0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[e,o.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),o.jsx(Nt,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):o.jsx("span",{children:e}),n&&o.jsxs(jt,{...r,children:[o.jsx(_t,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:o.jsx(Lr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(Nt,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function bl({title:e,children:t,className:n="",...r}){return o.jsxs("section",{"data-slot":"wizard-step-section",className:ie("mb-4",n),...r,children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function Ai({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:l,...c}){return s==="compact"?o.jsxs("div",{"data-slot":"wizard-step-hero",className:ie("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",l),...c,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[e&&o.jsx("div",{children:e}),o.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&o.jsx(we,{variant:"outline",asChild:!0,children:o.jsxs(Ha,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(wl,{className:"h-4 w-4"})]})})]}):o.jsxs("div",{"data-slot":"wizard-step-hero",className:ie("mb-6 flex flex-col items-center justify-center text-center",l),...c,children:[e&&o.jsx("div",{className:"mt-6 mb-3",children:e}),o.jsx("h2",{className:"text-xl font-medium",children:t}),n&&o.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&o.jsx(we,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:o.jsxs(Ha,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(wl,{className:"h-4 w-4"})]})})]})}function So({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step",className:ie("space-y-4",t),...n,children:e})}function hJ({children:e,className:t="",...n}){return o.jsx("div",{className:ie("grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",t),...n,children:e})}function bT({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:l,className:c="",...d}){return o.jsxs("div",{className:ie("border-border flex items-center gap-4 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",r?"cursor-not-allowed opacity-50 hover:shadow-none":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",n&&!r?"ring-primary border-transparent ring-2 dark:bg-white/8":"",c),onClick:s,onDoubleClick:l,...d,children:[e&&o.jsx("span",{className:"shrink-0",children:e}),r?o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),o.jsx(Nt,{side:"top",align:"center",children:"Coming soon"})]}):o.jsx("span",{className:"text-sm font-medium",children:t})]})}function $O({type:e,id:t,name:n,value:r,label:s,checked:l,selected:c=!1,disabled:d=!1,tooltip:h,rightIcon:m,onChange:g,className:v="",...x}){const b=C=>{g&&g(e==="checkbox"?C.target.checked:C.target.value)},w=p.useRef(null);return o.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:C=>{if(d)return;const E=C.target;E.tagName==="INPUT"||E.tagName==="LABEL"||E.closest("label")||w.current&&w.current.click()},className:ie("group border-border flex items-center gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",d?"cursor-not-allowed":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",c?"ring-primary border-transparent ring-2 dark:bg-white/8":"",v),children:[o.jsx("input",{ref:w,id:t,type:e,name:n,value:r,checked:l,disabled:d,onChange:b,className:ie("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"h-4 w-4":"h-8 w-full rounded-md border px-2"),...x}),s&&o.jsx(Gc,{htmlFor:t,className:ie("cursor-pointer",d&&"cursor-not-allowed"),children:s}),(h||m)&&o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[h&&o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(Lr,{className:"text-muted-foreground/75 pointer-events-none h-4 w-4 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100","data-tooltip-trigger":!0})}),o.jsx(Nt,{side:"top",align:"center",children:h})]}),m&&o.jsx("div",{className:"flex items-center",children:m})]})]})}function ZS({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),s=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return o.jsx("div",{"data-slot":"wizard-step-loading",className:ie(s,n),children:Array.from({length:r}).map((l,c)=>o.jsx(ts,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function mJ({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:l}){return n?o.jsx(ZS,{variant:"grid"}):r?o.jsxs(qS,{variant:"destructive",children:[o.jsx(xf,{className:"h-4 w-4"}),o.jsx(KS,{children:"Failed to load available connectors. Please try again."})]}):o.jsxs(So,{children:[o.jsx(bl,{title:"Choose Connector",children:o.jsxs(hJ,{children:[e.map(c=>o.jsx(bT,{icon:c.logoBase64?o.jsx(Lf,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),l==null||l(c)}},c.name)),o.jsx(bT,{icon:o.jsx(fb,{className:"h-5 w-5"}),title:"Custom code",disabled:!0},"custom-code")]})}),e.length===0&&o.jsx(Ai,{icon:o.jsx(ef,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function pJ({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:l,onBack:c,onFinish:d,nextLabel:h="Next",backLabel:m="Back",finishLabel:g="Finish"}){const v=e===t;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex-1",children:r&&o.jsxs(we,{variant:"outline",onClick:c,disabled:s,children:[o.jsx(xL,{className:"h-4 w-4"}),m]})}),o.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex flex-1 justify-end",children:v?o.jsx(we,{variant:"default",onClick:d,disabled:!n||s,children:g}):o.jsxs(we,{variant:"default",onClick:l,disabled:!n||s,children:[h,o.jsx(hs,{className:"h-4 w-4"})]})})]})}function Sl({connector:e,size:t=24,variant:n="compact"}){return o.jsx(Ai,{icon:o.jsx(Lf,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function eu({label:e}){return o.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:o.jsx(we,{variant:"outline",asChild:!0,children:o.jsxs(Ha,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",o.jsx(wl,{className:"h-4 w-4"})]})})})}const H0="**********";function gJ(e,t,n,r){const{name:s,title:l,requiredType:c,options:d,placeholder:h,default:m}=e,g=l??s,v=s,{isSecret:x=!1,isEditingExisting:b=!1,isSecretEditing:w=!1}=r??{};if(x){const C=b&&!w;return o.jsx(Bt,{id:e.name,...C?{}:{name:e.name},type:C?"password":"text",autoComplete:C?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:C?H0:t[e.name]||"",...C?{readOnly:!0,disabled:!0}:{},...C?{}:{placeholder:h??`Enter ${g.toLowerCase()}`},...C?{}:{onChange:E=>{n(e.name,E.target.value)}}})}if(d&&d.length>0){const C=d.map(E=>({value:E,label:E}));return o.jsx(PS,{options:C,value:t[s]||m||"",onValueChange:E=>{n(s,E)},placeholder:h??`Select ${g.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}switch(c){case _s.BOOLEAN:return o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("input",{type:"checkbox",id:v,name:s,checked:t[s]||m||!1,onChange:C=>{n(s,C.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),o.jsx(xa,{htmlFor:v,className:"cursor-pointer text-sm",children:g})]});case _s.NUMBER:return o.jsx(Bt,{id:v,name:s,type:"number",value:t[s]||m||"",placeholder:h??`Enter ${g.toLowerCase()}`,onChange:C=>{const E=parseFloat(C.target.value)||0;n(s,E)}});case _s.ARRAY:return o.jsx(Ti,{id:v,name:s,value:Array.isArray(t[s])?t[s].join(`
|
|
709
|
-
`):Array.isArray(m)?m.join(`
|
|
710
|
-
`):"",placeholder:h??`Enter ${g.toLowerCase()} (one per line)`,rows:4,onChange:C=>{const E=C.target.value.split(`
|
|
711
|
-
`).filter(R=>R.trim());n(s,E)}});case _s.OBJECT:return o.jsx(Ti,{id:v,name:s,value:t[s]&&typeof t[s]=="object"?JSON.stringify(t[s],null,2):typeof m=="object"?JSON.stringify(m,null,2):"",placeholder:h??`Enter ${g.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:C=>{try{const E=JSON.parse(C.target.value);n(s,E)}catch{n(s,C.target.value)}}});case _s.DATE:{const C=E=>{if(!E||typeof E!="string"&&typeof E!="number")return"";const R=typeof E=="string"?E:E.toString();try{const T=new Date(R);return isNaN(T.getTime())?"":T.toISOString().split("T")[0]}catch{return""}};return o.jsx(Bt,{id:v,name:s,type:"date",value:t[s]||C(m)||"",placeholder:h??`Enter ${g.toLowerCase()}`,onChange:E=>{n(s,E.target.value)}})}case _s.STRING:default:return o.jsx(Bt,{id:v,name:s,type:"text",value:t[s]||m||"",placeholder:h??`Enter ${g.toLowerCase()}`,onChange:C=>{n(s,C.target.value)}})}}function ST({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:l=!1,isEditingExisting:c=!1}){const[d,h]=p.useState({}),m=p.useRef(!1),g=p.useRef(!1),[v,x]=p.useState({});p.useEffect(()=>{if(t){g.current=!0;const E={...s??{}};t.forEach(R=>{const T=Array.isArray(R.attributes)?R.attributes.includes("SECRET"):!1;E[R.name]===void 0&&R.default!==void 0&&(E[R.name]=R.default),c&&T&&(E[R.name]=H0)}),h(E),m.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,s,c]),p.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(g.current=!0,h({...s}),setTimeout(()=>{g.current=!1},0))},[s]),p.useEffect(()=>{m.current&&!g.current&&Object.keys(d).length>0&&(n==null||n(d))},[d,n]);const b=(E,R)=>{h(T=>({...T,[E]:R}))},w=(E,R)=>R.filter(j=>j.required&&j.showInUI!==!1&&j.name!=="Fields").every(j=>{const O=E[j.name];return!(O==null||typeof O=="string"&&O.trim()===""||Array.isArray(O)&&O.length===0)});if(p.useEffect(()=>{if(t&&r){const E=w(d,t);r(E)}},[d,t,r]),l)return o.jsx(ZS,{variant:"list"});if(!t||t.length===0)return o.jsxs(So,{children:[o.jsx(Sl,{connector:e}),o.jsx(Ai,{icon:o.jsx(ef,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(eu,{label:"Need configuration?"})]});const C=[...t].filter(E=>E.showInUI!==!1&&E.name!=="Fields").sort((E,R)=>{const T=j=>{const O=j.default!=null&&j.default!=="";return j.required&&!O?1:j.required&&O?2:!j.required&&!O?3:4};return T(E)-T(R)});return o.jsx(o.Fragment,{children:o.jsxs(So,{children:[o.jsx(Sl,{connector:e}),o.jsx(bl,{title:"Configure Settings",children:C.map(E=>{const R=Array.isArray(E.attributes)?E.attributes.includes("SECRET"):!1,T=v[E.name],j=(O,D)=>{x(N=>({...N,[O]:D})),h(D?N=>({...N,[O]:""}):N=>({...N,[O]:H0}))};return o.jsxs(Vd,{children:[E.requiredType!==_s.BOOLEAN&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Gc,{htmlFor:E.name,required:E.required,tooltip:E.description,children:E.title??E.name}),R&&c&&o.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{j(E.name,!T)},children:T?"Cancel":"Edit"})]}),gJ(E,d,b,{isSecret:R,isEditingExisting:c,isSecretEditing:T})]},E.name)})})]})})}function vJ({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:l}){const c=r?`Select data for ${r}`:"Select data";return s?o.jsx(ZS,{variant:"list"}):!t||t.length===0?o.jsxs(So,{children:[o.jsx(Sl,{connector:e}),o.jsx(Ai,{icon:o.jsx(ef,{size:56,strokeWidth:1}),title:r?`No nodes found for ${r}`:"No nodes found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(eu,{label:"Missing some data?"})]}):o.jsxs(So,{children:[o.jsx(Sl,{connector:e}),o.jsxs(bl,{title:c,children:[t.map(d=>o.jsx($O,{type:"radio",id:d.name,name:"selectedField",value:d.name,label:d.overview??d.name,checked:n===d.name,onChange:h=>{l(h)},tooltip:d.name&&o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Table name:"})," ",d.destinationName??d.name]}),d.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",d.description]}),d.documentation&&o.jsxs(Ha,{to:d.documentation,target:"_blank",rel:"noopener noreferrer",className:"bg-muted/16 hover:bg-muted/20 dark:bg-muted/8 dark:hover:bg-muted/16 flex items-center justify-center gap-1 rounded-sm px-2 py-1 font-semibold",children:["Read more",o.jsx(hs,{className:"h-3 w-3"})]})]}),selected:n===d.name},d.name)),o.jsx(eu,{label:"Missing some data?"})]})]})}var js=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(js||{});function CT({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const l=p.useRef(null),[c,d]=p.useState(""),[h,m]=p.useState(js.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),v=p.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),x=p.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),b=p.useMemo(()=>{const R=new Map;return v.forEach((T,j)=>R.set(T.name,j)),R},[v]),w=p.useMemo(()=>{const R=v.filter(j=>j.name.toLowerCase().includes(c.toLowerCase().trim())),T=(j,O)=>{const D=x.includes(j.name),N=x.includes(O.name);if(D&&!N)return-1;if(!D&&N)return 1;if(h===js.ASC)return j.name.localeCompare(O.name);if(h===js.DESC)return O.name.localeCompare(j.name);const A=b.get(j.name)??0,k=b.get(O.name)??0;return A-k};return[...R].sort(T)},[v,c,x,h,b]),C=v.map(R=>R.name),E=r.filter(R=>C.includes(R)).length;return p.useEffect(()=>{if(x.length>0){const R=x.filter(T=>v.some(j=>j.name===T)&&!r.includes(T));R.length>0&&R.forEach(T=>{s(T,!0)})}},[n,x,v,r,s]),!n||!t?o.jsxs(So,{children:[o.jsx(Sl,{connector:e}),o.jsx(Ai,{icon:o.jsx(ef,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(eu,{label:"Need fields?"})]}):v.length?o.jsx(So,{children:o.jsxs(o.Fragment,{children:[o.jsx(Sl,{connector:e}),o.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Ll,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=l.current)==null||R.focus()}}),o.jsx("input",{ref:l,type:"text",placeholder:"Search field",value:c,onChange:R=>{d(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&o.jsx("button",{type:"button",onClick:()=>{d("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(ru,{className:"h-4 w-4"})})]}),o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[h===js.ASC&&o.jsx(_R,{className:"text-muted-foreground h-4 w-4"}),h===js.DESC&&o.jsx(jR,{className:"text-muted-foreground h-4 w-4"}),h===js.ORIGINAL&&o.jsx(NR,{className:"text-muted-foreground h-4 w-4"})]})}),o.jsxs(Or,{align:"end",children:[o.jsxs(Tt,{onSelect:()=>{m(js.ASC)},children:[o.jsx(_R,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),o.jsxs(Tt,{onSelect:()=>{m(js.DESC)},children:[o.jsx(jR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),o.jsxs(Tt,{onSelect:()=>{m(js.ORIGINAL)},children:[o.jsx(NR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),o.jsxs(bl,{title:`Selected ${String(E)} of ${String(C.length)} fields for "${n}" data`,children:[w.map(R=>{const T=x.includes(R.name);return o.jsx($O,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||T,disabled:T,onChange:j=>{s(R.name,j)},label:R.name,tooltip:o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[T&&o.jsxs("p",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-semibold",children:"Unique key"})," ",o.jsx(Xx,{className:"text-secondary h-3 w-3"})]}),o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:T?o.jsx(Xx,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),w.length===0&&c&&o.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),o.jsx(eu,{label:"Need another field?"})]})]})}):o.jsxs(So,{children:[o.jsx(Sl,{connector:e}),o.jsx(Ai,{icon:o.jsx(ef,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(eu,{label:"Need fields?"})]})}const BO=p.createContext(void 0),GO={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function yJ(e,t){switch(t.type){case"FETCH_TRIGGERS_START":case"FETCH_TRIGGER_START":case"CREATE_TRIGGER_START":case"UPDATE_TRIGGER_START":case"DELETE_TRIGGER_START":return{...e,isLoading:!0,error:null};case"FETCH_TRIGGERS_SUCCESS":return{...e,triggers:t.payload,isLoading:!1};case"FETCH_TRIGGER_SUCCESS":return{...e,selectedTrigger:t.payload,isLoading:!1};case"CREATE_TRIGGER_SUCCESS":return{...e,triggers:[...e.triggers,t.payload],isLoading:!1};case"UPDATE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.map(n=>n.id===t.payload.id?t.payload:n),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload.id?t.payload:e.selectedTrigger,isLoading:!1};case"DELETE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.filter(n=>n.id!==t.payload),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload?null:e.selectedTrigger,isLoading:!1};case"FETCH_TRIGGERS_ERROR":case"FETCH_TRIGGER_ERROR":case"CREATE_TRIGGER_ERROR":case"UPDATE_TRIGGER_ERROR":case"DELETE_TRIGGER_ERROR":return{...e,isLoading:!1,error:t.payload};case"SELECT_TRIGGER":return{...e,selectedTrigger:t.payload};case"RESET":return GO;default:return e}}class xJ extends Vl{constructor(){super("/data-marts")}async getScheduledTriggers(t){return this.get(`/${t}/scheduled-triggers`)}async getScheduledTrigger(t,n){return this.get(`/${t}/scheduled-triggers/${n}`)}async createScheduledTrigger(t,n){return this.post(`/${t}/scheduled-triggers`,n)}async updateScheduledTrigger(t,n,r){return this.put(`/${t}/scheduled-triggers/${n}`,r)}async deleteScheduledTrigger(t,n){return this.delete(`/${t}/scheduled-triggers/${n}`)}}const Ic=new xJ;var pn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(pn||{});const qc={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class $0{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}async enhanceWithReportData(t){if(t.type!==pn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await po.getReportById(n.reportId),s=ml(r);return{...t,triggerConfig:{...n,report:s}}}catch(r){return console.error(`Failed to fetch report data for trigger ${t.id}:`,r),t}}async enhanceTriggersWithReportData(t){return Promise.all(t.map(n=>this.enhanceWithReportData(n)))}mapToCreateRequest(t){return{type:pn.REPORT_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}class bJ{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToCreateRequest(t){return{type:pn.CONNECTOR_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}const Ux={getMapper(e){switch(e){case pn.REPORT_RUN:return new $0;case pn.CONNECTOR_RUN:return new bJ;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},kd={mapFromDto(e){return Ux.getMapper(e.type).mapFromDto(e)},mapFromDtoList(e){return e.map(t=>this.mapFromDto(t))},async mapFromDtoWithReportData(e,t){const n=this.mapFromDto(e);switch(n.type){case pn.REPORT_RUN:return new $0().enhanceWithReportData(n);case pn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new $0,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===pn.REPORT_RUN),l=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case pn.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case pn.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return Ux.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return Ux.getMapper(e.type).mapToUpdateRequest(e)}};function SJ({children:e}){const[t,n]=p.useReducer(yJ,GO),{dataMart:r}=zi(),{fetchAvailableConnectors:s}=$l();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=p.useCallback(async b=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const w=await Ic.getScheduledTriggers(b),C=await kd.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:C})}catch(w){n({type:"FETCH_TRIGGERS_ERROR",payload:w instanceof Error?w.message:"Failed to fetch scheduled triggers"})}},[r,s]),c=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await Ic.getScheduledTriggers(b)).filter(T=>T.type===w),R=await kd.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(C){n({type:"FETCH_TRIGGERS_ERROR",payload:C instanceof Error?C.message:"Failed to fetch scheduled triggers"})}},[r]),d=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGER_START"});try{const C=await Ic.getScheduledTrigger(b,w),E=await kd.mapFromDtoWithReportData(C,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(C){n({type:"FETCH_TRIGGER_ERROR",payload:C instanceof Error?C.message:"Failed to fetch scheduled trigger"})}},[r]),h=p.useCallback(async(b,w,C,E,R,T)=>{n({type:"CREATE_TRIGGER_START"});try{const j={type:w,cronExpression:C,timeZone:E,isActive:R,triggerConfig:T},O=await Ic.createScheduledTrigger(b,j),D=await kd.mapFromDtoWithReportData(O,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:D}),Jt.success("Trigger created"),D}catch(j){throw n({type:"CREATE_TRIGGER_ERROR",payload:j instanceof Error?j.message:"Failed to create scheduled trigger"}),j}},[r]),m=p.useCallback(async(b,w,C,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const T={cronExpression:C,timeZone:E,isActive:R},j=await Ic.updateScheduledTrigger(b,w,T),O=await kd.mapFromDtoWithReportData(j,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:O}),Jt.success("Trigger updated")}catch(T){throw n({type:"UPDATE_TRIGGER_ERROR",payload:T instanceof Error?T.message:"Failed to update scheduled trigger"}),T}},[r]),g=p.useCallback(async(b,w)=>{n({type:"DELETE_TRIGGER_START"});try{await Ic.deleteScheduledTrigger(b,w),n({type:"DELETE_TRIGGER_SUCCESS",payload:w}),Jt.success("Trigger deleted")}catch(C){throw n({type:"DELETE_TRIGGER_ERROR",payload:C instanceof Error?C.message:"Failed to delete scheduled trigger"}),C}},[]),v=p.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),x=p.useCallback(()=>{n({type:"RESET"})},[]);return o.jsx(BO.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:h,updateScheduledTrigger:m,deleteScheduledTrigger:g,selectScheduledTrigger:v,reset:x},children:e})}function qO(){const e=p.useContext(BO);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function CJ(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:h,triggers:m,selectedTrigger:g,isLoading:v,error:x}=qO();return p.useEffect(()=>(e?t(e):h(),()=>{h()}),[e,t,h]),{triggers:m,selectedTrigger:g,isLoading:v,error:x,getScheduledTriggers:b=>t(b),getScheduledTriggersByType:(b,w)=>n(b,w),getScheduledTrigger:(b,w)=>r(b,w),createScheduledTrigger:(b,w,C,E,R,T)=>s(b,w,C,E,R,T),updateScheduledTrigger:(b,w,C,E,R)=>l(b,w,C,E,R),deleteScheduledTrigger:(b,w)=>c(b,w),selectScheduledTrigger:d}}const wJ=en({type:$s(qc.SCHEDULED_REPORT_RUN),reportId:tn().min(1,"Report ID is required")}),EJ=S$(),RJ=en({type:Yb(pn),cronExpression:tn().min(1,"Cron expression is required"),timeZone:tn().min(1,"Time zone is required"),isActive:b$(),triggerConfig:w$([wJ,EJ])});function TJ({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Vi({resolver:Kl(RJ),defaultValues:{type:e?e.type:n??pn.REPORT_RUN,cronExpression:(e==null?void 0:e.cronExpression)??"",timeZone:(e==null?void 0:e.timeZone)??Intl.DateTimeFormat().resolvedOptions().timeZone,isActive:(e==null?void 0:e.isActive)??!0,triggerConfig:e?e.triggerConfig:{type:qc.SCHEDULED_REPORT_RUN,reportId:t??""}}});p.useEffect(()=>{t&&s.getValues("type")===pn.REPORT_RUN&&s.setValue("triggerConfig",{type:qc.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),p.useEffect(()=>{n&&(s.setValue("type",n),n===pn.REPORT_RUN?s.setValue("triggerConfig",{type:qc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const l=d=>{s.setValue("type",d),d===pn.REPORT_RUN?s.setValue("triggerConfig",{type:qc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(h){console.error("Error submitting form:",h)}};return{form:s,handleTypeChange:l,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}function jJ({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=Hl(),{dataMart:l}=zi();p.useEffect(()=>{l&&s(l.id)},[s,l]);const c=r.filter(d=>d.dataDestination.type===It.GOOGLE_SHEETS);return o.jsxs(ba,{value:e,onValueChange:t,disabled:n,children:[o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{placeholder:"Select a report"})}),o.jsx(wa,{children:c.map(d=>o.jsx(Hn,{value:d.id,children:d.title},d.id))})]})}var Dg="Switch",[_J]=Ur(Dg),[NJ,AJ]=_J(Dg),KO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:h="on",onCheckedChange:m,form:g,...v}=e,[x,b]=p.useState(null),w=vt(t,j=>b(j)),C=p.useRef(!1),E=x?g||!!x.closest("form"):!0,[R,T]=Xr({prop:s,defaultProp:l??!1,onChange:m,caller:Dg});return o.jsxs(NJ,{scope:n,checked:R,disabled:d,children:[o.jsx(Ye.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":QO(R),"data-disabled":d?"":void 0,disabled:d,value:h,...v,ref:w,onClick:je(e.onClick,j=>{T(O=>!O),E&&(C.current=j.isPropagationStopped(),C.current||j.stopPropagation())})}),E&&o.jsx(WO,{control:x,bubbles:!C.current,name:r,value:h,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});KO.displayName=Dg;var ZO="SwitchThumb",YO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=AJ(ZO,n);return o.jsx(Ye.span,{"data-state":QO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});YO.displayName=ZO;var DJ="SwitchBubbleInput",WO=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},l)=>{const c=p.useRef(null),d=vt(c,l),h=NS(n),m=jb(t);return p.useEffect(()=>{const g=c.current;if(!g)return;const v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(h!==n&&b){const w=new Event("click",{bubbles:r});b.call(g,n),g.dispatchEvent(w)}},[h,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:d,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});WO.displayName=DJ;function QO(e){return e?"checked":"unchecked"}var OJ=KO,MJ=YO;function XO({className:e,...t}){return o.jsx(OJ,{"data-slot":"switch",className:ie("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(MJ,{"data-slot":"switch-thumb",className:ie("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function kJ(e){const t=e.trim().split(/\s+/);return t.length!==5?null:{minute:t[0],hour:t[1],day:t[2],month:t[3],dayOfWeek:t[4]}}function B0(e,t="UTC"){const n=kJ(e);if(!n)return{type:"daily",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};const{minute:r,hour:s,day:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&s==="*"&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(r.substring(2));if(!isNaN(v))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:v,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(s.substring(2));if(!isNaN(v)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:v,timezone:t}}const h=Number.parseInt(r),m=Number.parseInt(s),g=!isNaN(h)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}`:"09:00";if(!isNaN(h)&&!isNaN(m)&&l==="*"&&c==="*"&&d==="*")return{type:"daily",time:g,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(h)&&!isNaN(m)&&l==="*"&&c==="*"&&d!=="*"){const v=d.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(v.length>0)return{type:"weekly",time:g,weekdays:v,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(h)&&!isNaN(m)&&l!=="*"&&c==="*"&&d==="*"){const v=l.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(v.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:v,customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}return{type:"custom",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}function JO({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:l=3}){const[c,d]=p.useState(!1),h=v=>{const x=t.includes(v)?t.filter(b=>b!==v):[...t,v].sort((b,w)=>b-w);n(x)},m=(v,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(b=>b!==v))},g=()=>{if(t.length===0)return o.jsx("span",{className:"text-muted-foreground text-sm",children:r});const v=t.map(x=>e.find(b=>b.value===x)).filter(Boolean);return v.length<=l?o.jsx("div",{className:"flex flex-wrap gap-1",children:v.map(x=>o.jsxs(Er,{variant:"secondary",className:"h-5 text-xs",children:[x.label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:b=>m(x.value,b),children:o.jsx(ru,{className:"h-2 w-2"})})]},x.value))}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(Er,{variant:"secondary",className:"h-5 text-xs",children:[v[0].label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:x=>m(v[0].value,x),children:o.jsx(ru,{className:"h-2 w-2"})})]}),v.length>1&&o.jsxs(Er,{variant:"outline",className:"h-5 text-xs",children:["+",v.length-1]})]})};return o.jsxs(kS,{open:c,onOpenChange:d,modal:!0,children:[o.jsx(IS,{asChild:!0,children:o.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[o.jsx("div",{className:"flex-1 text-left",children:g()}),o.jsx(db,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),o.jsx(LS,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:o.jsxs(oO,{className:"h-full overflow-visible",children:[o.jsx(iO,{placeholder:s,className:"h-8"}),o.jsxs(aX,{className:"h-full max-h-[350px] overflow-y-auto",children:[o.jsx(lO,{children:"No items found."}),o.jsx(cO,{className:"h-full overflow-visible",children:e.map(v=>o.jsxs(uO,{value:v.value.toString(),onSelect:()=>h(v.value),className:"text-sm",children:[o.jsx(ir,{className:ie("mr-2 h-3 w-3",t.includes(v.value)?"opacity-100":"opacity-0")}),v.label]},v.value))})]})]})})]})}const e3=[{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"},{value:0,label:"Sunday"}],_m=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function t3(e,t){if(!t)return"Schedule is disabled";const n=e.time;switch(e.type){case"daily":return`Daily at ${n}`;case"weekly":return`Weekly on ${e.weekdays.map(s=>{var l;return(l=e3.find(c=>c.value===s))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,d)=>c-d).map(c=>c===1?"1st":c===2?"2nd":c===3?"3rd":`${String(c)}th`);return`Monthly on the ${s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s[s.length-1]}`} at ${n}`}case"interval":return e.intervalType==="minutes"?`Every ${String(e.intervalValue)} minute${e.intervalValue!==1?"s":""}`:`Every ${String(e.intervalValue)} hour${e.intervalValue!==1?"s":""}`;case"custom":return"Custom schedule";default:return""}}function IJ(e,t,n=!0){const r=B0(e,t);return t3(r,n)}const LJ=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),G0=[5,10,15,30],q0=[1,2,3,4,6,8,12],PJ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(xa,{children:"Type"}),o.jsxs(ba,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{})}),o.jsxs(wa,{children:[o.jsx(Hn,{value:"daily",children:"Daily"}),o.jsx(Hn,{value:"weekly",children:"Weekly"}),o.jsx(Hn,{value:"monthly",children:"Monthly"}),o.jsx(Hn,{value:"interval",children:"Interval"})]})]})]}),UJ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(xa,{children:"Time"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(Bt,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),wT=({value:e,onChange:t,disabled:n,timezones:r})=>o.jsxs("div",{className:"w-full space-y-2",children:[o.jsx(xa,{children:"Timezone"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(PS,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),FJ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(xa,{children:"Days of Week"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(JO,{options:e3,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),zJ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(xa,{children:"Days of Month"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(JO,{options:LJ,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),VJ=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xa,{children:"Type"}),o.jsxs(ba,{value:e,onValueChange:l=>{n(l)},disabled:s,children:[o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{})}),o.jsxs(wa,{children:[o.jsx(Hn,{value:"minutes",children:"Minutes"}),o.jsx(Hn,{value:"hours",children:"Hours"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xa,{children:"Every"}),o.jsxs(ba,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:s,children:[o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{})}),o.jsx(wa,{children:(e==="minutes"?G0:q0).map(l=>o.jsxs(Hn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),HJ=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(xa,{className:"text-sm",children:"Cron Expression"}),o.jsx(Bt,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function $J({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:l=!0,showSaveButton:c=!1}){const[d,h]=p.useState(n),[m,g]=p.useState(t??_m()),[v,x]=p.useState(!1),b=p.useMemo(()=>qB.getTimezonesWithOffset().map(G=>({value:G.identifier,label:G.displayName,offset:G.offsetString,isDST:G.isDST})),[]),[w,C]=p.useState(()=>B0(e,m)),[E,R]=p.useState(""),[T,j]=p.useState("");p.useEffect(()=>{h(n)},[n]),p.useEffect(()=>{const G=t??_m();g(G)},[t]),p.useEffect(()=>{if(e){const G=B0(e,m);C(G)}},[e,m]);const O=G=>{const[Q,I]=G.time.split(":").map(Number);switch(G.type){case"daily":return`${String(I)} ${String(Q)} * * *`;case"weekly":return`${String(I)} ${String(Q)} * * ${G.weekdays.join(",")}`;case"monthly":return`${String(I)} ${String(Q)} ${G.monthDays.join(",")} * *`;case"interval":return G.intervalType==="minutes"?`*/${String(G.intervalValue)} * * * *`:`0 */${String(G.intervalValue)} * * *`;case"custom":return G.customCron;default:return`${String(I)} ${String(Q)} * * *`}},D=p.useCallback(G=>{C(Q=>{if(Q.intervalType===G)return console.log("Type unchanged, skipping update"),Q;const Y=(G==="minutes"?G0:q0)[0];return{...Q,intervalType:G,intervalValue:Y}})},[]),N=p.useCallback(G=>{C(Q=>(Q.intervalType==="minutes"?G0:q0).includes(G)?{...Q,intervalValue:G}:Q)},[]),A=p.useMemo(()=>G=>t3(G,d),[d]);p.useEffect(()=>{const G=O(w);R(G),j(A(w))},[w,d,m,A]);const k=p.useRef(""),V=p.useRef(""),q=p.useRef(!1);p.useEffect(()=>{const G=O(w);r&&(k.current!==G||V.current!==m||q.current!==d)&&(r({cron:G,timezone:m,enabled:d}),k.current=G,V.current=m,q.current=d)},[w,m,d,r]);const H=G=>{h(G)},W=G=>{g(G),C(Q=>({...Q,timezone:G}))},re=["daily","weekly","monthly"].includes(w.type);return o.jsxs("div",{className:s,children:[o.jsx("div",{className:"mb-4 space-y-4 pt-0",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xa,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),o.jsx(XO,{id:"schedule-enabled",checked:d,onCheckedChange:H})]})]})}),o.jsxs("div",{className:"space-y-4 pt-0",children:[o.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[o.jsx(PJ,{value:w.type,onChange:G=>{C(Q=>({...Q,type:G}))},disabled:!d}),w.type!=="custom"&&w.type!=="interval"&&o.jsxs("div",{className:"flex gap-3",children:[o.jsx(UJ,{value:w.time,onChange:G=>{C(Q=>({...Q,time:G}))},disabled:!d}),re&&o.jsx(wT,{value:m,onChange:W,disabled:!d,timezones:b})]}),(w.type==="interval"||w.type==="custom")&&o.jsx(wT,{value:m,onChange:W,disabled:!d,timezones:b}),w.type==="weekly"&&o.jsx(FJ,{value:w.weekdays,onChange:G=>{C(Q=>({...Q,weekdays:G}))},disabled:!d}),w.type==="monthly"&&o.jsx(zJ,{value:w.monthDays,onChange:G=>{C(Q=>({...Q,monthDays:G}))},disabled:!d}),w.type==="interval"&&o.jsx(VJ,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:D,onValueChange:N,disabled:!d}),w.type==="custom"&&o.jsx(HJ,{value:w.customCron,onChange:G=>{C(Q=>({...Q,customCron:G}))},disabled:!d})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx(qj,{className:"my-3"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{x(!v)},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Dj,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),v?o.jsx(Ls,{className:"text-muted-foreground h-4 w-4"}):o.jsx(Ga,{className:"text-muted-foreground h-4 w-4"})]}),v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),o.jsx(Er,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),o.jsx(Er,{variant:"secondary",className:"font-mono text-xs",children:E})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),o.jsx(Er,{variant:"outline",className:"text-xs",children:m})]}),o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),o.jsx("span",{className:"flex-1 text-right text-xs",children:T})]})]}),d&&re&&m!==_m()&&o.jsxs(qS,{className:"border-amber-200 bg-amber-50",children:[o.jsx(xf,{className:"h-4 w-4"}),o.jsx(HO,{children:"Time Zone"}),o.jsxs(KS,{children:["Schedule runs in ",m," (not your local ",_m()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&o.jsx(we,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function BJ(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"trigger-type-options-description-details",children:[o.jsx(Gn,{children:"How do I choose a type?"}),o.jsxs(qn,{children:[o.jsxs("p",{className:"mb-2",children:[o.jsx("strong",{children:"Report Run"})," - runs a report to import data from the specified Data Storage into a Destination provider (e.g. Google Sheets document)."]}),o.jsxs("p",{className:"mb-2",children:[o.jsx("strong",{children:"Connector Run"})," - runs a connector (e.g., Facebook Ads) configured in the Data Mart to update raw data in the selected Data Storage."]})]})]})})}function GJ(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"trigger-type-change-description-details",children:[o.jsx(Gn,{children:"How do I change the trigger type?"}),o.jsx(qn,{children:o.jsx("p",{children:"Trigger type cannot be changed after the trigger is created. If you need a different type, delete the existing trigger and create a new one with the desired type."})})]})})}function qJ(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"report-change-description-details",children:[o.jsx(Gn,{children:"How do I change a report?"}),o.jsx(qn,{children:o.jsx("p",{children:"The report cannot be changed after the trigger is created. If you need a different report, delete the existing trigger and create a new one with the desired report."})})]})})}function KJ(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"report-select-description-details",children:[o.jsx(Gn,{children:"How do I choose the report?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),o.jsxs("p",{children:["You can use an existing one or create a new one on the ",o.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function ZJ({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:l}){const[c,d]=p.useState(!1),{form:h,handleTypeChange:m,handleSubmit:g,isDirty:v}=TJ({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{d(!0);try{await r(E)}finally{d(!1)}}});p.useEffect(()=>{l==null||l(v)},[v,l]);const{control:x,watch:b}=h,C=b("type")===pn.REPORT_RUN;return o.jsx(Bl,{...h,children:o.jsxs(Hi,{onSubmit:E=>void g(E),noValidate:!1,children:[o.jsxs(Gl,{children:[o.jsx(Zt,{control:x,name:"type",render:({field:E})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),o.jsxs(ba,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[o.jsx(Qt,{children:o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{placeholder:"Select trigger type"})})}),o.jsxs(wa,{children:[o.jsx(Hn,{value:pn.REPORT_RUN,children:"Report Run"}),o.jsx(Hn,{value:pn.CONNECTOR_RUN,children:"Connector Run"})]})]}),o.jsx(er,{children:e?o.jsx(GJ,{}):o.jsx(BJ,{})}),o.jsx(nn,{})]})}),C&&o.jsx(Zt,{control:x,name:"triggerConfig.reportId",render:({field:E})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),o.jsx(Qt,{children:o.jsx(s4,{children:o.jsx(jJ,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),o.jsx(er,{children:e!=null&&e.triggerConfig?o.jsx(qJ,{}):o.jsx(KJ,{})}),o.jsx(nn,{})]})}),o.jsx($J,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("isActive"),onChange:E=>{h.setValue("cronExpression",E.cron,{shouldDirty:!0}),h.setValue("timeZone",E.timezone,{shouldDirty:!0}),h.setValue("isActive",E.enabled,{shouldDirty:!0})},className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4"})]}),o.jsxs(ql,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!v||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&o.jsx(we,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function YJ({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=p.useMemo(()=>IJ(e,t,n),[e,t,n]);return o.jsxs("div",{children:[o.jsx("div",{children:r}),n&&o.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function WJ({table:e}){return o.jsx("div",{className:"text-right",children:o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Or,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Tt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.title??t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function QJ({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),d=()=>{c(!1),n(e.id)};return o.jsxs("div",{className:"text-right",onClick:h=>{h.stopPropagation()},children:[o.jsxs(Ar,{open:r,onOpenChange:s,children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Or,{align:"end",children:[o.jsxs(Tt,{onClick:()=>{t(e.id)},children:[o.jsx(bf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),o.jsx($a,{}),o.jsxs(Tt,{onClick:()=>{c(!0)},children:[o.jsx(Do,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),o.jsx(ya,{open:l,onOpenChange:c,title:"Delete Scheduled Trigger",description:"Are you sure you want to delete this scheduled trigger? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:d,variant:"destructive"})]})}function XJ(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function JJ({connector:e}){const{connectors:t}=$l(),n=XJ(e,t);return o.jsx(o.Fragment,{children:n})}function n3({connector:e}){return o.jsx(JJ,{connector:e})}function eee(e){if(e.length===0)return{lastRunDate:null,lastRunStatus:null,totalRuns:0,firstRunDate:null};const t=e[0],n=e[e.length-1],r=new Date(n.createdAt);return{lastRunDate:new Date(t.createdAt),lastRunStatus:t.status,totalRuns:e.length,firstRunDate:r}}const tee=e=>{const{connectors:t}=$l();return p.useMemo(()=>t.find(n=>n.name===e),[t,e])},nee=_e.memo(function({connector:t,children:n}){const r=tee(t.source.name),{dataMart:s,runs:l,getDataMartRuns:c}=zi();p.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const d=p.useMemo(()=>r!=null&&r.logoBase64?o.jsx(Lf,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),h=p.useCallback(()=>{s!=null&&s.storage&&wG(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=p.useMemo(()=>eee(l),[l]),g=p.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:Fq(m.lastRunStatus),statusText:Vq(m.lastRunStatus),date:m.lastRunDate},[m]),v=p.useMemo(()=>(s==null?void 0:s.storage)&&EG(s.storage),[s]),x=p.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return o.jsxs(tS,{children:[o.jsx(nS,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(rS,{children:[o.jsxs(aS,{children:[o.jsx(sS,{children:d}),o.jsxs(oS,{children:[o.jsx(iS,{children:o.jsx(n3,{connector:t})}),o.jsx(lS,{children:x})]})]}),o.jsxs(cS,{children:[o.jsxs(mi,{children:[o.jsx(pi,{children:"Last run status:"}),o.jsx(gi,{children:g?o.jsx(Uf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),o.jsxs(mi,{children:[o.jsx(pi,{children:"Last run date:"}),o.jsx(gi,{children:g?o.jsx(Dl,{date:g.date}):"Never run"})]}),o.jsxs(mi,{children:[o.jsx(pi,{children:"Total runs:"}),o.jsxs(gi,{children:[m.totalRuns," runs",m.firstRunDate&&o.jsxs(o.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),o.jsx(uS,{children:o.jsxs(we,{className:"w-full",variant:"default",onClick:h,title:"Open Storage","aria-label":"Open Storage",children:[v,o.jsx(wl,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.connector.source.name===t.connector.source.name&&e.connector.storage.fullyQualifiedName===t.connector.storage.fullyQualifiedName&&e.connector.source.node===t.connector.source.node&&e.connector.source.fields.length===t.connector.source.fields.length);function ree(e){const t=e.triggerConfig;return o.jsxs("div",{className:"inline gap-1",children:[t.report.title,o.jsx(Pq,{report:t.report,children:o.jsx(Lr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function aee(e){const t=e.triggerConfig,{connector:n}=t.connector;return o.jsxs("div",{className:"inline gap-1",children:[o.jsx(n3,{connector:n}),o.jsx(nee,{connector:n,children:o.jsx(Lr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function see({trigger:e}){switch(e.type){case pn.REPORT_RUN:return ree(e);case pn.CONNECTOR_RUN:return aee(e);default:return o.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function oee({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===pn.REPORT_RUN?"Report Run":"Connector Run";return o.jsx(Er,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>o.jsx(see,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),s=n.original.timeZone,l=n.getValue("isActive");return o.jsx(YJ,{cronExpression:String(r),timeZone:s,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(Dl,{date:new Date(r)}):"Not scheduled"})},meta:{title:"Next Run"}},{accessorKey:"lastRun",size:15,header:"Last Run",cell:({row:n})=>{const r=n.original.lastRun;return o.jsx("div",{className:"text-sm",children:r?o.jsx(Dl,{date:new Date(r)}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",size:15,header:"Trigger Status",cell:({row:n})=>{const r=n.getValue("isActive");return o.jsx(Uf,{type:r?Cn.SUCCESS:Cn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>o.jsx(WJ,{table:n}),cell:({row:n})=>o.jsx(QJ,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function iee({table:e,onPreviousClick:t,onNextClick:n}){return o.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function YS({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=qO(),[h,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useCallback(()=>{g?m(!0):t()},[g,t]),b=p.useCallback(()=>{m(!1),v(!1),t()},[t]),w=p.useCallback(j=>{v(j)},[]),C=p.useCallback(()=>{v(!1),t()},[t]),E=!!d,R=p.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===pn.REPORT_RUN?{type:qc.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),T=async j=>{E?await c(n,d.id,j.cronExpression,j.timeZone,j.isActive):await l(n,j.type,j.cronExpression,j.timeZone,j.isActive,j.triggerConfig),C()};return o.jsxs(o.Fragment,{children:[o.jsx(Oi,{open:e,onOpenChange:j=>{j||x()},children:o.jsxs(Mi,{children:[o.jsxs(ki,{children:[o.jsxs(Ii,{children:[E?"Edit":"Create"," Scheduled Trigger"]}),o.jsx(Fl,{children:"Configure automatic runs for your reports or connectors."})]}),o.jsx(ZJ,{preSelectedReportId:r,preSelectedType:s,initialData:R,onSubmit:T,onCancel:x,onDirtyChange:w})]})}),o.jsx(ya,{open:h,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:b,variant:"destructive"})]})}function lee({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,l]=p.useState(!1),c=p.useCallback(()=>{l(!1)},[]),d=p.useCallback(R=>{r(R)},[r]),h=p.useMemo(()=>oee({onEditTrigger:n,onDeleteTrigger:d}),[n,d]),{sorting:m,setSorting:g,columnVisibility:v,setColumnVisibility:x}=Vf({columns:h,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),b=Eu({data:e,columns:h,getCoreRowModel:wu(),getPaginationRowModel:yg(),onSortingChange:g,getSortedRowModel:zf(),getFilteredRowModel:Ff(),state:{sorting:m,columnVisibility:v},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),w=p.useCallback(()=>{b.previousPage()},[b]),C=p.useCallback(()=>{b.nextPage()},[b]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ru,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[o.jsx(Tu,{className:"dm-card-table-header",children:b.getHeaderGroups().map(R=>o.jsx(tr,{className:"dm-card-table-header-row",children:R.headers.map(T=>o.jsx(_u,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:T.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.getSize())}%`},children:T.isPlaceholder?null:typeof T.column.columnDef.header=="function"?T.column.columnDef.header(T.getContext()):T.column.columnDef.header},T.id))},R.id))}),o.jsx(ju,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((R,T)=>o.jsx(tr,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":T+1,children:R.getVisibleCells().map((j,O)=>o.jsx(va,{className:`whitespace-normal ${j.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":O+1,style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.column.getSize())}%`},children:typeof j.column.columnDef.cell=="function"?j.column.columnDef.cell(j.getContext()):j.column.columnDef.cell},j.id))},R.id)):o.jsx(tr,{children:o.jsx(va,{colSpan:h.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),o.jsx(iee,{table:b,onPreviousClick:w,onNextClick:C}),o.jsx(YS,{isOpen:s,onClose:c,dataMartId:t})]})}function cee({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=CJ(e),[l,c]=p.useState(!1);p.useEffect(()=>{s&&c(!0)},[s]);const d=g=>{const v=t.find(x=>x.id===g);v&&r(v)},h=()=>{c(!1),r(null)},m=async g=>{try{await n(e,g)}catch(v){console.error("Error deleting trigger:",v)}};return o.jsxs(o.Fragment,{children:[o.jsx(lee,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void m(g)}),o.jsx(YS,{isOpen:l,onClose:h,dataMartId:e})]})}function r3(){return o.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:o.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[o.jsx(Mj,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Time Triggers"}),o.jsxs("p",{className:"text-muted-foreground",children:["Go to the ",o.jsx("span",{className:"font-medium",children:"Triggers tab"})," to set up automatic runs."]})]})]})})}function uee({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,h]=p.useState(""),[m,g]=p.useState(""),[v,x]=p.useState(null),[b,w]=p.useState(null),C=j=>j.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(j)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",E=p.useCallback((j,O,D,N)=>{s({fullyQualifiedName:`${j}.${O}`,isValid:!!(j&&O&&D===null&&N===null)})},[s]);p.useEffect(()=>{let j="",O="";if(t!=null&&t.fullyQualifiedName){const V=t.fullyQualifiedName.split(".");j=V[0]??"",O=V[1]??""}else j=`${c}_owox`,O=l;const D=C(j),N=C(O);h(j),g(O),x(D),w(N);const A=`${j}.${O}`,k=!!(j&&O&&D===null&&N===null);((t==null?void 0:t.fullyQualifiedName)!==A||t.isValid!==k)&&E(j,O,D,N)},[t,l,c,E]);const R=j=>{h(j);const O=C(j);x(O),E(j,m,O,b)},T=j=>{g(j);const O=C(j);w(O),E(d,j,v,O)};return o.jsxs(So,{children:[e===Pe.GOOGLE_BIGQUERY&&o.jsxs(o.Fragment,{children:[o.jsx(Ai,{icon:o.jsx(wA,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),o.jsxs(bl,{title:"Choose where to store your data",children:[o.jsxs(Vd,{children:[o.jsx(Gc,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),o.jsx(Bt,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:j=>{R(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&o.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs(Vd,{children:[o.jsx(Gc,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx(Bt,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"table-name-error":void 0,onChange:j=>{T(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),e===Pe.AWS_ATHENA&&o.jsxs(o.Fragment,{children:[o.jsx(Ai,{icon:o.jsx(EA,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),o.jsxs(bl,{title:"Choose where to store your data",children:[o.jsxs(Vd,{children:[o.jsx(Gc,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),o.jsx(Bt,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:j=>{R(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&o.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs(Vd,{children:[o.jsx(Gc,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx(Bt,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"athena-table-name-error":void 0,onChange:j=>{T(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),o.jsx(bl,{title:"Schedule updates",children:o.jsx(r3,{})})]})}function dee({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full"}){const[l,c]=p.useState(null),[d,h]=p.useState(""),[m,g]=p.useState([]),[v,x]=p.useState(1),[b,w]=p.useState({}),[C,E]=p.useState(!1),[R,T]=p.useState(new Set),[j,O]=p.useState(new Set),{connectors:D,connectorSpecification:N,connectorFields:A,loading:k,loadingSpecification:V,loadingFields:q,error:H,fetchAvailableConnectors:W,fetchConnectorSpecification:re,fetchConnectorFields:G}=$l(),[Q,I]=p.useState(null),B=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:s==="fields-only"?[{id:1,title:"Select Fields",description:"Pick specific fields"}]:[{id:1,title:"Select Connector",description:"Choose a data source"},{id:2,title:"Configuration",description:"Set up connector parameters"},{id:3,title:"Select Nodes",description:"Choose data nodes"},{id:4,title:"Select Fields",description:"Pick specific fields"},{id:5,title:"Target Setup",description:"Configure destination"}]).length,oe=p.useCallback(async Te=>{!R.has(Te)&&!V&&(T(ft=>new Set(ft).add(Te)),await re(Te))},[R,V,re]),be=p.useCallback(async Te=>{j.has(Te)||(O(ft=>new Set(ft).add(Te)),await G(Te))},[j,G]);p.useEffect(()=>{if(D.length===0&&!k&&W(),r&&D.length>0&&!l){const{source:Te,storage:ft}=r;h(Te.node),g(Te.fields),w(Te.configuration[0]||{}),I({fullyQualifiedName:ft.fullyQualifiedName,isValid:!0});const lt=D.find(sn=>sn.name===Te.name);lt&&(c(lt),oe(lt.name),!n&&s!=="fields-only"&&be(lt.name),s==="fields-only"&&be(lt.name))}if(n&&D.length>0&&!l&&!r){const Te=D[0];c(Te),oe(Te.name)}},[s,r,D,n,k,W,oe,be,l]);const L=Te=>{c(Te),w({}),E(!1),T(ft=>{const lt=new Set(ft);return lt.delete(Te.name),lt}),oe(Te.name),be(Te.name)},P=Te=>{h(Te),g([])},K=(Te,ft)=>{g(ft?lt=>lt.includes(Te)?lt:[...lt,Te]:lt=>lt.filter(sn=>sn!==Te))},ne=(Te,ft)=>{g(ft?lt=>{const sn=Te.filter(Ea=>!lt.includes(Ea));return[...lt,...sn]}:lt=>lt.filter(sn=>!Te.includes(sn)))},fe=Te=>{I(Te)},ge=p.useCallback(Te=>{w(Te)},[]),ue=p.useCallback(Te=>{E(Te)},[]);p.useEffect(()=>{N&&(N.some(ft=>ft.required&&ft.showInUI!==!1&&ft.name!=="Fields")||E(!0))},[N]);const Ae=()=>{v<B&&x(v+1)},Re=()=>{v>1&&x(v-1)},xe=()=>{if(n)return l!==null&&C;if(s==="fields-only")switch(v){case 1:return m.length>0;default:return!1}switch(v){case 1:return l!==null;case 2:return C;case 3:return d!=="";case 4:return m.length>0;case 5:return Q!==null&&Q.fullyQualifiedName!==""&&Q.isValid;default:return!1}},Je=()=>v>1,Qe=(Te,ft)=>{if(!Te)return ft;const lt=Te.find(sn=>sn.name===ft);return(lt==null?void 0:lt.destinationName)??ft},zt=()=>{if(n&&v===1)return N&&l?o.jsx(ST,{connector:l,connectorSpecification:N,onConfigurationChange:ge,onValidationChange:ue,initialConfiguration:b,loading:V,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(v){case 1:return l&&d&&A?o.jsx(CT,{connector:l,connectorFields:A,selectedField:d,selectedFields:m,onFieldToggle:K,onSelectAllFields:ne}):null;default:return null}switch(v){case 1:return o.jsx(mJ,{connectors:D,selectedConnector:l,loading:k,error:H,onConnectorSelect:L,onConnectorDoubleClick:()=>{x(Te=>Te<B?Te+1:Te)}});case 2:return l&&N?o.jsx(ST,{connector:l,connectorSpecification:N,onConfigurationChange:ge,onValidationChange:ue,initialConfiguration:b,loading:V,isEditingExisting:!1}):null;case 3:return l&&A?o.jsx(vJ,{connectorFields:A,connector:l,selectedField:d,connectorName:l.displayName,loading:q,onFieldSelect:P}):null;case 4:return l&&d&&A?o.jsx(CT,{connector:l,connectorFields:A,selectedField:d,selectedFields:m,onFieldToggle:K,onSelectAllFields:ne}):null;case 5:return d&&A?o.jsx(uee,{dataStorageType:t,destinationName:Qe(A,d),connectorName:(l==null?void 0:l.displayName)??"",target:Q,onTargetChange:fe}):null;default:return null}};return o.jsxs(uJ,{children:[o.jsx(dJ,{children:zt()}),o.jsx(fJ,{variant:"horizontal",children:o.jsx(pJ,{currentStep:v,totalSteps:B,canGoNext:xe(),canGoBack:Je(),isLoading:V||q,onNext:Ae,onBack:Re,onFinish:()=>{n&&l?e({source:{name:l.name,configuration:[b],node:(r==null?void 0:r.source.node)??d,fields:(r==null?void 0:r.source.fields)??m},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}):s==="fields-only"&&r?e({source:{...r.source,fields:m},storage:r.storage}):l&&Q&&e({source:{name:l.name,configuration:[b],node:d,fields:m},storage:{fullyQualifiedName:Q.fullyQualifiedName}})}})})]})}const a3=20,s3=20;function o3({vertical:e,horizontal:t}){if(window.Intercom)try{const n={};n.vertical_padding=e,n.horizontal_padding=t,Object.keys(n).length>0&&window.Intercom("update",n)}catch(n){console.warn("Failed to update Intercom padding",n)}}function fee(e=30,t=0){o3({vertical:s3+e,horizontal:a3+t})}function K0(){o3({vertical:s3,horizontal:a3})}function i3({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:l=null,mode:c="full"}){return p.useEffect(()=>(e?fee(55):K0(),()=>{K0()}),[e]),o.jsx(Oi,{open:e,onOpenChange:t,children:o.jsxs(Mi,{children:[o.jsxs(ki,{children:[o.jsx(Ii,{children:c==="fields-only"?"Connector Fields":l!=null&&l.source.name?"Edit Connector":"Set Up Connector"}),o.jsx(Fl,{children:c==="fields-only"?"Select fields for your Data Mart":l!=null&&l.source.name?"Update configuration":"Follow these steps to set it up"})]}),o.jsx(dee,{onSubmit:d=>{r(d),t()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:l,mode:c})]})})}const WS=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null})=>{const[l,c]=p.useState(!1),d=()=>{c(!0)},h=()=>{c(!1)},m=()=>n?o.jsx("div",{onClick:d,style:{cursor:"pointer"},children:n}):null;return o.jsxs(o.Fragment,{children:[m(),l&&o.jsx(du,{children:o.jsx(i3,{isOpen:l,onClose:h,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s})})]})};function hee({storageType:e,onSetupConnector:t}){return o.jsx(WS,{dataStorageType:e,onSubmit:t,configurationOnly:!1,children:o.jsxs(we,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[o.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:o.jsx(Nj,{className:"h-4 w-4",strokeWidth:2.25})}),o.jsx("span",{children:"Setup Connector"}),o.jsx(hs,{className:"h-6 w-6"})]})})}const mee=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"Google BigQuery";case Pe.AWS_ATHENA:return"AWS Athena";default:return e}},$c=e=>typeof e=="object"&&"connector"in e,Id=e=>{if(!$c(e))return!1;const{source:t,storage:n}=e.connector,r=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,s=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return r&&s};function pee({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,dataMartStatus:s,totalConfigurations:l,dataStorage:c}){const d=Fi.getInfo(c.type),{connectors:h,fetchAvailableConnectors:m}=$l();p.useEffect(()=>{m()},[m]);const g=C=>{const E=h.find(R=>R.name===C);if(E!=null&&E.logoBase64)return()=>o.jsx(Lf,{base64:E.logoBase64,size:24})},v=()=>{const C=t.connector.source.node||"No node selected";return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:C}),o.jsx("span",{className:"text-muted-foreground",children:"•"}),o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[o.jsx("span",{children:"Edit config"}),o.jsx(hs,{className:"h-3 w-3"})]})}),o.jsx(Nt,{children:"Edit connector configuration"})]})]})},x=(C,E,R)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",o.jsx(lr,{href:R,onClick:T=>{T.stopPropagation()},children:E})]}),b=()=>{switch(c.type){case Pe.GOOGLE_BIGQUERY:{const C=c.config.projectId,E=t.connector.storage.fullyQualifiedName,R=E.split(".")[0],T=E.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}`,O=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}!3s${T}`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Dataset",R,j),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,O),o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(Lr,{className:"h-4 w-4"})}),o.jsx(Nt,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Pe.AWS_ATHENA:{const C=c.config.region,E=t.connector.storage.fullyQualifiedName,[R,T]=E.split("."),j=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Database",R,j),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,j),o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(Lr,{className:"h-4 w-4"})}),o.jsx(Nt,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}default:return"Unknown storage type configuration"}},w=()=>!(s===or.PUBLISHED&&l===1);return o.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[o.jsx("div",{className:"flex-grow",children:o.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[o.jsx(WS,{dataStorageType:c.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:o.jsx(U0,{icon:g(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:v(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),o.jsx(U0,{title:mee(c.type),icon:d.icon,subtitle:b(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),o.jsx("div",{className:"shrink-0 px-4",children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(we,{type:"button",variant:"ghost",onClick:()=>{w()&&n(e)},disabled:!w(),children:o.jsx(Do,{className:"h-4 w-4"})})}),!w()&&o.jsx(Nt,{children:"Cannot remove the last configuration in published pipeline"})]})})]})}function gee({storageType:e,onAddConfiguration:t,existingConnector:n}){return o.jsx("div",{children:o.jsx(WS,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:o.jsxs(we,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(Jr,{className:"h-4 w-4"}),o.jsx("span",{children:"Configuration"})]})})})}function vee({control:e,storageType:t}){const{dataMart:n,runDataMart:r}=fs(),{setValue:s,getValues:l,trigger:c}=Nu(),[d,h]=p.useState(!1),m=()=>{setTimeout(()=>void c("definition"),0)},g=(n==null?void 0:n.status)??or.DRAFT,v=j=>{const O=j.source,D=j.storage;s("definition",{connector:{source:O,storage:D}},{shouldDirty:!0,shouldTouch:!0}),m()},x=async j=>{if(n){if(n.status.code!==or.PUBLISHED){fn.error("Manual run is only available for published data marts");return}await r({id:n.id,payload:j})}},b=j=>O=>{const N=l().definition;if(typeof N=="object"&&$c(N)){const A=[...N.connector.source.configuration];A[j]=O.source.configuration[0]||{};const k={connector:{...N.connector,source:{...N.connector.source,configuration:A}}};s("definition",k,{shouldDirty:!0,shouldTouch:!0}),m()}},w=j=>{const D=l().definition;if(typeof D=="object"&&$c(D)){const N={connector:{...D.connector,source:{...D.connector.source,fields:j.source.fields}}};s("definition",N,{shouldDirty:!0,shouldTouch:!0}),m()}h(!1)},C=j=>{x({runType:j.runType,data:j.data})},E=j=>{const O=j.connector.source.fields.length;return o.jsxs(we,{type:"button",variant:"outline",onClick:()=>{h(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(T8,{className:"h-4 w-4"}),o.jsxs("span",{children:["Edit Fields (",String(O),")"]})]})},R=j=>{const D=l().definition;if($c(D)&&D.connector.source.configuration.length<=1){const N=VO(We.CONNECTOR);s("definition",N,{shouldDirty:!0,shouldTouch:!0}),m()}if(typeof D=="object"&&$c(D)&&D.connector.source.configuration.length>1){const N={...D.connector.source,configuration:D.connector.source.configuration.filter((k,V)=>V!==j)},A={connector:{...D.connector,source:N}};s("definition",A,{shouldDirty:!0,shouldTouch:!0}),m()}},T=j=>{const D=l().definition;if($c(D)){const N={...D.connector.source,configuration:[...D.connector.source.configuration,j]},A={connector:{...D.connector,source:N}};s("definition",A,{shouldDirty:!0,shouldTouch:!0}),m()}};return o.jsxs(o.Fragment,{children:[o.jsx(Zt,{control:e,name:"definition",render:({field:j})=>o.jsxs(Yt,{className:"dark:bg-white/2",children:[o.jsx(Qt,{children:o.jsx("div",{className:"space-y-3",children:!Id(j.value)||g===or.DRAFT?o.jsx(hee,{storageType:t,onSetupConnector:v}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(gee,{storageType:t,onAddConfiguration:T,existingConnector:Id(j.value)?{source:j.value.connector.source,storage:j.value.connector.storage}:void 0}),Id(j.value)&&E(j.value)]}),o.jsx("div",{className:"flex items-center gap-2",children:n&&n.definitionType===We.CONNECTOR&&o.jsx($D,{configuration:n.definition,onManualRun:C,children:o.jsxs(we,{variant:"outline",children:[o.jsx(hb,{className:"h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})})})]}),o.jsx("div",{className:"space-y-3",children:Id(j.value)&&(n!=null&&n.storage)?j.value.connector.source.configuration.map((O,D)=>{const N=j.value;return o.jsx(du,{children:o.jsx(pee,{configIndex:D,connectorDef:N,dataStorage:n.storage,onRemoveConfiguration:R,onUpdateConfiguration:b,dataMartStatus:typeof g=="object"?g.code:g,totalConfigurations:N.connector.source.configuration.length},D)},D)}):null})]})})}),o.jsx(nn,{})]})}),o.jsx(du,{children:o.jsx(i3,{isOpen:d,onClose:()=>{h(!1)},onSubmit:w,dataStorageType:t,existingConnector:Id(l().definition)?{source:l().definition.connector.source,storage:l().definition.connector.storage}:void 0,mode:"fields-only"})})]})}function yee({definitionType:e,storageType:t}){const{control:n}=Nu();return o.jsxs("div",{className:"space-y-2",children:[e===We.SQL&&o.jsx(sJ,{control:n}),e===We.TABLE&&o.jsx(oJ,{control:n,storageType:t}),e===We.VIEW&&o.jsx(iJ,{control:n,storageType:t}),e===We.TABLE_PATTERN&&o.jsx(lJ,{control:n,storageType:t}),e===We.CONNECTOR&&o.jsx(vee,{control:n,storageType:t})]})}function xee(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/Math.pow(t,r)).toFixed(2)).toString()} ${n[r]}`}function bee(e,t){const[n,r]=p.useState(e);return p.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const See=300;function Cee({sql:e,dataMartId:t,debounceDelay:n=See,className:r="",onValidationStateChange:s}){const[l,c]=p.useState({isLoading:!1,isValid:null,error:null,bytes:null}),d=p.useRef(null),h=bee(e.trim(),n);p.useEffect(()=>{if(!h){const x={isLoading:!1,isValid:null,error:null,bytes:null};c(x),s==null||s(x);return}d.current&&d.current.abort(),d.current=new AbortController;const g=d.current;return(async()=>{const x={isLoading:!0,isValid:null,error:null,bytes:null};c(x),s==null||s(x);try{const b=await vr.validateSql(t,h,g);if(!g.signal.aborted){const w={isLoading:!1,isValid:b.isValid,error:b.error,bytes:b.bytes??null};c(w),s==null||s(w)}}catch(b){if(!g.signal.aborted){const w={isLoading:!1,isValid:!1,error:b instanceof Error?b.message:"Validation error",bytes:null};c(w),s==null||s(w)}}})(),()=>{g.abort()}},[h,t,s]);const m=()=>l.isLoading?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(mu,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{className:"text-sm",children:"Validating..."})]}):l.isValid===null?o.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[o.jsx(Zm,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:"Type a query to get started"})]}):l.isValid?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(Rj,{className:"h-4 w-4 text-green-600"}),o.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),l.bytes!==null&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Zm,{className:"h-3 w-3 text-gray-600"}),o.jsx("span",{className:"text-xs text-gray-600",children:xee(l.bytes)})]})}),o.jsx(Nt,{children:o.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):o.jsxs("div",{className:"flex h-9 items-center gap-2",children:[o.jsx(Xd,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),l.error&&o.jsx("span",{className:"text-xs text-red-500",children:l.error})]});return o.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:m()})}function wee(){const{dataMart:e,updateDataMartDefinition:t}=fs();if(!e)throw new Error("Data mart not found");const{definitionType:n,definition:r,id:s,storage:{type:l}}=e,[c,d]=p.useState(n),[h,m]=p.useState({isValid:null,isLoading:!1,error:null}),g=p.useCallback(()=>{if(!c)return;const H={definitionType:c,definition:VO(c)};return r?{definitionType:c,definition:r}:H},[c,r]),v=p.useCallback(()=>{if(!c)return;const H=aJ(c,l);return Kl(H)},[c,l]),x=Vi({resolver:v(),defaultValues:g(),mode:"onChange"}),{handleSubmit:b,reset:w,watch:C,formState:{isDirty:E,isValid:R}}=x,T=(H,W)=>{if(H!==We.SQL)return"";const re=W;return(re==null?void 0:re.sqlQuery)??""},j=C("definition"),O=T(c,j);p.useEffect(()=>{c&&w(g())},[c,w,g]);const D=p.useCallback(H=>{m({isLoading:H.isLoading,isValid:H.isValid,error:H.error})},[]),N=H=>{d(H)},A=async H=>{if(c&&s)try{await t(s,H.definitionType,H.definition),w(H)}catch(W){console.error("Failed to update data mart definition:",W)}},k=H=>{if(H.preventDefault(),c===We.SQL&&h.isValid===!1){console.error("Cannot submit form with invalid SQL:",h.error);return}b(A)(H)},V=()=>{w(g())},q=()=>c?o.jsxs("form",{onSubmit:k,className:"space-y-4",children:[o.jsx(yee,{definitionType:c,storageType:l}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(we,{variant:"default",type:"submit",disabled:!R||!E||c===We.SQL&&(h.isValid===!1||h.isLoading),children:"Save"}),o.jsx(we,{type:"button",variant:"ghost",onClick:V,disabled:!E,children:"Discard"}),c===We.SQL&&O&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-6 w-px bg-gray-300"}),o.jsx(Cee,{sql:O,dataMartId:s,onValidationStateChange:D})]})]})]}):null;return o.jsx(K4,{...x,children:o.jsxs("div",{className:"space-y-4",children:[!n&&o.jsx(XX,{initialType:c,onTypeSelect:N}),q()]})})}function Eee(e){switch(e){case Pe.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Pe.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function l3(e){return e.type==="bigquery-data-mart-schema"}function c3(e){return e.type==="athena-data-mart-schema"}function ET(e){return e!==null&&typeof e=="object"&&"mode"in e}function RT(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function Ree(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function Fx(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Tee(e){const t=Fx(e),[n,r]=p.useState(t),[s,l]=p.useState(!1);p.useEffect(()=>{const h=Fx(e);r(h),l(!1)},[e]);const c=p.useCallback(h=>{n?l3(n)&&h.every(ET)?(r({...n,fields:h}),l(!0)):c3(n)&&h.every(RT)&&(r({...n,fields:h}),l(!0)):h.length>0&&(ET(h[0])?(r({type:"bigquery-data-mart-schema",fields:h}),l(!0)):RT(h[0])&&(r({type:"athena-data-mart-schema",fields:h}),l(!0)))},[n]),d=p.useCallback(()=>{const h=Fx(e);r(h),l(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:d,setIsDirty:l}}function jee(e,t){const n=p.useRef(!1),r=p.useRef(!1),[s,l]=p.useState("idle");return p.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function _ee(e){const t=p.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(s=>s.meta&&s.meta.hidden).map(s=>["id"in s&&s.id?s.id:"accessorKey"in s&&typeof s.accessorKey=="string"?s.accessorKey:void 0,!1]).filter(([s])=>s!==void 0)):{},[e]),[n,r]=p.useState({});return p.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function u3(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,s=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||s)return!0;const l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>u3(c,t)):!1}function d3(e,t,n=""){const r=[];return e.forEach((s,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=s.name?s.name.toLowerCase().includes(t):!1,h=s.alias?s.alias.toLowerCase().includes(t):!1,m=s.description?s.description.toLowerCase().includes(t):!1;if((d||h||m)&&r.push(c),s.fields&&s.fields.length>0){const g=d3(s.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function Nee(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return u3(r,s)}function Aee(e){const[t,n]=p.useState(""),r=p.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}var os=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(os||{}),df=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(df||{}),Dn=(e=>(e.INTEGER="INTEGER",e.FLOAT="FLOAT",e.NUMERIC="NUMERIC",e.BIGNUMERIC="BIGNUMERIC",e.STRING="STRING",e.BYTES="BYTES",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.TIME="TIME",e.DATETIME="DATETIME",e.TIMESTAMP="TIMESTAMP",e.GEOGRAPHY="GEOGRAPHY",e.JSON="JSON",e.RECORD="RECORD",e.STRUCT="STRUCT",e.RANGE="RANGE",e.INTERVAL="INTERVAL",e))(Dn||{}),QS=(e=>(e.BOOLEAN="BOOLEAN",e.TINYINT="TINYINT",e.SMALLINT="SMALLINT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.REAL="REAL",e.FLOAT="FLOAT",e.DOUBLE="DOUBLE",e.DECIMAL="DECIMAL",e.CHAR="CHAR",e.VARCHAR="VARCHAR",e.STRING="STRING",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.DATE="DATE",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIME_WITH_TIME_ZONE="TIME WITH TIME ZONE",e.TIMESTAMP_WITH_TIME_ZONE="TIMESTAMP WITH TIME ZONE",e.INTERVAL_YEAR_TO_MONTH="INTERVAL YEAR TO MONTH",e.INTERVAL_DAY_TO_SECOND="INTERVAL DAY TO SECOND",e.ARRAY="ARRAY",e.MAP="MAP",e.STRUCT="STRUCT",e.ROW="ROW",e.JSON="JSON",e))(QS||{});function Dee(e){const[t,n]=p.useState(new Set),[r,s]=p.useState(null),l=p.useRef(""),c=p.useMemo(()=>{const w=C=>C.some(E=>E.type===Dn.RECORD||E.type===Dn.STRUCT||E.fields&&w(E.fields));return w(e)},[e]),d=p.useCallback(w=>{n(C=>{const E=new Set(C);return E.has(w)?E.delete(w):E.add(w),E})},[]),h=p.useCallback(()=>{const w=[],C=(E,R="")=>{E.forEach((T,j)=>{const O=R?`${R}.${String(j)}`:String(j);(T.type===Dn.RECORD||T.type===Dn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};C(e),n(E=>w.every(T=>E.has(T))?new Set:new Set(w))},[e]),m=p.useMemo(()=>{const w=[],C=(E,R="",T=0)=>{E.forEach((j,O)=>{const D=R?`${R}.${String(O)}`:String(O),N=j.type===Dn.RECORD||j.type===Dn.STRUCT;w.push({...j,path:D,level:T}),N&&j.fields&&t.has(D)&&C(j.fields,D,T+1)})};return C(e),w},[e,t]),g=p.useCallback(w=>{if(w!==l.current)if(l.current=w,w){r===null&&s(new Set(t));const E=d3(e,w).filter(R=>{const T=R.split(".").map(Number);let j=e,O;for(let D=0;D<T.length;D++){if(O=j[T[D]],!O)return!1;if((O.type===Dn.RECORD||O.type===Dn.STRUCT)&&O.fields&&O.fields.length>0)return!0;D<T.length-1&&(j=O.fields??[])}return!1});n(R=>{const T=new Set(R);return E.forEach(j=>{T.add(j)}),T})}else r!==null&&(n(r),s(null))},[e,t,r]),v=p.useCallback(w=>{const C=m[w];return C.type===Dn.RECORD||C.type===Dn.STRUCT},[m]),x=p.useMemo(()=>e.map(w=>({...w,fields:void 0})),[e]),b=p.useMemo(()=>{const w=[],C=(E,R="")=>{E.forEach((T,j)=>{const O=R?`${R}.${String(j)}`:String(j);(T.type===Dn.RECORD||T.type===Dn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};return C(e),w.length===0?!1:w.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:h,flattenedFields:m,handleSearchChange:g,isRecordType:v,topLevelFields:x,allExpanded:b}}function Oee(e,t,n,r){const s=p.useCallback((h,m)=>{if(n){const g=[...e],v=t[h].path;if(!v)g[h]={...g[h],...m};else{const x=v.split(".").map(Number);let b=g,w;for(let E=0;E<x.length-1;E++)w=b[x[E]],b=w.fields??[];const C=x[x.length-1];b[C]&&(b[C]={...b[C],...m})}n(g)}},[e,t,n]),l=p.useCallback(()=>{if(n){const h={name:"",type:Dn.STRING,mode:df.NULLABLE,isPrimaryKey:!1,status:os.DISCONNECTED};n([...e,h])}},[e,n]),c=p.useCallback(h=>{if(n){const m=[...e],g=t[h].path;if(!g)m.splice(h,1);else{const v=g.split(".").map(Number);let x=m,b;for(let C=0;C<v.length-1;C++)b=x[v[C]],x=b.fields??[];const w=v[v.length-1];x.splice(w,1)}n(m)}},[e,t,n]),d=p.useCallback(h=>{var m,g;if(n&&r){const v=[...e],x=t[h].path,b={name:"",type:Dn.STRING,mode:df.NULLABLE,isPrimaryKey:!1,status:os.DISCONNECTED};if(!x)(m=v[h]).fields??(m.fields=[]),v[h].fields.push(b);else{const w=x.split(".").map(Number);let C=v;for(let E=0;E<w.length;E++){const R=w[E];E===w.length-1?((g=C[R]).fields??(g.fields=[]),C[R].fields.push(b)):C=C[R].fields??[]}}n(v)}},[e,t,n,r]);return{updateField:s,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function f3(e,t,n){return{handleDragEnd:p.useCallback(s=>{const{active:l,over:c}=s;if(!c||l.id===c.id||!t)return;if(!n){const x=Number(l.id),b=Number(c.id),w=[...e],[C]=w.splice(x,1);w.splice(b,0,C),t(w);return}const d=n.findIndex((x,b)=>(x.path??String(b))===l.id),h=n.findIndex((x,b)=>(x.path??String(b))===c.id);if(d===-1||h===-1)return;const m=n[d].path,g=n[h].path,v=[...e];if(!m&&!g){const[x]=v.splice(d,1);v.splice(h,0,x),t(v);return}if(m&&g){const x=m.split(".").map(Number),b=g.split(".").map(Number);if(x.length===b.length&&x.slice(0,-1).join(".")===b.slice(0,-1).join(".")){let w=v;for(let T=0;T<x.length-1;T++)w=w[x[T]].fields??[];const C=x[x.length-1],E=b[b.length-1],[R]=w.splice(C,1);w.splice(E,0,R),t(v)}}},[e,n,t])}}function Mee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Og=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ou(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function XS(e){return"nodeType"in e}function ea(e){var t,n;return e?Ou(e)?e:XS(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function JS(e){const{Document:t}=ea(e);return e instanceof t}function Kf(e){return Ou(e)?!1:e instanceof ea(e).HTMLElement}function h3(e){return e instanceof ea(e).SVGElement}function Mu(e){return e?Ou(e)?e.document:XS(e)?JS(e)?e:Kf(e)||h3(e)?e.ownerDocument:document:document:document}const zs=Og?p.useLayoutEffect:p.useEffect;function e1(e){const t=p.useRef(e);return zs(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function kee(){const e=p.useRef(null),t=p.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ff(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return zs(()=>{n.current!==e&&(n.current=e)},t),n}function Zf(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function _p(e){const t=e1(e),n=p.useRef(null),r=p.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Z0(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let zx={};function Yf(e,t){return p.useMemo(()=>{if(t)return t;const n=zx[e]==null?0:zx[e]+1;return zx[e]=n,e+"-"+n},[e,t])}function m3(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((l,c)=>{const d=Object.entries(c);for(const[h,m]of d){const g=l[h];g!=null&&(l[h]=g+e*m)}return l},{...t})}}const tu=m3(1),Np=m3(-1);function Iee(e){return"clientX"in e&&"clientY"in e}function t1(e){if(!e)return!1;const{KeyboardEvent:t}=ea(e.target);return t&&e instanceof t}function Lee(e){if(!e)return!1;const{TouchEvent:t}=ea(e.target);return t&&e instanceof t}function Y0(e){if(Lee(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Iee(e)?{x:e.clientX,y:e.clientY}:null}const hf=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[hf.Translate.toString(e),hf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),TT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Pee(e){return e.matches(TT)?e:e.querySelector(TT)}const Uee={display:"none"};function Fee(e){let{id:t,value:n}=e;return _e.createElement("div",{id:t,style:Uee},n)}function zee(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return _e.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Vee(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const p3=p.createContext(null);function Hee(e){const t=p.useContext(p3);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function $ee(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:s,event:l}=r;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,l)})},[e]),t]}const Bee={draggable:`
|
|
712
|
-
To pick up a draggable item, press the space bar.
|
|
713
|
-
While dragging, use the arrow keys to move the item.
|
|
714
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
715
|
-
`},Gee={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function qee(e){let{announcements:t=Gee,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Bee}=e;const{announce:l,announcement:c}=Vee(),d=Yf("DndLiveRegion"),[h,m]=p.useState(!1);if(p.useEffect(()=>{m(!0)},[]),Hee(p.useMemo(()=>({onDragStart(v){let{active:x}=v;l(t.onDragStart({active:x}))},onDragMove(v){let{active:x,over:b}=v;t.onDragMove&&l(t.onDragMove({active:x,over:b}))},onDragOver(v){let{active:x,over:b}=v;l(t.onDragOver({active:x,over:b}))},onDragEnd(v){let{active:x,over:b}=v;l(t.onDragEnd({active:x,over:b}))},onDragCancel(v){let{active:x,over:b}=v;l(t.onDragCancel({active:x,over:b}))}}),[l,t])),!h)return null;const g=_e.createElement(_e.Fragment,null,_e.createElement(Fee,{id:r,value:s.draggable}),_e.createElement(zee,{id:d,announcement:c}));return n?as.createPortal(g,n):g}var Jn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Jn||(Jn={}));function Ap(){}function g3(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function v3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const us=Object.freeze({x:0,y:0});function Kee(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Zee(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Yee(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Wee(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function jT(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const y3=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=jT(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,h=n.get(d);if(h){const m=Kee(jT(h),s);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(Zee)};function Qee(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=s-r,d=l-n;if(r<s&&n<l){const h=t.width*t.height,m=e.width*e.height,g=c*d,v=g/(h+m-g);return Number(v.toFixed(4))}return 0}const Xee=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const h=Qee(d,t);h>0&&s.push({id:c,data:{droppableContainer:l,value:h}})}}return s.sort(Yee)};function Jee(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function x3(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:us}function ete(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const tte=ete(1);function nte(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function rte(e,t,n){const r=nte(t);if(!r)return e;const{scaleX:s,scaleY:l,x:c,y:d}=r,h=e.left-c-(1-s)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,v=l?e.height/l:e.height;return{width:g,height:v,top:m,right:h+g,bottom:m+v,left:h}}const ate={ignoreTransform:!1};function ku(e,t){t===void 0&&(t=ate);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=ea(e).getComputedStyle(e);m&&(n=rte(n,m,g))}const{top:r,left:s,width:l,height:c,bottom:d,right:h}=n;return{top:r,left:s,width:l,height:c,bottom:d,right:h}}function _T(e){return ku(e,{ignoreTransform:!0})}function ste(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function ote(e,t){return t===void 0&&(t=ea(e).getComputedStyle(e)),t.position==="fixed"}function ite(e,t){t===void 0&&(t=ea(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function n1(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(JS(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Kf(s)||h3(s)||n.includes(s))return n;const l=ea(e).getComputedStyle(s);return s!==e&&ite(s,l)&&n.push(s),ote(s,l)?n:r(s.parentNode)}return e?r(e):n}function b3(e){const[t]=n1(e,1);return t??null}function Vx(e){return!Og||!e?null:Ou(e)?e:XS(e)?JS(e)||e===Mu(e).scrollingElement?window:Kf(e)?e:null:null}function S3(e){return Ou(e)?e.scrollX:e.scrollLeft}function C3(e){return Ou(e)?e.scrollY:e.scrollTop}function W0(e){return{x:S3(e),y:C3(e)}}var sr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(sr||(sr={}));function w3(e){return!Og||!e?!1:e===document.scrollingElement}function E3(e){const t={x:0,y:0},n=w3(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const lte={x:.2,y:.2};function cte(e,t,n,r,s){let{top:l,left:c,right:d,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=lte);const{isTop:m,isBottom:g,isLeft:v,isRight:x}=E3(e),b={x:0,y:0},w={x:0,y:0},C={height:t.height*s.y,width:t.width*s.x};return!m&&l<=t.top+C.height?(b.y=sr.Backward,w.y=r*Math.abs((t.top+C.height-l)/C.height)):!g&&h>=t.bottom-C.height&&(b.y=sr.Forward,w.y=r*Math.abs((t.bottom-C.height-h)/C.height)),!x&&d>=t.right-C.width?(b.x=sr.Forward,w.x=r*Math.abs((t.right-C.width-d)/C.width)):!v&&c<=t.left+C.width&&(b.x=sr.Backward,w.x=r*Math.abs((t.left+C.width-c)/C.width)),{direction:b,speed:w}}function ute(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function R3(e){return e.reduce((t,n)=>tu(t,W0(n)),us)}function dte(e){return e.reduce((t,n)=>t+S3(n),0)}function fte(e){return e.reduce((t,n)=>t+C3(n),0)}function hte(e,t){if(t===void 0&&(t=ku),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);b3(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const mte=[["x",["left","right"],dte],["y",["top","bottom"],fte]];class r1{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=n1(n),s=R3(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of mte)for(const h of c)Object.defineProperty(this,h,{get:()=>{const m=d(r),g=s[l]-m;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class qd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function pte(e){const{EventTarget:t}=ea(e);return e instanceof t?e:Mu(e)}function Hx(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Fa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Fa||(Fa={}));function NT(e){e.preventDefault()}function gte(e){e.stopPropagation()}var Ut;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ut||(Ut={}));const T3={start:[Ut.Space,Ut.Enter],cancel:[Ut.Esc],end:[Ut.Space,Ut.Enter,Ut.Tab]},vte=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ut.Right:return{...n,x:n.x+25};case Ut.Left:return{...n,x:n.x-25};case Ut.Down:return{...n,y:n.y+25};case Ut.Up:return{...n,y:n.y-25}}};class j3{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new qd(Mu(n)),this.windowListeners=new qd(ea(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fa.Resize,this.handleCancel),this.windowListeners.add(Fa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&hte(r),n(us)}handleKeyDown(t){if(t1(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=T3,coordinateGetter:c=vte,scrollBehavior:d="smooth"}=s,{code:h}=t;if(l.end.includes(h)){this.handleEnd(t);return}if(l.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:m}=r.current,g=m?{x:m.left,y:m.top}:us;this.referenceCoordinates||(this.referenceCoordinates=g);const v=c(t,{active:n,context:r.current,currentCoordinates:g});if(v){const x=Np(v,g),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const E=t.code,{isTop:R,isRight:T,isLeft:j,isBottom:O,maxScroll:D,minScroll:N}=E3(C),A=ute(C),k={x:Math.min(E===Ut.Right?A.right-A.width/2:A.right,Math.max(E===Ut.Right?A.left:A.left+A.width/2,v.x)),y:Math.min(E===Ut.Down?A.bottom-A.height/2:A.bottom,Math.max(E===Ut.Down?A.top:A.top+A.height/2,v.y))},V=E===Ut.Right&&!T||E===Ut.Left&&!j,q=E===Ut.Down&&!O||E===Ut.Up&&!R;if(V&&k.x!==v.x){const H=C.scrollLeft+x.x,W=E===Ut.Right&&H<=D.x||E===Ut.Left&&H>=N.x;if(W&&!x.y){C.scrollTo({left:H,behavior:d});return}W?b.x=C.scrollLeft-H:b.x=E===Ut.Right?C.scrollLeft-D.x:C.scrollLeft-N.x,b.x&&C.scrollBy({left:-b.x,behavior:d});break}else if(q&&k.y!==v.y){const H=C.scrollTop+x.y,W=E===Ut.Down&&H<=D.y||E===Ut.Up&&H>=N.y;if(W&&!x.x){C.scrollTo({top:H,behavior:d});return}W?b.y=C.scrollTop-H:b.y=E===Ut.Down?C.scrollTop-D.y:C.scrollTop-N.y,b.y&&C.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,tu(Np(v,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}j3.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=T3,onActivation:s}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function AT(e){return!!(e&&"distance"in e)}function DT(e){return!!(e&&"delay"in e)}class a1{constructor(t,n,r){var s;r===void 0&&(r=pte(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=Mu(c),this.documentListeners=new qd(this.document),this.listeners=new qd(r),this.windowListeners=new qd(ea(c)),this.initialCoordinates=(s=Y0(l))!=null?s:us,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Fa.Resize,this.handleCancel),this.windowListeners.add(Fa.DragStart,NT),this.windowListeners.add(Fa.VisibilityChange,this.handleCancel),this.windowListeners.add(Fa.ContextMenu,NT),this.documentListeners.add(Fa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(DT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(AT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Fa.Click,gte,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!s)return;const h=(n=Y0(t))!=null?n:us,m=Np(s,h);if(!r&&d){if(AT(d)){if(d.tolerance!=null&&Hx(m,d.tolerance))return this.handleCancel();if(Hx(m,d.distance))return this.handleStart()}if(DT(d)&&Hx(m,d.tolerance))return this.handleCancel();this.handlePending(d,m);return}t.cancelable&&t.preventDefault(),c(h)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ut.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const yte={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mg extends a1{constructor(t){const{event:n}=t,r=Mu(n.target);super(t,yte,r)}}Mg.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const xte={move:{name:"mousemove"},end:{name:"mouseup"}};var Q0;(function(e){e[e.RightClick=2]="RightClick"})(Q0||(Q0={}));class bte extends a1{constructor(t){super(t,xte,Mu(t.event.target))}}bte.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Q0.RightClick?!1:(r==null||r({event:n}),!0)}}];const $x={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ste extends a1{constructor(t){super(t,$x)}static setup(){return window.addEventListener($x.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener($x.move.name,t)};function t(){}}}Ste.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var Kd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Kd||(Kd={}));var Dp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dp||(Dp={}));function Cte(e){let{acceleration:t,activator:n=Kd.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:c=5,order:d=Dp.TreeOrder,pointerCoordinates:h,scrollableAncestors:m,scrollableAncestorRects:g,delta:v,threshold:x}=e;const b=Ete({delta:v,disabled:!l}),[w,C]=kee(),E=p.useRef({x:0,y:0}),R=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case Kd.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case Kd.DraggableRect:return s}},[n,s,h]),j=p.useRef(null),O=p.useCallback(()=>{const N=j.current;if(!N)return;const A=E.current.x*R.current.x,k=E.current.y*R.current.y;N.scrollBy(A,k)},[]),D=p.useMemo(()=>d===Dp.TreeOrder?[...m].reverse():m,[d,m]);p.useEffect(()=>{if(!l||!m.length||!T){C();return}for(const N of D){if((r==null?void 0:r(N))===!1)continue;const A=m.indexOf(N),k=g[A];if(!k)continue;const{direction:V,speed:q}=cte(N,k,T,t,x);for(const H of["x","y"])b[H][V[H]]||(q[H]=0,V[H]=0);if(q.x>0||q.y>0){C(),j.current=N,w(O,c),E.current=q,R.current=V;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,O,r,C,l,c,JSON.stringify(T),JSON.stringify(b),w,m,D,g,JSON.stringify(x)])}const wte={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};function Ete(e){let{delta:t,disabled:n}=e;const r=Z0(t);return Zf(s=>{if(n||!r||!s)return wte;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[sr.Backward]:s.x[sr.Backward]||l.x===-1,[sr.Forward]:s.x[sr.Forward]||l.x===1},y:{[sr.Backward]:s.y[sr.Backward]||l.y===-1,[sr.Forward]:s.y[sr.Forward]||l.y===1}}},[n,t,r])}function Rte(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Zf(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function Tte(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var mf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(mf||(mf={}));var X0;(function(e){e.Optimized="optimized"})(X0||(X0={}));const OT=new Map;function jte(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,c]=p.useState(null),{frequency:d,measure:h,strategy:m}=s,g=p.useRef(e),v=E(),x=ff(v),b=p.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(T=>T===null?R:T.concat(R.filter(j=>!T.includes(j))))},[x]),w=p.useRef(null),C=Zf(R=>{if(v&&!n)return OT;if(!R||R===OT||g.current!==e||l!=null){const T=new Map;for(let j of e){if(!j)continue;if(l&&l.length>0&&!l.includes(j.id)&&j.rect.current){T.set(j.id,j.rect.current);continue}const O=j.node.current,D=O?new r1(h(O),O):null;j.rect.current=D,D&&T.set(j.id,D)}return T}return R},[e,l,n,v,h]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{v||b()},[n,v]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{v||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},d))},[d,v,b,...r]),{droppableRects:C,measureDroppableContainers:b,measuringScheduled:l!=null};function E(){switch(m){case mf.Always:return!1;case mf.BeforeDragging:return n;default:return!n}}}function _3(e,t){return Zf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function _te(e,t){return _3(e,t)}function Nte(e){let{callback:t,disabled:n}=e;const r=e1(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function kg(e){let{callback:t,disabled:n}=e;const r=e1(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Ate(e){return new r1(ku(e),e)}function MT(e,t,n){t===void 0&&(t=Ate);const[r,s]=p.useState(null);function l(){s(h=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=h??n)!=null?m:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const c=Nte({callback(h){if(e)for(const m of h){const{type:g,target:v}=m;if(g==="childList"&&v instanceof HTMLElement&&v.contains(e)){l();break}}}}),d=kg({callback:l});return zs(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),r}function Dte(e){const t=_3(e);return x3(e,t)}const kT=[];function Ote(e){const t=p.useRef(e),n=Zf(r=>e?r&&r!==kT&&e&&t.current&&e.parentNode===t.current.parentNode?r:n1(e):kT,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function Mte(e){const[t,n]=p.useState(null),r=p.useRef(e),s=p.useCallback(l=>{const c=Vx(l.target);c&&n(d=>d?(d.set(c,W0(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(h=>{const m=Vx(h);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,W0(m)]):null}).filter(h=>h!=null);n(d.length?new Map(d):null),r.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(h=>{const m=Vx(h);m==null||m.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>tu(l,c),us):R3(e):us,[e,t])}function IT(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==us;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Np(e,n.current):us}function kte(e){p.useEffect(()=>{if(!Og)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Ite(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=c=>{l(c,t)},n},{}),[e,t])}function N3(e){return p.useMemo(()=>e?ste(e):null,[e])}const LT=[];function Lte(e,t){t===void 0&&(t=ku);const[n]=e,r=N3(n?ea(n):null),[s,l]=p.useState(LT);function c(){l(()=>e.length?e.map(h=>w3(h)?r:new r1(t(h),h)):LT)}const d=kg({callback:c});return zs(()=>{d==null||d.disconnect(),c(),e.forEach(h=>d==null?void 0:d.observe(h))},[e]),s}function Pte(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Kf(t)?t:e}function Ute(e){let{measure:t}=e;const[n,r]=p.useState(null),s=p.useCallback(m=>{for(const{target:g}of m)if(Kf(g)){r(v=>{const x=t(g);return v?{...v,width:x.width,height:x.height}:x});break}},[t]),l=kg({callback:s}),c=p.useCallback(m=>{const g=Pte(m);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,h]=_p(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:h}),[n,d,h])}const Fte=[{sensor:Mg,options:{}},{sensor:j3,options:{}}],zte={current:{}},Bm={draggable:{measure:_T},droppable:{measure:_T,strategy:mf.WhileDragging,frequency:X0.Optimized},dragOverlay:{measure:ku}};class Zd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Vte={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ap},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bm,measureDroppableContainers:Ap,windowRect:null,measuringScheduled:!1},Hte={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ap,draggableNodes:new Map,over:null,measureDroppableContainers:Ap},Ig=p.createContext(Hte),A3=p.createContext(Vte);function $te(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zd}}}function Bte(e,t){switch(t.type){case Jn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Jn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Jn.DragEnd:case Jn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Jn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Zd(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Jn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new Zd(e.droppable.containers);return c.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case Jn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new Zd(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Gte(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=p.useContext(Ig),l=Z0(r),c=Z0(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!t1(l)||document.activeElement===l.target)return;const d=s.get(c);if(!d)return;const{activatorNode:h,node:m}=d;if(!h.current&&!m.current)return;requestAnimationFrame(()=>{for(const g of[h.current,m.current]){if(!g)continue;const v=Pee(g);if(v){v.focus();break}}})}},[r,t,s,c,l]),null}function qte(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function Kte(e){return p.useMemo(()=>({draggable:{...Bm.draggable,...e==null?void 0:e.draggable},droppable:{...Bm.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Bm.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Zte(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;zs(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const g=n(m),v=x3(g,r);if(c||(v.x=0),d||(v.y=0),l.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const x=b3(m);x&&x.scrollBy({top:v.y,left:v.x})}},[t,c,d,r,n])}const D3=p.createContext({...us,scaleX:1,scaleY:1});var ci;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ci||(ci={}));const O3=p.memo(function(t){var n,r,s,l;let{id:c,accessibility:d,autoScroll:h=!0,children:m,sensors:g=Fte,collisionDetection:v=Xee,measuring:x,modifiers:b,...w}=t;const C=p.useReducer(Bte,void 0,$te),[E,R]=C,[T,j]=$ee(),[O,D]=p.useState(ci.Uninitialized),N=O===ci.Initialized,{draggable:{active:A,nodes:k,translate:V},droppable:{containers:q}}=E,H=A!=null?k.get(A):null,W=p.useRef({initial:null,translated:null}),re=p.useMemo(()=>{var cn;return A!=null?{id:A,data:(cn=H==null?void 0:H.data)!=null?cn:zte,rect:W}:null},[A,H]),G=p.useRef(null),[Q,I]=p.useState(null),[Y,B]=p.useState(null),oe=ff(w,Object.values(w)),be=Yf("DndDescribedBy",c),L=p.useMemo(()=>q.getEnabled(),[q]),P=Kte(x),{droppableRects:K,measureDroppableContainers:ne,measuringScheduled:fe}=jte(L,{dragging:N,dependencies:[V.x,V.y],config:P.droppable}),ge=Rte(k,A),ue=p.useMemo(()=>Y?Y0(Y):null,[Y]),Ae=Io(),Re=_te(ge,P.draggable.measure);Zte({activeNode:A!=null?k.get(A):null,config:Ae.layoutShiftCompensation,initialRect:Re,measure:P.draggable.measure});const xe=MT(ge,P.draggable.measure,Re),Je=MT(ge?ge.parentElement:null),Qe=p.useRef({activatorEvent:null,active:null,activeNode:ge,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:q,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),zt=q.getNodeFor((n=Qe.current.over)==null?void 0:n.id),Te=Ute({measure:P.dragOverlay.measure}),ft=(r=Te.nodeRef.current)!=null?r:ge,lt=N?(s=Te.rect)!=null?s:xe:null,sn=!!(Te.nodeRef.current&&Te.rect),Ea=Dte(sn?null:xe),ur=N3(ft?ea(ft):null),z=Ote(N?zt??ge:null),J=Lte(z),de=qte(b,{transform:{x:V.x-Ea.x,y:V.y-Ea.y,scaleX:1,scaleY:1},activatorEvent:Y,active:re,activeNodeRect:xe,containerNodeRect:Je,draggingNodeRect:lt,over:Qe.current.over,overlayNodeRect:Te.rect,scrollableAncestors:z,scrollableAncestorRects:J,windowRect:ur}),Ne=ue?tu(ue,V):null,ye=Mte(z),Ce=IT(ye),Le=IT(ye,[xe]),at=tu(de,Ce),ht=lt?tte(lt,de):null,gn=re&&ht?v({active:re,collisionRect:ht,droppableRects:K,droppableContainers:L,pointerCoordinates:Ne}):null,Fr=Wee(gn,"id"),[Rn,xr]=p.useState(null),zr=sn?de:tu(de,Le),vn=Jee(zr,(l=Rn==null?void 0:Rn.rect)!=null?l:null,xe),dr=p.useRef(null),Tn=p.useCallback((cn,hn)=>{let{sensor:jn,options:Kn}=hn;if(G.current==null)return;const Zn=k.get(G.current);if(!Zn)return;const nr=cn.nativeEvent,br=new jn({active:G.current,activeNode:Zn,event:nr,options:Kn,context:Qe,onAbort(Z){if(!k.get(Z))return;const{onDragAbort:ve}=oe.current,Ee={id:Z};ve==null||ve(Ee),T({type:"onDragAbort",event:Ee})},onPending(Z,se,ve,Ee){if(!k.get(Z))return;const{onDragPending:Ve}=oe.current,Ie={id:Z,constraint:se,initialCoordinates:ve,offset:Ee};Ve==null||Ve(Ie),T({type:"onDragPending",event:Ie})},onStart(Z){const se=G.current;if(se==null)return;const ve=k.get(se);if(!ve)return;const{onDragStart:Ee}=oe.current,Fe={activatorEvent:nr,active:{id:se,data:ve.data,rect:W}};as.unstable_batchedUpdates(()=>{Ee==null||Ee(Fe),D(ci.Initializing),R({type:Jn.DragStart,initialCoordinates:Z,active:se}),T({type:"onDragStart",event:Fe}),I(dr.current),B(nr)})},onMove(Z){R({type:Jn.DragMove,coordinates:Z})},onEnd:U(Jn.DragEnd),onCancel:U(Jn.DragCancel)});dr.current=br;function U(Z){return async function(){const{active:ve,collisions:Ee,over:Fe,scrollAdjustedTranslate:Ve}=Qe.current;let Ie=null;if(ve&&Ve){const{cancelDrop:Ge}=oe.current;Ie={activatorEvent:nr,active:ve,collisions:Ee,delta:Ve,over:Fe},Z===Jn.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(Ie))&&(Z=Jn.DragCancel)}G.current=null,as.unstable_batchedUpdates(()=>{R({type:Z}),D(ci.Uninitialized),xr(null),I(null),B(null),dr.current=null;const Ge=Z===Jn.DragEnd?"onDragEnd":"onDragCancel";if(Ie){const qe=oe.current[Ge];qe==null||qe(Ie),T({type:Ge,event:Ie})}})}}},[k]),ko=p.useCallback((cn,hn)=>(jn,Kn)=>{const Zn=jn.nativeEvent,nr=k.get(Kn);if(G.current!==null||!nr||Zn.dndKit||Zn.defaultPrevented)return;const br={active:nr};cn(jn,hn.options,br)===!0&&(Zn.dndKit={capturedBy:hn.sensor},G.current=Kn,Tn(jn,hn))},[k,Tn]),Ra=Tte(g,ko);kte(g),zs(()=>{xe&&O===ci.Initializing&&D(ci.Initialized)},[xe,O]),p.useEffect(()=>{const{onDragMove:cn}=oe.current,{active:hn,activatorEvent:jn,collisions:Kn,over:Zn}=Qe.current;if(!hn||!jn)return;const nr={active:hn,activatorEvent:jn,collisions:Kn,delta:{x:at.x,y:at.y},over:Zn};as.unstable_batchedUpdates(()=>{cn==null||cn(nr),T({type:"onDragMove",event:nr})})},[at.x,at.y]),p.useEffect(()=>{const{active:cn,activatorEvent:hn,collisions:jn,droppableContainers:Kn,scrollAdjustedTranslate:Zn}=Qe.current;if(!cn||G.current==null||!hn||!Zn)return;const{onDragOver:nr}=oe.current,br=Kn.get(Fr),U=br&&br.rect.current?{id:br.id,rect:br.rect.current,data:br.data,disabled:br.disabled}:null,Z={active:cn,activatorEvent:hn,collisions:jn,delta:{x:Zn.x,y:Zn.y},over:U};as.unstable_batchedUpdates(()=>{xr(U),nr==null||nr(Z),T({type:"onDragOver",event:Z})})},[Fr]),zs(()=>{Qe.current={activatorEvent:Y,active:re,activeNode:ge,collisionRect:ht,collisions:gn,droppableRects:K,draggableNodes:k,draggingNode:ft,draggingNodeRect:lt,droppableContainers:q,over:Rn,scrollableAncestors:z,scrollAdjustedTranslate:at},W.current={initial:lt,translated:ht}},[re,ge,gn,ht,k,ft,lt,K,q,Rn,z,at]),Cte({...Ae,delta:V,draggingRect:ht,pointerCoordinates:Ne,scrollableAncestors:z,scrollableAncestorRects:J});const Zl=p.useMemo(()=>({active:re,activeNode:ge,activeNodeRect:xe,activatorEvent:Y,collisions:gn,containerNodeRect:Je,dragOverlay:Te,draggableNodes:k,droppableContainers:q,droppableRects:K,over:Rn,measureDroppableContainers:ne,scrollableAncestors:z,scrollableAncestorRects:J,measuringConfiguration:P,measuringScheduled:fe,windowRect:ur}),[re,ge,xe,Y,gn,Je,Te,k,q,K,Rn,ne,z,J,P,fe,ur]),vs=p.useMemo(()=>({activatorEvent:Y,activators:Ra,active:re,activeNodeRect:xe,ariaDescribedById:{draggable:be},dispatch:R,draggableNodes:k,over:Rn,measureDroppableContainers:ne}),[Y,Ra,re,xe,R,be,k,Rn,ne]);return _e.createElement(p3.Provider,{value:j},_e.createElement(Ig.Provider,{value:vs},_e.createElement(A3.Provider,{value:Zl},_e.createElement(D3.Provider,{value:vn},m)),_e.createElement(Gte,{disabled:(d==null?void 0:d.restoreFocus)===!1})),_e.createElement(qee,{...d,hiddenTextDescribedById:be}));function Io(){const cn=(Q==null?void 0:Q.autoScrollEnabled)===!1,hn=typeof h=="object"?h.enabled===!1:h===!1,jn=N&&!cn&&!hn;return typeof h=="object"?{...h,enabled:jn}:{enabled:jn}}}),Yte=p.createContext(null),PT="button",Wte="Draggable";function Qte(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=Yf(Wte),{activators:c,activatorEvent:d,active:h,activeNodeRect:m,ariaDescribedById:g,draggableNodes:v,over:x}=p.useContext(Ig),{role:b=PT,roleDescription:w="draggable",tabIndex:C=0}=s??{},E=(h==null?void 0:h.id)===t,R=p.useContext(E?D3:Yte),[T,j]=_p(),[O,D]=_p(),N=Ite(c,t),A=ff(n);zs(()=>(v.set(t,{id:t,key:l,node:T,activatorNode:O,data:A}),()=>{const V=v.get(t);V&&V.key===l&&v.delete(t)}),[v,t]);const k=p.useMemo(()=>({role:b,tabIndex:C,"aria-disabled":r,"aria-pressed":E&&b===PT?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,b,C,E,w,g.draggable]);return{active:h,activatorEvent:d,activeNodeRect:m,attributes:k,isDragging:E,listeners:r?void 0:N,node:T,over:x,setNodeRef:j,setActivatorNodeRef:D,transform:R}}function Xte(){return p.useContext(A3)}const Jte="Droppable",ene={timeout:25};function tne(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=Yf(Jte),{active:c,dispatch:d,over:h,measureDroppableContainers:m}=p.useContext(Ig),g=p.useRef({disabled:n}),v=p.useRef(!1),x=p.useRef(null),b=p.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...ene,...s},R=ff(C??r),T=p.useCallback(()=>{if(!v.current){v.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),b.current=null},E)},[E]),j=kg({callback:T,disabled:w||!c}),O=p.useCallback((k,V)=>{j&&(V&&(j.unobserve(V),v.current=!1),k&&j.observe(k))},[j]),[D,N]=_p(O),A=ff(t);return p.useEffect(()=>{!j||!D.current||(j.disconnect(),v.current=!1,j.observe(D.current))},[D,j]),p.useEffect(()=>(d({type:Jn.RegisterDroppable,element:{id:r,key:l,disabled:n,node:D,rect:x,data:A}}),()=>d({type:Jn.UnregisterDroppable,key:l,id:r})),[r]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:Jn.SetDroppableDisabled,id:r,key:l,disabled:n}),g.current.disabled=n)},[r,l,n,d]),{active:c,rect:x,isOver:(h==null?void 0:h.id)===r,node:D,over:h,setNodeRef:N}}function M3(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function nne(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function Nm(e){return e!==null&&e>=0}function rne(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ane(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const k3=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=M3(t,r,n),c=t[s],d=l[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Am={scaleX:1,scaleY:1},I3=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(s===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...Am}:null}const h=sne(l,s,n);return s>n&&s<=c?{x:0,y:-d.height-h,...Am}:s<n&&s>=c?{x:0,y:d.height+h,...Am}:{x:0,y:0,...Am}};function sne(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const L3="Sortable",P3=_e.createContext({activeIndex:-1,containerId:L3,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:k3,disabled:{draggable:!1,droppable:!1}});function U3(e){let{children:t,id:n,items:r,strategy:s=k3,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:h,over:m,measureDroppableContainers:g}=Xte(),v=Yf(L3,n),x=d.rect!==null,b=p.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),w=c!=null,C=c?b.indexOf(c.id):-1,E=m?b.indexOf(m.id):-1,R=p.useRef(b),T=!rne(b,R.current),j=E!==-1&&C===-1||T,O=ane(l);zs(()=>{T&&w&&g(b)},[T,b,w,g]),p.useEffect(()=>{R.current=b},[b]);const D=p.useMemo(()=>({activeIndex:C,containerId:v,disabled:O,disableTransforms:j,items:b,overIndex:E,useDragOverlay:x,sortedRects:nne(b,h),strategy:s}),[C,v,O.draggable,O.droppable,j,b,E,h,x,s]);return _e.createElement(P3.Provider,{value:D},t)}const one=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return M3(n,r,s).indexOf(t)},ine=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:c,previousItems:d,previousContainerId:h,transition:m}=e;return!m||!r||d!==l&&s===c?!1:n?!0:c!==s&&t===h},lne={duration:200,easing:"ease"},F3="transform",cne=hf.Transition.toString({property:F3,duration:0,easing:"linear"}),une={roleDescription:"sortable"};function dne(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,c]=p.useState(null),d=p.useRef(n);return zs(()=>{if(!t&&n!==d.current&&r.current){const h=s.current;if(h){const m=ku(r.current,{ignoreTransform:!0}),g={x:h.left-m.left,y:h.top-m.top,scaleX:h.width/m.width,scaleY:h.height/m.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,r,s]),p.useEffect(()=>{l&&c(null)},[l]),l}function fne(e){let{animateLayoutChanges:t=ine,attributes:n,disabled:r,data:s,getNewIndex:l=one,id:c,strategy:d,resizeObserverConfig:h,transition:m=lne}=e;const{items:g,containerId:v,activeIndex:x,disabled:b,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:T}=p.useContext(P3),j=hne(r,b),O=g.indexOf(c),D=p.useMemo(()=>({sortable:{containerId:v,index:O,items:g},...s}),[v,s,O,g]),N=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:A,node:k,isOver:V,setNodeRef:q}=tne({id:c,data:D,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...h}}),{active:H,activatorEvent:W,activeNodeRect:re,attributes:G,setNodeRef:Q,listeners:I,isDragging:Y,over:B,setActivatorNodeRef:oe,transform:be}=Qte({id:c,data:D,attributes:{...une,...n},disabled:j.draggable}),L=Mee(q,Q),P=!!H,K=P&&!w&&Nm(x)&&Nm(E),ne=!R&&Y,fe=ne&&K?be:null,ue=K?fe??(d??T)({rects:C,activeNodeRect:re,activeIndex:x,overIndex:E,index:O}):null,Ae=Nm(x)&&Nm(E)?l({id:c,items:g,activeIndex:x,overIndex:E}):O,Re=H==null?void 0:H.id,xe=p.useRef({activeId:Re,items:g,newIndex:Ae,containerId:v}),Je=g!==xe.current.items,Qe=t({active:H,containerId:v,isDragging:Y,isSorting:P,id:c,index:O,items:g,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:m,wasDragging:xe.current.activeId!=null}),zt=dne({disabled:!Qe,index:O,node:k,rect:A});return p.useEffect(()=>{P&&xe.current.newIndex!==Ae&&(xe.current.newIndex=Ae),v!==xe.current.containerId&&(xe.current.containerId=v),g!==xe.current.items&&(xe.current.items=g)},[P,Ae,v,g]),p.useEffect(()=>{if(Re===xe.current.activeId)return;if(Re&&!xe.current.activeId){xe.current.activeId=Re;return}const ft=setTimeout(()=>{xe.current.activeId=Re},50);return()=>clearTimeout(ft)},[Re]),{active:H,activeIndex:x,attributes:G,data:D,rect:A,index:O,newIndex:Ae,items:g,isOver:V,isSorting:P,isDragging:Y,listeners:I,node:k,overIndex:E,over:B,setNodeRef:L,setActivatorNodeRef:oe,setDroppableNodeRef:q,setDraggableNodeRef:Q,transform:zt??ue,transition:Te()};function Te(){if(zt||Je&&xe.current.newIndex===O)return cne;if(!(ne&&!t1(W)||!m)&&(P||Qe))return hf.Transition.toString({...m,property:F3})}}function hne(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Ut.Down,Ut.Right,Ut.Up,Ut.Left;function nu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[h,m]=p.useState(!1),[g,v]=p.useState(e),x=p.useRef(null),b=T=>{v(T.target.value)},w=()=>{n&&g!==e&&n(g.trim()),m(!1)},C=()=>{v(e),m(!1)},E=T=>{T.key==="Enter"&&!T.shiftKey?(r===1||T.ctrlKey)&&(T.preventDefault(),w()):T.key==="Escape"&&(T.preventDefault(),C())},R=T=>{m(T),T?(v(e),setTimeout(()=>{x.current&&x.current.focus()},0)):C()};return o.jsxs(kS,{open:h,onOpenChange:R,children:[o.jsx(IS,{asChild:!0,children:o.jsx("div",{className:ie("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",l),children:e||t})}),o.jsxs(LS,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[o.jsx(Ti,{ref:x,value:g,onChange:b,onKeyDown:E,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:d}),o.jsx(we,{size:"sm",onClick:w,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function mne({isAllExpanded:e,onToggle:t}){return o.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?o.jsx(wL,{className:"h-4 w-4"}):o.jsx(db,{className:"h-4 w-4"})})}function pne({isExpanded:e,onToggle:t,ariaLabel:n}){return o.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?o.jsx(Ga,{className:"h-4 w-4"}):o.jsx(hs,{className:"h-4 w-4"})})}function gne({className:e="",...t}){return o.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:o.jsx(JL,{className:"h-4 w-4 text-gray-400"})})}function z3({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:l,transition:c,isDragging:d}=fne({id:e}),h={transform:hf.Transform.toString(l),transition:c,opacity:d?.75:1},m=p.Children.toArray(t),g=[o.jsx(va,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:o.jsx(gne,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return o.jsx(tr,{ref:s,style:h,className:"group",children:g})}function V3({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,l]=p.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),h=!!t,m=d&&h;return o.jsxs("div",{className:"px-3 text-right",children:[o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Or,{align:"end",children:[d&&o.jsxs(Tt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[o.jsx(Jr,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&o.jsx($a,{}),h&&o.jsxs(Tt,{onClick:()=>{l(!0)},children:[o.jsx(Do,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),o.jsx(ya,{open:s,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function vne({mode:e,onModeChange:t}){const n=Object.values(df),r=s=>{t&&t(s)};return o.jsxs(ba,{value:e,onValueChange:r,children:[o.jsx(Ca,{className:"h-90 cursor-pointer",size:"sm",children:o.jsx(Sa,{placeholder:"Select field mode"})}),o.jsx(wa,{className:"max-h-[300px]",children:n.map(s=>o.jsx(Hn,{value:s,children:s},s))})]})}var Lg="Checkbox",[yne]=Ur(Lg),[xne,s1]=yne(Lg);function bne(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:l,form:c,name:d,onCheckedChange:h,required:m,value:g="on",internal_do_not_use_render:v}=e,[x,b]=Xr({prop:n,defaultProp:s??!1,onChange:h,caller:Lg}),[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useRef(!1),j=w?!!c||!!w.closest("form"):!0,O={checked:x,disabled:l,setChecked:b,control:w,setControl:C,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:T,required:m,defaultChecked:bi(s)?!1:s,isFormControl:j,bubbleInput:E,setBubbleInput:R};return o.jsx(xne,{scope:t,...O,children:Sne(v)?v(O):r})}var H3="CheckboxTrigger",$3=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:l,value:c,disabled:d,checked:h,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:w}=s1(H3,e),C=vt(s,g),E=p.useRef(h);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const T=()=>v(E.current);return R.addEventListener("reset",T),()=>R.removeEventListener("reset",T)}},[l,v]),o.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":bi(h)?"mixed":h,"aria-required":m,"data-state":Y3(h),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:C,onKeyDown:je(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:je(n,R=>{v(T=>bi(T)?!0:!T),w&&b&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});$3.displayName=H3;var B3=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:h,onCheckedChange:m,form:g,...v}=e;return o.jsx(bne,{__scopeCheckbox:n,checked:s,defaultChecked:l,disabled:d,required:c,onCheckedChange:m,name:r,form:g,value:h,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx($3,{...v,ref:t,__scopeCheckbox:n}),x&&o.jsx(Z3,{__scopeCheckbox:n})]})})});B3.displayName=Lg;var G3="CheckboxIndicator",q3=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,l=s1(G3,n);return o.jsx(_r,{present:r||bi(l.checked)||l.checked===!0,children:o.jsx(Ye.span,{"data-state":Y3(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});q3.displayName=G3;var K3="CheckboxBubbleInput",Z3=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:c,required:d,disabled:h,name:m,value:g,form:v,bubbleInput:x,setBubbleInput:b}=s1(K3,e),w=vt(n,b),C=NS(l),E=jb(r);p.useEffect(()=>{const T=x;if(!T)return;const j=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(j,"checked").set,N=!s.current;if(C!==l&&D){const A=new Event("click",{bubbles:N});T.indeterminate=bi(l),D.call(T,bi(l)?!1:l),T.dispatchEvent(A)}},[x,C,l,s]);const R=p.useRef(bi(l)?!1:l);return o.jsx(Ye.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:d,disabled:h,name:m,value:g,form:v,...t,tabIndex:-1,ref:w,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Z3.displayName=K3;function Sne(e){return typeof e=="function"}function bi(e){return e==="indeterminate"}function Y3(e){return bi(e)?"indeterminate":e?"checked":"unchecked"}function Cne({className:e,...t}){return o.jsx(B3,{"data-slot":"checkbox",className:ie("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(q3,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5"})})})}function W3({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return o.jsx(Cne,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const UT={[os.CONNECTED]:{icon:Pp,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[os.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Up,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[os.DISCONNECTED]:{icon:C8,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function Q3({status:e}){if(!e||!(e in UT))return null;const t=UT[e],{icon:n,color:r,label:s,description:l}=t,c=`schema-field-status-tooltip-${e}`;return o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(n,{className:ie("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),o.jsxs(Nt,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs font-medium",children:s}),o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function X3({type:e,storageType:t,onTypeChange:n}){const r=t===Pe.GOOGLE_BIGQUERY?Object.values(Dn):Object.values(QS),s=l=>{n&&(Pe.GOOGLE_BIGQUERY,n(l))};return o.jsxs(ba,{value:e,onValueChange:s,children:[o.jsx(Ca,{className:"cursor-pointer",size:"sm",children:o.jsx(Sa,{placeholder:"Select field type"})}),o.jsx(wa,{className:"max-h-[300px]",children:r.map(l=>o.jsx(Hn,{value:l,children:l},l))})]})}function wne({table:e}){return o.jsx("div",{className:"px-3 text-right",children:o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Or,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Tt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id:t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function Ene({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:l,"aria-label":c}){const[d,h]=p.useState(n),m=p.useRef(!0);p.useEffect(()=>{(n===""||m.current)&&(h(n),m.current=!1)},[n]);const g=p.useCallback(v=>{const x=v.target.value;h(x);const b=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(b)}},[r,s]);return o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Ll,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),o.jsx(Bt,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function Rne({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s}){return o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsx(Ene,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),o.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&o.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([l,c])=>c===0?null:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Q3,{status:l}),o.jsx("span",{className:"text-sm font-medium text-gray-500",children:c})]},l))}),o.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,"aria-label":"Add new field",children:[o.jsx(Jr,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const Tne={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function FT(e,t={}){const n=Tne[e];return n?{...t,position:"sticky",zIndex:n.zIndex,...n.left!==void 0&&{left:n.left},...n.right!==void 0&&{right:n.right}}:t}function jne({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:l,dragContextProps:c,rowComponent:d=tr,getRowId:h}){const m=t,g=l,v=d,{columnVisibility:x,setColumnVisibility:b}=_ee(m),w=Eu({data:e,columns:m,getCoreRowModel:wu(),getFilteredRowModel:Ff(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:x},onColumnVisibilityChange:b,enableGlobalFilter:!0,globalFilterFn:Nee,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:C,onChange:E,searchValue:R}=Aee(w),T=p.useRef("");p.useEffect(()=>{s&&R!==T.current&&(T.current=R,s(R))},[R,s]);const j=p.useMemo(()=>{const N={[os.CONNECTED]:0,[os.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[os.DISCONNECTED]:0};return(r??e).forEach(k=>{k.status in N&&N[k.status]++}),N},[e,r]);return o.jsxs("div",{className:"space-y-4",children:[n&&o.jsx(Rne,{table:w,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:C,onFilterChange:E,statusCounts:j}),o.jsx("div",{className:"dm-card-table-wrap mb-0",children:o.jsxs(Ru,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[o.jsx(Tu,{className:"dm-card-table-header",children:w.getHeaderGroups().map(N=>o.jsx(tr,{className:"dm-card-table-header-row",children:N.headers.map(A=>o.jsx(_u,{className:"bg-secondary dark:bg-background",style:FT(A.column.id,{width:A.getSize()!==0?A.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:A.isPlaceholder?null:typeof A.column.columnDef.header=="function"?A.column.columnDef.header(A.getContext()):A.column.columnDef.header},A.id))},N.id))}),o.jsx(ju,{className:"dm-card-table-body",children:w.getRowModel().rows.length?o.jsx(g,{...c,children:w.getRowModel().rows.map(N=>o.jsx(v,{id:h?h(N):N.index,row:N,children:N.getVisibleCells().map(A=>o.jsx(va,{className:"bg-background dark:bg-muted",style:FT(A.column.id,{width:A.column.getSize()!==0?A.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:A.column.columnDef.cell&&typeof A.column.columnDef.cell=="function"?A.column.columnDef.cell(A.getContext()):null},A.id))},N.id))}):o.jsx(tr,{children:o.jsx(va,{colSpan:m.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&o.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,"aria-label":"Add new field",children:[o.jsx(Jr,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function J3({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:h,nameColumnCell:m,primaryKeyColumnCell:g,aliasColumnCell:v,descriptionColumnCell:x,actionsColumnCell:b,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R}){const T=p.useCallback((A,k)=>{if(t){const V=[...e];V[A]={...V[A],...k},t(V)}},[e,t]),j=p.useCallback(()=>{if(t){const A=r();t([...e,A])}},[e,t,r]),O=p.useCallback(A=>{if(t){const k=[...e];k.splice(A,1),t(k)}},[e,t]),D=p.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:A})=>o.jsx(Q3,{status:A.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:h??(()=>o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default",children:"Name"}),o.jsx(Nt,{children:"Field name in the output schema"})]})),size:80,cell:({row:A})=>m?m({row:A,updateField:T}):o.jsx(nu,{value:Ree(A.getValue("name")),onValueChange:k=>{T(A.index,{name:k})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default",children:"PK"}),o.jsx(Nt,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:A})=>g?g({row:A,updateField:T}):o.jsx(W3,{isPrimaryKey:A.getValue("isPrimaryKey"),onPrimaryKeyChange:k=>{T(A.index,{isPrimaryKey:k})}}),enableHiding:!1},{accessorKey:"alias",header:()=>o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default",children:"Alias"}),o.jsx(Nt,{children:"Alternative name for the field"})]}),size:80,cell:({row:A})=>v?v({row:A,updateField:T}):o.jsx(nu,{value:A.getValue("alias"),onValueChange:k=>{T(A.index,{alias:k})},placeholder:"-"})},{accessorKey:"description",header:()=>o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default",children:"Description"}),o.jsx(Nt,{children:"Detailed information about the field"})]}),cell:({row:A})=>x?x({row:A,updateField:T}):o.jsx(nu,{value:A.getValue("description"),onValueChange:k=>{T(A.index,{description:k})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:A})=>o.jsx(wne,{table:A}),cell:({row:A,table:k})=>b?b({row:A,table:k}):o.jsx(V3,{row:A,onDeleteRow:t?O:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[T,O,t,h,m,g,v,x,b]),N=p.useMemo(()=>{const k={accessorKey:"type",header:()=>o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default pl-[12px]",children:"Type"}),o.jsx(Nt,{children:"Data type of the field"})]}),size:80,cell:q=>s({row:q.row,updateField:T}),enableHiding:!1},V=[...D];if(V.splice(3,0,k),l.length>0){const q=[...l];q.sort((H,W)=>{const re=H.columnIndex??1/0,G=W.columnIndex??1/0;return re-G}),q.forEach(H=>{if(H.columnIndex!==void 0){const W=Math.min(Math.max(0,H.columnIndex),V.length);V.splice(W,0,H)}else V.splice(V.length-1,0,H)})}return V},[D,s,T,l]);return o.jsx(jne,{fields:e,columns:N,onFieldsChange:t,onAddRow:n??(t?j:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R})}function _ne({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:h,topLevelFields:m,allExpanded:g}=Dee(e),{updateField:v,handleDeleteRow:x,handleAddNestedField:b,handleAddRow:w}=Oee(e,c,t,H=>H),C=p.useCallback(()=>({name:"",type:Dn.STRING,mode:df.NULLABLE,isPrimaryKey:!1,status:os.DISCONNECTED}),[]),E=p.useCallback(({row:H})=>o.jsx(X3,{type:H.getValue("type"),storageType:Pe.GOOGLE_BIGQUERY,onTypeChange:W=>{v(H.index,{type:W})}}),[v]),R=p.useMemo(()=>[{accessorKey:"mode",header:()=>o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default pl-[12px]",children:"Mode"}),o.jsx(Nt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
716
|
-
NULLABLE - field can be NULL
|
|
717
|
-
REQUIRED - field cant be NULL
|
|
718
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:H})=>o.jsx(vne,{mode:H.getValue("mode"),onModeChange:W=>{v(H.index,{mode:W})}}),columnIndex:4}],[v]),T=p.useCallback(()=>o.jsxs("div",{className:"flex items-center",children:[r&&o.jsx(mne,{isAllExpanded:g,onToggle:l}),o.jsxs(jt,{children:[o.jsx(_t,{className:"cursor-default",children:"Name"}),o.jsx(Nt,{children:"Field name in the output schema"})]})]}),[r,g,l]),j=p.useCallback(({row:H})=>{const W=c[H.index],G=(W.type===Dn.RECORD||W.type===Dn.STRUCT)&&W.fields&&W.fields.length>0,Q=W.path??"",I=W.level??0,Y=n.has(Q);return o.jsxs("div",{className:"flex items-center",children:[I>0&&o.jsx("div",{style:{width:`${String(I*16-(G?4:0))}px`},className:"flex-shrink-0"}),G?o.jsx(pne,{isExpanded:Y,onToggle:()=>{s(Q)},ariaLabel:Y?"Collapse nested fields":"Expand nested fields"}):r&&o.jsx("div",{className:"w-5"}),o.jsx(nu,{value:H.getValue("name"),onValueChange:B=>{v(H.index,{name:B})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,v]),O=p.useCallback(({row:H})=>{const W=c[H.index],re=W.type===Dn.RECORD||W.type===Dn.STRUCT;return(W.level??0)===0&&!re?o.jsx(W3,{isPrimaryKey:H.getValue("isPrimaryKey"),onPrimaryKeyChange:Q=>{v(H.index,{isPrimaryKey:Q})}}):o.jsx("div",{})},[c,v]),D=p.useCallback(({row:H})=>o.jsx(nu,{value:H.getValue("description"),onValueChange:W=>{v(H.index,{description:W})},minRows:5,placeholder:"-"}),[v]),N=p.useCallback(({row:H})=>o.jsx(nu,{value:H.getValue("alias"),onValueChange:W=>{v(H.index,{alias:W})},placeholder:"-"}),[v]),A=p.useCallback(({row:H})=>o.jsx(V3,{row:H,onDeleteRow:t?x:void 0,onAddNestedField:t?b:void 0,isRecordType:h}),[t,x,b,h]),{handleDragEnd:k}=f3(e,t,c),V=p.useCallback(H=>{const W=c[H.index];return W.path??String(c.indexOf(W))},[c]),q=v3(g3(Mg,{activationConstraint:{distance:5}}));return o.jsx(O3,{sensors:q,collisionDetection:y3,onDragEnd:k,children:o.jsx(J3,{fields:c,onFieldsChange:t,onAddRow:w,createNewField:C,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:d,nameColumnHeader:T,nameColumnCell:j,primaryKeyColumnCell:O,aliasColumnCell:N,descriptionColumnCell:D,actionsColumnCell:A,dragContext:U3,dragContextProps:{items:c.map(H=>H.path??String(c.indexOf(H))),strategy:I3},rowComponent:z3,getRowId:V})})}function Nne({fields:e,onFieldsChange:t}){const n=p.useCallback(()=>({name:"",type:QS.STRING,isPrimaryKey:!1,status:os.DISCONNECTED}),[]),r=p.useCallback(({row:c,updateField:d})=>o.jsx(X3,{type:c.getValue("type"),storageType:Pe.AWS_ATHENA,onTypeChange:h=>{d(c.index,{type:h})}}),[]),{handleDragEnd:s}=f3(e,t),l=v3(g3(Mg,{activationConstraint:{distance:5}}));return o.jsx(O3,{sensors:l,collisionDetection:y3,onDragEnd:s,children:o.jsx(J3,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:U3,dragContextProps:{items:e.map((c,d)=>d),strategy:I3},rowComponent:z3})})}function Ane({schema:e,storageType:t,onFieldsChange:n}){const r=p.useMemo(()=>{if(!e){const s=Eee(t);return n(s.fields),s}return e},[e,t,n]);return l3(r)?o.jsx(_ne,{fields:r.fields,onFieldsChange:n}):c3(r)?o.jsx(Nne,{fields:r.fields,onFieldsChange:n}):o.jsx("div",{className:"p-4 text-center",children:o.jsx("p",{children:"Unsupported schema type"})})}function Dne(){const{dataMart:e,updateDataMartSchema:t,actualizeDataMartSchema:n,isLoading:r,error:s}=fs(),l=e==null?void 0:e.schema,{schema:c,isDirty:d,updateSchema:h,resetSchema:m}=Tee(l),{operationStatus:g,startSaveOperation:v,startActualizeOperation:x}=jee(r,s);p.useEffect(()=>{g==="success"&&m()},[g,m]);const b=p.useCallback(T=>{h(T)},[h]);if(!e)return o.jsx("div",{children:"Error: Data mart not found"});const{id:w}=e,C=()=>{w&&c&&(v(),t(w,c))},E=()=>{w&&(x(),n(w))},R=()=>{m()};return o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(Ane,{schema:c,storageType:e.storage.type,onFieldsChange:b}),o.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[o.jsxs("div",{className:"flex space-x-4",children:[o.jsx(we,{variant:"default",onClick:C,disabled:!d,children:"Save"}),o.jsx(we,{type:"button",variant:"ghost",onClick:R,disabled:!d,children:"Discard"})]}),o.jsx("div",{children:o.jsx(we,{type:"button",variant:"outline",onClick:E,children:"Refresh schema"})})]})]})})}function One(){const e=fj(),{id:t,projectId:n}=e;return t?n?o.jsx("div",{className:"dm-page",children:o.jsx($4,{children:o.jsx(CW,{id:t})})}):o.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):o.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function Mne({className:e,...t}){return o.jsx("div",{"data-slot":"card",className:ie("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function kne({className:e,...t}){return o.jsx("div",{"data-slot":"card-header",className:ie("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ine({className:e,...t}){return o.jsx("div",{"data-slot":"card-title",className:ie("leading-none font-semibold",e),...t})}function Lne({className:e,...t}){return o.jsx("div",{"data-slot":"card-description",className:ie("text-muted-foreground text-sm",e),...t})}function Pne({className:e,...t}){return o.jsx("div",{"data-slot":"card-content",className:ie("px-6",e),...t})}function Une({className:e,...t}){return o.jsx("div",{"data-slot":"card-footer",className:ie("flex items-center px-6 [.border-t]:pt-6",e),...t})}const o1=p.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function Co({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=p.useContext(o1);return o.jsxs("div",{className:"flex items-center gap-2 self-center",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:o.jsx(e,{size:18})}),o.jsx(Ine,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&o.jsx(Lne,{className:ie("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsxs("div",{className:"pointer-events-none ml-2 flex items-center opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100",children:[o.jsx(Lr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),o.jsx("span",{className:"sr-only",children:t})]})}),o.jsx(Nt,{children:o.jsx("p",{children:t})})]})})]})}Co.displayName="CollapsibleCardHeaderTitle";function Wf({children:e,className:t}){const n=r=>{r.stopPropagation()};return o.jsx("div",{className:ie("flex items-center gap-2 self-center",t),onClick:n,children:e})}Wf.displayName="CollapsibleCardHeaderActions";function wo({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=p.useContext(o1);let s,l;return p.Children.forEach(e,c=>{if(p.isValidElement(c))switch(c.type){case Co:s=c;break;case Wf:l=c;break}}),o.jsxs(kne,{className:ie("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,o.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&o.jsx("div",{className:ie("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:o.jsx("div",{className:ie("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:o.jsx(Ga,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}wo.displayName="CollapsibleCardHeader";function Eo({children:e}){return o.jsx(Pne,{className:"px-4 pt-1",children:e})}Eo.displayName="CollapsibleCardContent";function Si({left:e,right:t}){return o.jsxs(Une,{className:"flex items-center gap-2 px-4 py-4",children:[o.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&o.jsx("div",{className:"flex items-center",children:t})]})}Si.displayName="CollapsibleCardFooter";const zT="collapsed-card-";function Cl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:l,name:c}){const d=c?hi.get(`${zT}${c}`,"boolean")??s:s,[h,m]=p.useState(d);p.useEffect(()=>{c&&hi.set(`${zT}${c}`,h)},[h,c]);const g=()=>{const C=!h;m(C),l==null||l(C)};let v,x,b;p.Children.forEach(e,C=>{if(p.isValidElement(C))switch(C.type){case wo:v=C;break;case Eo:x=C;break;case Si:b=C;break}});const w={default:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none",dense:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none text-sm",flat:"rounded-md p-0 gap-0 border-0 border-b-0 shadow-none"};return o.jsx(o1.Provider,{value:{isCollapsed:h,collapsible:r,handleCollapse:g},children:o.jsxs(Mne,{className:ie(w[n],t),children:[v,o.jsx("div",{className:ie("grid transition-all duration-200",h?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:o.jsxs("div",{className:"overflow-hidden",children:[x,b]})})]})})}function Fne(){const{dataMart:e,updateDataMartStorage:t}=zi();return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs(Cl,{collapsible:!0,name:"data-storage",children:[o.jsx(wo,{children:o.jsx(Co,{icon:Zm,tooltip:"Configure where your data will be stored",children:"Storage"})}),o.jsx(Eo,{children:(e==null?void 0:e.storage)&&o.jsx(QX,{dataStorage:e.storage,onDataStorageChange:t})}),o.jsx(Si,{})]}),o.jsxs(Cl,{collapsible:!0,name:"input-source",children:[o.jsx(wo,{children:o.jsx(Co,{icon:fb,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),o.jsx(Eo,{children:e&&o.jsx(wee,{})}),o.jsx(Si,{})]}),o.jsxs(Cl,{collapsible:!0,name:"output-schema",children:[o.jsx(wo,{children:o.jsx(Co,{icon:IL,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),o.jsx(Eo,{children:e&&o.jsx(Dne,{})}),o.jsx(Si,{})]})]})}function zne({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),[d,h]=p.useState(!1),{deleteReport:m,fetchReportsByDataMartId:g,runReport:v}=Hl(),x=`actions-menu-${e.original.id}`,b=p.useCallback(async()=>{try{await m(e.original.id),await g(e.original.dataMart.id),t==null||t(),h(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,g,t,e.original.id,e.original.dataMart.id]),w=p.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),C=p.useCallback(async()=>{try{s(!0),await v(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[v,e.original.id]),E=p.useCallback(()=>{h(!0),c(!1)},[]);return o.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[o.jsxs(Ar,{open:l,onOpenChange:c,children:[o.jsx(Dr,{asChild:!0,children:o.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":l,"aria-controls":x,children:[o.jsx("span",{className:"sr-only",children:"Open menu"}),o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),o.jsxs(Or,{id:x,align:"end",role:"menu",children:[o.jsxs(Tt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:[o.jsx(bf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),gg(e.original.destinationConfig)&&o.jsxs(o.Fragment,{children:[o.jsx($a,{}),o.jsxs(Tt,{onClick:R=>{R.stopPropagation(),C()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[o.jsx(hb,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),o.jsx(Tt,{asChild:!0,children:o.jsxs("a",{href:Jb(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[o.jsx(WL,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),o.jsx($a,{}),o.jsxs(Tt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[o.jsx(Do,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),o.jsx(ya,{open:d,onOpenChange:h,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{b()},variant:"destructive"})]})}const Vne={[an.SUCCESS]:{icon:Pp,color:"text-green-500",label:"Success"},[an.ERROR]:{icon:Xd,color:"text-red-500",label:"Fail"},[an.RUNNING]:{icon:mu,color:"text-primary animate-spin",label:"In progress"},[an.CANCELLED]:{icon:Xd,color:"text-gray-500",label:"Cancelled"}};function Hne({status:e,error:t}){if(!e)return null;const n=Vne[e],{icon:r,color:s,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===an.ERROR&&t?`${l}: ${t}`:l;return o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(r,{className:ie("h-5 w-5",s),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),o.jsxs(Nt,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs",children:l}),e===an.ERROR&&t&&o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function Bx({column:e,children:t,label:n}){const r=e.getIsSorted(),s=p.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),l=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",d=n??(typeof t=="string"?t:"Column");return o.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&o.jsx(Ls,{className:"text-foreground h-4 w-4"}),r==="desc"&&o.jsx(Ga,{className:"text-foreground h-4 w-4"}),!r&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Ls,{className:"text-muted-foreground h-4 w-4"})})]})]})}var yi=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(yi||{});const eM={[yi.TITLE]:"Title",[yi.LAST_RUN_DATE]:"Last Run Date",[yi.LAST_RUN_STATUS]:"Last Run Status"};function $ne({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Or,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=eM[t.id]||t.id;return o.jsx(Tt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const VT=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},Bne=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:yi.TITLE,header:({column:n})=>o.jsx(Bx,{column:n,children:eM[yi.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:yi.LAST_RUN_DATE,header:({column:n})=>o.jsx(Bx,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(Dl,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:yi.LAST_RUN_STATUS,header:({column:n})=>o.jsx(Bx,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?o.jsx(Hne,{status:n.original.lastRunStatus,error:n.original.lastRunError}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>o.jsx($ne,{table:n}),cell:({row:n})=>o.jsx(zne,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Gne({destination:e,onEditReport:t}){const{dataMart:n}=fs(),{fetchReportsByDataMartId:r,reports:s,stopAllPolling:l,setPollingConfig:c}=Hl(),d=p.useMemo(()=>s.filter(C=>C.dataDestination.type===It.GOOGLE_SHEETS&&C.dataDestination.id===e.id),[s,e.id]);p.useEffect(()=>{c({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[c]),p.useEffect(()=>{(async()=>{try{if(!n)return;await r(n.id)}catch(E){console.error(E)}})()},[r,n]),p.useEffect(()=>()=>{l()},[n==null?void 0:n.id,l]);const h=p.useMemo(()=>Bne({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:m,setSorting:g,columnVisibility:v,setColumnVisibility:x}=Vf({columns:h,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),b=Eu({data:d,columns:h,getCoreRowModel:wu(),onSortingChange:g,getSortedRowModel:zf(),state:{sorting:m,columnVisibility:v},onColumnVisibilityChange:x}),w=`google-sheets-reports-table-${e.id}`;return o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ru,{id:w,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[o.jsx(Tu,{className:"dm-card-table-header",children:b.getHeaderGroups().map(C=>o.jsx(tr,{className:"dm-card-table-header-row",children:C.headers.map(E=>o.jsx(_u,{className:VT(E.column.columnDef._align),style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},scope:"col",children:E.isPlaceholder?null:typeof E.column.columnDef.header=="function"?E.column.columnDef.header(E.getContext()):E.column.columnDef.header},E.id))},C.id))}),o.jsx(ju,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((C,E)=>o.jsx(tr,{onClick:()=>{const R=s.find(T=>T.id===C.original.id);R&&t(R)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":E+1,children:C.getVisibleCells().map((R,T)=>o.jsx(va,{className:`px-6 whitespace-normal ${VT(R.column.columnDef._align)}`,style:R.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(R.column.getSize())}%`},role:"cell","aria-colindex":T+1,children:typeof R.column.columnDef.cell=="function"?R.column.columnDef.cell(R.getContext()):R.column.columnDef.cell},R.id))},C.id)):o.jsx(tr,{children:o.jsx(va,{colSpan:h.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function qne({children:e,className:t,...n}){return o.jsx("div",{className:ie("group flex items-start justify-center gap-3 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",t),...n,children:e})}function Kne({children:e,className:t,...n}){return o.jsx("div",{className:ie("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Zne({children:e,className:t,...n}){return o.jsx("div",{className:ie("text-md font-medium",t),...n,children:e})}function Yne({children:e,className:t,...n}){return o.jsx("div",{className:ie("text-muted-foreground text-sm",t),...n,children:e})}function Wne({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:l,tooltipTextSwitchDisabled:c}){const d=t?c??"Disabled":e?s:l;return o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:h=>h.stopPropagation(),children:n?o.jsx(mu,{className:"text-muted-foreground h-5 w-5 animate-spin"}):o.jsx(XO,{checked:e,disabled:t,onCheckedChange:r})})}),o.jsx(Nt,{children:d})]})}function Qne({icon:e,className:t,...n}){return o.jsx("div",{className:ie("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:e??o.jsx(hs,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Xne(e){const{dataMart:t}=fs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:l}=Hl(),[c,d]=p.useState(!1),h=p.useMemo(()=>n.find(b=>b.dataDestination.type===It.LOOKER_STUDIO&&b.dataDestination.id===e.id),[n,e.id]),m=p.useMemo(()=>(t==null?void 0:t.status.code)===or.PUBLISHED,[t==null?void 0:t.status.code]),g=p.useMemo(()=>!!h,[h]),v=p.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),x=p.useCallback(async b=>{if(!(!t||!m)){d(!0);try{if(b){const w={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:pa.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(w),await l(t.id)}else h&&(await s(h.id),await l(t.id))}catch(w){console.error("Failed to toggle Looker Studio report:",w)}finally{d(!1)}}},[t,m,e,h,r,s,l]);return{existingReport:h,isLoading:c,isEnabled:m,isChecked:g,dynamicTitle:v,handleSwitchChange:x}}function Jne({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:l,isChecked:c,dynamicTitle:d,handleSwitchChange:h}=Xne(e),m=p.useCallback(()=>{r&&t(r)},[r,t]);return o.jsxs(qne,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[o.jsx(Wne,{checked:c,disabled:!l,loading:s,onCheckedChange:g=>void h(g),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),o.jsxs(Kne,{children:[o.jsx(Zne,{children:d}),o.jsx(Yne,{children:c&&r?o.jsx(o.Fragment,{children:r.lastRunDate?o.jsxs(o.Fragment,{children:["Last fetched"," ",r.lastRunStatus===an.SUCCESS&&"successfully ",o.jsx(Dl,{date:new Date(r.lastRunDate)}),r.lastRunStatus===an.ERROR&&" but failed with error",r.lastRunError&&o.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&o.jsx(Qne,{})]})}function ere(){const{scope:e}=Oo();return o.jsx("div",{className:"dm-card",children:o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(ub,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),o.jsx(we,{variant:"outline",asChild:!0,children:o.jsxs(Ha,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",o.jsx(hs,{className:"h-4 w-4"})]})})]})})}function tre(){const[e,t]=p.useState(!1),[n,r]=p.useState(Vn.CREATE),[s,l]=p.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Vn.CREATE),l(null),t(!0)},handleEditReport:m=>{r(Vn.EDIT),l(m),t(!0)},handleCloseModal:()=>{t(!1),l(null)}}}function nre({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=kq(e),{isOpen:s,mode:l,editingReport:c,handleAddReport:d,handleEditReport:h,handleCloseModal:m}=tre();return r?o.jsxs(o.Fragment,{children:[o.jsxs(Cl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[o.jsxs(wo,{children:[o.jsx(Co,{icon:n.icon,children:e.title}),o.jsx(Wf,{children:e.type===It.GOOGLE_SHEETS&&o.jsx(rre,{dataMartStatus:t,onAddReport:d})})]}),o.jsx(Eo,{children:o.jsx(yre,{destination:e,onEditReport:h})}),o.jsx(Si,{})]}),o.jsx(vre,{destination:e,isOpen:s,onClose:m,mode:l,initialReport:c})]}):null}function rre({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===or.DRAFT;return o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("span",{children:o.jsxs(we,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[o.jsx(Jr,{className:"h-4 w-4"}),"Add Report"]})})}),n&&o.jsx(Nt,{children:o.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function are({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){p.useEffect(()=>{{const s=setTimeout(()=>{const l=document.getElementById(e);if(l){const c=l;c.focus(),r&&c.value?c.select():c.value&&c.setSelectionRange(c.value.length,c.value.length)}},n);return()=>{clearTimeout(s)}}},[t,e,n,r])}const sre=en({title:tn().min(1,"Title is required"),documentUrl:tn().refine(r4,"Enter a valid Google Sheets URL"),dataDestinationId:tn().min(1,"Destination is required")});function ore({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[l,c]=p.useState(null),[d,h]=p.useState(!1),{updateReport:m,createReport:g,error:v,clearError:x}=Hl();p.useEffect(()=>{d&&v&&(c(v),h(!1))},[v,d]);const b=Vi({resolver:Kl(sre),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&gg(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??""},mode:"onTouched"}),{register:w,handleSubmit:C,formState:E,reset:R}=b,{errors:T,isDirty:j}=E,O=p.useCallback(async D=>{try{c(null),x(),h(!0);const{spreadsheetId:N,sheetId:A}=tq(D.documentUrl);if(!N){c("Invalid Google Sheets URL");return}let k;if(t===Vn.CREATE)k=await g({title:D.title,dataMartId:n,dataDestinationId:D.dataDestinationId,destinationConfig:{type:pa.GOOGLE_SHEETS_CONFIG,spreadsheetId:N,sheetId:A}});else{if(!e){c("Initial report is required for edit mode");return}k=await m(e.id,{title:D.title,dataDestinationId:D.dataDestinationId,destinationConfig:{type:pa.GOOGLE_SHEETS_CONFIG,spreadsheetId:N,sheetId:A}})}if(!k||v){c(v??"An error occurred while submitting the form");return}r==null||r()}catch(N){console.error("Error submitting form:",N),c("An error occurred while submitting the form")}},[t,e,n,g,m,r,x,v]);return{form:b,register:w,handleSubmit:C,errors:T,isDirty:j,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:O}}function ire(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"service-account-details",children:[o.jsx(Gn,{children:"How do I get a correct document link?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open your Google Sheets document and select the specific ",o.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),o.jsxs("li",{children:["Share the document with the service account email and grant it ",o.jsx("strong",{children:"Editor"})," ","access."]}),o.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",o.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),o.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function Gx(e){return"serviceAccount"in e}function lre({value:e,children:t}){const[n,r]=p.useState(!1),s=async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3))};return o.jsx(Ds,{children:o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>l.key==="Enter"&&s(),className:ie("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[o.jsx("span",{className:"truncate",children:t||e||"No data"}),n?o.jsx(ir,{className:"h-4 w-4 text-green-500"}):o.jsx(Jd,{className:"h-4 w-4"})]})}),o.jsx(Nt,{children:o.jsx("p",{children:n?"Copied!":"Click to copy"})})]})})}const cre=p.forwardRef(({initialReport:e,mode:t=Vn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const h="google-sheets-edit-form",m="google-sheets-title-input",g="google-sheets-document-url-input",v="google-sheets-data-destination-select",{dataMart:x}=fs(),{scope:b}=Oo(),{dataDestinations:w,fetchDataDestinations:C,loading:E}=pg(),[R,T]=p.useState([]);p.useEffect(()=>{x&&C()},[x,C]),p.useEffect(()=>{if(w.length>0){const H=w.filter(W=>W.type===It.GOOGLE_SHEETS);T(H)}},[w]),are({elementId:m,isOpen:!0,delay:150});const{isDirty:j,reset:O,form:D,isSubmitting:N,formError:A,onSubmit:k}=ore({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});p.useEffect(()=>{r&&r(A)},[A,r]),p.useEffect(()=>{if(t===Vn.EDIT&&e&&gg(e.destinationConfig))O({title:e.title,documentUrl:Jb(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Vn.CREATE){const H=(c==null?void 0:c.id)??"";O({title:"",documentUrl:"",dataDestinationId:H})}},[e,t,O,c]),p.useEffect(()=>{n==null||n(j)},[j,n]);const V=D.watch("documentUrl"),q=V&&r4(V.trim());return o.jsx(Bl,{...D,children:o.jsxs(Hi,{id:h,ref:d,noValidate:!0,onSubmit:H=>void D.handleSubmit(k)(H),children:[o.jsxs(Gl,{children:[o.jsxs(Fs,{title:"General",children:[o.jsx(Zt,{control:D.control,name:"title",render:({field:H})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),o.jsx(Qt,{children:o.jsx(Bt,{id:m,placeholder:"Enter a report title",...H})}),o.jsx(nn,{})]})}),o.jsx(Zt,{control:D.control,name:"dataDestinationId",render:({field:H})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Select one of your existing destinations",children:"Destination"}),o.jsxs(ba,{onValueChange:H.onChange,value:H.value,disabled:E||R.length===0,children:[o.jsx(Qt,{children:o.jsx(Ca,{id:v,className:"w-full max-w-full overflow-hidden",children:o.jsx(Sa,{className:"truncate",placeholder:"Select a destination",children:H.value&&R.length>0&&(()=>{const W=R.find(re=>re.id===H.value);if(W){const G=cf.getInfo(W.type).icon;return o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(G,{className:"flex-shrink-0",size:18}),o.jsx("div",{className:"flex min-w-0 flex-col",children:o.jsx("span",{className:"truncate",children:W.title})})]})}return null})()})})}),o.jsx(wa,{children:R.map(W=>{const G=cf.getInfo(W.type).icon;return o.jsx(Hn,{value:W.id,children:o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(G,{className:"flex-shrink-0",size:18}),o.jsxs("div",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate",children:W.title}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(Gx(W.credentials)&&Sx(W.credentials.serviceAccount))??"No email found"})]})]})},W.id)})})]}),R.length===0&&!E&&o.jsxs(qS,{className:"mt-2",children:[o.jsx(xf,{className:"h-4 w-4"}),o.jsx(HO,{children:"No destinations available"}),o.jsxs(KS,{children:["You need to create a Destination before you can create a report."," ",o.jsx(Ha,{to:b("/data-destinations"),className:"font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:"Go to Destinations"})]})]}),H.value&&R.length>0&&(()=>{const W=R.find(re=>re.id===H.value);return W?o.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[o.jsx(Wt,{children:"Service Account Email"}),o.jsx(lre,{value:Gx(W.credentials)?Sx(W.credentials.serviceAccount)??"No email found":"",children:Gx(W.credentials)?Sx(W.credentials.serviceAccount):"No email found"})]}):null})(),o.jsx(nn,{})]})}),o.jsx(Zt,{control:D.control,name:"documentUrl",render:({field:H})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),o.jsx(Qt,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bt,{id:g,placeholder:"Document URL",className:"flex-1",...H}),o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${q?"text-blue-600 hover:bg-blue-50 hover:text-blue-700 dark:text-blue-400 dark:hover:bg-blue-950/20 dark:hover:text-blue-300":"text-muted-foreground/30 cursor-not-allowed"}`,onClick:()=>{q&&window.open(V.trim(),"_blank","noopener,noreferrer")},disabled:!q,"aria-label":q?"Open document in new tab":"Document link is not valid",children:o.jsx(wl,{className:"h-4 w-4","aria-hidden":"true"})})}),o.jsx(Nt,{side:"top",align:"center",role:"tooltip",children:q?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),o.jsx(er,{children:o.jsx(ire,{})}),o.jsx(nn,{})]})})]}),o.jsx(Fs,{title:"Automate Report Runs",children:o.jsx(r3,{})})]}),o.jsxs(ql,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===Vn.CREATE?"Create new report":"Save changes to report",disabled:!j||N,children:N?t===Vn.CREATE?"Creating...":"Saving...":t===Vn.CREATE?"Create new report":"Save changes to report"}),l&&o.jsx(we,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function ure({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=p.useCallback(()=>{h(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Oi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(Mi,{children:[o.jsxs(ki,{children:[o.jsx(Ii,{children:r===Vn.CREATE?"Create new report":"Edit report"}),o.jsx(Fl,{children:r===Vn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),o.jsx(mg,{children:o.jsx(cre,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(ya,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const dre=en({cacheLifetime:x$().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function fre({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,l]=p.useState(null),{createReport:c,updateReport:d}=Hl(),h=Vi({resolver:Kl(dre),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&p4(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:h,onSubmit:async g=>{try{l(null);const{cacheLifetime:v}=g,x={type:pa.LOOKER_STUDIO_CONFIG,cacheLifetime:v};e?await d(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:x}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:x}),n==null||n()}catch(v){console.error("Error submitting form:",v),l("Failed to save report. Please try again.")}},formError:s,isSubmitting:h.formState.isSubmitting,isDirty:h.formState.isDirty,reset:h.reset}}function hre(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"cache-lifetime-details",children:[o.jsx(Gn,{children:"What is the Cache Lifetime for Looker Studio?"}),o.jsx(qn,{children:o.jsx("p",{className:"mb-2",children:"Cache Lifetime - defines the period during which results from previous query executions are served from storage-side cache, eliminating the need to re-execute the query"})})]})})}const mre=[{value:300,label:"5 minutes"},{value:600,label:"10 minutes"},{value:900,label:"15 minutes"},{value:1800,label:"30 minutes"},{value:3600,label:"1 hour"},{value:7200,label:"2 hours"},{value:14400,label:"4 hours"},{value:28800,label:"8 hours"},{value:43200,label:"12 hours"}],pre=p.forwardRef(({initialReport:e,mode:t=Vn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const h="looker-studio-edit-form",{dataMart:m}=fs(),{isDirty:g,reset:v,form:x,isSubmitting:b,formError:w,onSubmit:C}=fre({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return p.useEffect(()=>{r&&r(w)},[w,r]),p.useEffect(()=>{t===Vn.EDIT&&e&&p4(e.destinationConfig)?v({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Vn.CREATE&&v({cacheLifetime:300})},[e,t,v]),p.useEffect(()=>{n==null||n(g)},[g,n]),o.jsx(Bl,{...x,children:o.jsxs(Hi,{id:h,ref:d,noValidate:!0,onSubmit:E=>void x.handleSubmit(C)(E),children:[o.jsx(Gl,{children:o.jsx(Fs,{title:"Cache Configuration",children:o.jsx(Zt,{control:x.control,name:"cacheLifetime",render:({field:E})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),o.jsxs(ba,{onValueChange:R=>{E.onChange(parseInt(R,10))},value:E.value.toString(),defaultValue:"300",children:[o.jsx(Qt,{children:o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{placeholder:"Select cache time"})})}),o.jsx(wa,{children:mre.map(R=>o.jsx(Hn,{value:R.value.toString(),children:R.label},R.value))})]}),o.jsx(nn,{}),o.jsx(er,{children:o.jsx(hre,{})})]})})})}),o.jsxs(ql,{children:[o.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===Vn.CREATE?"Create":"Save changes",disabled:!g||b,children:b?t===Vn.CREATE?"Creating...":"Saving...":t===Vn.CREATE?"Create":"Save changes"}),l&&o.jsx(we,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function gre({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=p.useCallback(()=>{h(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Oi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(Mi,{children:[o.jsxs(ki,{children:[o.jsx(Ii,{children:(s==null?void 0:s.title)??"Looker Studio"}),o.jsx(Fl,{children:r===Vn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),o.jsx(mg,{children:o.jsx(pre,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(ya,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function vre({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case It.GOOGLE_SHEETS:return o.jsx(ure,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case It.LOOKER_STUDIO:return o.jsx(gre,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function yre({destination:e,onEditReport:t}){const r={[It.GOOGLE_SHEETS]:Gne,[It.LOOKER_STUDIO]:Jne}[e.type];return r?o.jsx(r,{destination:e,onEditReport:t}):null}function tM(){return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>o.jsx("div",{className:"border-border rounded-lg border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ts,{className:"h-4 w-4 rounded-full"}),o.jsx(ts,{className:"h-4 w-40"}),o.jsx(ts,{className:"h-3 w-32"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ts,{className:"h-6 w-16 rounded-full"}),o.jsx(ts,{className:"h-4 w-4"})]})]})},t))})})}function xre(){const{dataMart:e}=fs(),{dataDestinations:t,isLoading:n}=Iq();return e?o.jsx("div",{className:"flex flex-col gap-4",children:n?o.jsx(tM,{}):t.length===0?o.jsx(ere,{}):t.map(r=>o.jsx(nre,{destination:r,dataMartStatus:e.status},r.id))}):null}function bre(){return o.jsx(mg,{children:o.jsx(s4,{children:o.jsx(xre,{})})})}function HT(){return o.jsxs(Cl,{children:[o.jsx(wo,{children:o.jsx(Co,{icon:dL,tooltip:"Description of the Data Mart",children:"Description"})}),o.jsx(Eo,{children:o.jsx(EW,{})}),o.jsx(Si,{})]})}function Sre(){const{dataMart:e}=zi(),[t,n]=p.useState(!1),r=p.useCallback(()=>{n(!0)},[]),s=p.useCallback(()=>{n(!1)},[]);return o.jsxs(Cl,{children:[o.jsxs(wo,{children:[o.jsx(Co,{icon:Mj,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),o.jsx(Wf,{children:o.jsxs(we,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[o.jsx(Jr,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),o.jsx(Eo,{children:o.jsx(du,{children:o.jsx(SJ,{children:e&&o.jsxs(o.Fragment,{children:[o.jsx(cee,{dataMartId:e.id}),o.jsx(YS,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),o.jsx(Si,{})]})}function Cre(){const{navigate:e}=Oo(),t=n=>{e(`/data-marts/${n.id}/data-setup`)};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsx("div",{className:"mx-auto my-auto w-lg",children:o.jsxs("div",{className:"bg-muted/50 dark:bg-sidebar rounded-xl border-b border-gray-200 p-12 pt-8 dark:border-gray-700/50",children:[o.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),o.jsx(DS,{children:o.jsx($4,{children:o.jsx(yW,{initialData:{title:"New Data Mart"},onSuccess:t})})})]})})})}function nM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:l,clearCurrentDataStorage:c}=Eg();p.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return o.jsx(gS,{open:e,onOpenChange:h=>{h||d()},children:o.jsxs(vS,{children:[o.jsxs(yS,{children:[o.jsx(xS,{children:"Storage Details"}),o.jsx(bS,{children:"View detailed information about this storage."})]}),o.jsx("div",{className:"py-4",children:o.jsx(yG,{dataStorage:s,isLoading:l})})]})})}function qx({column:e,children:t}){return o.jsxs(we,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Ls,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Ga,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Ls,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const wre=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,l]=p.useState(!1);return o.jsx("div",{className:"text-right",children:o.jsxs(Ar,{open:s,onOpenChange:l,children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${s?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Or,{align:"end",children:[o.jsxs(Tt,{onClick:()=>t==null?void 0:t(e),children:[o.jsx(Tj,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"View details"})]}),o.jsxs(Tt,{onClick:()=>void(n==null?void 0:n(e)),children:[o.jsx(bf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),o.jsx($a,{}),o.jsxs(Tt,{onClick:()=>r==null?void 0:r(e),children:[o.jsx(Do,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})};function Ere({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Or,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Tt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const Rre=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(qx,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(qx,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Fi.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(qx,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(Ere,{table:r}),cell:({row:r})=>o.jsx(wre,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Tre({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(UL,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),o.jsxs(we,{variant:"outline",onClick:e,children:[o.jsx(Jr,{className:"h-4 w-4"}),"New Storage"]})]})}function jre({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Vf({columns:e,storageKeyPrefix:"data-storage-list"}),[h,m]=p.useState([]),[g,v]=p.useState({}),[x,b]=p.useState(!1),[w]=p.useState(null),C=Eu({data:t,columns:[...e],getCoreRowModel:wu(),getPaginationRowModel:yg(),onSortingChange:l,getSortedRowModel:zf(),onColumnFiltersChange:m,getFilteredRowModel:Ff(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:h,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),E=(T,j)=>{j.target instanceof HTMLElement&&(j.target.closest('[role="checkbox"]')||j.target.closest(".actions-cell")||j.target.closest('[role="menuitem"]'))||n==null||n(T)};return t.length?o.jsxs("div",{children:[w&&o.jsx(nM,{isOpen:x,onClose:()=>{b(!1)},id:w.id}),o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Ll,{className:"dm-card-toolbar-search-icon"}),o.jsx(Bt,{placeholder:"Search by title",value:(R=C.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:T=>{var j;return(j=C.getColumn("title"))==null?void 0:j.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(Jr,{className:"h-4 w-4"}),"New Storage"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ru,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[o.jsx(Tu,{className:"dm-card-table-header",children:C.getHeaderGroups().map(T=>o.jsx(tr,{className:"dm-card-table-header-row",children:T.headers.map(j=>o.jsx(_u,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:uu(j.column.columnDef.header,j.getContext())},j.id))},T.id))}),o.jsx(ju,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(T=>o.jsx(tr,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:j=>{const O=T.original.id;E(O,j)},children:T.getVisibleCells().map(j=>o.jsx(va,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${j.column.id==="actions"?"actions-cell":""} ${j.column.id==="createdAt"?"whitespace-nowrap":""}`,style:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.column.getSize())}%`},children:uu(j.column.columnDef.cell,j.getContext())},j.id))},T.id)):o.jsx(tr,{children:o.jsx(va,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):o.jsx("div",{className:"dm-card",children:o.jsx(Tre,{onOpenTypeDialog:r})})}const _re=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=p.useState(e),{dataStorages:s,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:h,deleteDataStorage:m,createDataStorage:g}=Eg();p.useEffect(()=>{d()},[d]),p.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,j]=p.useState(!1),[O,D]=p.useState(null),N=async I=>{try{const Y=await g(I);v(),Y!=null&&Y.id&&(await h(Y.id),b(!0))}catch(Y){console.error("Failed to create storage:",Y)}},A=I=>{D(I),j(!0)},k=()=>{j(!1),D(null)},V=async I=>{await h(I),b(!0)},q=I=>{R(I),C(!0)},H=async()=>{if(E)try{await m(E),await d()}catch(I){console.error("Failed to delete storage:",I)}finally{C(!1),R(null)}},W=async()=>{try{b(!1),await d()}catch(I){console.error("Failed to save storage:",I)}},re=()=>{b(!1),c()},G=s.map(I=>({id:I.id,title:I.title,type:I.type,createdAt:I.createdAt,modifiedAt:I.modifiedAt})),Q=Rre({onViewDetails:A,onEdit:V,onDelete:q});return o.jsxs("div",{children:[o.jsx(jre,{columns:Q,data:G,onEdit:V,onOpenTypeDialog:()=>{r(!0)}}),o.jsx(nM,{isOpen:T,onClose:k,id:O??""}),o.jsx(VD,{isOpen:n,onClose:v,onSelect:N}),o.jsx(zO,{isOpen:x,onClose:re,dataStorage:l,onSaveSuccess:()=>void W()}),o.jsx(ya,{open:w,onOpenChange:C,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{H()},onCancel:()=>{R(null)},variant:"destructive"})]})},Nre=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(DS,{children:o.jsx(_re,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Are({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(ub,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),o.jsxs(we,{variant:"outline",onClick:e,children:[o.jsx(Jr,{className:"h-4 w-4"}),"New Destination"]})]})}function Dre({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var w;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Vf({columns:e,storageKeyPrefix:"data-destination-list"}),[h,m]=p.useState([]),[g,v]=p.useState({}),x=Eu({data:t,columns:[...e],getCoreRowModel:wu(),getPaginationRowModel:yg(),onSortingChange:l,getSortedRowModel:zf(),onColumnFiltersChange:m,getFilteredRowModel:Ff(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:h,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(C,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.target.closest('[role="menuitem"]'))||n==null||n(C)};return t.length?o.jsx("div",{children:o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Ll,{className:"dm-card-toolbar-search-icon"}),o.jsx(Bt,{placeholder:"Search by title",value:(w=x.getColumn("title"))==null?void 0:w.getFilterValue(),onChange:C=>{var E;return(E=x.getColumn("title"))==null?void 0:E.setFilterValue(C.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(Jr,{className:"h-4 w-4"}),"New Destination"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ru,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[o.jsx(Tu,{className:"dm-card-table-header",children:x.getHeaderGroups().map(C=>o.jsx(tr,{className:"dm-card-table-header-row",children:C.headers.map(E=>o.jsx(_u,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.getSize())}%`},children:E.isPlaceholder?null:uu(E.column.columnDef.header,E.getContext())},E.id))},C.id))}),o.jsx(ju,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(C=>o.jsx(tr,{"data-state":C.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=C.original.id;b(R,E)},children:C.getVisibleCells().map(E=>o.jsx(va,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${E.column.id==="actions"?"actions-cell":""} ${E.column.id==="createdAt"?"whitespace-nowrap":""}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},children:uu(E.column.columnDef.cell,E.getContext())},E.id))},C.id)):o.jsx(tr,{children:o.jsx(va,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),o.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):o.jsx("div",{className:"dm-card",children:o.jsx(Are,{onOpenTypeDialog:r})})}function Kx({column:e,children:t}){return o.jsxs(we,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Ls,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Ga,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Ls,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function i1(e){return"destinationSecretKey"in e}const Ore=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:l})=>{const[c,d]=p.useState(!1),h=()=>{if(n&&i1(n)){const v=dS(n);navigator.clipboard.writeText(v),fn.success("JSON Config copied to clipboard")}},m=t===It.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-right",children:o.jsxs(Ar,{open:c,onOpenChange:d,children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Or,{align:"end",children:[o.jsxs(Tt,{onClick:()=>void(r==null?void 0:r(e)),children:[o.jsx(bf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),m&&g&&o.jsxs(o.Fragment,{children:[o.jsx($a,{}),o.jsxs(Tt,{onClick:h,children:[o.jsx(Jd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Copy JSON Config"})]}),o.jsxs(Tt,{onClick:()=>{l==null||l(e)},children:[o.jsx(Xx,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Rotate Secret Key"})]})]}),o.jsx($a,{}),o.jsxs(Tt,{onClick:()=>s==null?void 0:s(e),children:[o.jsx(Do,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})};function Mre({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Ar,{children:[o.jsx(Dr,{asChild:!0,children:o.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(qa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Or,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(Tt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(ir,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const kre=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(Kx,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(Kx,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=cf.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(Kx,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(Mre,{table:r}),cell:({row:r})=>o.jsx(Ore,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function Ire(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"service-account-details",children:[o.jsx(Gn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(lr,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Lre({form:e}){const[t,n]=p.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?UO(l):null;return o.jsx(Zt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Yt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Wt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&o.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(Qt,{children:!t&&c?o.jsxs(jt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(lr,{href:c.url,children:c.email})}),o.jsx(Nt,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(Ti,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(er,{children:o.jsx(Ire,{})}),o.jsx(nn,{})]})})}function Pre(){return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Bn,{value:"json-config-details",children:[o.jsx(Gn,{children:"What is the JSON Config for Looker Studio?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),o.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[o.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),o.jsx("li",{children:"If you need to rotate a previous secret key, you can use the corresponding function in the menu on the destinations list."})]})]})]})})}function Ure({form:e}){const t=e.getValues("credentials"),n=p.useMemo(()=>t&&i1(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=p.useMemo(()=>dS(n),[n]);return o.jsx(o.Fragment,{children:n.destinationSecretKey&&o.jsx(Zt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>o.jsxs(Yt,{children:[o.jsx(Wt,{children:"JSON Config"}),o.jsx(Qt,{children:o.jsx(KH,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),o.jsx(nn,{}),o.jsx(er,{children:o.jsx(Pre,{})})]})})})}const Fre=()=>o.jsxs(Bn,{value:"sheets-api-details",children:[o.jsx(Gn,{children:"How do I enable the Google Sheets API?"}),o.jsxs(qn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",o.jsx(lr,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]}),zre=()=>o.jsxs(Bn,{value:"looker-studio-details",children:[o.jsx(Gn,{children:"How do I connect to Looker Studio?"}),o.jsxs(qn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",o.jsx(lr,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),o.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),o.jsx(lr,{className:"p-0",href:"https://docs.owox.com/docs/destinations/supported-destinations/looker-studio/?utm_source=owox_data_marts&utm_medium=destination_enity&utm_campaign=tooltip",children:"Learn more"})]})]}),Vre=()=>o.jsxs(Bn,{value:"odata-details",children:[o.jsx(Gn,{children:"How do I use OData?"}),o.jsxs(qn,{children:[o.jsx("p",{className:"mb-2",children:"OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs."}),o.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]}),Hre={[It.GOOGLE_SHEETS]:Fre,[It.LOOKER_STUDIO]:zre,[It.ODATA]:Vre};function $re({destinationType:e}){const t=Hre[e];return o.jsx(cr,{variant:"common",type:"single",collapsible:!0,children:o.jsx(t,{})})}function Bre({form:e,initialData:t}){return o.jsx(Zt,{control:e.control,name:"type",render:({field:n})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),o.jsxs(ba,{onValueChange:n.onChange,defaultValue:n.value,disabled:!!t,children:[o.jsx(Qt,{children:o.jsx(Ca,{className:"w-full",children:o.jsx(Sa,{placeholder:"Select a destination type"})})}),o.jsx(wa,{children:o.jsx(wg,{children:cf.getAllTypes().map(({type:r,displayName:s,icon:l,status:c})=>{const d=c===Qc.COMING_SOON;return o.jsx(Hn,{value:r,disabled:d,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(l,{size:18}),s,d&&o.jsx(Er,{variant:"secondary",children:c})]})},r)})})})]}),o.jsx(er,{children:o.jsx($re,{destinationType:n.value})}),o.jsx(nn,{})]})})}function Gre({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Vi({resolver:Kl(Aq),defaultValues:e??{title:"",type:It.GOOGLE_SHEETS},mode:"onTouched"}),l=s.watch("type");p.useEffect(()=>{r==null||r(s.formState.isDirty)},[s.formState.isDirty,r]);const c=async d=>{const{dirtyFields:h}=s.formState,m=FO(d);return h.credentials||delete m.credentials,t(m)};return o.jsx(Bl,{...s,children:o.jsxs(Hi,{onSubmit:d=>{s.handleSubmit(c)(d)},children:[o.jsxs(Gl,{children:[o.jsx(Zt,{control:s.control,name:"title",render:({field:d})=>o.jsxs(Yt,{children:[o.jsx(Wt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),o.jsx(Qt,{children:o.jsx(Bt,{placeholder:"Enter title",...d})}),o.jsx(nn,{})]})}),o.jsx(Bre,{form:s,initialData:e}),l===It.GOOGLE_SHEETS&&o.jsx(Lre,{form:s}),l===It.LOOKER_STUDIO&&o.jsx(Ure,{form:s})]}),o.jsxs(ql,{children:[o.jsxs(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!s.formState.isDirty||s.formState.isSubmitting,children:[s.formState.isSubmitting&&o.jsx(mu,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),o.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function qre({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:s,createDataDestination:l}=pg(),[c,d]=p.useState(!1),[h,m]=p.useState(!1),g=p.useCallback(()=>{h?d(!0):t()},[h,t]),v=p.useCallback(()=>{d(!1),m(!1),t()},[t]),x=p.useCallback(w=>{m(w)},[]),b=async w=>{const C=o4.getMapper(w.type);if(n){const E=C.mapToUpdateRequest(w),R=await s(n.id,E);R&&r(R)}else{const E=C.mapToCreateRequest(w),R=await l(E);R&&r(R)}t()};return o.jsxs(o.Fragment,{children:[o.jsx(Oi,{open:e,onOpenChange:w=>{w||g()},children:o.jsxs(Mi,{children:[o.jsxs(ki,{children:[o.jsx(Ii,{children:"Configure destination"}),o.jsx(Fl,{children:"Customize settings for your destination"})]}),o.jsx(Gre,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:x})]})}),o.jsx(ya,{open:c,onOpenChange:d,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}const Kre=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:h}=pg(),m=p.useCallback(()=>{s(),v(!0),t==null||t()},[s,t]),[g,v]=p.useState(!1),[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,j]=p.useState(null);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{e&&m()},[e,m]);const O=async re=>{await c(re),v(!0)},D=re=>{R(re),b(!0)},N=re=>{j(re),C(!0)},A=async()=>{if(T)try{const re=await h(T);if(i1(re.credentials)){fn.success("New JSON Config copied to clipboard");const G=dS(re.credentials);navigator.clipboard.writeText(G)}await l()}catch(re){console.error("Failed to rotate secret key:",re)}finally{C(!1),j(null)}},k=async()=>{if(E)try{await d(E),await l()}catch(re){console.error("Failed to delete destination:",re)}finally{b(!1),R(null)}},V=async()=>{try{v(!1),await l()}catch(re){console.error("Failed to save destination:",re)}},q=()=>{v(!1),s()},H=n.map(re=>({id:re.id,title:re.title,type:re.type,createdAt:re.createdAt,modifiedAt:re.modifiedAt,credentials:re.credentials})),W=kre({onEdit:O,onDelete:D,onRotateSecretKey:N});return o.jsxs("div",{children:[o.jsx(Dre,{columns:W,data:H,onEdit:O,onDelete:D,onRotateSecretKey:N,onOpenTypeDialog:m}),o.jsx(qre,{isOpen:g,onClose:q,dataDestination:r,onSaveSuccess:()=>void V()}),o.jsx(ya,{open:x,onOpenChange:b,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{k()},onCancel:()=>{R(null)},variant:"destructive"}),o.jsx(ya,{open:w,onOpenChange:C,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void A(),onCancel:()=>{C(!1)},variant:"destructive",children:o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),o.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[o.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),o.jsx("li",{children:"Go to your Looker Studio Connector"}),o.jsx("li",{children:"Update the configuration with the new JSON Config"}),o.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),o.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Zre=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(mg,{children:o.jsx(Kre,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Yre(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:l=[],isLoading:c}=fs(),[d,h]=p.useState(!1),[m,g]=p.useState(!0),[v,x]=p.useState(0),[b,w]=p.useState(null),[C,E]=p.useState(es.STRUCTURED),[R,T]=p.useState(""),j=p.useCallback(async()=>{if(!(t!=null&&t.id))return;const N=await n(t.id,20,0);x(N.length),g(N.length===20)},[t==null?void 0:t.id,n,20]),O=p.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;h(!0);const N=await r(t.id,v,20);x(A=>A+N.length),g(N.length===20),h(!1)},[t==null?void 0:t.id,r,v,d,20]);p.useEffect(()=>{t!=null&&t.id&&j()},[t==null?void 0:t.id,j]);const D=N=>{w(b===N?null:N)};return c?o.jsx(tM,{}):o.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?o.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):o.jsxs("div",{className:"space-y-2",children:[l.map(N=>o.jsx(QG,{run:N,isExpanded:b===N.id,onToggle:D,logViewType:C,setLogViewType:E,searchTerm:R,setSearchTerm:T,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id},N.id)),m&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx(Jc,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:d,className:"flex items-center gap-2",children:d?o.jsxs(o.Fragment,{children:[o.jsx(Aj,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}function Wre(){const{dataMart:e,isLoading:t,getDataMartRuns:n}=zi(),r=async()=>{e!=null&&e.id&&await n(e.id,20,0)};return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsxs(Cl,{collapsible:!1,name:"run-history",children:[o.jsxs(wo,{children:[o.jsx(Co,{icon:r8,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"}),o.jsx(Wf,{children:o.jsxs(we,{variant:"outline",size:"sm",onClick:()=>void r(),disabled:t,className:"flex cursor-pointer items-center gap-2",children:[o.jsx(Aj,{className:"h-4 w-4"}),"Refresh"]})})]}),o.jsx(Eo,{children:o.jsx(Yre,{})})]})})}const Qre=[{path:"overview",element:o.jsx(HT,{})},{path:"data-setup",element:o.jsx(Fne,{})},{path:"reports",element:o.jsx(bre,{})},{path:"triggers",element:o.jsx(Sre,{})},{path:"run-history",element:o.jsx(Wre,{})},{index:!0,element:o.jsx(HT,{})}];function Xre({to:e="/data-marts"}){const{user:t,status:n}=Pi();if(n===Tr.LOADING)return o.jsx(Wc,{fullScreen:!0,message:"Loading..."});if(n===Tr.UNAUTHENTICATED||!t)return o.jsx(Wc,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=ap(t.projectId,e);return o.jsx(o6,{to:r,replace:!0})}return o.jsx(Wc,{fullScreen:!0,message:"Project not found"})}const Jre=[{index:!0,path:"/",element:o.jsx(Xre,{})},{path:"/ui/:projectId",element:o.jsx(JB,{}),children:[{path:"about",element:o.jsx(eG,{})},{index:!0,element:o.jsx(Z2,{})},{path:"data-marts",element:o.jsx(Z2,{})},{path:"data-marts/create",element:o.jsx(Cre,{})},{path:"data-marts/:id",element:o.jsx(One,{}),children:Qre},{path:"data-storages",element:o.jsx(Nre,{})},{path:"data-destinations",element:o.jsx(Zre,{})},{path:"*",element:o.jsx($2,{})}]},{path:"*",element:o.jsx($2,{})}],rM="gtm-script",aM="gtm-noscript",eae="GOOGLE_TAG_MANAGER_CONTAINER_ID";function tae(){return!!document.getElementById(rM)}function nae(e){const t=document.createElement("script");return t.id=rM,t.innerHTML=`
|
|
719
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
720
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
721
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
722
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
723
|
-
})(window,document,'script','dataLayer','${e}');
|
|
724
|
-
`,t}function rae(e){const t=document.createElement("noscript");return t.id=aM,t.innerHTML=`
|
|
725
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
726
|
-
height="0"
|
|
727
|
-
width="0"
|
|
728
|
-
style="display:none;visibility:hidden">
|
|
729
|
-
</iframe>
|
|
730
|
-
`,t}function aae(e){if(tae())return;const t=nae(e);document.head.prepend(t)}function sae(e){if(document.getElementById(aM))return;const t=rae(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function oae(e){try{aae(e),sae(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function iae(e){return(e[eae]??"").trim()}function lae(){const{flags:e,callState:t}=zb();return p.useEffect(()=>{if(t!==jr.LOADED||!e)return;const n=iae(e);n&&oae(n)},[e,t]),null}const cae="INTERCOM_APP_ID",sM="intercom-widget-script";function uae(){return!!document.getElementById(sM)}function dae(e,t){if(uae()){t();return}const n=document.createElement("script");n.id=sM,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function fae(){try{return(await fa.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function hae(e,t){const n={app_id:e,user_id:t.id};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function mae(e,t){if(!t)return;const n=hae(e,t),r=await fae();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function pae(){const{flags:e,callState:t}=zb(),{user:n}=Pi(),r=p.useRef(!1);return p.useEffect(()=>{if(r.current||t!==jr.LOADED||!e)return;const s=e[cae],l=(typeof s=="string"?s:"").trim();l&&dae(l,()=>{mae(l,n).then(()=>{r.current=!0,K0()})})},[e,t,n]),null}function gae({initialState:e,reducer:t,children:n}){const[r,s]=p.useReducer(t,e),l=p.useMemo(()=>s,[s]);return o.jsx(qN.Provider,{value:r,children:o.jsx(KN.Provider,{value:l,children:n})})}function vae(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const l=e[s],c=t[s],d=l(c,n);d!==c&&(r[s]=d)}),r}}const $T={id:null,title:null},oM="project/SET_PROJECT",yae="project/CLEAR_PROJECT";function xae(e){return{type:oM,payload:e}}function bae(e=$T,t){switch(t.type){case oM:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case yae:return{...$T};default:return e}}class Sae extends Vl{getFlags(){return this.get("/flags")}}const Cae=new Sae(""),iM={MENU_GITHUB_COMMUNITY_VISIBLE:"true",MENU_UPGRADE_OPTIONS_VISIBLE:"true",MENU_FEEDBACK_VISIBLE:"true",MENU_ISSUES_VISIBLE:"true",MENU_LICENSE_VISIBLE:"true",MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE:"true",MENU_SLACK_COMMUNITY_VISIBLE:"true"},wae={data:{...iM},callState:jr.IDLE},lM="settings/LOAD_FLAGS",cM="settings/LOAD_FLAGS_SUCCESS",uM="settings/LOAD_FLAGS_ERROR";function Eae(){return{type:lM}}function Rae(e){return{type:cM,payload:e}}function Tae(e){return{type:uM,payload:e}}function jae(e=wae,t){switch(t.type){case lM:return{...e,callState:jr.LOADING,error:void 0};case cM:return{...e,callState:jr.LOADED,data:{...iM,...t.payload}};case uM:return{...e,callState:jr.ERROR,error:t.payload};default:return e}}async function _ae(e){try{e(Eae());const t=await Cae.getFlags();e(Rae(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Tae(n))}}const dM="app/SET_READY";function Nae(e={ready:!1},t){switch(t.type){case dM:return{...e,ready:!!t.payload};default:return e}}const Aae=vae({project:bae,flags:jae,app:Nae});function Dae({children:e}){return o.jsx(gae,{reducer:Aae,initialState:{project:{id:null,title:null},flags:{data:null,callState:jr.IDLE},app:{ready:!1}},children:e})}function Oae({children:e}){const t=$z(),{user:n,status:r}=Pi(),s=np(h=>h.flags),l=s.callState,c=np(h=>h.app.ready);p.useEffect(()=>{r===Tr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(xae({id:n.projectId,title:n.projectTitle??null})),l===jr.IDLE&&_ae(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,l,t]),p.useEffect(()=>{const h=r===Tr.AUTHENTICATED&&!!(n!=null&&n.projectId)&&l===jr.LOADED;t({type:dM,payload:h})},[r,n==null?void 0:n.projectId,l,t]);const d=p.useMemo(()=>o.jsx(Wc,{fullScreen:!0,message:"Loading application..."}),[]);return c?o.jsx(o.Fragment,{children:e}):l===jr.ERROR?o.jsx(Wc,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):d}function Mae(){const e=A6(Jre);return o.jsx(AH,{children:o.jsx(Dae,{children:o.jsxs(Oae,{children:[o.jsx(lae,{}),o.jsx(pae,{}),o.jsx(H6,{router:e})]})})})}const fM=document.getElementById("root");if(!fM)throw new Error("Root element not found");Dk.createRoot(fM).render(o.jsx(p.StrictMode,{children:o.jsx(Mae,{})}));
|