@owox/web 0.15.0-next-20251211122103 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-ByYrTnKg.js +831 -0
- package/dist/index.html +1 -1
- package/package.json +3 -12
- package/dist/assets/index-D7tQ__nj.js +0 -831
|
@@ -1,831 +0,0 @@
|
|
|
1
|
-
var d9=Object.defineProperty;var f9=(e,t,n)=>t in e?d9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qs=(e,t,n)=>f9(e,typeof t!="symbol"?t+"":t,n);function h9(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 i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{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 i of s)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function PN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u0={exports:{}},df={};/**
|
|
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 ij;function m9(){if(ij)return df;ij=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var c=null;if(i!==void 0&&(c=""+i),s.key!==void 0&&(c=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:i}}return df.Fragment=t,df.jsx=n,df.jsxs=n,df}var lj;function p9(){return lj||(lj=1,u0.exports=m9()),u0.exports}var a=p9(),d0={exports:{}},gt={};/**
|
|
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 cj;function g9(){if(cj)return gt;cj=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"),i=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function R(P,U,F){this.props=P,this.context=U,this.refs=w,this.updater=F||C}R.prototype.isReactComponent={},R.prototype.setState=function(P,U){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,U,"setState")},R.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function j(){}j.prototype=R.prototype;function _(P,U,F){this.props=P,this.context=U,this.refs=w,this.updater=F||C}var I=_.prototype=new j;I.constructor=_,S(I,R.prototype),I.isPureReactComponent=!0;var A=Array.isArray;function O(){}var T={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function L(P,U,F){var W=F.ref;return{$$typeof:e,type:P,key:U,ref:W!==void 0?W:null,props:F}}function $(P,U){return L(P.type,U,P.props)}function K(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function Z(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(F){return U[F]})}var G=/\/+/g;function q(P,U){return typeof P=="object"&&P!==null&&P.key!=null?Z(""+P.key):U.toString(36)}function z(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(O,O):(P.status="pending",P.then(function(U){P.status==="pending"&&(P.status="fulfilled",P.value=U)},function(U){P.status==="pending"&&(P.status="rejected",P.reason=U)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,U,F,W,X){var ae=typeof P;(ae==="undefined"||ae==="boolean")&&(P=null);var J=!1;if(P===null)J=!0;else switch(ae){case"bigint":case"string":case"number":J=!0;break;case"object":switch(P.$$typeof){case e:case t:J=!0;break;case y:return J=P._init,M(J(P._payload),U,F,W,X)}}if(J)return X=X(P),J=W===""?"."+q(P,0):W,A(X)?(F="",J!=null&&(F=J.replace(G,"$&/")+"/"),M(X,U,F,"",function(Se){return Se})):X!=null&&(K(X)&&(X=$(X,F+(X.key==null||P&&P.key===X.key?"":(""+X.key).replace(G,"$&/")+"/")+J)),U.push(X)),1;J=0;var ce=W===""?".":W+":";if(A(P))for(var ye=0;ye<P.length;ye++)W=P[ye],ae=ce+q(W,ye),J+=M(W,U,F,ae,X);else if(ye=v(P),typeof ye=="function")for(P=ye.call(P),ye=0;!(W=P.next()).done;)W=W.value,ae=ce+q(W,ye++),J+=M(W,U,F,ae,X);else if(ae==="object"){if(typeof P.then=="function")return M(z(P),U,F,W,X);throw U=String(P),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return J}function H(P,U,F){if(P==null)return P;var W=[],X=0;return M(P,W,"","",function(ae){return U.call(F,ae,X++)}),W}function V(P){if(P._status===-1){var U=P._result;U=U(),U.then(function(F){(P._status===0||P._status===-1)&&(P._status=1,P._result=F)},function(F){(P._status===0||P._status===-1)&&(P._status=2,P._result=F)}),P._status===-1&&(P._status=0,P._result=U)}if(P._status===1)return P._result.default;throw P._result}var se=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},ge={map:H,forEach:function(P,U,F){H(P,function(){U.apply(this,arguments)},F)},count:function(P){var U=0;return H(P,function(){U++}),U},toArray:function(P){return H(P,function(U){return U})||[]},only:function(P){if(!K(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return gt.Activity=g,gt.Children=ge,gt.Component=R,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=_,gt.StrictMode=r,gt.Suspense=f,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,gt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return T.H.useMemoCache(P)}},gt.cache=function(P){return function(){return P.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(P,U,F){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var W=S({},P.props),X=P.key;if(U!=null)for(ae in U.key!==void 0&&(X=""+U.key),U)!D.call(U,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&U.ref===void 0||(W[ae]=U[ae]);var ae=arguments.length-2;if(ae===1)W.children=F;else if(1<ae){for(var J=Array(ae),ce=0;ce<ae;ce++)J[ce]=arguments[ce+2];W.children=J}return L(P.type,X,W)},gt.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:i,_context:P},P},gt.createElement=function(P,U,F){var W,X={},ae=null;if(U!=null)for(W in U.key!==void 0&&(ae=""+U.key),U)D.call(U,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(X[W]=U[W]);var J=arguments.length-2;if(J===1)X.children=F;else if(1<J){for(var ce=Array(J),ye=0;ye<J;ye++)ce[ye]=arguments[ye+2];X.children=ce}if(P&&P.defaultProps)for(W in J=P.defaultProps,J)X[W]===void 0&&(X[W]=J[W]);return L(P,ae,X)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:u,render:P}},gt.isValidElement=K,gt.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:V}},gt.memo=function(P,U){return{$$typeof:h,type:P,compare:U===void 0?null:U}},gt.startTransition=function(P){var U=T.T,F={};T.T=F;try{var W=P(),X=T.S;X!==null&&X(F,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(O,se)}catch(ae){se(ae)}finally{U!==null&&F.types!==null&&(U.types=F.types),T.T=U}},gt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},gt.use=function(P){return T.H.use(P)},gt.useActionState=function(P,U,F){return T.H.useActionState(P,U,F)},gt.useCallback=function(P,U){return T.H.useCallback(P,U)},gt.useContext=function(P){return T.H.useContext(P)},gt.useDebugValue=function(){},gt.useDeferredValue=function(P,U){return T.H.useDeferredValue(P,U)},gt.useEffect=function(P,U){return T.H.useEffect(P,U)},gt.useEffectEvent=function(P){return T.H.useEffectEvent(P)},gt.useId=function(){return T.H.useId()},gt.useImperativeHandle=function(P,U,F){return T.H.useImperativeHandle(P,U,F)},gt.useInsertionEffect=function(P,U){return T.H.useInsertionEffect(P,U)},gt.useLayoutEffect=function(P,U){return T.H.useLayoutEffect(P,U)},gt.useMemo=function(P,U){return T.H.useMemo(P,U)},gt.useOptimistic=function(P,U){return T.H.useOptimistic(P,U)},gt.useReducer=function(P,U,F){return T.H.useReducer(P,U,F)},gt.useRef=function(P){return T.H.useRef(P)},gt.useState=function(P){return T.H.useState(P)},gt.useSyncExternalStore=function(P,U,F){return T.H.useSyncExternalStore(P,U,F)},gt.useTransition=function(){return T.H.useTransition()},gt.version="19.2.0",gt}var uj;function Pb(){return uj||(uj=1,d0.exports=g9()),d0.exports}var m=Pb();const re=PN(m),Vg=h9({__proto__:null,default:re},[m]);var f0={exports:{}},ff={},h0={exports:{}},m0={};/**
|
|
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 dj;function y9(){return dj||(dj=1,(function(e){function t(M,H){var V=M.length;M.push(H);e:for(;0<V;){var se=V-1>>>1,ge=M[se];if(0<s(ge,H))M[se]=H,M[V]=ge,V=se;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var H=M[0],V=M.pop();if(V!==H){M[0]=V;e:for(var se=0,ge=M.length,P=ge>>>1;se<P;){var U=2*(se+1)-1,F=M[U],W=U+1,X=M[W];if(0>s(F,V))W<ge&&0>s(X,F)?(M[se]=X,M[W]=V,se=W):(M[se]=F,M[U]=V,se=U);else if(W<ge&&0>s(X,V))M[se]=X,M[W]=V,se=W;else break e}}return H}function s(M,H){var V=M.sortIndex-H.sortIndex;return V!==0?V:M.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],y=1,g=null,x=3,v=!1,C=!1,S=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function I(M){for(var H=n(h);H!==null;){if(H.callback===null)r(h);else if(H.startTime<=M)r(h),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(h)}}function A(M){if(S=!1,I(M),!C)if(n(f)!==null)C=!0,O||(O=!0,Z());else{var H=n(h);H!==null&&z(A,H.startTime-M)}}var O=!1,T=-1,D=5,L=-1;function $(){return w?!0:!(e.unstable_now()-L<D)}function K(){if(w=!1,O){var M=e.unstable_now();L=M;var H=!0;try{e:{C=!1,S&&(S=!1,j(T),T=-1),v=!0;var V=x;try{t:{for(I(M),g=n(f);g!==null&&!(g.expirationTime>M&&$());){var se=g.callback;if(typeof se=="function"){g.callback=null,x=g.priorityLevel;var ge=se(g.expirationTime<=M);if(M=e.unstable_now(),typeof ge=="function"){g.callback=ge,I(M),H=!0;break t}g===n(f)&&r(f),I(M)}else r(f);g=n(f)}if(g!==null)H=!0;else{var P=n(h);P!==null&&z(A,P.startTime-M),H=!1}}break e}finally{g=null,x=V,v=!1}H=void 0}}finally{H?Z():O=!1}}}var Z;if(typeof _=="function")Z=function(){_(K)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,q=G.port2;G.port1.onmessage=K,Z=function(){q.postMessage(null)}}else Z=function(){R(K,0)};function z(M,H){T=R(function(){M(e.unstable_now())},H)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var H=3;break;default:H=x}var V=x;x=H;try{return M()}finally{x=V}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(M,H){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var V=x;x=M;try{return H()}finally{x=V}},e.unstable_scheduleCallback=function(M,H,V){var se=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?se+V:se):V=se,M){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=V+ge,M={id:y++,callback:H,priorityLevel:M,startTime:V,expirationTime:ge,sortIndex:-1},V>se?(M.sortIndex=V,t(h,M),n(f)===null&&M===n(h)&&(S?(j(T),T=-1):S=!0,z(A,V-se))):(M.sortIndex=ge,t(f,M),C||v||(C=!0,O||(O=!0,Z()))),M},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(M){var H=x;return function(){var V=x;x=H;try{return M.apply(this,arguments)}finally{x=V}}}})(m0)),m0}var fj;function x9(){return fj||(fj=1,h0.exports=y9()),h0.exports}var p0={exports:{}},Br={};/**
|
|
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 hj;function v9(){if(hj)return Br;hj=1;var e=Pb();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+h+" 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 i(f,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:f,containerInfo:h,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Br.createPortal=function(f,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return i(f,h,null,y)},Br.flushSync=function(f){var h=c.T,y=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=y,r.d.f()}},Br.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Br.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Br.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var y=h.as,g=u(y,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):y==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Br.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Br.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=u(y,h.crossOrigin);r.d.L(f,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Br.preloadModule=function(f,h){if(typeof f=="string")if(h){var y=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Br.requestFormReset=function(f){r.d.r(f)},Br.unstable_batchedUpdates=function(f,h){return f(h)},Br.useFormState=function(f,h,y){return c.H.useFormState(f,h,y)},Br.useFormStatus=function(){return c.H.useHostTransitionStatus()},Br.version="19.2.0",Br}var mj;function UN(){if(mj)return p0.exports;mj=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(),p0.exports=v9(),p0.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 pj;function b9(){if(pj)return ff;pj=1;var e=x9(),t=Pb(),n=UN();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function c(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function f(o){if(i(o)!==o)throw Error(r(188))}function h(o){var l=o.alternate;if(!l){if(l=i(o),l===null)throw Error(r(188));return l!==o?null:o}for(var d=o,p=l;;){var b=d.return;if(b===null)break;var E=b.alternate;if(E===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===E.child){for(E=b.child;E;){if(E===d)return f(b),o;if(E===p)return f(b),l;E=E.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=E;else{for(var N=!1,k=b.child;k;){if(k===d){N=!0,d=b,p=E;break}if(k===p){N=!0,p=b,d=E;break}k=k.sibling}if(!N){for(k=E.child;k;){if(k===d){N=!0,d=E,p=b;break}if(k===p){N=!0,p=E,d=b;break}k=k.sibling}if(!N)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:l}function y(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=y(o),l!==null)return l;o=o.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Z(o){return o===null||typeof o!="object"?null:(o=K&&o[K]||o["@@iterator"],typeof o=="function"?o:null)}var G=Symbol.for("react.client.reference");function q(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===G?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case R:return"Profiler";case w:return"StrictMode";case A:return"Suspense";case O:return"SuspenseList";case L:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case C:return"Portal";case _:return o.displayName||"Context";case j:return(o._context.displayName||"Context")+".Consumer";case I:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case T:return l=o.displayName||null,l!==null?l:q(o.type)||"Memo";case D:l=o._payload,o=o._init;try{return q(o(l))}catch{}}return null}var z=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},se=[],ge=-1;function P(o){return{current:o}}function U(o){0>ge||(o.current=se[ge],se[ge]=null,ge--)}function F(o,l){ge++,se[ge]=o.current,o.current=l}var W=P(null),X=P(null),ae=P(null),J=P(null);function ce(o,l){switch(F(ae,l),F(X,o),F(W,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?AR(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=AR(l),o=DR(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(W),F(W,o)}function ye(){U(W),U(X),U(ae)}function Se(o){o.memoizedState!==null&&F(J,o);var l=W.current,d=DR(l,o.type);l!==d&&(F(X,o),F(W,d))}function Me(o){X.current===o&&(U(W),U(X)),J.current===o&&(U(J),of._currentValue=V)}var ke,tt;function at(o){if(ke===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);ke=l&&l[1]||"",tt=-1<d.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ke+o+tt}var Pt=!1;function fn(o,l){if(!o||Pt)return"";Pt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(pe){var he=pe}Reflect.construct(o,[],be)}else{try{be.call()}catch(pe){he=pe}o.call(be.prototype)}}else{try{throw Error()}catch(pe){he=pe}(be=o())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(pe){if(pe&&he&&typeof pe.stack=="string")return[pe.stack,he.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=p.DetermineComponentFrameRoot(),N=E[0],k=E[1];if(N&&k){var Q=N.split(`
|
|
44
|
-
`),fe=k.split(`
|
|
45
|
-
`);for(b=p=0;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;for(;b<fe.length&&!fe[b].includes("DetermineComponentFrameRoot");)b++;if(p===Q.length||b===fe.length)for(p=Q.length-1,b=fe.length-1;1<=p&&0<=b&&Q[p]!==fe[b];)b--;for(;1<=p&&0<=b;p--,b--)if(Q[p]!==fe[b]){if(p!==1||b!==1)do if(p--,b--,0>b||Q[p]!==fe[b]){var xe=`
|
|
46
|
-
`+Q[p].replace(" at new "," at ");return o.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",o.displayName)),xe}while(1<=p&&0<=b);break}}}finally{Pt=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?at(d):""}function Dn(o,l){switch(o.tag){case 26:case 27:case 5:return at(o.type);case 16:return at("Lazy");case 13:return o.child!==l&&l!==null?at("Suspense Fallback"):at("Suspense");case 19:return at("SuspenseList");case 0:case 15:return fn(o.type,!1);case 11:return fn(o.type.render,!1);case 1:return fn(o.type,!0);case 31:return at("Activity");default:return""}}function ln(o){try{var l="",d=null;do l+=Dn(o,d),d=o,o=o.return;while(o);return l}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var Ie=Object.prototype.hasOwnProperty,B=e.unstable_scheduleCallback,ne=e.unstable_cancelCallback,ue=e.unstable_shouldYield,Ne=e.unstable_requestPaint,Ee=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,$e=e.unstable_ImmediatePriority,st=e.unstable_UserBlockingPriority,ot=e.unstable_NormalPriority,jn=e.unstable_LowPriority,mr=e.unstable_IdlePriority,On=e.log,Qr=e.unstable_setDisableYieldValue,Gn=null,Hn=null;function or(o){if(typeof On=="function"&&Qr(o),Hn&&typeof Hn.setStrictMode=="function")try{Hn.setStrictMode(Gn,o)}catch{}}var kn=Math.clz32?Math.clz32:Dr,Eo=Math.log,pa=Math.LN2;function Dr(o){return o>>>=0,o===0?32:31-(Eo(o)/pa|0)|0}var vs=256,es=262144,In=4194304;function Tn(o){var l=o&42;if(l!==0)return l;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function We(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var b=0,E=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var k=p&134217727;return k!==0?(p=k&~E,p!==0?b=Tn(p):(N&=k,N!==0?b=Tn(N):d||(d=k&~o,d!==0&&(b=Tn(d))))):(k=p&~E,k!==0?b=Tn(k):N!==0?b=Tn(N):d||(d=p&~o,d!==0&&(b=Tn(d)))),b===0?0:l!==0&&l!==b&&(l&E)===0&&(E=b&-b,d=l&-l,E>=d||E===32&&(d&4194048)!==0)?l:b}function Ft(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Ht(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 qt(){var o=In;return In<<=1,(In&62914560)===0&&(In=4194304),o}function Zn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function nn(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Xt(o,l,d,p,b,E){var N=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var k=o.entanglements,Q=o.expirationTimes,fe=o.hiddenUpdates;for(d=N&~d;0<d;){var xe=31-kn(d),be=1<<xe;k[xe]=0,Q[xe]=-1;var he=fe[xe];if(he!==null)for(fe[xe]=null,xe=0;xe<he.length;xe++){var pe=he[xe];pe!==null&&(pe.lane&=-536870913)}d&=~be}p!==0&&Y(o,p,0),E!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=E&~(N&~l))}function Y(o,l,d){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-kn(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|d&261930}function ee(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var p=31-kn(d),b=1<<p;b&l|o[p]&l&&(o[p]|=l),d&=~b}}function le(o,l){var d=l&-l;return d=(d&42)!==0?1:Ce(d),(d&(o.suspendedLanes|l))!==0?0:d}function Ce(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function je(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function He(){var o=H.p;return o!==0?o:(o=window.event,o===void 0?32:ej(o.type))}function qe(o,l){var d=H.p;try{return H.p=o,l()}finally{H.p=d}}var Fe=Math.random().toString(36).slice(2),Ue="__reactFiber$"+Fe,Ve="__reactProps$"+Fe,nt="__reactContainer$"+Fe,et="__reactEvents$"+Fe,pt="__reactListeners$"+Fe,bn="__reactHandles$"+Fe,Yn="__reactResources$"+Fe,$n="__reactMarker$"+Fe;function mn(o){delete o[Ue],delete o[Ve],delete o[et],delete o[pt],delete o[bn]}function rn(o){var l=o[Ue];if(l)return l;for(var d=o.parentNode;d;){if(l=d[nt]||d[Ue]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=UR(o);o!==null;){if(d=o[Ue])return d;o=UR(o)}return l}o=d,d=o.parentNode}return null}function ga(o){if(o=o[Ue]||o[nt]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function bs(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function Jr(o){var l=o[Yn];return l||(l=o[Yn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function pn(o){o[$n]=!0}var Mc=new Set,yi={};function ea(o,l){Ss(o,l),Ss(o+"Capture",l)}function Ss(o,l){for(yi[o]=l,o=0;o<l.length;o++)Mc.add(l[o])}var kc=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]*$"),$t={},pr={};function xi(o){return Ie.call(pr,o)?!0:Ie.call($t,o)?!1:kc.test(o)?pr[o]=!0:($t[o]=!0,!1)}function ts(o,l,d){if(xi(l))if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+d)}}function _n(o,l,d){if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+d)}}function ya(o,l,d,p){if(p===null)o.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(l,d,""+p)}}function ta(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Zh(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function a8(o,l,d){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,E=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(N){d=""+N,E.call(this,N)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(N){d=""+N},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function rx(o){if(!o._valueTracker){var l=Zh(o)?"checked":"value";o._valueTracker=a8(o,l,""+o[l])}}function wC(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return o&&(p=Zh(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function Yh(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var s8=/[\n"\\]/g;function ns(o){return o.replace(s8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ax(o,l,d,p,b,E,N,k){o.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.type=N:o.removeAttribute("type"),l!=null?N==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+ta(l)):o.value!==""+ta(l)&&(o.value=""+ta(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?sx(o,N,ta(l)):d!=null?sx(o,N,ta(d)):p!=null&&o.removeAttribute("value"),b==null&&E!=null&&(o.defaultChecked=!!E),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?o.name=""+ta(k):o.removeAttribute("name")}function EC(o,l,d,p,b,E,N,k){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),l!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||l!=null)){rx(o);return}d=d!=null?""+ta(d):"",l=l!=null?""+ta(l):d,k||l===o.value||(o.value=l),o.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=k?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),rx(o)}function sx(o,l,d){l==="number"&&Yh(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function Lc(o,l,d,p){if(o=o.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<o.length;d++)b=l.hasOwnProperty("$"+o[d].value),o[d].selected!==b&&(o[d].selected=b),b&&p&&(o[d].defaultSelected=!0)}else{for(d=""+ta(d),l=null,b=0;b<o.length;b++){if(o[b].value===d){o[b].selected=!0,p&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function RC(o,l,d){if(l!=null&&(l=""+ta(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+ta(d):""}function jC(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(z(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=ta(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),rx(o)}function Pc(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var o8=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 TC(o,l,d){var p=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,d):typeof d!="number"||d===0||o8.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function _C(o,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var b in l)p=l[b],l.hasOwnProperty(b)&&d[b]!==p&&TC(o,b,p)}else for(var E in l)l.hasOwnProperty(E)&&TC(o,E,l[E])}function ox(o){if(o.indexOf("-")===-1)return!1;switch(o){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 i8=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"]]),l8=/^[\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 Wh(o){return l8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ro(){}var ix=null;function lx(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Uc=null,zc=null;function NC(o){var l=ga(o);if(l&&(o=l.stateNode)){var d=o[Ve]||null;e:switch(o=l.stateNode,l.type){case"input":if(ax(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+ns(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var b=p[Ve]||null;if(!b)throw Error(r(90));ax(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===o.form&&wC(p)}break e;case"textarea":RC(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Lc(o,!!d.multiple,l,!1)}}}var cx=!1;function AC(o,l,d){if(cx)return o(l,d);cx=!0;try{var p=o(l);return p}finally{if(cx=!1,(Uc!==null||zc!==null)&&(Pm(),Uc&&(l=Uc,o=zc,zc=Uc=null,NC(l),o)))for(l=0;l<o.length;l++)NC(o[l])}}function wd(o,l){var d=o.stateNode;if(d===null)return null;var p=d[Ve]||null;if(p===null)return null;d=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var jo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ux=!1;if(jo)try{var Ed={};Object.defineProperty(Ed,"passive",{get:function(){ux=!0}}),window.addEventListener("test",Ed,Ed),window.removeEventListener("test",Ed,Ed)}catch{ux=!1}var vi=null,dx=null,Xh=null;function DC(){if(Xh)return Xh;var o,l=dx,d=l.length,p,b="value"in vi?vi.value:vi.textContent,E=b.length;for(o=0;o<d&&l[o]===b[o];o++);var N=d-o;for(p=1;p<=N&&l[d-p]===b[E-p];p++);return Xh=b.slice(o,1<p?1-p:void 0)}function Qh(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Jh(){return!0}function OC(){return!1}function xa(o){function l(d,p,b,E,N){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=E,this.target=N,this.currentTarget=null;for(var k in o)o.hasOwnProperty(k)&&(d=o[k],this[k]=d?d(E):E[k]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Jh:OC,this.isPropagationStopped=OC,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Jh)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Jh)},persist:function(){},isPersistent:Jh}),l}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},em=xa(Ml),Rd=g({},Ml,{view:0,detail:0}),c8=xa(Rd),fx,hx,jd,tm=g({},Rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:px,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==jd&&(jd&&o.type==="mousemove"?(fx=o.screenX-jd.screenX,hx=o.screenY-jd.screenY):hx=fx=0,jd=o),fx)},movementY:function(o){return"movementY"in o?o.movementY:hx}}),IC=xa(tm),u8=g({},tm,{dataTransfer:0}),d8=xa(u8),f8=g({},Rd,{relatedTarget:0}),mx=xa(f8),h8=g({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),m8=xa(h8),p8=g({},Ml,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),g8=xa(p8),y8=g({},Ml,{data:0}),MC=xa(y8),x8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v8={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"},b8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S8(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=b8[o])?!!l[o]:!1}function px(){return S8}var C8=g({},Rd,{key:function(o){if(o.key){var l=x8[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Qh(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?v8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:px,charCode:function(o){return o.type==="keypress"?Qh(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Qh(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),w8=xa(C8),E8=g({},tm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kC=xa(E8),R8=g({},Rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:px}),j8=xa(R8),T8=g({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),_8=xa(T8),N8=g({},tm,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),A8=xa(N8),D8=g({},Ml,{newState:0,oldState:0}),O8=xa(D8),I8=[9,13,27,32],gx=jo&&"CompositionEvent"in window,Td=null;jo&&"documentMode"in document&&(Td=document.documentMode);var M8=jo&&"TextEvent"in window&&!Td,LC=jo&&(!gx||Td&&8<Td&&11>=Td),PC=" ",UC=!1;function zC(o,l){switch(o){case"keyup":return I8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Fc=!1;function k8(o,l){switch(o){case"compositionend":return FC(l);case"keypress":return l.which!==32?null:(UC=!0,PC);case"textInput":return o=l.data,o===PC&&UC?null:o;default:return null}}function L8(o,l){if(Fc)return o==="compositionend"||!gx&&zC(o,l)?(o=DC(),Xh=dx=vi=null,Fc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return LC&&l.locale!=="ko"?null:l.data;default:return null}}var P8={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 HC(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!P8[o.type]:l==="textarea"}function $C(o,l,d,p){Uc?zc?zc.push(p):zc=[p]:Uc=p,l=Bm(l,"onChange"),0<l.length&&(d=new em("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var _d=null,Nd=null;function U8(o){ER(o,0)}function nm(o){var l=bs(o);if(wC(l))return o}function VC(o,l){if(o==="change")return l}var BC=!1;if(jo){var yx;if(jo){var xx="oninput"in document;if(!xx){var GC=document.createElement("div");GC.setAttribute("oninput","return;"),xx=typeof GC.oninput=="function"}yx=xx}else yx=!1;BC=yx&&(!document.documentMode||9<document.documentMode)}function qC(){_d&&(_d.detachEvent("onpropertychange",KC),Nd=_d=null)}function KC(o){if(o.propertyName==="value"&&nm(Nd)){var l=[];$C(l,Nd,o,lx(o)),AC(U8,l)}}function z8(o,l,d){o==="focusin"?(qC(),_d=l,Nd=d,_d.attachEvent("onpropertychange",KC)):o==="focusout"&&qC()}function F8(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return nm(Nd)}function H8(o,l){if(o==="click")return nm(l)}function $8(o,l){if(o==="input"||o==="change")return nm(l)}function V8(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ia=typeof Object.is=="function"?Object.is:V8;function Ad(o,l){if(Ia(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),p=Object.keys(l);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var b=d[p];if(!Ie.call(l,b)||!Ia(o[b],l[b]))return!1}return!0}function ZC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function YC(o,l){var d=ZC(o);o=0;for(var p;d;){if(d.nodeType===3){if(p=o+d.textContent.length,o<=l&&p>=l)return{node:d,offset:l-o};o=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=ZC(d)}}function WC(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?WC(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function XC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Yh(o.document);l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Yh(o.document)}return l}function vx(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var B8=jo&&"documentMode"in document&&11>=document.documentMode,Hc=null,bx=null,Dd=null,Sx=!1;function QC(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Sx||Hc==null||Hc!==Yh(p)||(p=Hc,"selectionStart"in p&&vx(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Dd&&Ad(Dd,p)||(Dd=p,p=Bm(bx,"onSelect"),0<p.length&&(l=new em("onSelect","select",null,l,d),o.push({event:l,listeners:p}),l.target=Hc)))}function kl(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var $c={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionrun:kl("Transition","TransitionRun"),transitionstart:kl("Transition","TransitionStart"),transitioncancel:kl("Transition","TransitionCancel"),transitionend:kl("Transition","TransitionEnd")},Cx={},JC={};jo&&(JC=document.createElement("div").style,"AnimationEvent"in window||(delete $c.animationend.animation,delete $c.animationiteration.animation,delete $c.animationstart.animation),"TransitionEvent"in window||delete $c.transitionend.transition);function Ll(o){if(Cx[o])return Cx[o];if(!$c[o])return o;var l=$c[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in JC)return Cx[o]=l[d];return o}var ew=Ll("animationend"),tw=Ll("animationiteration"),nw=Ll("animationstart"),G8=Ll("transitionrun"),q8=Ll("transitionstart"),K8=Ll("transitioncancel"),rw=Ll("transitionend"),aw=new Map,wx="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(" ");wx.push("scrollEnd");function Cs(o,l){aw.set(o,l),ea(l,[o])}var rm=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},rs=[],Vc=0,Ex=0;function am(){for(var o=Vc,l=Ex=Vc=0;l<o;){var d=rs[l];rs[l++]=null;var p=rs[l];rs[l++]=null;var b=rs[l];rs[l++]=null;var E=rs[l];if(rs[l++]=null,p!==null&&b!==null){var N=p.pending;N===null?b.next=b:(b.next=N.next,N.next=b),p.pending=b}E!==0&&sw(d,b,E)}}function sm(o,l,d,p){rs[Vc++]=o,rs[Vc++]=l,rs[Vc++]=d,rs[Vc++]=p,Ex|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Rx(o,l,d,p){return sm(o,l,d,p),om(o)}function Pl(o,l){return sm(o,null,null,l),om(o)}function sw(o,l,d){o.lanes|=d;var p=o.alternate;p!==null&&(p.lanes|=d);for(var b=!1,E=o.return;E!==null;)E.childLanes|=d,p=E.alternate,p!==null&&(p.childLanes|=d),E.tag===22&&(o=E.stateNode,o===null||o._visibility&1||(b=!0)),o=E,E=E.return;return o.tag===3?(E=o.stateNode,b&&l!==null&&(b=31-kn(d),o=E.hiddenUpdates,p=o[b],p===null?o[b]=[l]:p.push(l),l.lane=d|536870912),E):null}function om(o){if(50<Jd)throw Jd=0,Mv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Bc={};function Z8(o,l,d,p){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ma(o,l,d,p){return new Z8(o,l,d,p)}function jx(o){return o=o.prototype,!(!o||!o.isReactComponent)}function To(o,l){var d=o.alternate;return d===null?(d=Ma(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&65011712,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d.refCleanup=o.refCleanup,d}function ow(o,l){o.flags&=65011714;var d=o.alternate;return d===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=d.childLanes,o.lanes=d.lanes,o.child=d.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=d.memoizedProps,o.memoizedState=d.memoizedState,o.updateQueue=d.updateQueue,o.type=d.type,l=d.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function im(o,l,d,p,b,E){var N=0;if(p=o,typeof o=="function")jx(o)&&(N=1);else if(typeof o=="string")N=Jk(o,d,W.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=Ma(31,d,l,b),o.elementType=L,o.lanes=E,o;case S:return Ul(d.children,b,E,l);case w:N=8,b|=24;break;case R:return o=Ma(12,d,l,b|2),o.elementType=R,o.lanes=E,o;case A:return o=Ma(13,d,l,b),o.elementType=A,o.lanes=E,o;case O:return o=Ma(19,d,l,b),o.elementType=O,o.lanes=E,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case _:N=10;break e;case j:N=9;break e;case I:N=11;break e;case T:N=14;break e;case D:N=16,p=null;break e}N=29,d=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=Ma(N,d,l,b),l.elementType=o,l.type=p,l.lanes=E,l}function Ul(o,l,d,p){return o=Ma(7,o,p,l),o.lanes=d,o}function Tx(o,l,d){return o=Ma(6,o,null,l),o.lanes=d,o}function iw(o){var l=Ma(18,null,null,0);return l.stateNode=o,l}function _x(o,l,d){return l=Ma(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var lw=new WeakMap;function as(o,l){if(typeof o=="object"&&o!==null){var d=lw.get(o);return d!==void 0?d:(l={value:o,source:l,stack:ln(l)},lw.set(o,l),l)}return{value:o,source:l,stack:ln(l)}}var Gc=[],qc=0,lm=null,Od=0,ss=[],os=0,bi=null,Zs=1,Ys="";function _o(o,l){Gc[qc++]=Od,Gc[qc++]=lm,lm=o,Od=l}function cw(o,l,d){ss[os++]=Zs,ss[os++]=Ys,ss[os++]=bi,bi=o;var p=Zs;o=Ys;var b=32-kn(p)-1;p&=~(1<<b),d+=1;var E=32-kn(l)+b;if(30<E){var N=b-b%5;E=(p&(1<<N)-1).toString(32),p>>=N,b-=N,Zs=1<<32-kn(l)+b|d<<b|p,Ys=E+o}else Zs=1<<E|d<<b|p,Ys=o}function Nx(o){o.return!==null&&(_o(o,1),cw(o,1,0))}function Ax(o){for(;o===lm;)lm=Gc[--qc],Gc[qc]=null,Od=Gc[--qc],Gc[qc]=null;for(;o===bi;)bi=ss[--os],ss[os]=null,Ys=ss[--os],ss[os]=null,Zs=ss[--os],ss[os]=null}function uw(o,l){ss[os++]=Zs,ss[os++]=Ys,ss[os++]=bi,Zs=l.id,Ys=l.overflow,bi=o}var Or=null,Ln=null,Kt=!1,Si=null,is=!1,Dx=Error(r(519));function Ci(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Id(as(l,o)),Dx}function dw(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[Ue]=o,l[Ve]=p,d){case"dialog":zt("cancel",l),zt("close",l);break;case"iframe":case"object":case"embed":zt("load",l);break;case"video":case"audio":for(d=0;d<tf.length;d++)zt(tf[d],l);break;case"source":zt("error",l);break;case"img":case"image":case"link":zt("error",l),zt("load",l);break;case"details":zt("toggle",l);break;case"input":zt("invalid",l),EC(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":zt("invalid",l);break;case"textarea":zt("invalid",l),jC(l,p.value,p.defaultValue,p.children)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||p.suppressHydrationWarning===!0||_R(l.textContent,d)?(p.popover!=null&&(zt("beforetoggle",l),zt("toggle",l)),p.onScroll!=null&&zt("scroll",l),p.onScrollEnd!=null&&zt("scrollend",l),p.onClick!=null&&(l.onclick=Ro),l=!0):l=!1,l||Ci(o,!0)}function fw(o){for(Or=o.return;Or;)switch(Or.tag){case 5:case 31:case 13:is=!1;return;case 27:case 3:is=!0;return;default:Or=Or.return}}function Kc(o){if(o!==Or)return!1;if(!Kt)return fw(o),Kt=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||Yv(o.type,o.memoizedProps)),d=!d),d&&Ln&&Ci(o),fw(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Ln=PR(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Ln=PR(o)}else l===27?(l=Ln,Li(o.type)?(o=e0,e0=null,Ln=o):Ln=l):Ln=Or?cs(o.stateNode.nextSibling):null;return!0}function zl(){Ln=Or=null,Kt=!1}function Ox(){var o=Si;return o!==null&&(Ca===null?Ca=o:Ca.push.apply(Ca,o),Si=null),o}function Id(o){Si===null?Si=[o]:Si.push(o)}var Ix=P(null),Fl=null,No=null;function wi(o,l,d){F(Ix,l._currentValue),l._currentValue=d}function Ao(o){o._currentValue=Ix.current,U(Ix)}function Mx(o,l,d){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===d)break;o=o.return}}function kx(o,l,d,p){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var E=b.dependencies;if(E!==null){var N=b.child;E=E.firstContext;e:for(;E!==null;){var k=E;E=b;for(var Q=0;Q<l.length;Q++)if(k.context===l[Q]){E.lanes|=d,k=E.alternate,k!==null&&(k.lanes|=d),Mx(E.return,d,o),p||(N=null);break e}E=k.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(r(341));N.lanes|=d,E=N.alternate,E!==null&&(E.lanes|=d),Mx(N,d,o),N=null}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===o){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}}function Zc(o,l,d,p){o=null;for(var b=l,E=!1;b!==null;){if(!E){if((b.flags&524288)!==0)E=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var N=b.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var k=b.type;Ia(b.pendingProps.value,N.value)||(o!==null?o.push(k):o=[k])}}else if(b===J.current){if(N=b.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(o!==null?o.push(of):o=[of])}b=b.return}o!==null&&kx(l,o,d,p),l.flags|=262144}function cm(o){for(o=o.firstContext;o!==null;){if(!Ia(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Hl(o){Fl=o,No=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Ir(o){return hw(Fl,o)}function um(o,l){return Fl===null&&Hl(o),hw(o,l)}function hw(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},No===null){if(o===null)throw Error(r(308));No=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else No=No.next=l;return d}var Y8=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(d,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(d){return d()})}},W8=e.unstable_scheduleCallback,X8=e.unstable_NormalPriority,ir={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lx(){return{controller:new Y8,data:new Map,refCount:0}}function Md(o){o.refCount--,o.refCount===0&&W8(X8,function(){o.controller.abort()})}var kd=null,Px=0,Yc=0,Wc=null;function Q8(o,l){if(kd===null){var d=kd=[];Px=0,Yc=Fv(),Wc={status:"pending",value:void 0,then:function(p){d.push(p)}}}return Px++,l.then(mw,mw),l}function mw(){if(--Px===0&&kd!==null){Wc!==null&&(Wc.status="fulfilled");var o=kd;kd=null,Yc=0,Wc=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function J8(o,l){var d=[],p={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var b=0;b<d.length;b++)(0,d[b])(l)},function(b){for(p.status="rejected",p.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),p}var pw=M.S;M.S=function(o,l){QE=Ee(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&Q8(o,l),pw!==null&&pw(o,l)};var $l=P(null);function Ux(){var o=$l.current;return o!==null?o:Nn.pooledCache}function dm(o,l){l===null?F($l,$l.current):F($l,l.pool)}function gw(){var o=Ux();return o===null?null:{parent:ir._currentValue,pool:o}}var Xc=Error(r(460)),zx=Error(r(474)),fm=Error(r(542)),hm={then:function(){}};function yw(o){return o=o.status,o==="fulfilled"||o==="rejected"}function xw(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(Ro,Ro),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,bw(o),o;default:if(typeof l.status=="string")l.then(Ro,Ro);else{if(o=Nn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=p}},function(p){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,bw(o),o}throw Bl=l,Xc}}function Vl(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Bl=d,Xc):d}}var Bl=null;function vw(){if(Bl===null)throw Error(r(459));var o=Bl;return Bl=null,o}function bw(o){if(o===Xc||o===fm)throw Error(r(483))}var Qc=null,Ld=0;function mm(o){var l=Ld;return Ld+=1,Qc===null&&(Qc=[]),xw(Qc,o,l)}function Pd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function pm(o,l){throw l.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function Sw(o){function l(ie,te){if(o){var de=ie.deletions;de===null?(ie.deletions=[te],ie.flags|=16):de.push(te)}}function d(ie,te){if(!o)return null;for(;te!==null;)l(ie,te),te=te.sibling;return null}function p(ie){for(var te=new Map;ie!==null;)ie.key!==null?te.set(ie.key,ie):te.set(ie.index,ie),ie=ie.sibling;return te}function b(ie,te){return ie=To(ie,te),ie.index=0,ie.sibling=null,ie}function E(ie,te,de){return ie.index=de,o?(de=ie.alternate,de!==null?(de=de.index,de<te?(ie.flags|=67108866,te):de):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function N(ie){return o&&ie.alternate===null&&(ie.flags|=67108866),ie}function k(ie,te,de,ve){return te===null||te.tag!==6?(te=Tx(de,ie.mode,ve),te.return=ie,te):(te=b(te,de),te.return=ie,te)}function Q(ie,te,de,ve){var rt=de.type;return rt===S?xe(ie,te,de.props.children,ve,de.key):te!==null&&(te.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===D&&Vl(rt)===te.type)?(te=b(te,de.props),Pd(te,de),te.return=ie,te):(te=im(de.type,de.key,de.props,null,ie.mode,ve),Pd(te,de),te.return=ie,te)}function fe(ie,te,de,ve){return te===null||te.tag!==4||te.stateNode.containerInfo!==de.containerInfo||te.stateNode.implementation!==de.implementation?(te=_x(de,ie.mode,ve),te.return=ie,te):(te=b(te,de.children||[]),te.return=ie,te)}function xe(ie,te,de,ve,rt){return te===null||te.tag!==7?(te=Ul(de,ie.mode,ve,rt),te.return=ie,te):(te=b(te,de),te.return=ie,te)}function be(ie,te,de){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Tx(""+te,ie.mode,de),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return de=im(te.type,te.key,te.props,null,ie.mode,de),Pd(de,te),de.return=ie,de;case C:return te=_x(te,ie.mode,de),te.return=ie,te;case D:return te=Vl(te),be(ie,te,de)}if(z(te)||Z(te))return te=Ul(te,ie.mode,de,null),te.return=ie,te;if(typeof te.then=="function")return be(ie,mm(te),de);if(te.$$typeof===_)return be(ie,um(ie,te),de);pm(ie,te)}return null}function he(ie,te,de,ve){var rt=te!==null?te.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return rt!==null?null:k(ie,te,""+de,ve);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case v:return de.key===rt?Q(ie,te,de,ve):null;case C:return de.key===rt?fe(ie,te,de,ve):null;case D:return de=Vl(de),he(ie,te,de,ve)}if(z(de)||Z(de))return rt!==null?null:xe(ie,te,de,ve,null);if(typeof de.then=="function")return he(ie,te,mm(de),ve);if(de.$$typeof===_)return he(ie,te,um(ie,de),ve);pm(ie,de)}return null}function pe(ie,te,de,ve,rt){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ie=ie.get(de)||null,k(te,ie,""+ve,rt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return ie=ie.get(ve.key===null?de:ve.key)||null,Q(te,ie,ve,rt);case C:return ie=ie.get(ve.key===null?de:ve.key)||null,fe(te,ie,ve,rt);case D:return ve=Vl(ve),pe(ie,te,de,ve,rt)}if(z(ve)||Z(ve))return ie=ie.get(de)||null,xe(te,ie,ve,rt,null);if(typeof ve.then=="function")return pe(ie,te,de,mm(ve),rt);if(ve.$$typeof===_)return pe(ie,te,de,um(te,ve),rt);pm(te,ve)}return null}function Ke(ie,te,de,ve){for(var rt=null,an=null,Xe=te,jt=te=0,Bt=null;Xe!==null&&jt<de.length;jt++){Xe.index>jt?(Bt=Xe,Xe=null):Bt=Xe.sibling;var sn=he(ie,Xe,de[jt],ve);if(sn===null){Xe===null&&(Xe=Bt);break}o&&Xe&&sn.alternate===null&&l(ie,Xe),te=E(sn,te,jt),an===null?rt=sn:an.sibling=sn,an=sn,Xe=Bt}if(jt===de.length)return d(ie,Xe),Kt&&_o(ie,jt),rt;if(Xe===null){for(;jt<de.length;jt++)Xe=be(ie,de[jt],ve),Xe!==null&&(te=E(Xe,te,jt),an===null?rt=Xe:an.sibling=Xe,an=Xe);return Kt&&_o(ie,jt),rt}for(Xe=p(Xe);jt<de.length;jt++)Bt=pe(Xe,ie,jt,de[jt],ve),Bt!==null&&(o&&Bt.alternate!==null&&Xe.delete(Bt.key===null?jt:Bt.key),te=E(Bt,te,jt),an===null?rt=Bt:an.sibling=Bt,an=Bt);return o&&Xe.forEach(function(Hi){return l(ie,Hi)}),Kt&&_o(ie,jt),rt}function it(ie,te,de,ve){if(de==null)throw Error(r(151));for(var rt=null,an=null,Xe=te,jt=te=0,Bt=null,sn=de.next();Xe!==null&&!sn.done;jt++,sn=de.next()){Xe.index>jt?(Bt=Xe,Xe=null):Bt=Xe.sibling;var Hi=he(ie,Xe,sn.value,ve);if(Hi===null){Xe===null&&(Xe=Bt);break}o&&Xe&&Hi.alternate===null&&l(ie,Xe),te=E(Hi,te,jt),an===null?rt=Hi:an.sibling=Hi,an=Hi,Xe=Bt}if(sn.done)return d(ie,Xe),Kt&&_o(ie,jt),rt;if(Xe===null){for(;!sn.done;jt++,sn=de.next())sn=be(ie,sn.value,ve),sn!==null&&(te=E(sn,te,jt),an===null?rt=sn:an.sibling=sn,an=sn);return Kt&&_o(ie,jt),rt}for(Xe=p(Xe);!sn.done;jt++,sn=de.next())sn=pe(Xe,ie,jt,sn.value,ve),sn!==null&&(o&&sn.alternate!==null&&Xe.delete(sn.key===null?jt:sn.key),te=E(sn,te,jt),an===null?rt=sn:an.sibling=sn,an=sn);return o&&Xe.forEach(function(u9){return l(ie,u9)}),Kt&&_o(ie,jt),rt}function wn(ie,te,de,ve){if(typeof de=="object"&&de!==null&&de.type===S&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case v:e:{for(var rt=de.key;te!==null;){if(te.key===rt){if(rt=de.type,rt===S){if(te.tag===7){d(ie,te.sibling),ve=b(te,de.props.children),ve.return=ie,ie=ve;break e}}else if(te.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===D&&Vl(rt)===te.type){d(ie,te.sibling),ve=b(te,de.props),Pd(ve,de),ve.return=ie,ie=ve;break e}d(ie,te);break}else l(ie,te);te=te.sibling}de.type===S?(ve=Ul(de.props.children,ie.mode,ve,de.key),ve.return=ie,ie=ve):(ve=im(de.type,de.key,de.props,null,ie.mode,ve),Pd(ve,de),ve.return=ie,ie=ve)}return N(ie);case C:e:{for(rt=de.key;te!==null;){if(te.key===rt)if(te.tag===4&&te.stateNode.containerInfo===de.containerInfo&&te.stateNode.implementation===de.implementation){d(ie,te.sibling),ve=b(te,de.children||[]),ve.return=ie,ie=ve;break e}else{d(ie,te);break}else l(ie,te);te=te.sibling}ve=_x(de,ie.mode,ve),ve.return=ie,ie=ve}return N(ie);case D:return de=Vl(de),wn(ie,te,de,ve)}if(z(de))return Ke(ie,te,de,ve);if(Z(de)){if(rt=Z(de),typeof rt!="function")throw Error(r(150));return de=rt.call(de),it(ie,te,de,ve)}if(typeof de.then=="function")return wn(ie,te,mm(de),ve);if(de.$$typeof===_)return wn(ie,te,um(ie,de),ve);pm(ie,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,te!==null&&te.tag===6?(d(ie,te.sibling),ve=b(te,de),ve.return=ie,ie=ve):(d(ie,te),ve=Tx(de,ie.mode,ve),ve.return=ie,ie=ve),N(ie)):d(ie,te)}return function(ie,te,de,ve){try{Ld=0;var rt=wn(ie,te,de,ve);return Qc=null,rt}catch(Xe){if(Xe===Xc||Xe===fm)throw Xe;var an=Ma(29,Xe,null,ie.mode);return an.lanes=ve,an.return=ie,an}finally{}}}var Gl=Sw(!0),Cw=Sw(!1),Ei=!1;function Fx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hx(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Ri(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ji(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(cn&2)!==0){var b=p.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),p.pending=l,l=om(o),sw(o,null,d),l}return sm(o,p,l,d),om(o)}function Ud(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,ee(o,d)}}function $x(o,l){var d=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,E=null;if(d=d.firstBaseUpdate,d!==null){do{var N={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};E===null?b=E=N:E=E.next=N,d=d.next}while(d!==null);E===null?b=E=l:E=E.next=l}else b=E=l;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:E,shared:p.shared,callbacks:p.callbacks},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}var Vx=!1;function zd(){if(Vx){var o=Wc;if(o!==null)throw o}}function Fd(o,l,d,p){Vx=!1;var b=o.updateQueue;Ei=!1;var E=b.firstBaseUpdate,N=b.lastBaseUpdate,k=b.shared.pending;if(k!==null){b.shared.pending=null;var Q=k,fe=Q.next;Q.next=null,N===null?E=fe:N.next=fe,N=Q;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,k=xe.lastBaseUpdate,k!==N&&(k===null?xe.firstBaseUpdate=fe:k.next=fe,xe.lastBaseUpdate=Q))}if(E!==null){var be=b.baseState;N=0,xe=fe=Q=null,k=E;do{var he=k.lane&-536870913,pe=he!==k.lane;if(pe?(Vt&he)===he:(p&he)===he){he!==0&&he===Yc&&(Vx=!0),xe!==null&&(xe=xe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ke=o,it=k;he=l;var wn=d;switch(it.tag){case 1:if(Ke=it.payload,typeof Ke=="function"){be=Ke.call(wn,be,he);break e}be=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=it.payload,he=typeof Ke=="function"?Ke.call(wn,be,he):Ke,he==null)break e;be=g({},be,he);break e;case 2:Ei=!0}}he=k.callback,he!==null&&(o.flags|=64,pe&&(o.flags|=8192),pe=b.callbacks,pe===null?b.callbacks=[he]:pe.push(he))}else pe={lane:he,tag:k.tag,payload:k.payload,callback:k.callback,next:null},xe===null?(fe=xe=pe,Q=be):xe=xe.next=pe,N|=he;if(k=k.next,k===null){if(k=b.shared.pending,k===null)break;pe=k,k=pe.next,pe.next=null,b.lastBaseUpdate=pe,b.shared.pending=null}}while(!0);xe===null&&(Q=be),b.baseState=Q,b.firstBaseUpdate=fe,b.lastBaseUpdate=xe,E===null&&(b.shared.lanes=0),Di|=N,o.lanes=N,o.memoizedState=be}}function ww(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function Ew(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)ww(d[o],l)}var Jc=P(null),gm=P(0);function Rw(o,l){o=zo,F(gm,o),F(Jc,l),zo=o|l.baseLanes}function Bx(){F(gm,zo),F(Jc,Jc.current)}function Gx(){zo=gm.current,U(Jc),U(gm)}var ka=P(null),ls=null;function Ti(o){var l=o.alternate;F(rr,rr.current&1),F(ka,o),ls===null&&(l===null||Jc.current!==null||l.memoizedState!==null)&&(ls=o)}function qx(o){F(rr,rr.current),F(ka,o),ls===null&&(ls=o)}function jw(o){o.tag===22?(F(rr,rr.current),F(ka,o),ls===null&&(ls=o)):_i()}function _i(){F(rr,rr.current),F(ka,ka.current)}function La(o){U(ka),ls===o&&(ls=null),U(rr)}var rr=P(0);function ym(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Qv(d)||Jv(d)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Do=0,vt=null,Sn=null,lr=null,xm=!1,eu=!1,ql=!1,vm=0,Hd=0,tu=null,ek=0;function Wn(){throw Error(r(321))}function Kx(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Ia(o[d],l[d]))return!1;return!0}function Zx(o,l,d,p,b,E){return Do=E,vt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=o===null||o.memoizedState===null?cE:cv,ql=!1,E=d(p,b),ql=!1,eu&&(E=_w(l,d,p,b)),Tw(o),E}function Tw(o){M.H=Bd;var l=Sn!==null&&Sn.next!==null;if(Do=0,lr=Sn=vt=null,xm=!1,Hd=0,tu=null,l)throw Error(r(300));o===null||cr||(o=o.dependencies,o!==null&&cm(o)&&(cr=!0))}function _w(o,l,d,p){vt=o;var b=0;do{if(eu&&(tu=null),Hd=0,eu=!1,25<=b)throw Error(r(301));if(b+=1,lr=Sn=null,o.updateQueue!=null){var E=o.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}M.H=uE,E=l(d,p)}while(eu);return E}function tk(){var o=M.H,l=o.useState()[0];return l=typeof l.then=="function"?$d(l):l,o=o.useState()[0],(Sn!==null?Sn.memoizedState:null)!==o&&(vt.flags|=1024),l}function Yx(){var o=vm!==0;return vm=0,o}function Wx(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function Xx(o){if(xm){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}xm=!1}Do=0,lr=Sn=vt=null,eu=!1,Hd=vm=0,tu=null}function na(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?vt.memoizedState=lr=o:lr=lr.next=o,lr}function ar(){if(Sn===null){var o=vt.alternate;o=o!==null?o.memoizedState:null}else o=Sn.next;var l=lr===null?vt.memoizedState:lr.next;if(l!==null)lr=l,Sn=o;else{if(o===null)throw vt.alternate===null?Error(r(467)):Error(r(310));Sn=o,o={memoizedState:Sn.memoizedState,baseState:Sn.baseState,baseQueue:Sn.baseQueue,queue:Sn.queue,next:null},lr===null?vt.memoizedState=lr=o:lr=lr.next=o}return lr}function bm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $d(o){var l=Hd;return Hd+=1,tu===null&&(tu=[]),o=xw(tu,o,l),l=vt,(lr===null?l.memoizedState:lr.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?cE:cv),o}function Sm(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return $d(o);if(o.$$typeof===_)return Ir(o)}throw Error(r(438,String(o)))}function Qx(o){var l=null,d=vt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=vt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=bm(),vt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(o),p=0;p<o;p++)d[p]=$;return l.index++,d}function Oo(o,l){return typeof l=="function"?l(o):l}function Cm(o){var l=ar();return Jx(l,Sn,o)}function Jx(o,l,d){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=o.baseQueue,E=p.pending;if(E!==null){if(b!==null){var N=b.next;b.next=E.next,E.next=N}l.baseQueue=b=E,p.pending=null}if(E=o.baseState,b===null)o.memoizedState=E;else{l=b.next;var k=N=null,Q=null,fe=l,xe=!1;do{var be=fe.lane&-536870913;if(be!==fe.lane?(Vt&be)===be:(Do&be)===be){var he=fe.revertLane;if(he===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),be===Yc&&(xe=!0);else if((Do&he)===he){fe=fe.next,he===Yc&&(xe=!0);continue}else be={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Q===null?(k=Q=be,N=E):Q=Q.next=be,vt.lanes|=he,Di|=he;be=fe.action,ql&&d(E,be),E=fe.hasEagerState?fe.eagerState:d(E,be)}else he={lane:be,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},Q===null?(k=Q=he,N=E):Q=Q.next=he,vt.lanes|=be,Di|=be;fe=fe.next}while(fe!==null&&fe!==l);if(Q===null?N=E:Q.next=k,!Ia(E,o.memoizedState)&&(cr=!0,xe&&(d=Wc,d!==null)))throw d;o.memoizedState=E,o.baseState=N,o.baseQueue=Q,p.lastRenderedState=E}return b===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function ev(o){var l=ar(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var p=d.dispatch,b=d.pending,E=l.memoizedState;if(b!==null){d.pending=null;var N=b=b.next;do E=o(E,N.action),N=N.next;while(N!==b);Ia(E,l.memoizedState)||(cr=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),d.lastRenderedState=E}return[E,p]}function Nw(o,l,d){var p=vt,b=ar(),E=Kt;if(E){if(d===void 0)throw Error(r(407));d=d()}else d=l();var N=!Ia((Sn||b).memoizedState,d);if(N&&(b.memoizedState=d,cr=!0),b=b.queue,rv(Ow.bind(null,p,b,o),[o]),b.getSnapshot!==l||N||lr!==null&&lr.memoizedState.tag&1){if(p.flags|=2048,nu(9,{destroy:void 0},Dw.bind(null,p,b,d,l),null),Nn===null)throw Error(r(349));E||(Do&127)!==0||Aw(p,l,d)}return d}function Aw(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=vt.updateQueue,l===null?(l=bm(),vt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Dw(o,l,d,p){l.value=d,l.getSnapshot=p,Iw(l)&&Mw(o)}function Ow(o,l,d){return d(function(){Iw(l)&&Mw(o)})}function Iw(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!Ia(o,d)}catch{return!0}}function Mw(o){var l=Pl(o,2);l!==null&&wa(l,o,2)}function tv(o){var l=na();if(typeof o=="function"){var d=o;if(o=d(),ql){or(!0);try{d()}finally{or(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:o},l}function kw(o,l,d,p){return o.baseState=d,Jx(o,Sn,typeof p=="function"?p:Oo)}function nk(o,l,d,p,b){if(Rm(o))throw Error(r(485));if(o=l.action,o!==null){var E={payload:b,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){E.listeners.push(N)}};M.T!==null?d(!0):E.isTransition=!1,p(E),d=l.pending,d===null?(E.next=l.pending=E,Lw(l,E)):(E.next=d.next,l.pending=d.next=E)}}function Lw(o,l){var d=l.action,p=l.payload,b=o.state;if(l.isTransition){var E=M.T,N={};M.T=N;try{var k=d(b,p),Q=M.S;Q!==null&&Q(N,k),Pw(o,l,k)}catch(fe){nv(o,l,fe)}finally{E!==null&&N.types!==null&&(E.types=N.types),M.T=E}}else try{E=d(b,p),Pw(o,l,E)}catch(fe){nv(o,l,fe)}}function Pw(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){Uw(o,l,p)},function(p){return nv(o,l,p)}):Uw(o,l,d)}function Uw(o,l,d){l.status="fulfilled",l.value=d,zw(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,Lw(o,d)))}function nv(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,zw(l),l=l.next;while(l!==p)}o.action=null}function zw(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function Fw(o,l){return l}function Hw(o,l){if(Kt){var d=Nn.formState;if(d!==null){e:{var p=vt;if(Kt){if(Ln){t:{for(var b=Ln,E=is;b.nodeType!==8;){if(!E){b=null;break t}if(b=cs(b.nextSibling),b===null){b=null;break t}}E=b.data,b=E==="F!"||E==="F"?b:null}if(b){Ln=cs(b.nextSibling),p=b.data==="F!";break e}}Ci(p)}p=!1}p&&(l=d[0])}}return d=na(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fw,lastRenderedState:l},d.queue=p,d=oE.bind(null,vt,p),p.dispatch=d,p=tv(!1),E=lv.bind(null,vt,!1,p.queue),p=na(),b={state:l,dispatch:null,action:o,pending:null},p.queue=b,d=nk.bind(null,vt,b,E,d),b.dispatch=d,p.memoizedState=o,[l,d,!1]}function $w(o){var l=ar();return Vw(l,Sn,o)}function Vw(o,l,d){if(l=Jx(o,l,Fw)[0],o=Cm(Oo)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=$d(l)}catch(N){throw N===Xc?fm:N}else p=l;l=ar();var b=l.queue,E=b.dispatch;return d!==l.memoizedState&&(vt.flags|=2048,nu(9,{destroy:void 0},rk.bind(null,b,d),null)),[p,E,o]}function rk(o,l){o.action=l}function Bw(o){var l=ar(),d=Sn;if(d!==null)return Vw(l,d,o);ar(),l=l.memoizedState,d=ar();var p=d.queue.dispatch;return d.memoizedState=o,[l,p,!1]}function nu(o,l,d,p){return o={tag:o,create:d,deps:p,inst:l,next:null},l=vt.updateQueue,l===null&&(l=bm(),vt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=o.next=o:(p=d.next,d.next=o,o.next=p,l.lastEffect=o),o}function Gw(){return ar().memoizedState}function wm(o,l,d,p){var b=na();vt.flags|=o,b.memoizedState=nu(1|l,{destroy:void 0},d,p===void 0?null:p)}function Em(o,l,d,p){var b=ar();p=p===void 0?null:p;var E=b.memoizedState.inst;Sn!==null&&p!==null&&Kx(p,Sn.memoizedState.deps)?b.memoizedState=nu(l,E,d,p):(vt.flags|=o,b.memoizedState=nu(1|l,E,d,p))}function qw(o,l){wm(8390656,8,o,l)}function rv(o,l){Em(2048,8,o,l)}function ak(o){vt.flags|=4;var l=vt.updateQueue;if(l===null)l=bm(),vt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function Kw(o){var l=ar().memoizedState;return ak({ref:l,nextImpl:o}),function(){if((cn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Zw(o,l){return Em(4,2,o,l)}function Yw(o,l){return Em(4,4,o,l)}function Ww(o,l){if(typeof l=="function"){o=o();var d=l(o);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Xw(o,l,d){d=d!=null?d.concat([o]):null,Em(4,4,Ww.bind(null,l,o),d)}function av(){}function Qw(o,l){var d=ar();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&Kx(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function Jw(o,l){var d=ar();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&Kx(l,p[1]))return p[0];if(p=o(),ql){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p}function sv(o,l,d){return d===void 0||(Do&1073741824)!==0&&(Vt&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=eR(),vt.lanes|=o,Di|=o,d)}function eE(o,l,d,p){return Ia(d,l)?d:Jc.current!==null?(o=sv(o,d,p),Ia(o,l)||(cr=!0),o):(Do&42)===0||(Do&1073741824)!==0&&(Vt&261930)===0?(cr=!0,o.memoizedState=d):(o=eR(),vt.lanes|=o,Di|=o,l)}function tE(o,l,d,p,b){var E=H.p;H.p=E!==0&&8>E?E:8;var N=M.T,k={};M.T=k,lv(o,!1,l,d);try{var Q=b(),fe=M.S;if(fe!==null&&fe(k,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var xe=J8(Q,p);Vd(o,l,xe,za(o))}else Vd(o,l,p,za(o))}catch(be){Vd(o,l,{then:function(){},status:"rejected",reason:be},za())}finally{H.p=E,N!==null&&k.types!==null&&(N.types=k.types),M.T=N}}function sk(){}function ov(o,l,d,p){if(o.tag!==5)throw Error(r(476));var b=nE(o).queue;tE(o,b,l,V,d===null?sk:function(){return rE(o),d(p)})}function nE(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:V},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function rE(o){var l=nE(o);l.next===null&&(l=o.alternate.memoizedState),Vd(o,l.next.queue,{},za())}function iv(){return Ir(of)}function aE(){return ar().memoizedState}function sE(){return ar().memoizedState}function ok(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=za();o=Ri(d);var p=ji(l,o,d);p!==null&&(wa(p,l,d),Ud(p,l,d)),l={cache:Lx()},o.payload=l;return}l=l.return}}function ik(o,l,d){var p=za();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Rm(o)?iE(l,d):(d=Rx(o,l,d,p),d!==null&&(wa(d,o,p),lE(d,l,p)))}function oE(o,l,d){var p=za();Vd(o,l,d,p)}function Vd(o,l,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Rm(o))iE(l,b);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var N=l.lastRenderedState,k=E(N,d);if(b.hasEagerState=!0,b.eagerState=k,Ia(k,N))return sm(o,l,b,0),Nn===null&&am(),!1}catch{}finally{}if(d=Rx(o,l,b,p),d!==null)return wa(d,o,p),lE(d,l,p),!0}return!1}function lv(o,l,d,p){if(p={lane:2,revertLane:Fv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Rm(o)){if(l)throw Error(r(479))}else l=Rx(o,d,p,2),l!==null&&wa(l,o,2)}function Rm(o){var l=o.alternate;return o===vt||l!==null&&l===vt}function iE(o,l){eu=xm=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function lE(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,ee(o,d)}}var Bd={readContext:Ir,use:Sm,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useLayoutEffect:Wn,useInsertionEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useSyncExternalStore:Wn,useId:Wn,useHostTransitionStatus:Wn,useFormState:Wn,useActionState:Wn,useOptimistic:Wn,useMemoCache:Wn,useCacheRefresh:Wn};Bd.useEffectEvent=Wn;var cE={readContext:Ir,use:Sm,useCallback:function(o,l){return na().memoizedState=[o,l===void 0?null:l],o},useContext:Ir,useEffect:qw,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,wm(4194308,4,Ww.bind(null,l,o),d)},useLayoutEffect:function(o,l){return wm(4194308,4,o,l)},useInsertionEffect:function(o,l){wm(4,2,o,l)},useMemo:function(o,l){var d=na();l=l===void 0?null:l;var p=o();if(ql){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p},useReducer:function(o,l,d){var p=na();if(d!==void 0){var b=d(l);if(ql){or(!0);try{d(l)}finally{or(!1)}}}else b=l;return p.memoizedState=p.baseState=b,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:b},p.queue=o,o=o.dispatch=ik.bind(null,vt,o),[p.memoizedState,o]},useRef:function(o){var l=na();return o={current:o},l.memoizedState=o},useState:function(o){o=tv(o);var l=o.queue,d=oE.bind(null,vt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:av,useDeferredValue:function(o,l){var d=na();return sv(d,o,l)},useTransition:function(){var o=tv(!1);return o=tE.bind(null,vt,o.queue,!0,!1),na().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=vt,b=na();if(Kt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),Nn===null)throw Error(r(349));(Vt&127)!==0||Aw(p,l,d)}b.memoizedState=d;var E={value:d,getSnapshot:l};return b.queue=E,qw(Ow.bind(null,p,E,o),[o]),p.flags|=2048,nu(9,{destroy:void 0},Dw.bind(null,p,E,d,l),null),d},useId:function(){var o=na(),l=Nn.identifierPrefix;if(Kt){var d=Ys,p=Zs;d=(p&~(1<<32-kn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=vm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=ek++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:iv,useFormState:Hw,useActionState:Hw,useOptimistic:function(o){var l=na();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=lv.bind(null,vt,!0,d),d.dispatch=l,[o,l]},useMemoCache:Qx,useCacheRefresh:function(){return na().memoizedState=ok.bind(null,vt)},useEffectEvent:function(o){var l=na(),d={impl:o};return l.memoizedState=d,function(){if((cn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},cv={readContext:Ir,use:Sm,useCallback:Qw,useContext:Ir,useEffect:rv,useImperativeHandle:Xw,useInsertionEffect:Zw,useLayoutEffect:Yw,useMemo:Jw,useReducer:Cm,useRef:Gw,useState:function(){return Cm(Oo)},useDebugValue:av,useDeferredValue:function(o,l){var d=ar();return eE(d,Sn.memoizedState,o,l)},useTransition:function(){var o=Cm(Oo)[0],l=ar().memoizedState;return[typeof o=="boolean"?o:$d(o),l]},useSyncExternalStore:Nw,useId:aE,useHostTransitionStatus:iv,useFormState:$w,useActionState:$w,useOptimistic:function(o,l){var d=ar();return kw(d,Sn,o,l)},useMemoCache:Qx,useCacheRefresh:sE};cv.useEffectEvent=Kw;var uE={readContext:Ir,use:Sm,useCallback:Qw,useContext:Ir,useEffect:rv,useImperativeHandle:Xw,useInsertionEffect:Zw,useLayoutEffect:Yw,useMemo:Jw,useReducer:ev,useRef:Gw,useState:function(){return ev(Oo)},useDebugValue:av,useDeferredValue:function(o,l){var d=ar();return Sn===null?sv(d,o,l):eE(d,Sn.memoizedState,o,l)},useTransition:function(){var o=ev(Oo)[0],l=ar().memoizedState;return[typeof o=="boolean"?o:$d(o),l]},useSyncExternalStore:Nw,useId:aE,useHostTransitionStatus:iv,useFormState:Bw,useActionState:Bw,useOptimistic:function(o,l){var d=ar();return Sn!==null?kw(d,Sn,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:Qx,useCacheRefresh:sE};uE.useEffectEvent=Kw;function uv(o,l,d,p){l=o.memoizedState,d=d(p,l),d=d==null?l:g({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var dv={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=za(),b=Ri(p);b.payload=l,d!=null&&(b.callback=d),l=ji(o,b,p),l!==null&&(wa(l,o,p),Ud(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=za(),b=Ri(p);b.tag=1,b.payload=l,d!=null&&(b.callback=d),l=ji(o,b,p),l!==null&&(wa(l,o,p),Ud(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=za(),p=Ri(d);p.tag=2,l!=null&&(p.callback=l),l=ji(o,p,d),l!==null&&(wa(l,o,d),Ud(l,o,d))}};function dE(o,l,d,p,b,E,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,E,N):l.prototype&&l.prototype.isPureReactComponent?!Ad(d,p)||!Ad(b,E):!0}function fE(o,l,d,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,p),l.state!==o&&dv.enqueueReplaceState(l,l.state,null)}function Kl(o,l){var d=l;if("ref"in l){d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}if(o=o.defaultProps){d===l&&(d=g({},d));for(var b in o)d[b]===void 0&&(d[b]=o[b])}return d}function hE(o){rm(o)}function mE(o){console.error(o)}function pE(o){rm(o)}function jm(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function gE(o,l,d){try{var p=o.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function fv(o,l,d){return d=Ri(d),d.tag=3,d.payload={element:null},d.callback=function(){jm(o,l)},d}function yE(o){return o=Ri(o),o.tag=3,o}function xE(o,l,d,p){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var E=p.value;o.payload=function(){return b(E)},o.callback=function(){gE(l,d,p)}}var N=d.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){gE(l,d,p),typeof b!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var k=p.stack;this.componentDidCatch(p.value,{componentStack:k!==null?k:""})})}function lk(o,l,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&Zc(l,d,b,!0),d=ka.current,d!==null){switch(d.tag){case 31:case 13:return ls===null?Um():d.alternate===null&&Xn===0&&(Xn=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===hm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),Pv(o,p,b)),!1;case 22:return d.flags|=65536,p===hm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([p]):d.add(p)),Pv(o,p,b)),!1}throw Error(r(435,d.tag))}return Pv(o,p,b),Um(),!1}if(Kt)return l=ka.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,p!==Dx&&(o=Error(r(422),{cause:p}),Id(as(o,d)))):(p!==Dx&&(l=Error(r(423),{cause:p}),Id(as(l,d))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,p=as(p,d),b=fv(o.stateNode,p,b),$x(o,b),Xn!==4&&(Xn=2)),!1;var E=Error(r(520),{cause:p});if(E=as(E,d),Qd===null?Qd=[E]:Qd.push(E),Xn!==4&&(Xn=2),l===null)return!0;p=as(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=b&-b,d.lanes|=o,o=fv(d.stateNode,p,o),$x(d,o),!1;case 1:if(l=d.type,E=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Oi===null||!Oi.has(E))))return d.flags|=65536,b&=-b,d.lanes|=b,b=yE(b),xE(b,o,d,p),$x(d,b),!1}d=d.return}while(d!==null);return!1}var hv=Error(r(461)),cr=!1;function Mr(o,l,d,p){l.child=o===null?Cw(l,null,d,p):Gl(l,o.child,d,p)}function vE(o,l,d,p,b){d=d.render;var E=l.ref;if("ref"in p){var N={};for(var k in p)k!=="ref"&&(N[k]=p[k])}else N=p;return Hl(l),p=Zx(o,l,d,N,E,b),k=Yx(),o!==null&&!cr?(Wx(o,l,b),Io(o,l,b)):(Kt&&k&&Nx(l),l.flags|=1,Mr(o,l,p,b),l.child)}function bE(o,l,d,p,b){if(o===null){var E=d.type;return typeof E=="function"&&!jx(E)&&E.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=E,SE(o,l,E,p,b)):(o=im(d.type,null,p,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(E=o.child,!Sv(o,b)){var N=E.memoizedProps;if(d=d.compare,d=d!==null?d:Ad,d(N,p)&&o.ref===l.ref)return Io(o,l,b)}return l.flags|=1,o=To(E,p),o.ref=l.ref,o.return=l,l.child=o}function SE(o,l,d,p,b){if(o!==null){var E=o.memoizedProps;if(Ad(E,p)&&o.ref===l.ref)if(cr=!1,l.pendingProps=p=E,Sv(o,b))(o.flags&131072)!==0&&(cr=!0);else return l.lanes=o.lanes,Io(o,l,b)}return mv(o,l,d,p,b)}function CE(o,l,d,p){var b=p.children,E=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(E=E!==null?E.baseLanes|d:d,o!==null){for(p=l.child=o.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~E}else p=0,l.child=null;return wE(o,l,E,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&dm(l,E!==null?E.cachePool:null),E!==null?Rw(l,E):Bx(),jw(l);else return p=l.lanes=536870912,wE(o,l,E!==null?E.baseLanes|d:d,d,p)}else E!==null?(dm(l,E.cachePool),Rw(l,E),_i(),l.memoizedState=null):(o!==null&&dm(l,null),Bx(),_i());return Mr(o,l,b,d),l.child}function Gd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function wE(o,l,d,p,b){var E=Ux();return E=E===null?null:{parent:ir._currentValue,pool:E},l.memoizedState={baseLanes:d,cachePool:E},o!==null&&dm(l,null),Bx(),jw(l),o!==null&&Zc(o,l,p,!0),l.childLanes=b,null}function Tm(o,l){return l=Nm({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function EE(o,l,d){return Gl(l,o.child,null,d),o=Tm(l,l.pendingProps),o.flags|=2,La(l),l.memoizedState=null,o}function ck(o,l,d){var p=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(Kt){if(p.mode==="hidden")return o=Tm(l,p),l.lanes=536870912,Gd(null,o);if(qx(l),(o=Ln)?(o=LR(o,is),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:bi!==null?{id:Zs,overflow:Ys}:null,retryLane:536870912,hydrationErrors:null},d=iw(o),d.return=l,l.child=d,Or=l,Ln=null)):o=null,o===null)throw Ci(l);return l.lanes=536870912,null}return Tm(l,p)}var E=o.memoizedState;if(E!==null){var N=E.dehydrated;if(qx(l),b)if(l.flags&256)l.flags&=-257,l=EE(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(cr||Zc(o,l,d,!1),b=(d&o.childLanes)!==0,cr||b){if(p=Nn,p!==null&&(N=le(p,d),N!==0&&N!==E.retryLane))throw E.retryLane=N,Pl(o,N),wa(p,o,N),hv;Um(),l=EE(o,l,d)}else o=E.treeContext,Ln=cs(N.nextSibling),Or=l,Kt=!0,Si=null,is=!1,o!==null&&uw(l,o),l=Tm(l,p),l.flags|=4096;return l}return o=To(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function _m(o,l){var d=l.ref;if(d===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(o===null||o.ref!==d)&&(l.flags|=4194816)}}function mv(o,l,d,p,b){return Hl(l),d=Zx(o,l,d,p,void 0,b),p=Yx(),o!==null&&!cr?(Wx(o,l,b),Io(o,l,b)):(Kt&&p&&Nx(l),l.flags|=1,Mr(o,l,d,b),l.child)}function RE(o,l,d,p,b,E){return Hl(l),l.updateQueue=null,d=_w(l,p,d,b),Tw(o),p=Yx(),o!==null&&!cr?(Wx(o,l,E),Io(o,l,E)):(Kt&&p&&Nx(l),l.flags|=1,Mr(o,l,d,E),l.child)}function jE(o,l,d,p,b){if(Hl(l),l.stateNode===null){var E=Bc,N=d.contextType;typeof N=="object"&&N!==null&&(E=Ir(N)),E=new d(p,E),l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=dv,l.stateNode=E,E._reactInternals=l,E=l.stateNode,E.props=p,E.state=l.memoizedState,E.refs={},Fx(l),N=d.contextType,E.context=typeof N=="object"&&N!==null?Ir(N):Bc,E.state=l.memoizedState,N=d.getDerivedStateFromProps,typeof N=="function"&&(uv(l,d,N,p),E.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(N=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),N!==E.state&&dv.enqueueReplaceState(E,E.state,null),Fd(l,p,E,b),zd(),E.state=l.memoizedState),typeof E.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){E=l.stateNode;var k=l.memoizedProps,Q=Kl(d,k);E.props=Q;var fe=E.context,xe=d.contextType;N=Bc,typeof xe=="object"&&xe!==null&&(N=Ir(xe));var be=d.getDerivedStateFromProps;xe=typeof be=="function"||typeof E.getSnapshotBeforeUpdate=="function",k=l.pendingProps!==k,xe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(k||fe!==N)&&fE(l,E,p,N),Ei=!1;var he=l.memoizedState;E.state=he,Fd(l,p,E,b),zd(),fe=l.memoizedState,k||he!==fe||Ei?(typeof be=="function"&&(uv(l,d,be,p),fe=l.memoizedState),(Q=Ei||dE(l,d,Q,p,he,fe,N))?(xe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(l.flags|=4194308)):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=fe),E.props=p,E.state=fe,E.context=N,p=Q):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{E=l.stateNode,Hx(o,l),N=l.memoizedProps,xe=Kl(d,N),E.props=xe,be=l.pendingProps,he=E.context,fe=d.contextType,Q=Bc,typeof fe=="object"&&fe!==null&&(Q=Ir(fe)),k=d.getDerivedStateFromProps,(fe=typeof k=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(N!==be||he!==Q)&&fE(l,E,p,Q),Ei=!1,he=l.memoizedState,E.state=he,Fd(l,p,E,b),zd();var pe=l.memoizedState;N!==be||he!==pe||Ei||o!==null&&o.dependencies!==null&&cm(o.dependencies)?(typeof k=="function"&&(uv(l,d,k,p),pe=l.memoizedState),(xe=Ei||dE(l,d,xe,p,he,pe,Q)||o!==null&&o.dependencies!==null&&cm(o.dependencies))?(fe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(p,pe,Q),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(p,pe,Q)),typeof E.componentDidUpdate=="function"&&(l.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof E.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=pe),E.props=p,E.state=pe,E.context=Q,p=xe):(typeof E.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),p=!1)}return E=p,_m(o,l),p=(l.flags&128)!==0,E||p?(E=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:E.render(),l.flags|=1,o!==null&&p?(l.child=Gl(l,o.child,null,b),l.child=Gl(l,null,d,b)):Mr(o,l,d,b),l.memoizedState=E.state,o=l.child):o=Io(o,l,b),o}function TE(o,l,d,p){return zl(),l.flags|=256,Mr(o,l,d,p),l.child}var pv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gv(o){return{baseLanes:o,cachePool:gw()}}function yv(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=Ua),o}function _E(o,l,d){var p=l.pendingProps,b=!1,E=(l.flags&128)!==0,N;if((N=E)||(N=o!==null&&o.memoizedState===null?!1:(rr.current&2)!==0),N&&(b=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if(Kt){if(b?Ti(l):_i(),(o=Ln)?(o=LR(o,is),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:bi!==null?{id:Zs,overflow:Ys}:null,retryLane:536870912,hydrationErrors:null},d=iw(o),d.return=l,l.child=d,Or=l,Ln=null)):o=null,o===null)throw Ci(l);return Jv(o)?l.lanes=32:l.lanes=536870912,null}var k=p.children;return p=p.fallback,b?(_i(),b=l.mode,k=Nm({mode:"hidden",children:k},b),p=Ul(p,b,d,null),k.return=l,p.return=l,k.sibling=p,l.child=k,p=l.child,p.memoizedState=gv(d),p.childLanes=yv(o,N,d),l.memoizedState=pv,Gd(null,p)):(Ti(l),xv(l,k))}var Q=o.memoizedState;if(Q!==null&&(k=Q.dehydrated,k!==null)){if(E)l.flags&256?(Ti(l),l.flags&=-257,l=vv(o,l,d)):l.memoizedState!==null?(_i(),l.child=o.child,l.flags|=128,l=null):(_i(),k=p.fallback,b=l.mode,p=Nm({mode:"visible",children:p.children},b),k=Ul(k,b,d,null),k.flags|=2,p.return=l,k.return=l,p.sibling=k,l.child=p,Gl(l,o.child,null,d),p=l.child,p.memoizedState=gv(d),p.childLanes=yv(o,N,d),l.memoizedState=pv,l=Gd(null,p));else if(Ti(l),Jv(k)){if(N=k.nextSibling&&k.nextSibling.dataset,N)var fe=N.dgst;N=fe,p=Error(r(419)),p.stack="",p.digest=N,Id({value:p,source:null,stack:null}),l=vv(o,l,d)}else if(cr||Zc(o,l,d,!1),N=(d&o.childLanes)!==0,cr||N){if(N=Nn,N!==null&&(p=le(N,d),p!==0&&p!==Q.retryLane))throw Q.retryLane=p,Pl(o,p),wa(N,o,p),hv;Qv(k)||Um(),l=vv(o,l,d)}else Qv(k)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,Ln=cs(k.nextSibling),Or=l,Kt=!0,Si=null,is=!1,o!==null&&uw(l,o),l=xv(l,p.children),l.flags|=4096);return l}return b?(_i(),k=p.fallback,b=l.mode,Q=o.child,fe=Q.sibling,p=To(Q,{mode:"hidden",children:p.children}),p.subtreeFlags=Q.subtreeFlags&65011712,fe!==null?k=To(fe,k):(k=Ul(k,b,d,null),k.flags|=2),k.return=l,p.return=l,p.sibling=k,l.child=p,Gd(null,p),p=l.child,k=o.child.memoizedState,k===null?k=gv(d):(b=k.cachePool,b!==null?(Q=ir._currentValue,b=b.parent!==Q?{parent:Q,pool:Q}:b):b=gw(),k={baseLanes:k.baseLanes|d,cachePool:b}),p.memoizedState=k,p.childLanes=yv(o,N,d),l.memoizedState=pv,Gd(o.child,p)):(Ti(l),d=o.child,o=d.sibling,d=To(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,o!==null&&(N=l.deletions,N===null?(l.deletions=[o],l.flags|=16):N.push(o)),l.child=d,l.memoizedState=null,d)}function xv(o,l){return l=Nm({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Nm(o,l){return o=Ma(22,o,null,l),o.lanes=0,o}function vv(o,l,d){return Gl(l,o.child,null,d),o=xv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function NE(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),Mx(o.return,l,d)}function bv(o,l,d,p,b,E){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:E}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=d,N.tailMode=b,N.treeForkCount=E)}function AE(o,l,d){var p=l.pendingProps,b=p.revealOrder,E=p.tail;p=p.children;var N=rr.current,k=(N&2)!==0;if(k?(N=N&1|2,l.flags|=128):N&=1,F(rr,N),Mr(o,l,p,d),p=Kt?Od:0,!k&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&NE(o,d,l);else if(o.tag===19)NE(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(b){case"forwards":for(d=l.child,b=null;d!==null;)o=d.alternate,o!==null&&ym(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),bv(l,!1,b,d,E,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&ym(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}bv(l,!0,d,null,E,p);break;case"together":bv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function Io(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Di|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(Zc(o,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,d=To(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=To(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function Sv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&cm(o)))}function uk(o,l,d){switch(l.tag){case 3:ce(l,l.stateNode.containerInfo),wi(l,ir,o.memoizedState.cache),zl();break;case 27:case 5:Se(l);break;case 4:ce(l,l.stateNode.containerInfo);break;case 10:wi(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,qx(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(Ti(l),l.flags|=128,null):(d&l.child.childLanes)!==0?_E(o,l,d):(Ti(l),o=Io(o,l,d),o!==null?o.sibling:null);Ti(l);break;case 19:var b=(o.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(Zc(o,l,d,!1),p=(d&l.childLanes)!==0),b){if(p)return AE(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),F(rr,rr.current),p)break;return null;case 22:return l.lanes=0,CE(o,l,d,l.pendingProps);case 24:wi(l,ir,o.memoizedState.cache)}return Io(o,l,d)}function DE(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)cr=!0;else{if(!Sv(o,d)&&(l.flags&128)===0)return cr=!1,uk(o,l,d);cr=(o.flags&131072)!==0}else cr=!1,Kt&&(l.flags&1048576)!==0&&cw(l,Od,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Vl(l.elementType),l.type=o,typeof o=="function")jx(o)?(p=Kl(o,p),l.tag=1,l=jE(null,l,o,p,d)):(l.tag=0,l=mv(null,l,o,p,d));else{if(o!=null){var b=o.$$typeof;if(b===I){l.tag=11,l=vE(null,l,o,p,d);break e}else if(b===T){l.tag=14,l=bE(null,l,o,p,d);break e}}throw l=q(o)||o,Error(r(306,l,""))}}return l;case 0:return mv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,b=Kl(p,l.pendingProps),jE(o,l,p,b,d);case 3:e:{if(ce(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var E=l.memoizedState;b=E.element,Hx(o,l),Fd(l,p,null,d);var N=l.memoizedState;if(p=N.cache,wi(l,ir,p),p!==E.cache&&kx(l,[ir],d,!0),zd(),p=N.element,E.isDehydrated)if(E={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){l=TE(o,l,p,d);break e}else if(p!==b){b=as(Error(r(424)),l),Id(b),l=TE(o,l,p,d);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Ln=cs(o.firstChild),Or=l,Kt=!0,Si=null,is=!0,d=Cw(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(zl(),p===b){l=Io(o,l,d);break e}Mr(o,l,p,d)}l=l.child}return l;case 26:return _m(o,l),o===null?(d=$R(l.type,null,l.pendingProps,null))?l.memoizedState=d:Kt||(d=l.type,o=l.pendingProps,p=Gm(ae.current).createElement(d),p[Ue]=l,p[Ve]=o,kr(p,d,o),pn(p),l.stateNode=p):l.memoizedState=$R(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Se(l),o===null&&Kt&&(p=l.stateNode=zR(l.type,l.pendingProps,ae.current),Or=l,is=!0,b=Ln,Li(l.type)?(e0=b,Ln=cs(p.firstChild)):Ln=b),Mr(o,l,l.pendingProps.children,d),_m(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Kt&&((b=p=Ln)&&(p=Fk(p,l.type,l.pendingProps,is),p!==null?(l.stateNode=p,Or=l,Ln=cs(p.firstChild),is=!1,b=!0):b=!1),b||Ci(l)),Se(l),b=l.type,E=l.pendingProps,N=o!==null?o.memoizedProps:null,p=E.children,Yv(b,E)?p=null:N!==null&&Yv(b,N)&&(l.flags|=32),l.memoizedState!==null&&(b=Zx(o,l,tk,null,null,d),of._currentValue=b),_m(o,l),Mr(o,l,p,d),l.child;case 6:return o===null&&Kt&&((o=d=Ln)&&(d=Hk(d,l.pendingProps,is),d!==null?(l.stateNode=d,Or=l,Ln=null,o=!0):o=!1),o||Ci(l)),null;case 13:return _E(o,l,d);case 4:return ce(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=Gl(l,null,p,d):Mr(o,l,p,d),l.child;case 11:return vE(o,l,l.type,l.pendingProps,d);case 7:return Mr(o,l,l.pendingProps,d),l.child;case 8:return Mr(o,l,l.pendingProps.children,d),l.child;case 12:return Mr(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,wi(l,l.type,p.value),Mr(o,l,p.children,d),l.child;case 9:return b=l.type._context,p=l.pendingProps.children,Hl(l),b=Ir(b),p=p(b),l.flags|=1,Mr(o,l,p,d),l.child;case 14:return bE(o,l,l.type,l.pendingProps,d);case 15:return SE(o,l,l.type,l.pendingProps,d);case 19:return AE(o,l,d);case 31:return ck(o,l,d);case 22:return CE(o,l,d,l.pendingProps);case 24:return Hl(l),p=Ir(ir),o===null?(b=Ux(),b===null&&(b=Nn,E=Lx(),b.pooledCache=E,E.refCount++,E!==null&&(b.pooledCacheLanes|=d),b=E),l.memoizedState={parent:p,cache:b},Fx(l),wi(l,ir,b)):((o.lanes&d)!==0&&(Hx(o,l),Fd(l,null,null,d),zd()),b=o.memoizedState,E=l.memoizedState,b.parent!==p?(b={parent:p,cache:p},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),wi(l,ir,p)):(p=E.cache,wi(l,ir,p),p!==b.cache&&kx(l,[ir],d,!0))),Mr(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Mo(o){o.flags|=4}function Cv(o,l,d,p,b){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(b&335544128)===b)if(o.stateNode.complete)o.flags|=8192;else if(aR())o.flags|=8192;else throw Bl=hm,zx}else o.flags&=-16777217}function OE(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!KR(l))if(aR())o.flags|=8192;else throw Bl=hm,zx}function Am(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?qt():536870912,o.lanes|=l,ou|=l)}function qd(o,l){if(!Kt)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function Pn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,p=0;if(l)for(var b=o.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=p,o.childLanes=d,l}function dk(o,l,d){var p=l.pendingProps;switch(Ax(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pn(l),null;case 1:return Pn(l),null;case 3:return d=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Ao(ir),ye(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Kc(l)?Mo(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ox())),Pn(l),null;case 26:var b=l.type,E=l.memoizedState;return o===null?(Mo(l),E!==null?(Pn(l),OE(l,E)):(Pn(l),Cv(l,b,null,p,d))):E?E!==o.memoizedState?(Mo(l),Pn(l),OE(l,E)):(Pn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&Mo(l),Pn(l),Cv(l,b,o,p,d)),null;case 27:if(Me(l),d=ae.current,b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Mo(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Pn(l),null}o=W.current,Kc(l)?dw(l):(o=zR(b,p,d),l.stateNode=o,Mo(l))}return Pn(l),null;case 5:if(Me(l),b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Mo(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Pn(l),null}if(E=W.current,Kc(l))dw(l);else{var N=Gm(ae.current);switch(E){case 1:E=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:E=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":E=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":E=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":E=N.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?E.multiple=!0:p.size&&(E.size=p.size);break;default:E=typeof p.is=="string"?N.createElement(b,{is:p.is}):N.createElement(b)}}E[Ue]=l,E[Ve]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)E.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===l)break e;for(;N.sibling===null;){if(N.return===null||N.return===l)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}l.stateNode=E;e:switch(kr(E,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Mo(l)}}return Pn(l),Cv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&Mo(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=ae.current,Kc(l)){if(o=l.stateNode,d=l.memoizedProps,p=null,b=Or,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}o[Ue]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||_R(o.nodeValue,d)),o||Ci(l,!0)}else o=Gm(o).createTextNode(p),o[Ue]=l,l.stateNode=o}return Pn(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(p=Kc(l),d!==null){if(o===null){if(!p)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Ue]=l}else zl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pn(l),o=!1}else d=Ox(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(La(l),l):(La(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Pn(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(b=Kc(l),p!==null&&p.dehydrated!==null){if(o===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Ue]=l}else zl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pn(l),b=!1}else b=Ox(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(La(l),l):(La(l),null)}return La(l),(l.flags&128)!==0?(l.lanes=d,l):(d=p!==null,o=o!==null&&o.memoizedState!==null,d&&(p=l.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),E=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(E=p.memoizedState.cachePool.pool),E!==b&&(p.flags|=2048)),d!==o&&d&&(l.child.flags|=8192),Am(l,l.updateQueue),Pn(l),null);case 4:return ye(),o===null&&Bv(l.stateNode.containerInfo),Pn(l),null;case 10:return Ao(l.type),Pn(l),null;case 19:if(U(rr),p=l.memoizedState,p===null)return Pn(l),null;if(b=(l.flags&128)!==0,E=p.rendering,E===null)if(b)qd(p,!1);else{if(Xn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(E=ym(o),E!==null){for(l.flags|=128,qd(p,!1),o=E.updateQueue,l.updateQueue=o,Am(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)ow(d,o),d=d.sibling;return F(rr,rr.current&1|2),Kt&&_o(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&Ee()>km&&(l.flags|=128,b=!0,qd(p,!1),l.lanes=4194304)}else{if(!b)if(o=ym(E),o!==null){if(l.flags|=128,b=!0,o=o.updateQueue,l.updateQueue=o,Am(l,o),qd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!E.alternate&&!Kt)return Pn(l),null}else 2*Ee()-p.renderingStartTime>km&&d!==536870912&&(l.flags|=128,b=!0,qd(p,!1),l.lanes=4194304);p.isBackwards?(E.sibling=l.child,l.child=E):(o=p.last,o!==null?o.sibling=E:l.child=E,p.last=E)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Ee(),o.sibling=null,d=rr.current,F(rr,b?d&1|2:d&1),Kt&&_o(l,p.treeForkCount),o):(Pn(l),null);case 22:case 23:return La(l),Gx(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(d&536870912)!==0&&(l.flags&128)===0&&(Pn(l),l.subtreeFlags&6&&(l.flags|=8192)):Pn(l),d=l.updateQueue,d!==null&&Am(l,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),o!==null&&U($l),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Ao(ir),Pn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function fk(o,l){switch(Ax(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Ao(ir),ye(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Me(l),null;case 31:if(l.memoizedState!==null){if(La(l),l.alternate===null)throw Error(r(340));zl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(La(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));zl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return U(rr),null;case 4:return ye(),null;case 10:return Ao(l.type),null;case 22:case 23:return La(l),Gx(),o!==null&&U($l),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Ao(ir),null;case 25:return null;default:return null}}function IE(o,l){switch(Ax(l),l.tag){case 3:Ao(ir),ye();break;case 26:case 27:case 5:Me(l);break;case 4:ye();break;case 31:l.memoizedState!==null&&La(l);break;case 13:La(l);break;case 19:U(rr);break;case 10:Ao(l.type);break;case 22:case 23:La(l),Gx(),o!==null&&U($l);break;case 24:Ao(ir)}}function Kd(o,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&o)===o){p=void 0;var E=d.create,N=d.inst;p=E(),N.destroy=p}d=d.next}while(d!==b)}}catch(k){yn(l,l.return,k)}}function Ni(o,l,d){try{var p=l.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var E=b.next;p=E;do{if((p.tag&o)===o){var N=p.inst,k=N.destroy;if(k!==void 0){N.destroy=void 0,b=l;var Q=d,fe=k;try{fe()}catch(xe){yn(b,Q,xe)}}}p=p.next}while(p!==E)}}catch(xe){yn(l,l.return,xe)}}function ME(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{Ew(l,d)}catch(p){yn(o,o.return,p)}}}function kE(o,l,d){d.props=Kl(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){yn(o,l,p)}}function Zd(o,l){try{var d=o.ref;if(d!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof d=="function"?o.refCleanup=d(p):d.current=p}}catch(b){yn(o,l,b)}}function Ws(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){yn(o,l,b)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){yn(o,l,b)}else d.current=null}function LE(o){var l=o.type,d=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(b){yn(o,o.return,b)}}function wv(o,l,d){try{var p=o.stateNode;Mk(p,o.type,d,l),p[Ve]=l}catch(b){yn(o,o.return,b)}}function PE(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Li(o.type)||o.tag===4}function Ev(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||PE(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Li(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Rv(o,l,d){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(o,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(o),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Ro));else if(p!==4&&(p===27&&Li(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(Rv(o,l,d),o=o.sibling;o!==null;)Rv(o,l,d),o=o.sibling}function Dm(o,l,d){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(p!==4&&(p===27&&Li(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Dm(o,l,d),o=o.sibling;o!==null;)Dm(o,l,d),o=o.sibling}function UE(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);kr(l,p,d),l[Ue]=o,l[Ve]=d}catch(E){yn(o,o.return,E)}}var ko=!1,ur=!1,jv=!1,zE=typeof WeakSet=="function"?WeakSet:Set,Er=null;function hk(o,l){if(o=o.containerInfo,Kv=Qm,o=XC(o),vx(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var b=p.anchorOffset,E=p.focusNode;p=p.focusOffset;try{d.nodeType,E.nodeType}catch{d=null;break e}var N=0,k=-1,Q=-1,fe=0,xe=0,be=o,he=null;t:for(;;){for(var pe;be!==d||b!==0&&be.nodeType!==3||(k=N+b),be!==E||p!==0&&be.nodeType!==3||(Q=N+p),be.nodeType===3&&(N+=be.nodeValue.length),(pe=be.firstChild)!==null;)he=be,be=pe;for(;;){if(be===o)break t;if(he===d&&++fe===b&&(k=N),he===E&&++xe===p&&(Q=N),(pe=be.nextSibling)!==null)break;be=he,he=be.parentNode}be=pe}d=k===-1||Q===-1?null:{start:k,end:Q}}else d=null}d=d||{start:0,end:0}}else d=null;for(Zv={focusedElem:o,selectionRange:d},Qm=!1,Er=l;Er!==null;)if(l=Er,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Er=o;else for(;Er!==null;){switch(l=Er,E=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(d=0;d<o.length;d++)b=o[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&E!==null){o=void 0,d=l,b=E.memoizedProps,E=E.memoizedState,p=d.stateNode;try{var Ke=Kl(d.type,b);o=p.getSnapshotBeforeUpdate(Ke,E),p.__reactInternalSnapshotBeforeUpdate=o}catch(it){yn(d,d.return,it)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)Xv(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Xv(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Er=o;break}Er=l.return}}function FE(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Po(o,d),p&4&&Kd(5,d);break;case 1:if(Po(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(N){yn(d,d.return,N)}else{var b=Kl(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(b,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){yn(d,d.return,N)}}p&64&&ME(d),p&512&&Zd(d,d.return);break;case 3:if(Po(o,d),p&64&&(o=d.updateQueue,o!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{Ew(o,l)}catch(N){yn(d,d.return,N)}}break;case 27:l===null&&p&4&&UE(d);case 26:case 5:Po(o,d),l===null&&p&4&&LE(d),p&512&&Zd(d,d.return);break;case 12:Po(o,d);break;case 31:Po(o,d),p&4&&VE(o,d);break;case 13:Po(o,d),p&4&&BE(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=Ck.bind(null,d),$k(o,d))));break;case 22:if(p=d.memoizedState!==null||ko,!p){l=l!==null&&l.memoizedState!==null||ur,b=ko;var E=ur;ko=p,(ur=l)&&!E?Uo(o,d,(d.subtreeFlags&8772)!==0):Po(o,d),ko=b,ur=E}break;case 30:break;default:Po(o,d)}}function HE(o){var l=o.alternate;l!==null&&(o.alternate=null,HE(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&mn(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Vn=null,va=!1;function Lo(o,l,d){for(d=d.child;d!==null;)$E(o,l,d),d=d.sibling}function $E(o,l,d){if(Hn&&typeof Hn.onCommitFiberUnmount=="function")try{Hn.onCommitFiberUnmount(Gn,d)}catch{}switch(d.tag){case 26:ur||Ws(d,l),Lo(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ur||Ws(d,l);var p=Vn,b=va;Li(d.type)&&(Vn=d.stateNode,va=!1),Lo(o,l,d),rf(d.stateNode),Vn=p,va=b;break;case 5:ur||Ws(d,l);case 6:if(p=Vn,b=va,Vn=null,Lo(o,l,d),Vn=p,va=b,Vn!==null)if(va)try{(Vn.nodeType===9?Vn.body:Vn.nodeName==="HTML"?Vn.ownerDocument.body:Vn).removeChild(d.stateNode)}catch(E){yn(d,l,E)}else try{Vn.removeChild(d.stateNode)}catch(E){yn(d,l,E)}break;case 18:Vn!==null&&(va?(o=Vn,MR(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),mu(o)):MR(Vn,d.stateNode));break;case 4:p=Vn,b=va,Vn=d.stateNode.containerInfo,va=!0,Lo(o,l,d),Vn=p,va=b;break;case 0:case 11:case 14:case 15:Ni(2,d,l),ur||Ni(4,d,l),Lo(o,l,d);break;case 1:ur||(Ws(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&kE(d,l,p)),Lo(o,l,d);break;case 21:Lo(o,l,d);break;case 22:ur=(p=ur)||d.memoizedState!==null,Lo(o,l,d),ur=p;break;default:Lo(o,l,d)}}function VE(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{mu(o)}catch(d){yn(l,l.return,d)}}}function BE(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{mu(o)}catch(d){yn(l,l.return,d)}}function mk(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new zE),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new zE),l;default:throw Error(r(435,o.tag))}}function Om(o,l){var d=mk(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var b=wk.bind(null,o,p);p.then(b,b)}})}function ba(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],E=o,N=l,k=N;e:for(;k!==null;){switch(k.tag){case 27:if(Li(k.type)){Vn=k.stateNode,va=!1;break e}break;case 5:Vn=k.stateNode,va=!1;break e;case 3:case 4:Vn=k.stateNode.containerInfo,va=!0;break e}k=k.return}if(Vn===null)throw Error(r(160));$E(E,N,b),Vn=null,va=!1,E=b.alternate,E!==null&&(E.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)GE(l,o),l=l.sibling}var ws=null;function GE(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:ba(l,o),Sa(o),p&4&&(Ni(3,o,o.return),Kd(3,o),Ni(5,o,o.return));break;case 1:ba(l,o),Sa(o),p&512&&(ur||d===null||Ws(d,d.return)),p&64&&ko&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(d=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var b=ws;if(ba(l,o),Sa(o),p&512&&(ur||d===null||Ws(d,d.return)),p&4){var E=d!==null?d.memoizedState:null;if(p=o.memoizedState,d===null)if(p===null)if(o.stateNode===null){e:{p=o.type,d=o.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":E=b.getElementsByTagName("title")[0],(!E||E[$n]||E[Ue]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=b.createElement(p),b.head.insertBefore(E,b.querySelector("head > title"))),kr(E,p,d),E[Ue]=o,pn(E),p=E;break e;case"link":var N=GR("link","href",b).get(p+(d.href||""));if(N){for(var k=0;k<N.length;k++)if(E=N[k],E.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&E.getAttribute("rel")===(d.rel==null?null:d.rel)&&E.getAttribute("title")===(d.title==null?null:d.title)&&E.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){N.splice(k,1);break t}}E=b.createElement(p),kr(E,p,d),b.head.appendChild(E);break;case"meta":if(N=GR("meta","content",b).get(p+(d.content||""))){for(k=0;k<N.length;k++)if(E=N[k],E.getAttribute("content")===(d.content==null?null:""+d.content)&&E.getAttribute("name")===(d.name==null?null:d.name)&&E.getAttribute("property")===(d.property==null?null:d.property)&&E.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&E.getAttribute("charset")===(d.charSet==null?null:d.charSet)){N.splice(k,1);break t}}E=b.createElement(p),kr(E,p,d),b.head.appendChild(E);break;default:throw Error(r(468,p))}E[Ue]=o,pn(E),p=E}o.stateNode=p}else qR(b,o.type,o.stateNode);else o.stateNode=BR(b,p,o.memoizedProps);else E!==p?(E===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):E.count--,p===null?qR(b,o.type,o.stateNode):BR(b,p,o.memoizedProps)):p===null&&o.stateNode!==null&&wv(o,o.memoizedProps,d.memoizedProps)}break;case 27:ba(l,o),Sa(o),p&512&&(ur||d===null||Ws(d,d.return)),d!==null&&p&4&&wv(o,o.memoizedProps,d.memoizedProps);break;case 5:if(ba(l,o),Sa(o),p&512&&(ur||d===null||Ws(d,d.return)),o.flags&32){b=o.stateNode;try{Pc(b,"")}catch(Ke){yn(o,o.return,Ke)}}p&4&&o.stateNode!=null&&(b=o.memoizedProps,wv(o,b,d!==null?d.memoizedProps:b)),p&1024&&(jv=!0);break;case 6:if(ba(l,o),Sa(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(Ke){yn(o,o.return,Ke)}}break;case 3:if(Zm=null,b=ws,ws=qm(l.containerInfo),ba(l,o),ws=b,Sa(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{mu(l.containerInfo)}catch(Ke){yn(o,o.return,Ke)}jv&&(jv=!1,qE(o));break;case 4:p=ws,ws=qm(o.stateNode.containerInfo),ba(l,o),Sa(o),ws=p;break;case 12:ba(l,o),Sa(o);break;case 31:ba(l,o),Sa(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Om(o,p)));break;case 13:ba(l,o),Sa(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Mm=Ee()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Om(o,p)));break;case 22:b=o.memoizedState!==null;var Q=d!==null&&d.memoizedState!==null,fe=ko,xe=ur;if(ko=fe||b,ur=xe||Q,ba(l,o),ur=xe,ko=fe,Sa(o),p&8192)e:for(l=o.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(d===null||Q||ko||ur||Zl(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){Q=d=l;try{if(E=Q.stateNode,b)N=E.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{k=Q.stateNode;var be=Q.memoizedProps.style,he=be!=null&&be.hasOwnProperty("display")?be.display:null;k.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Ke){yn(Q,Q.return,Ke)}}}else if(l.tag===6){if(d===null){Q=l;try{Q.stateNode.nodeValue=b?"":Q.memoizedProps}catch(Ke){yn(Q,Q.return,Ke)}}}else if(l.tag===18){if(d===null){Q=l;try{var pe=Q.stateNode;b?kR(pe,!0):kR(Q.stateNode,!1)}catch(Ke){yn(Q,Q.return,Ke)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,Om(o,d))));break;case 19:ba(l,o),Sa(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Om(o,p)));break;case 30:break;case 21:break;default:ba(l,o),Sa(o)}}function Sa(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if(PE(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,E=Ev(o);Dm(o,E,b);break;case 5:var N=d.stateNode;d.flags&32&&(Pc(N,""),d.flags&=-33);var k=Ev(o);Dm(o,k,N);break;case 3:case 4:var Q=d.stateNode.containerInfo,fe=Ev(o);Rv(o,fe,Q);break;default:throw Error(r(161))}}catch(xe){yn(o,o.return,xe)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function qE(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;qE(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Po(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)FE(o,l.alternate,l),l=l.sibling}function Zl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ni(4,l,l.return),Zl(l);break;case 1:Ws(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&kE(l,l.return,d),Zl(l);break;case 27:rf(l.stateNode);case 26:case 5:Ws(l,l.return),Zl(l);break;case 22:l.memoizedState===null&&Zl(l);break;case 30:Zl(l);break;default:Zl(l)}o=o.sibling}}function Uo(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,b=o,E=l,N=E.flags;switch(E.tag){case 0:case 11:case 15:Uo(b,E,d),Kd(4,E);break;case 1:if(Uo(b,E,d),p=E,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(fe){yn(p,p.return,fe)}if(p=E,b=p.updateQueue,b!==null){var k=p.stateNode;try{var Q=b.shared.hiddenCallbacks;if(Q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Q.length;b++)ww(Q[b],k)}catch(fe){yn(p,p.return,fe)}}d&&N&64&&ME(E),Zd(E,E.return);break;case 27:UE(E);case 26:case 5:Uo(b,E,d),d&&p===null&&N&4&&LE(E),Zd(E,E.return);break;case 12:Uo(b,E,d);break;case 31:Uo(b,E,d),d&&N&4&&VE(b,E);break;case 13:Uo(b,E,d),d&&N&4&&BE(b,E);break;case 22:E.memoizedState===null&&Uo(b,E,d),Zd(E,E.return);break;case 30:break;default:Uo(b,E,d)}l=l.sibling}}function Tv(o,l){var d=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==d&&(o!=null&&o.refCount++,d!=null&&Md(d))}function _v(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Md(o))}function Es(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)KE(o,l,d,p),l=l.sibling}function KE(o,l,d,p){var b=l.flags;switch(l.tag){case 0:case 11:case 15:Es(o,l,d,p),b&2048&&Kd(9,l);break;case 1:Es(o,l,d,p);break;case 3:Es(o,l,d,p),b&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Md(o)));break;case 12:if(b&2048){Es(o,l,d,p),o=l.stateNode;try{var E=l.memoizedProps,N=E.id,k=E.onPostCommit;typeof k=="function"&&k(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){yn(l,l.return,Q)}}else Es(o,l,d,p);break;case 31:Es(o,l,d,p);break;case 13:Es(o,l,d,p);break;case 23:break;case 22:E=l.stateNode,N=l.alternate,l.memoizedState!==null?E._visibility&2?Es(o,l,d,p):Yd(o,l):E._visibility&2?Es(o,l,d,p):(E._visibility|=2,ru(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),b&2048&&Tv(N,l);break;case 24:Es(o,l,d,p),b&2048&&_v(l.alternate,l);break;default:Es(o,l,d,p)}}function ru(o,l,d,p,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var E=o,N=l,k=d,Q=p,fe=N.flags;switch(N.tag){case 0:case 11:case 15:ru(E,N,k,Q,b),Kd(8,N);break;case 23:break;case 22:var xe=N.stateNode;N.memoizedState!==null?xe._visibility&2?ru(E,N,k,Q,b):Yd(E,N):(xe._visibility|=2,ru(E,N,k,Q,b)),b&&fe&2048&&Tv(N.alternate,N);break;case 24:ru(E,N,k,Q,b),b&&fe&2048&&_v(N.alternate,N);break;default:ru(E,N,k,Q,b)}l=l.sibling}}function Yd(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=o,p=l,b=p.flags;switch(p.tag){case 22:Yd(d,p),b&2048&&Tv(p.alternate,p);break;case 24:Yd(d,p),b&2048&&_v(p.alternate,p);break;default:Yd(d,p)}l=l.sibling}}var Wd=8192;function au(o,l,d){if(o.subtreeFlags&Wd)for(o=o.child;o!==null;)ZE(o,l,d),o=o.sibling}function ZE(o,l,d){switch(o.tag){case 26:au(o,l,d),o.flags&Wd&&o.memoizedState!==null&&e9(d,ws,o.memoizedState,o.memoizedProps);break;case 5:au(o,l,d);break;case 3:case 4:var p=ws;ws=qm(o.stateNode.containerInfo),au(o,l,d),ws=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Wd,Wd=16777216,au(o,l,d),Wd=p):au(o,l,d));break;default:au(o,l,d)}}function YE(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function Xd(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Er=p,XE(p,o)}YE(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)WE(o),o=o.sibling}function WE(o){switch(o.tag){case 0:case 11:case 15:Xd(o),o.flags&2048&&Ni(9,o,o.return);break;case 3:Xd(o);break;case 12:Xd(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Im(o)):Xd(o);break;default:Xd(o)}}function Im(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Er=p,XE(p,o)}YE(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ni(8,l,l.return),Im(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Im(l));break;default:Im(l)}o=o.sibling}}function XE(o,l){for(;Er!==null;){var d=Er;switch(d.tag){case 0:case 11:case 15:Ni(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Md(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Er=p;else e:for(d=o;Er!==null;){p=Er;var b=p.sibling,E=p.return;if(HE(p),p===d){Er=null;break e}if(b!==null){b.return=E,Er=b;break e}Er=E}}}var pk={getCacheForType:function(o){var l=Ir(ir),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return Ir(ir).controller.signal}},gk=typeof WeakMap=="function"?WeakMap:Map,cn=0,Nn=null,Ut=null,Vt=0,gn=0,Pa=null,Ai=!1,su=!1,Nv=!1,zo=0,Xn=0,Di=0,Yl=0,Av=0,Ua=0,ou=0,Qd=null,Ca=null,Dv=!1,Mm=0,QE=0,km=1/0,Lm=null,Oi=null,gr=0,Ii=null,iu=null,Fo=0,Ov=0,Iv=null,JE=null,Jd=0,Mv=null;function za(){return(cn&2)!==0&&Vt!==0?Vt&-Vt:M.T!==null?Fv():He()}function eR(){if(Ua===0)if((Vt&536870912)===0||Kt){var o=es;es<<=1,(es&3932160)===0&&(es=262144),Ua=o}else Ua=536870912;return o=ka.current,o!==null&&(o.flags|=32),Ua}function wa(o,l,d){(o===Nn&&(gn===2||gn===9)||o.cancelPendingCommit!==null)&&(lu(o,0),Mi(o,Vt,Ua,!1)),nn(o,d),((cn&2)===0||o!==Nn)&&(o===Nn&&((cn&2)===0&&(Yl|=d),Xn===4&&Mi(o,Vt,Ua,!1)),Xs(o))}function tR(o,l,d){if((cn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||Ft(o,l),b=p?vk(o,l):Lv(o,l,!0),E=p;do{if(b===0){su&&!p&&Mi(o,l,0,!1);break}else{if(d=o.current.alternate,E&&!yk(d)){b=Lv(o,l,!1),E=!1;continue}if(b===2){if(E=l,o.errorRecoveryDisabledLanes&E)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var k=o;b=Qd;var Q=k.current.memoizedState.isDehydrated;if(Q&&(lu(k,N).flags|=256),N=Lv(k,N,!1),N!==2){if(Nv&&!Q){k.errorRecoveryDisabledLanes|=E,Yl|=E,b=4;break e}E=Ca,Ca=b,E!==null&&(Ca===null?Ca=E:Ca.push.apply(Ca,E))}b=N}if(E=!1,b!==2)continue}}if(b===1){lu(o,0),Mi(o,l,0,!0);break}e:{switch(p=o,E=b,E){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Mi(p,l,Ua,!Ai);break e;case 2:Ca=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=Mm+300-Ee(),10<b)){if(Mi(p,l,Ua,!Ai),We(p,0,!0)!==0)break e;Fo=l,p.timeoutHandle=OR(nR.bind(null,p,d,Ca,Lm,Dv,l,Ua,Yl,ou,Ai,E,"Throttled",-0,0),b);break e}nR(p,d,Ca,Lm,Dv,l,Ua,Yl,ou,Ai,E,null,-0,0)}}break}while(!0);Xs(o)}function nR(o,l,d,p,b,E,N,k,Q,fe,xe,be,he,pe){if(o.timeoutHandle=-1,be=l.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ro},ZE(l,E,be);var Ke=(E&62914560)===E?Mm-Ee():(E&4194048)===E?QE-Ee():0;if(Ke=t9(be,Ke),Ke!==null){Fo=E,o.cancelPendingCommit=Ke(uR.bind(null,o,l,E,d,p,b,N,k,Q,xe,be,null,he,pe)),Mi(o,E,N,!fe);return}}uR(o,l,E,d,p,b,N,k,Q)}function yk(o){for(var l=o;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var b=d[p],E=b.getSnapshot;b=b.value;try{if(!Ia(E(),b))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Mi(o,l,d,p){l&=~Av,l&=~Yl,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var b=l;0<b;){var E=31-kn(b),N=1<<E;p[E]=-1,b&=~N}d!==0&&Y(o,d,l)}function Pm(){return(cn&6)===0?(ef(0),!1):!0}function kv(){if(Ut!==null){if(gn===0)var o=Ut.return;else o=Ut,No=Fl=null,Xx(o),Qc=null,Ld=0,o=Ut;for(;o!==null;)IE(o.alternate,o),o=o.return;Ut=null}}function lu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,Pk(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Fo=0,kv(),Nn=o,Ut=d=To(o.current,null),Vt=l,gn=0,Pa=null,Ai=!1,su=Ft(o,l),Nv=!1,ou=Ua=Av=Yl=Di=Xn=0,Ca=Qd=null,Dv=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var b=31-kn(p),E=1<<b;l|=o[b],p&=~E}return zo=l,am(),d}function rR(o,l){vt=null,M.H=Bd,l===Xc||l===fm?(l=vw(),gn=3):l===zx?(l=vw(),gn=4):gn=l===hv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Pa=l,Ut===null&&(Xn=1,jm(o,as(l,o.current)))}function aR(){var o=ka.current;return o===null?!0:(Vt&4194048)===Vt?ls===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?o===ls:!1}function sR(){var o=M.H;return M.H=Bd,o===null?Bd:o}function oR(){var o=M.A;return M.A=pk,o}function Um(){Xn=4,Ai||(Vt&4194048)!==Vt&&ka.current!==null||(su=!0),(Di&134217727)===0&&(Yl&134217727)===0||Nn===null||Mi(Nn,Vt,Ua,!1)}function Lv(o,l,d){var p=cn;cn|=2;var b=sR(),E=oR();(Nn!==o||Vt!==l)&&(Lm=null,lu(o,l)),l=!1;var N=Xn;e:do try{if(gn!==0&&Ut!==null){var k=Ut,Q=Pa;switch(gn){case 8:kv(),N=6;break e;case 3:case 2:case 9:case 6:ka.current===null&&(l=!0);var fe=gn;if(gn=0,Pa=null,cu(o,k,Q,fe),d&&su){N=0;break e}break;default:fe=gn,gn=0,Pa=null,cu(o,k,Q,fe)}}xk(),N=Xn;break}catch(xe){rR(o,xe)}while(!0);return l&&o.shellSuspendCounter++,No=Fl=null,cn=p,M.H=b,M.A=E,Ut===null&&(Nn=null,Vt=0,am()),N}function xk(){for(;Ut!==null;)iR(Ut)}function vk(o,l){var d=cn;cn|=2;var p=sR(),b=oR();Nn!==o||Vt!==l?(Lm=null,km=Ee()+500,lu(o,l)):su=Ft(o,l);e:do try{if(gn!==0&&Ut!==null){l=Ut;var E=Pa;t:switch(gn){case 1:gn=0,Pa=null,cu(o,l,E,1);break;case 2:case 9:if(yw(E)){gn=0,Pa=null,lR(l);break}l=function(){gn!==2&&gn!==9||Nn!==o||(gn=7),Xs(o)},E.then(l,l);break e;case 3:gn=7;break e;case 4:gn=5;break e;case 7:yw(E)?(gn=0,Pa=null,lR(l)):(gn=0,Pa=null,cu(o,l,E,7));break;case 5:var N=null;switch(Ut.tag){case 26:N=Ut.memoizedState;case 5:case 27:var k=Ut;if(N?KR(N):k.stateNode.complete){gn=0,Pa=null;var Q=k.sibling;if(Q!==null)Ut=Q;else{var fe=k.return;fe!==null?(Ut=fe,zm(fe)):Ut=null}break t}}gn=0,Pa=null,cu(o,l,E,5);break;case 6:gn=0,Pa=null,cu(o,l,E,6);break;case 8:kv(),Xn=6;break e;default:throw Error(r(462))}}bk();break}catch(xe){rR(o,xe)}while(!0);return No=Fl=null,M.H=p,M.A=b,cn=d,Ut!==null?0:(Nn=null,Vt=0,am(),Xn)}function bk(){for(;Ut!==null&&!ue();)iR(Ut)}function iR(o){var l=DE(o.alternate,o,zo);o.memoizedProps=o.pendingProps,l===null?zm(o):Ut=l}function lR(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=RE(d,l,l.pendingProps,l.type,void 0,Vt);break;case 11:l=RE(d,l,l.pendingProps,l.type.render,l.ref,Vt);break;case 5:Xx(l);default:IE(d,l),l=Ut=ow(l,zo),l=DE(d,l,zo)}o.memoizedProps=o.pendingProps,l===null?zm(o):Ut=l}function cu(o,l,d,p){No=Fl=null,Xx(l),Qc=null,Ld=0;var b=l.return;try{if(lk(o,b,l,d,Vt)){Xn=1,jm(o,as(d,o.current)),Ut=null;return}}catch(E){if(b!==null)throw Ut=b,E;Xn=1,jm(o,as(d,o.current)),Ut=null;return}l.flags&32768?(Kt||p===1?o=!0:su||(Vt&536870912)!==0?o=!1:(Ai=o=!0,(p===2||p===9||p===3||p===6)&&(p=ka.current,p!==null&&p.tag===13&&(p.flags|=16384))),cR(l,o)):zm(l)}function zm(o){var l=o;do{if((l.flags&32768)!==0){cR(l,Ai);return}o=l.return;var d=dk(l.alternate,l,zo);if(d!==null){Ut=d;return}if(l=l.sibling,l!==null){Ut=l;return}Ut=l=o}while(l!==null);Xn===0&&(Xn=5)}function cR(o,l){do{var d=fk(o.alternate,o);if(d!==null){d.flags&=32767,Ut=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Ut=o;return}Ut=o=d}while(o!==null);Xn=6,Ut=null}function uR(o,l,d,p,b,E,N,k,Q){o.cancelPendingCommit=null;do Fm();while(gr!==0);if((cn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(E=l.lanes|l.childLanes,E|=Ex,Xt(o,d,E,N,k,Q),o===Nn&&(Ut=Nn=null,Vt=0),iu=l,Ii=o,Fo=d,Ov=E,Iv=b,JE=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,Ek(ot,function(){return pR(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=M.T,M.T=null,b=H.p,H.p=2,N=cn,cn|=4;try{hk(o,l,d)}finally{cn=N,H.p=b,M.T=p}}gr=1,dR(),fR(),hR()}}function dR(){if(gr===1){gr=0;var o=Ii,l=iu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var p=H.p;H.p=2;var b=cn;cn|=4;try{GE(l,o);var E=Zv,N=XC(o.containerInfo),k=E.focusedElem,Q=E.selectionRange;if(N!==k&&k&&k.ownerDocument&&WC(k.ownerDocument.documentElement,k)){if(Q!==null&&vx(k)){var fe=Q.start,xe=Q.end;if(xe===void 0&&(xe=fe),"selectionStart"in k)k.selectionStart=fe,k.selectionEnd=Math.min(xe,k.value.length);else{var be=k.ownerDocument||document,he=be&&be.defaultView||window;if(he.getSelection){var pe=he.getSelection(),Ke=k.textContent.length,it=Math.min(Q.start,Ke),wn=Q.end===void 0?it:Math.min(Q.end,Ke);!pe.extend&&it>wn&&(N=wn,wn=it,it=N);var ie=YC(k,it),te=YC(k,wn);if(ie&&te&&(pe.rangeCount!==1||pe.anchorNode!==ie.node||pe.anchorOffset!==ie.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var de=be.createRange();de.setStart(ie.node,ie.offset),pe.removeAllRanges(),it>wn?(pe.addRange(de),pe.extend(te.node,te.offset)):(de.setEnd(te.node,te.offset),pe.addRange(de))}}}}for(be=[],pe=k;pe=pe.parentNode;)pe.nodeType===1&&be.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<be.length;k++){var ve=be[k];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Qm=!!Kv,Zv=Kv=null}finally{cn=b,H.p=p,M.T=d}}o.current=l,gr=2}}function fR(){if(gr===2){gr=0;var o=Ii,l=iu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var p=H.p;H.p=2;var b=cn;cn|=4;try{FE(o,l.alternate,l)}finally{cn=b,H.p=p,M.T=d}}gr=3}}function hR(){if(gr===4||gr===3){gr=0,Ne();var o=Ii,l=iu,d=Fo,p=JE;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?gr=5:(gr=0,iu=Ii=null,mR(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(Oi=null),je(d),l=l.stateNode,Hn&&typeof Hn.onCommitFiberRoot=="function")try{Hn.onCommitFiberRoot(Gn,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=M.T,b=H.p,H.p=2,M.T=null;try{for(var E=o.onRecoverableError,N=0;N<p.length;N++){var k=p[N];E(k.value,{componentStack:k.stack})}}finally{M.T=l,H.p=b}}(Fo&3)!==0&&Fm(),Xs(o),b=o.pendingLanes,(d&261930)!==0&&(b&42)!==0?o===Mv?Jd++:(Jd=0,Mv=o):Jd=0,ef(0)}}function mR(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Md(l)))}function Fm(){return dR(),fR(),hR(),pR()}function pR(){if(gr!==5)return!1;var o=Ii,l=Ov;Ov=0;var d=je(Fo),p=M.T,b=H.p;try{H.p=32>d?32:d,M.T=null,d=Iv,Iv=null;var E=Ii,N=Fo;if(gr=0,iu=Ii=null,Fo=0,(cn&6)!==0)throw Error(r(331));var k=cn;if(cn|=4,WE(E.current),KE(E,E.current,N,d),cn=k,ef(0,!1),Hn&&typeof Hn.onPostCommitFiberRoot=="function")try{Hn.onPostCommitFiberRoot(Gn,E)}catch{}return!0}finally{H.p=b,M.T=p,mR(o,l)}}function gR(o,l,d){l=as(d,l),l=fv(o.stateNode,l,2),o=ji(o,l,2),o!==null&&(nn(o,2),Xs(o))}function yn(o,l,d){if(o.tag===3)gR(o,o,d);else for(;l!==null;){if(l.tag===3){gR(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Oi===null||!Oi.has(p))){o=as(d,o),d=yE(2),p=ji(l,d,2),p!==null&&(xE(d,p,l,o),nn(p,2),Xs(p));break}}l=l.return}}function Pv(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new gk;var b=new Set;p.set(l,b)}else b=p.get(l),b===void 0&&(b=new Set,p.set(l,b));b.has(d)||(Nv=!0,b.add(d),o=Sk.bind(null,o,l,d),l.then(o,o))}function Sk(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Nn===o&&(Vt&d)===d&&(Xn===4||Xn===3&&(Vt&62914560)===Vt&&300>Ee()-Mm?(cn&2)===0&&lu(o,0):Av|=d,ou===Vt&&(ou=0)),Xs(o)}function yR(o,l){l===0&&(l=qt()),o=Pl(o,l),o!==null&&(nn(o,l),Xs(o))}function Ck(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),yR(o,d)}function wk(o,l){var d=0;switch(o.tag){case 31:case 13:var p=o.stateNode,b=o.memoizedState;b!==null&&(d=b.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),yR(o,d)}function Ek(o,l){return B(o,l)}var Hm=null,uu=null,Uv=!1,$m=!1,zv=!1,ki=0;function Xs(o){o!==uu&&o.next===null&&(uu===null?Hm=uu=o:uu=uu.next=o),$m=!0,Uv||(Uv=!0,jk())}function ef(o,l){if(!zv&&$m){zv=!0;do for(var d=!1,p=Hm;p!==null;){if(o!==0){var b=p.pendingLanes;if(b===0)var E=0;else{var N=p.suspendedLanes,k=p.pingedLanes;E=(1<<31-kn(42|o)+1)-1,E&=b&~(N&~k),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(d=!0,SR(p,E))}else E=Vt,E=We(p,p===Nn?E:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(E&3)===0||Ft(p,E)||(d=!0,SR(p,E));p=p.next}while(d);zv=!1}}function Rk(){xR()}function xR(){$m=Uv=!1;var o=0;ki!==0&&Lk()&&(o=ki);for(var l=Ee(),d=null,p=Hm;p!==null;){var b=p.next,E=vR(p,l);E===0?(p.next=null,d===null?Hm=b:d.next=b,b===null&&(uu=d)):(d=p,(o!==0||(E&3)!==0)&&($m=!0)),p=b}gr!==0&&gr!==5||ef(o),ki!==0&&(ki=0)}function vR(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,b=o.expirationTimes,E=o.pendingLanes&-62914561;0<E;){var N=31-kn(E),k=1<<N,Q=b[N];Q===-1?((k&d)===0||(k&p)!==0)&&(b[N]=Ht(k,l)):Q<=l&&(o.expiredLanes|=k),E&=~k}if(l=Nn,d=Vt,d=We(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(gn===2||gn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ne(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Ft(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&ne(p),je(d)){case 2:case 8:d=st;break;case 32:d=ot;break;case 268435456:d=mr;break;default:d=ot}return p=bR.bind(null,o),d=B(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&ne(p),o.callbackPriority=2,o.callbackNode=null,2}function bR(o,l){if(gr!==0&&gr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(Fm()&&o.callbackNode!==d)return null;var p=Vt;return p=We(o,o===Nn?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(tR(o,p,l),vR(o,Ee()),o.callbackNode!=null&&o.callbackNode===d?bR.bind(null,o):null)}function SR(o,l){if(Fm())return null;tR(o,l,!0)}function jk(){Uk(function(){(cn&6)!==0?B($e,Rk):xR()})}function Fv(){if(ki===0){var o=Yc;o===0&&(o=vs,vs<<=1,(vs&261888)===0&&(vs=256)),ki=o}return ki}function CR(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Wh(""+o)}function wR(o,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,o.id&&d.setAttribute("form",o.id),l.parentNode.insertBefore(d,l),o=new FormData(o),d.parentNode.removeChild(d),o}function Tk(o,l,d,p,b){if(l==="submit"&&d&&d.stateNode===b){var E=CR((b[Ve]||null).action),N=p.submitter;N&&(l=(l=N[Ve]||null)?CR(l.formAction):N.getAttribute("formAction"),l!==null&&(E=l,N=null));var k=new em("action","action",null,p,b);o.push({event:k,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ki!==0){var Q=N?wR(b,N):new FormData(b);ov(d,{pending:!0,data:Q,method:b.method,action:E},null,Q)}}else typeof E=="function"&&(k.preventDefault(),Q=N?wR(b,N):new FormData(b),ov(d,{pending:!0,data:Q,method:b.method,action:E},E,Q))},currentTarget:b}]})}}for(var Hv=0;Hv<wx.length;Hv++){var $v=wx[Hv],_k=$v.toLowerCase(),Nk=$v[0].toUpperCase()+$v.slice(1);Cs(_k,"on"+Nk)}Cs(ew,"onAnimationEnd"),Cs(tw,"onAnimationIteration"),Cs(nw,"onAnimationStart"),Cs("dblclick","onDoubleClick"),Cs("focusin","onFocus"),Cs("focusout","onBlur"),Cs(G8,"onTransitionRun"),Cs(q8,"onTransitionStart"),Cs(K8,"onTransitionCancel"),Cs(rw,"onTransitionEnd"),Ss("onMouseEnter",["mouseout","mouseover"]),Ss("onMouseLeave",["mouseout","mouseover"]),Ss("onPointerEnter",["pointerout","pointerover"]),Ss("onPointerLeave",["pointerout","pointerover"]),ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tf="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(" "),Ak=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(tf));function ER(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var p=o[d],b=p.event;p=p.listeners;e:{var E=void 0;if(l)for(var N=p.length-1;0<=N;N--){var k=p[N],Q=k.instance,fe=k.currentTarget;if(k=k.listener,Q!==E&&b.isPropagationStopped())break e;E=k,b.currentTarget=fe;try{E(b)}catch(xe){rm(xe)}b.currentTarget=null,E=Q}else for(N=0;N<p.length;N++){if(k=p[N],Q=k.instance,fe=k.currentTarget,k=k.listener,Q!==E&&b.isPropagationStopped())break e;E=k,b.currentTarget=fe;try{E(b)}catch(xe){rm(xe)}b.currentTarget=null,E=Q}}}}function zt(o,l){var d=l[et];d===void 0&&(d=l[et]=new Set);var p=o+"__bubble";d.has(p)||(RR(l,o,2,!1),d.add(p))}function Vv(o,l,d){var p=0;l&&(p|=4),RR(d,o,p,l)}var Vm="_reactListening"+Math.random().toString(36).slice(2);function Bv(o){if(!o[Vm]){o[Vm]=!0,Mc.forEach(function(d){d!=="selectionchange"&&(Ak.has(d)||Vv(d,!1,o),Vv(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Vm]||(l[Vm]=!0,Vv("selectionchange",!1,l))}}function RR(o,l,d,p){switch(ej(l)){case 2:var b=a9;break;case 8:b=s9;break;default:b=s0}d=b.bind(null,l,d,o),b=void 0,!ux||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),p?b!==void 0?o.addEventListener(l,d,{capture:!0,passive:b}):o.addEventListener(l,d,!0):b!==void 0?o.addEventListener(l,d,{passive:b}):o.addEventListener(l,d,!1)}function Gv(o,l,d,p,b){var E=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var k=p.stateNode.containerInfo;if(k===b)break;if(N===4)for(N=p.return;N!==null;){var Q=N.tag;if((Q===3||Q===4)&&N.stateNode.containerInfo===b)return;N=N.return}for(;k!==null;){if(N=rn(k),N===null)return;if(Q=N.tag,Q===5||Q===6||Q===26||Q===27){p=E=N;continue e}k=k.parentNode}}p=p.return}AC(function(){var fe=E,xe=lx(d),be=[];e:{var he=aw.get(o);if(he!==void 0){var pe=em,Ke=o;switch(o){case"keypress":if(Qh(d)===0)break e;case"keydown":case"keyup":pe=w8;break;case"focusin":Ke="focus",pe=mx;break;case"focusout":Ke="blur",pe=mx;break;case"beforeblur":case"afterblur":pe=mx;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=IC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=d8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=j8;break;case ew:case tw:case nw:pe=m8;break;case rw:pe=_8;break;case"scroll":case"scrollend":pe=c8;break;case"wheel":pe=A8;break;case"copy":case"cut":case"paste":pe=g8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=kC;break;case"toggle":case"beforetoggle":pe=O8}var it=(l&4)!==0,wn=!it&&(o==="scroll"||o==="scrollend"),ie=it?he!==null?he+"Capture":null:he;it=[];for(var te=fe,de;te!==null;){var ve=te;if(de=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||de===null||ie===null||(ve=wd(te,ie),ve!=null&&it.push(nf(te,ve,de))),wn)break;te=te.return}0<it.length&&(he=new pe(he,Ke,null,d,xe),be.push({event:he,listeners:it}))}}if((l&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",pe=o==="mouseout"||o==="pointerout",he&&d!==ix&&(Ke=d.relatedTarget||d.fromElement)&&(rn(Ke)||Ke[nt]))break e;if((pe||he)&&(he=xe.window===xe?xe:(he=xe.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(Ke=d.relatedTarget||d.toElement,pe=fe,Ke=Ke?rn(Ke):null,Ke!==null&&(wn=i(Ke),it=Ke.tag,Ke!==wn||it!==5&&it!==27&&it!==6)&&(Ke=null)):(pe=null,Ke=fe),pe!==Ke)){if(it=IC,ve="onMouseLeave",ie="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(it=kC,ve="onPointerLeave",ie="onPointerEnter",te="pointer"),wn=pe==null?he:bs(pe),de=Ke==null?he:bs(Ke),he=new it(ve,te+"leave",pe,d,xe),he.target=wn,he.relatedTarget=de,ve=null,rn(xe)===fe&&(it=new it(ie,te+"enter",Ke,d,xe),it.target=de,it.relatedTarget=wn,ve=it),wn=ve,pe&&Ke)t:{for(it=Dk,ie=pe,te=Ke,de=0,ve=ie;ve;ve=it(ve))de++;ve=0;for(var rt=te;rt;rt=it(rt))ve++;for(;0<de-ve;)ie=it(ie),de--;for(;0<ve-de;)te=it(te),ve--;for(;de--;){if(ie===te||te!==null&&ie===te.alternate){it=ie;break t}ie=it(ie),te=it(te)}it=null}else it=null;pe!==null&&jR(be,he,pe,it,!1),Ke!==null&&wn!==null&&jR(be,wn,Ke,it,!0)}}e:{if(he=fe?bs(fe):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var an=VC;else if(HC(he))if(BC)an=$8;else{an=F8;var Xe=z8}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?fe&&ox(fe.elementType)&&(an=VC):an=H8;if(an&&(an=an(o,fe))){$C(be,an,d,xe);break e}Xe&&Xe(o,he,fe),o==="focusout"&&fe&&he.type==="number"&&fe.memoizedProps.value!=null&&sx(he,"number",he.value)}switch(Xe=fe?bs(fe):window,o){case"focusin":(HC(Xe)||Xe.contentEditable==="true")&&(Hc=Xe,bx=fe,Dd=null);break;case"focusout":Dd=bx=Hc=null;break;case"mousedown":Sx=!0;break;case"contextmenu":case"mouseup":case"dragend":Sx=!1,QC(be,d,xe);break;case"selectionchange":if(B8)break;case"keydown":case"keyup":QC(be,d,xe)}var jt;if(gx)e:{switch(o){case"compositionstart":var Bt="onCompositionStart";break e;case"compositionend":Bt="onCompositionEnd";break e;case"compositionupdate":Bt="onCompositionUpdate";break e}Bt=void 0}else Fc?zC(o,d)&&(Bt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Bt="onCompositionStart");Bt&&(LC&&d.locale!=="ko"&&(Fc||Bt!=="onCompositionStart"?Bt==="onCompositionEnd"&&Fc&&(jt=DC()):(vi=xe,dx="value"in vi?vi.value:vi.textContent,Fc=!0)),Xe=Bm(fe,Bt),0<Xe.length&&(Bt=new MC(Bt,o,null,d,xe),be.push({event:Bt,listeners:Xe}),jt?Bt.data=jt:(jt=FC(d),jt!==null&&(Bt.data=jt)))),(jt=M8?k8(o,d):L8(o,d))&&(Bt=Bm(fe,"onBeforeInput"),0<Bt.length&&(Xe=new MC("onBeforeInput","beforeinput",null,d,xe),be.push({event:Xe,listeners:Bt}),Xe.data=jt)),Tk(be,o,fe,d,xe)}ER(be,l)})}function nf(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Bm(o,l){for(var d=l+"Capture",p=[];o!==null;){var b=o,E=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||E===null||(b=wd(o,d),b!=null&&p.unshift(nf(o,b,E)),b=wd(o,l),b!=null&&p.push(nf(o,b,E))),o.tag===3)return p;o=o.return}return[]}function Dk(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function jR(o,l,d,p,b){for(var E=l._reactName,N=[];d!==null&&d!==p;){var k=d,Q=k.alternate,fe=k.stateNode;if(k=k.tag,Q!==null&&Q===p)break;k!==5&&k!==26&&k!==27||fe===null||(Q=fe,b?(fe=wd(d,E),fe!=null&&N.unshift(nf(d,fe,Q))):b||(fe=wd(d,E),fe!=null&&N.push(nf(d,fe,Q)))),d=d.return}N.length!==0&&o.push({event:l,listeners:N})}var Ok=/\r\n?/g,Ik=/\u0000|\uFFFD/g;function TR(o){return(typeof o=="string"?o:""+o).replace(Ok,`
|
|
49
|
-
`).replace(Ik,"")}function _R(o,l){return l=TR(l),TR(o)===l}function Cn(o,l,d,p,b,E){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||Pc(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&Pc(o,""+p);break;case"className":_n(o,"class",p);break;case"tabIndex":_n(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":_n(o,d,p);break;case"style":_C(o,p,E);break;case"data":if(l!=="object"){_n(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||d!=="href")){o.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Wh(""+p),o.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(d,"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 E=="function"&&(d==="formAction"?(l!=="input"&&Cn(o,l,"name",b.name,b,null),Cn(o,l,"formEncType",b.formEncType,b,null),Cn(o,l,"formMethod",b.formMethod,b,null),Cn(o,l,"formTarget",b.formTarget,b,null)):(Cn(o,l,"encType",b.encType,b,null),Cn(o,l,"method",b.method,b,null),Cn(o,l,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Wh(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=Ro);break;case"onScroll":p!=null&&zt("scroll",o);break;case"onScrollEnd":p!=null&&zt("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}d=Wh(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""+p):o.removeAttribute(d);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":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":p===!0?o.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,p):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(d,p):o.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(d):o.setAttribute(d,p);break;case"popover":zt("beforetoggle",o),zt("toggle",o),ts(o,"popover",p);break;case"xlinkActuate":ya(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":ya(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":ya(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":ya(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":ya(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":ya(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":ya(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":ya(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":ya(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":ts(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=i8.get(d)||d,ts(o,d,p))}}function qv(o,l,d,p,b,E){switch(d){case"style":_C(o,p,E);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"children":typeof p=="string"?Pc(o,p):(typeof p=="number"||typeof p=="bigint")&&Pc(o,""+p);break;case"onScroll":p!=null&&zt("scroll",o);break;case"onScrollEnd":p!=null&&zt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=Ro);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yi.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),l=d.slice(2,b?d.length-7:void 0),E=o[Ve]||null,E=E!=null?E[d]:null,typeof E=="function"&&o.removeEventListener(l,E,b),typeof p=="function")){typeof E!="function"&&E!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(l,p,b);break e}d in o?o[d]=p:p===!0?o.setAttribute(d,""):ts(o,d,p)}}}function kr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":zt("error",o),zt("load",o);var p=!1,b=!1,E;for(E in d)if(d.hasOwnProperty(E)){var N=d[E];if(N!=null)switch(E){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Cn(o,l,E,N,d,null)}}b&&Cn(o,l,"srcSet",d.srcSet,d,null),p&&Cn(o,l,"src",d.src,d,null);return;case"input":zt("invalid",o);var k=E=N=b=null,Q=null,fe=null;for(p in d)if(d.hasOwnProperty(p)){var xe=d[p];if(xe!=null)switch(p){case"name":b=xe;break;case"type":N=xe;break;case"checked":Q=xe;break;case"defaultChecked":fe=xe;break;case"value":E=xe;break;case"defaultValue":k=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,l));break;default:Cn(o,l,p,xe,d,null)}}EC(o,E,k,Q,fe,N,b,!1);return;case"select":zt("invalid",o),p=N=E=null;for(b in d)if(d.hasOwnProperty(b)&&(k=d[b],k!=null))switch(b){case"value":E=k;break;case"defaultValue":N=k;break;case"multiple":p=k;default:Cn(o,l,b,k,d,null)}l=E,d=N,o.multiple=!!p,l!=null?Lc(o,!!p,l,!1):d!=null&&Lc(o,!!p,d,!0);return;case"textarea":zt("invalid",o),E=b=p=null;for(N in d)if(d.hasOwnProperty(N)&&(k=d[N],k!=null))switch(N){case"value":p=k;break;case"defaultValue":b=k;break;case"children":E=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:Cn(o,l,N,k,d,null)}jC(o,p,b,E);return;case"option":for(Q in d)if(d.hasOwnProperty(Q)&&(p=d[Q],p!=null))switch(Q){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Cn(o,l,Q,p,d,null)}return;case"dialog":zt("beforetoggle",o),zt("toggle",o),zt("cancel",o),zt("close",o);break;case"iframe":case"object":zt("load",o);break;case"video":case"audio":for(p=0;p<tf.length;p++)zt(tf[p],o);break;case"image":zt("error",o),zt("load",o);break;case"details":zt("toggle",o);break;case"embed":case"source":case"link":zt("error",o),zt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in d)if(d.hasOwnProperty(fe)&&(p=d[fe],p!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Cn(o,l,fe,p,d,null)}return;default:if(ox(l)){for(xe in d)d.hasOwnProperty(xe)&&(p=d[xe],p!==void 0&&qv(o,l,xe,p,d,void 0));return}}for(k in d)d.hasOwnProperty(k)&&(p=d[k],p!=null&&Cn(o,l,k,p,d,null))}function Mk(o,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,E=null,N=null,k=null,Q=null,fe=null,xe=null;for(pe in d){var be=d[pe];if(d.hasOwnProperty(pe)&&be!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":Q=be;default:p.hasOwnProperty(pe)||Cn(o,l,pe,null,p,be)}}for(var he in p){var pe=p[he];if(be=d[he],p.hasOwnProperty(he)&&(pe!=null||be!=null))switch(he){case"type":E=pe;break;case"name":b=pe;break;case"checked":fe=pe;break;case"defaultChecked":xe=pe;break;case"value":N=pe;break;case"defaultValue":k=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:pe!==be&&Cn(o,l,he,pe,p,be)}}ax(o,N,k,Q,fe,xe,E,b);return;case"select":pe=N=k=he=null;for(E in d)if(Q=d[E],d.hasOwnProperty(E)&&Q!=null)switch(E){case"value":break;case"multiple":pe=Q;default:p.hasOwnProperty(E)||Cn(o,l,E,null,p,Q)}for(b in p)if(E=p[b],Q=d[b],p.hasOwnProperty(b)&&(E!=null||Q!=null))switch(b){case"value":he=E;break;case"defaultValue":k=E;break;case"multiple":N=E;default:E!==Q&&Cn(o,l,b,E,p,Q)}l=k,d=N,p=pe,he!=null?Lc(o,!!d,he,!1):!!p!=!!d&&(l!=null?Lc(o,!!d,l,!0):Lc(o,!!d,d?[]:"",!1));return;case"textarea":pe=he=null;for(k in d)if(b=d[k],d.hasOwnProperty(k)&&b!=null&&!p.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Cn(o,l,k,null,p,b)}for(N in p)if(b=p[N],E=d[N],p.hasOwnProperty(N)&&(b!=null||E!=null))switch(N){case"value":he=b;break;case"defaultValue":pe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==E&&Cn(o,l,N,b,p,E)}RC(o,he,pe);return;case"option":for(var Ke in d)if(he=d[Ke],d.hasOwnProperty(Ke)&&he!=null&&!p.hasOwnProperty(Ke))switch(Ke){case"selected":o.selected=!1;break;default:Cn(o,l,Ke,null,p,he)}for(Q in p)if(he=p[Q],pe=d[Q],p.hasOwnProperty(Q)&&he!==pe&&(he!=null||pe!=null))switch(Q){case"selected":o.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Cn(o,l,Q,he,p,pe)}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 it in d)he=d[it],d.hasOwnProperty(it)&&he!=null&&!p.hasOwnProperty(it)&&Cn(o,l,it,null,p,he);for(fe in p)if(he=p[fe],pe=d[fe],p.hasOwnProperty(fe)&&he!==pe&&(he!=null||pe!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:Cn(o,l,fe,he,p,pe)}return;default:if(ox(l)){for(var wn in d)he=d[wn],d.hasOwnProperty(wn)&&he!==void 0&&!p.hasOwnProperty(wn)&&qv(o,l,wn,void 0,p,he);for(xe in p)he=p[xe],pe=d[xe],!p.hasOwnProperty(xe)||he===pe||he===void 0&&pe===void 0||qv(o,l,xe,he,p,pe);return}}for(var ie in d)he=d[ie],d.hasOwnProperty(ie)&&he!=null&&!p.hasOwnProperty(ie)&&Cn(o,l,ie,null,p,he);for(be in p)he=p[be],pe=d[be],!p.hasOwnProperty(be)||he===pe||he==null&&pe==null||Cn(o,l,be,he,p,pe)}function NR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kk(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var b=d[p],E=b.transferSize,N=b.initiatorType,k=b.duration;if(E&&k&&NR(N)){for(N=0,k=b.responseEnd,p+=1;p<d.length;p++){var Q=d[p],fe=Q.startTime;if(fe>k)break;var xe=Q.transferSize,be=Q.initiatorType;xe&&NR(be)&&(Q=Q.responseEnd,N+=xe*(Q<k?1:(k-fe)/(Q-fe)))}if(--p,l+=8*(E+N)/(b.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Kv=null,Zv=null;function Gm(o){return o.nodeType===9?o:o.ownerDocument}function AR(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function DR(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function Yv(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Wv=null;function Lk(){var o=window.event;return o&&o.type==="popstate"?o===Wv?!1:(Wv=o,!0):(Wv=null,!1)}var OR=typeof setTimeout=="function"?setTimeout:void 0,Pk=typeof clearTimeout=="function"?clearTimeout:void 0,IR=typeof Promise=="function"?Promise:void 0,Uk=typeof queueMicrotask=="function"?queueMicrotask:typeof IR<"u"?function(o){return IR.resolve(null).then(o).catch(zk)}:OR;function zk(o){setTimeout(function(){throw o})}function Li(o){return o==="head"}function MR(o,l){var d=l,p=0;do{var b=d.nextSibling;if(o.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(p===0){o.removeChild(b),mu(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")rf(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,rf(d);for(var E=d.firstChild;E;){var N=E.nextSibling,k=E.nodeName;E[$n]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&E.rel.toLowerCase()==="stylesheet"||d.removeChild(E),E=N}}else d==="body"&&rf(o.ownerDocument.body);d=b}while(d);mu(l)}function kR(o,l){var d=o;o=0;do{var p=d.nextSibling;if(d.nodeType===1?l?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(l?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),p&&p.nodeType===8)if(d=p.data,d==="/$"){if(o===0)break;o--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||o++;d=p}while(d)}function Xv(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Xv(d),mn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function Fk(o,l,d,p){for(;o.nodeType===1;){var b=d;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[$n])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(E=o.getAttribute("rel"),E==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(E!==b.rel||o.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||o.getAttribute("title")!==(b.title==null?null:b.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(E=o.getAttribute("src"),(E!==(b.src==null?null:b.src)||o.getAttribute("type")!==(b.type==null?null:b.type)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&E&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var E=b.name==null?null:""+b.name;if(b.type==="hidden"&&o.getAttribute("name")===E)return o}else return o;if(o=cs(o.nextSibling),o===null)break}return null}function Hk(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=cs(o.nextSibling),o===null))return null;return o}function LR(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=cs(o.nextSibling),o===null))return null;return o}function Qv(o){return o.data==="$?"||o.data==="$~"}function Jv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function $k(o,l){var d=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||d.readyState!=="loading")l();else{var p=function(){l(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function cs(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var e0=null;function PR(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return cs(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function UR(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(l===0)return o;l--}else d!=="/$"&&d!=="/&"||l++}o=o.previousSibling}return null}function zR(o,l,d){switch(l=Gm(d),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function rf(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);mn(o)}var us=new Map,FR=new Set;function qm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ho=H.d;H.d={f:Vk,r:Bk,D:Gk,C:qk,L:Kk,m:Zk,X:Wk,S:Yk,M:Xk};function Vk(){var o=Ho.f(),l=Pm();return o||l}function Bk(o){var l=ga(o);l!==null&&l.tag===5&&l.type==="form"?rE(l):Ho.r(o)}var du=typeof document>"u"?null:document;function HR(o,l,d){var p=du;if(p&&typeof l=="string"&&l){var b=ns(l);b='link[rel="'+o+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),FR.has(b)||(FR.add(b),o={rel:o,crossOrigin:d,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),kr(l,"link",o),pn(l),p.head.appendChild(l)))}}function Gk(o){Ho.D(o),HR("dns-prefetch",o,null)}function qk(o,l){Ho.C(o,l),HR("preconnect",o,l)}function Kk(o,l,d){Ho.L(o,l,d);var p=du;if(p&&o&&l){var b='link[rel="preload"][as="'+ns(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+ns(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+ns(d.imageSizes)+'"]')):b+='[href="'+ns(o)+'"]';var E=b;switch(l){case"style":E=fu(o);break;case"script":E=hu(o)}us.has(E)||(o=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),us.set(E,o),p.querySelector(b)!==null||l==="style"&&p.querySelector(af(E))||l==="script"&&p.querySelector(sf(E))||(l=p.createElement("link"),kr(l,"link",o),pn(l),p.head.appendChild(l)))}}function Zk(o,l){Ho.m(o,l);var d=du;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+ns(p)+'"][href="'+ns(o)+'"]',E=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=hu(o)}if(!us.has(E)&&(o=g({rel:"modulepreload",href:o},l),us.set(E,o),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(sf(E)))return}p=d.createElement("link"),kr(p,"link",o),pn(p),d.head.appendChild(p)}}}function Yk(o,l,d){Ho.S(o,l,d);var p=du;if(p&&o){var b=Jr(p).hoistableStyles,E=fu(o);l=l||"default";var N=b.get(E);if(!N){var k={loading:0,preload:null};if(N=p.querySelector(af(E)))k.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},d),(d=us.get(E))&&t0(o,d);var Q=N=p.createElement("link");pn(Q),kr(Q,"link",o),Q._p=new Promise(function(fe,xe){Q.onload=fe,Q.onerror=xe}),Q.addEventListener("load",function(){k.loading|=1}),Q.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Km(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:k},b.set(E,N)}}}function Wk(o,l){Ho.X(o,l);var d=du;if(d&&o){var p=Jr(d).hoistableScripts,b=hu(o),E=p.get(b);E||(E=d.querySelector(sf(b)),E||(o=g({src:o,async:!0},l),(l=us.get(b))&&n0(o,l),E=d.createElement("script"),pn(E),kr(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(b,E))}}function Xk(o,l){Ho.M(o,l);var d=du;if(d&&o){var p=Jr(d).hoistableScripts,b=hu(o),E=p.get(b);E||(E=d.querySelector(sf(b)),E||(o=g({src:o,async:!0,type:"module"},l),(l=us.get(b))&&n0(o,l),E=d.createElement("script"),pn(E),kr(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(b,E))}}function $R(o,l,d,p){var b=(b=ae.current)?qm(b):null;if(!b)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=fu(d.href),d=Jr(b).hoistableStyles,p=d.get(l),p||(p={type:"style",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=fu(d.href);var E=Jr(b).hoistableStyles,N=E.get(o);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,N),(E=b.querySelector(af(o)))&&!E._p&&(N.instance=E,N.state.loading=5),us.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},us.set(o,d),E||Qk(b,o,d,N.state))),l&&p===null)throw Error(r(528,""));return N}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=hu(d),d=Jr(b).hoistableScripts,p=d.get(l),p||(p={type:"script",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function fu(o){return'href="'+ns(o)+'"'}function af(o){return'link[rel="stylesheet"]['+o+"]"}function VR(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function Qk(o,l,d,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),kr(l,"link",d),pn(l),o.head.appendChild(l))}function hu(o){return'[src="'+ns(o)+'"]'}function sf(o){return"script[async]"+o}function BR(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+ns(d.href)+'"]');if(p)return l.instance=p,pn(p),p;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),pn(p),kr(p,"style",b),Km(p,d.precedence,o),l.instance=p;case"stylesheet":b=fu(d.href);var E=o.querySelector(af(b));if(E)return l.state.loading|=4,l.instance=E,pn(E),E;p=VR(d),(b=us.get(b))&&t0(p,b),E=(o.ownerDocument||o).createElement("link"),pn(E);var N=E;return N._p=new Promise(function(k,Q){N.onload=k,N.onerror=Q}),kr(E,"link",p),l.state.loading|=4,Km(E,d.precedence,o),l.instance=E;case"script":return E=hu(d.src),(b=o.querySelector(sf(E)))?(l.instance=b,pn(b),b):(p=d,(b=us.get(E))&&(p=g({},d),n0(p,b)),o=o.ownerDocument||o,b=o.createElement("script"),pn(b),kr(b,"link",p),o.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,Km(p,d.precedence,o));return l.instance}function Km(o,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,E=b,N=0;N<p.length;N++){var k=p[N];if(k.dataset.precedence===l)E=k;else if(E!==b)break}E?E.parentNode.insertBefore(o,E.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(o,l.firstChild))}function t0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function n0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Zm=null;function GR(o,l,d){if(Zm===null){var p=new Map,b=Zm=new Map;b.set(d,p)}else b=Zm,p=b.get(d),p||(p=new Map,b.set(d,p));if(p.has(o))return p;for(p.set(o,null),d=d.getElementsByTagName(o),b=0;b<d.length;b++){var E=d[b];if(!(E[$n]||E[Ue]||o==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var N=E.getAttribute(l)||"";N=o+N;var k=p.get(N);k?k.push(E):p.set(N,[E])}}return p}function qR(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function Jk(o,l,d){if(d===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function KR(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function e9(o,l,d,p){if(d.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=fu(p.href),E=l.querySelector(af(b));if(E){l=E._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Ym.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=E,pn(E);return}E=l.ownerDocument||l,p=VR(p),(b=us.get(b))&&t0(p,b),E=E.createElement("link"),pn(E);var N=E;N._p=new Promise(function(k,Q){N.onload=k,N.onerror=Q}),kr(E,"link",p),d.instance=E}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=Ym.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var r0=0;function t9(o,l){return o.stylesheets&&o.count===0&&Xm(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&Xm(o,o.stylesheets),o.unsuspend){var E=o.unsuspend;o.unsuspend=null,E()}},6e4+l);0<o.imgBytes&&r0===0&&(r0=62500*kk());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Xm(o,o.stylesheets),o.unsuspend)){var E=o.unsuspend;o.unsuspend=null,E()}},(o.imgBytes>r0?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function Ym(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Wm=null;function Xm(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Wm=new Map,l.forEach(n9,o),Wm=null,Ym.call(o))}function n9(o,l){if(!(l.state.loading&4)){var d=Wm.get(o);if(d)var p=d.get(null);else{d=new Map,Wm.set(o,d);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<b.length;E++){var N=b[E];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(d.set(N.dataset.precedence,N),p=N)}p&&d.set(null,p)}b=l.instance,N=b.getAttribute("data-precedence"),E=d.get(N)||p,E===p&&d.set(null,b),d.set(N,b),this.count++,p=Ym.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),E?E.parentNode.insertBefore(b,E.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(b,o.firstChild)),l.state.loading|=4}}var of={$$typeof:_,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function r9(o,l,d,p,b,E,N,k,Q){this.tag=1,this.containerInfo=o,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=Zn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zn(0),this.hiddenUpdates=Zn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=E,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function ZR(o,l,d,p,b,E,N,k,Q,fe,xe,be){return o=new r9(o,l,d,N,Q,fe,xe,be,k),l=1,E===!0&&(l|=24),E=Ma(3,null,null,l),o.current=E,E.stateNode=o,l=Lx(),l.refCount++,o.pooledCache=l,l.refCount++,E.memoizedState={element:p,isDehydrated:d,cache:l},Fx(E),o}function YR(o){return o?(o=Bc,o):Bc}function WR(o,l,d,p,b,E){b=YR(b),p.context===null?p.context=b:p.pendingContext=b,p=Ri(l),p.payload={element:d},E=E===void 0?null:E,E!==null&&(p.callback=E),d=ji(o,p,l),d!==null&&(wa(d,o,l),Ud(d,o,l))}function XR(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function a0(o,l){XR(o,l),(o=o.alternate)&&XR(o,l)}function QR(o){if(o.tag===13||o.tag===31){var l=Pl(o,67108864);l!==null&&wa(l,o,67108864),a0(o,67108864)}}function JR(o){if(o.tag===13||o.tag===31){var l=za();l=Ce(l);var d=Pl(o,l);d!==null&&wa(d,o,l),a0(o,l)}}var Qm=!0;function a9(o,l,d,p){var b=M.T;M.T=null;var E=H.p;try{H.p=2,s0(o,l,d,p)}finally{H.p=E,M.T=b}}function s9(o,l,d,p){var b=M.T;M.T=null;var E=H.p;try{H.p=8,s0(o,l,d,p)}finally{H.p=E,M.T=b}}function s0(o,l,d,p){if(Qm){var b=o0(p);if(b===null)Gv(o,l,p,Jm,d),tj(o,p);else if(i9(b,o,l,d,p))p.stopPropagation();else if(tj(o,p),l&4&&-1<o9.indexOf(o)){for(;b!==null;){var E=ga(b);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var N=Tn(E.pendingLanes);if(N!==0){var k=E;for(k.pendingLanes|=2,k.entangledLanes|=2;N;){var Q=1<<31-kn(N);k.entanglements[1]|=Q,N&=~Q}Xs(E),(cn&6)===0&&(km=Ee()+500,ef(0))}}break;case 31:case 13:k=Pl(E,2),k!==null&&wa(k,E,2),Pm(),a0(E,2)}if(E=o0(p),E===null&&Gv(o,l,p,Jm,d),E===b)break;b=E}b!==null&&p.stopPropagation()}else Gv(o,l,p,null,d)}}function o0(o){return o=lx(o),i0(o)}var Jm=null;function i0(o){if(Jm=null,o=rn(o),o!==null){var l=i(o);if(l===null)o=null;else{var d=l.tag;if(d===13){if(o=c(l),o!==null)return o;o=null}else if(d===31){if(o=u(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return Jm=o,null}function ej(o){switch(o){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(Te()){case $e:return 2;case st:return 8;case ot:case jn:return 32;case mr:return 268435456;default:return 32}default:return 32}}var l0=!1,Pi=null,Ui=null,zi=null,lf=new Map,cf=new Map,Fi=[],o9="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 tj(o,l){switch(o){case"focusin":case"focusout":Pi=null;break;case"dragenter":case"dragleave":Ui=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":lf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":cf.delete(l.pointerId)}}function uf(o,l,d,p,b,E){return o===null||o.nativeEvent!==E?(o={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:E,targetContainers:[b]},l!==null&&(l=ga(l),l!==null&&QR(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function i9(o,l,d,p,b){switch(l){case"focusin":return Pi=uf(Pi,o,l,d,p,b),!0;case"dragenter":return Ui=uf(Ui,o,l,d,p,b),!0;case"mouseover":return zi=uf(zi,o,l,d,p,b),!0;case"pointerover":var E=b.pointerId;return lf.set(E,uf(lf.get(E)||null,o,l,d,p,b)),!0;case"gotpointercapture":return E=b.pointerId,cf.set(E,uf(cf.get(E)||null,o,l,d,p,b)),!0}return!1}function nj(o){var l=rn(o.target);if(l!==null){var d=i(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){o.blockedOn=l,qe(o.priority,function(){JR(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,qe(o.priority,function(){JR(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function ep(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=o0(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);ix=p,d.target.dispatchEvent(p),ix=null}else return l=ga(d),l!==null&&QR(l),o.blockedOn=d,!1;l.shift()}return!0}function rj(o,l,d){ep(o)&&d.delete(l)}function l9(){l0=!1,Pi!==null&&ep(Pi)&&(Pi=null),Ui!==null&&ep(Ui)&&(Ui=null),zi!==null&&ep(zi)&&(zi=null),lf.forEach(rj),cf.forEach(rj)}function tp(o,l){o.blockedOn===l&&(o.blockedOn=null,l0||(l0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l9)))}var np=null;function aj(o){np!==o&&(np=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){np===o&&(np=null);for(var l=0;l<o.length;l+=3){var d=o[l],p=o[l+1],b=o[l+2];if(typeof p!="function"){if(i0(p||d)===null)continue;break}var E=ga(d);E!==null&&(o.splice(l,3),l-=3,ov(E,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function mu(o){function l(Q){return tp(Q,o)}Pi!==null&&tp(Pi,o),Ui!==null&&tp(Ui,o),zi!==null&&tp(zi,o),lf.forEach(l),cf.forEach(l);for(var d=0;d<Fi.length;d++){var p=Fi[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Fi.length&&(d=Fi[0],d.blockedOn===null);)nj(d),d.blockedOn===null&&Fi.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],E=d[p+1],N=b[Ve]||null;if(typeof E=="function")N||aj(d);else if(N){var k=null;if(E&&E.hasAttribute("formAction")){if(b=E,N=E[Ve]||null)k=N.formAction;else if(i0(b)!==null)continue}else k=N.action;typeof k=="function"?d[p+1]=k:(d.splice(p,3),p-=3),aj(d)}}}function sj(){function o(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(N){return b=N})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),p||setTimeout(d,20)}function d(){if(!p&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function c0(o){this._internalRoot=o}rp.prototype.render=c0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=za();WR(d,p,o,l,null,null)},rp.prototype.unmount=c0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;WR(o.current,2,null,o,null,null),Pm(),l[nt]=null}};function rp(o){this._internalRoot=o}rp.prototype.unstable_scheduleHydration=function(o){if(o){var l=He();o={blockedOn:null,target:o,priority:l};for(var d=0;d<Fi.length&&l!==0&&l<Fi[d].priority;d++);Fi.splice(d,0,o),d===0&&nj(o)}};var oj=t.version;if(oj!=="19.2.0")throw Error(r(527,oj,"19.2.0"));H.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=h(l),o=o!==null?y(o):null,o=o===null?null:o.stateNode,o};var c9={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ap=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ap.isDisabled&&ap.supportsFiber)try{Gn=ap.inject(c9),Hn=ap}catch{}}return ff.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",b=hE,E=mE,N=pE;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=ZR(o,1,!1,null,null,d,p,null,b,E,N,sj),o[nt]=l.current,Bv(o),new c0(l)},ff.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,b="",E=hE,N=mE,k=pE,Q=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(E=d.onUncaughtError),d.onCaughtError!==void 0&&(N=d.onCaughtError),d.onRecoverableError!==void 0&&(k=d.onRecoverableError),d.formState!==void 0&&(Q=d.formState)),l=ZR(o,1,!0,l,d??null,p,b,Q,E,N,k,sj),l.context=YR(null),d=l.current,p=za(),p=Ce(p),b=Ri(p),b.callback=null,ji(d,b,p),d=p,l.current.lanes=d,nn(l,d),Xs(l),o[nt]=l.current,Bv(o),new rp(l)},ff.version="19.2.0",ff}var gj;function S9(){if(gj)return f0.exports;gj=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(),f0.exports=b9(),f0.exports}var C9=S9();/**
|
|
50
|
-
* react-router v7.9.6
|
|
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 zN=e=>{throw TypeError(e)},w9=(e,t,n)=>t.has(e)||zN("Cannot "+n),g0=(e,t,n)=>(w9(e,t,"read from private field"),n?n.call(e):t.get(e)),E9=(e,t,n)=>t.has(e)?zN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),yj="popstate";function R9(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return Vf("",{pathname:i,search:c,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:go(s)}return T9(t,n,null,e)}function Lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function j9(){return Math.random().toString(36).substring(2,10)}function xj(e,t){return{usr:e.state,key:e.key,idx:t}}function Vf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?yl(t):t,state:n,key:t&&t.key||r||j9()}}function go({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 yl(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 T9(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){u="POP";let w=y(),R=w==null?null:w-h;h=w,f&&f({action:u,location:S.location,delta:R})}function x(w,R){u="PUSH";let j=Vf(S.location,w,R);h=y()+1;let _=xj(j,h),I=S.createHref(j);try{c.pushState(_,"",I)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(I)}i&&f&&f({action:u,location:S.location,delta:1})}function v(w,R){u="REPLACE";let j=Vf(S.location,w,R);h=y();let _=xj(j,h),I=S.createHref(j);c.replaceState(_,"",I),i&&f&&f({action:u,location:S.location,delta:0})}function C(w){return FN(w)}let S={get action(){return u},get location(){return e(s,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(yj,g),f=w,()=>{s.removeEventListener(yj,g),f=null}},createHref(w){return t(s,w)},createURL:C,encodeLocation(w){let R=C(w);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:v,go(w){return c.go(w)}};return S}function FN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:go(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var jf,vj=class{constructor(e){if(E9(this,jf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(g0(this,jf).has(e))return g0(this,jf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){g0(this,jf).set(e,t)}};jf=new WeakMap;var _9=new Set(["lazy","caseSensitive","path","id","index","children"]);function N9(e){return _9.has(e)}var A9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function D9(e){return A9.has(e)}function O9(e){return e.index===!0}function Bf(e,t,n=[],r={},s=!1){return e.map((i,c)=>{let u=[...n,String(c)],f=typeof i.id=="string"?i.id:u.join("-");if(Lt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Lt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),O9(i)){let h={...i,id:f};return r[f]=bj(h,t(h)),h}else{let h={...i,id:f,children:void 0};return r[f]=bj(h,t(h)),i.children&&(h.children=Bf(i.children,t,u,r,s)),h}})}function bj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Zi(e,t,n="/"){return Tf(e,t,n,!1)}function Tf(e,t,n,r){let s=typeof t=="string"?yl(t):t,i=ms(s.pathname||"/",n);if(i==null)return null;let c=HN(e);M9(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let h=G9(i);u=V9(c[f],h,r)}return u}function I9(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 HN(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&f)return;Lt(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let g=lo([r,y.relativePath]),x=n.concat(y);c.children&&c.children.length>0&&(Lt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),HN(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:H9(g,c.index),routesMeta:x})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let h of $N(c.path))i(c,u,!0,h)}),t}function $N(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let c=$N(r.join("/")),u=[];return u.push(...c.map(f=>f===""?i:[i,f].join("/"))),s&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function M9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var k9=/^:[\w-]+$/,L9=3,P9=2,U9=1,z9=10,F9=-2,Sj=e=>e==="*";function H9(e,t){let n=e.split("/"),r=n.length;return n.some(Sj)&&(r+=F9),t&&(r+=P9),n.filter(s=>!Sj(s)).reduce((s,i)=>s+(k9.test(i)?L9:i===""?U9:z9),r)}function $9(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 V9(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,y=i==="/"?t:t.slice(i.length)||"/",g=Wp({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},y),x=f.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=Wp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},y)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:lo([i,g.pathname]),pathnameBase:Y9(lo([i,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(i=lo([i,g.pathnameBase]))}return c}function Wp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=B9(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],c=i.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((h,{paramName:y,isOptional:g},x)=>{if(y==="*"){let C=u[x]||"";c=i.slice(0,i.length-C.length).replace(/(.)\/+$/,"$1")}const v=u[x];return g&&!v?h[y]=void 0:h[y]=(v||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:c,pattern:e}}function B9(e,t=!1,n=!0){Kn(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,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).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 G9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kn(!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 ms(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 q9({basename:e,pathname:t}){return t==="/"?e:lo([e,t])}var K9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bg=e=>K9.test(e);function Z9(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?yl(e):e,i;if(n)if(Bg(n))i=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Kn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?i=Cj(n.substring(1),"/"):i=Cj(n,t)}else i=t;return{pathname:i,search:W9(r),hash:X9(s)}}function Cj(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 y0(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 VN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Gg(e){let t=VN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function qg(e,t,n,r=!1){let s;typeof e=="string"?s=yl(e):(s={...e},Lt(!s.pathname||!s.pathname.includes("?"),y0("?","pathname","search",s)),Lt(!s.pathname||!s.pathname.includes("#"),y0("#","pathname","hash",s)),Lt(!s.search||!s.search.includes("#"),y0("#","search","hash",s)));let i=e===""||s.pathname==="",c=i?"/":s.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}u=g>=0?t[g]:"/"}let f=Z9(s,u),h=c&&c!=="/"&&c.endsWith("/"),y=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||y)&&(f.pathname+="/"),f}var lo=e=>e.join("/").replace(/\/\/+/g,"/"),Y9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),W9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,X9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Xp=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 Gf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ub(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ji=Symbol("Uninstrumented");function Q9(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(i){let c=Object.keys(n);for(let u of c)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=Ou(n.lazy,t.lazy,()=>{});s&&(r.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(i=>{let c=s[i],u=n[`lazy.${i}`];if(typeof c=="function"&&u.length>0){let f=Ou(u,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(s=>{let i=t[s];if(typeof i=="function"&&n[s].length>0){let c=i[Ji]??i,u=Ou(n[s],c,(...f)=>wj(f[0]));u&&(u[Ji]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[Ji]??s,c=Ou(n.middleware,i,(...u)=>wj(u[0]));return c?(c[Ji]=i,c):s})),r}function J9(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(s){let i=Object.keys(s);for(let c of i)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let r=e.navigate[Ji]??e.navigate,s=Ou(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?go(c):".",...Ej(e,u??{})}});s&&(s[Ji]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[Ji]??e.fetch,s=Ou(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...Ej(e,f??{})}});s&&(s[Ji]=r,e.fetch=s)}return e}function Ou(e,t,n){return e.length===0?null:async(...r)=>{let s=await BN(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function BN(e,t,n,r){let s=e[r],i;if(s){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=BN(e,t,n,r-1),i=await c,Lt(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await s(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await u(),await c}else try{i={type:"success",value:await n()}}catch(c){i={type:"error",value:c}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function wj(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:e7(t),params:{...r},unstable_pattern:s,context:t7(n)}}function Ej(e,t){return{currentUrl:go(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function e7(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function t7(e){if(r7(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var n7=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function r7(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===n7}var GN=["POST","PUT","PATCH","DELETE"],a7=new Set(GN),s7=["GET",...GN],o7=new Set(s7),i7=new Set([301,302,303,307,308]),l7=new Set([307,308]),x0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},c7={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},u7=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),qN="remix-router-transitions",KN=Symbol("ResetLoaderData");function d7(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";Lt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||u7,i=s;if(e.unstable_instrumentations){let Y=e.unstable_instrumentations;i=ee=>({...s(ee),...Q9(Y.map(le=>le.route).filter(Boolean),ee)})}let c={},u=Bf(e.routes,i,void 0,c),f,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let y=e.dataStrategy||g7,g={...e.future},x=null,v=new Set,C=null,S=null,w=null,R=e.hydrationData!=null,j=Zi(u,e.history.location,h),_=!1,I=null,A;if(j==null&&!e.patchRoutesOnNavigation){let Y=ds(404,{pathname:e.history.location.pathname}),{matches:ee,route:le}=sp(u);A=!0,j=ee,I={[le.id]:Y}}else if(j&&!e.hydrationData&&Ht(j,u,e.history.location.pathname).active&&(j=null),j)if(j.some(Y=>Y.route.lazy))A=!1;else if(!j.some(Y=>zb(Y.route)))A=!0;else{let Y=e.hydrationData?e.hydrationData.loaderData:null,ee=e.hydrationData?e.hydrationData.errors:null;if(ee){let le=j.findIndex(Ce=>ee[Ce.route.id]!==void 0);A=j.slice(0,le+1).every(Ce=>!w1(Ce.route,Y,ee))}else A=j.every(le=>!w1(le.route,Y,ee))}else{A=!1,j=[];let Y=Ht(null,u,e.history.location.pathname);Y.active&&Y.matches&&(_=!0,j=Y.matches)}let O,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:A,navigation:x0,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||I,fetchers:new Map,blockers:new Map},D="POP",L=!1,$,K=!1,Z=new Map,G=null,q=!1,z=!1,M=new Set,H=new Map,V=0,se=-1,ge=new Map,P=new Set,U=new Map,F=new Map,W=new Set,X=new Map,ae,J=null;function ce(){if(x=e.history.listen(({action:Y,location:ee,delta:le})=>{if(ae){ae(),ae=void 0;return}Kn(X.size===0||le!=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 Ce=vs({currentLocation:T.location,nextLocation:ee,historyAction:Y});if(Ce&&le!=null){let je=new Promise(He=>{ae=He});e.history.go(le*-1),Dr(Ce,{state:"blocked",location:ee,proceed(){Dr(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),je.then(()=>e.history.go(le))},reset(){let He=new Map(T.blockers);He.set(Ce,hf),Me({blockers:He})}});return}return Pt(Y,ee)}),n){D7(t,Z);let Y=()=>O7(t,Z);t.addEventListener("pagehide",Y),G=()=>t.removeEventListener("pagehide",Y)}return T.initialized||Pt("POP",T.location,{initialHydration:!0}),O}function ye(){x&&x(),G&&G(),v.clear(),$&&$.abort(),T.fetchers.forEach((Y,ee)=>On(ee)),T.blockers.forEach((Y,ee)=>pa(ee))}function Se(Y){return v.add(Y),()=>v.delete(Y)}function Me(Y,ee={}){Y.matches&&(Y.matches=Y.matches.map(je=>{let He=c[je.route.id],qe=je.route;return qe.element!==He.element||qe.errorElement!==He.errorElement||qe.hydrateFallbackElement!==He.hydrateFallbackElement?{...je,route:He}:je})),T={...T,...Y};let le=[],Ce=[];T.fetchers.forEach((je,He)=>{je.state==="idle"&&(W.has(He)?le.push(He):Ce.push(He))}),W.forEach(je=>{!T.fetchers.has(je)&&!H.has(je)&&le.push(je)}),[...v].forEach(je=>je(T,{deletedFetchers:le,viewTransitionOpts:ee.viewTransitionOpts,flushSync:ee.flushSync===!0})),le.forEach(je=>On(je)),Ce.forEach(je=>T.fetchers.delete(je))}function ke(Y,ee,{flushSync:le}={}){var nt,et;let Ce=T.actionData!=null&&T.navigation.formMethod!=null&&aa(T.navigation.formMethod)&&T.navigation.state==="loading"&&((nt=Y.state)==null?void 0:nt._isRedirect)!==!0,je;ee.actionData?Object.keys(ee.actionData).length>0?je=ee.actionData:je=null:Ce?je=T.actionData:je=null;let He=ee.loaderData?Mj(T.loaderData,ee.loaderData,ee.matches||[],ee.errors):T.loaderData,qe=T.blockers;qe.size>0&&(qe=new Map(qe),qe.forEach((pt,bn)=>qe.set(bn,hf)));let Fe=q?!1:Ft(Y,ee.matches||T.matches),Ue=L===!0||T.navigation.formMethod!=null&&aa(T.navigation.formMethod)&&((et=Y.state)==null?void 0:et._isRedirect)!==!0;f&&(u=f,f=void 0),q||D==="POP"||(D==="PUSH"?e.history.push(Y,Y.state):D==="REPLACE"&&e.history.replace(Y,Y.state));let Ve;if(D==="POP"){let pt=Z.get(T.location.pathname);pt&&pt.has(Y.pathname)?Ve={currentLocation:T.location,nextLocation:Y}:Z.has(Y.pathname)&&(Ve={currentLocation:Y,nextLocation:T.location})}else if(K){let pt=Z.get(T.location.pathname);pt?pt.add(Y.pathname):(pt=new Set([Y.pathname]),Z.set(T.location.pathname,pt)),Ve={currentLocation:T.location,nextLocation:Y}}Me({...ee,actionData:je,loaderData:He,historyAction:D,location:Y,initialized:!0,navigation:x0,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Ue,blockers:qe},{viewTransitionOpts:Ve,flushSync:le===!0}),D="POP",L=!1,K=!1,q=!1,z=!1,J==null||J.resolve(),J=null}async function tt(Y,ee){if(typeof Y=="number"){e.history.go(Y);return}let le=C1(T.location,T.matches,h,Y,ee==null?void 0:ee.fromRouteId,ee==null?void 0:ee.relative),{path:Ce,submission:je,error:He}=Rj(!1,le,ee),qe=T.location,Fe=Vf(T.location,Ce,ee&&ee.state);Fe={...Fe,...e.history.encodeLocation(Fe)};let Ue=ee&&ee.replace!=null?ee.replace:void 0,Ve="PUSH";Ue===!0?Ve="REPLACE":Ue===!1||je!=null&&aa(je.formMethod)&&je.formAction===T.location.pathname+T.location.search&&(Ve="REPLACE");let nt=ee&&"preventScrollReset"in ee?ee.preventScrollReset===!0:void 0,et=(ee&&ee.flushSync)===!0,pt=vs({currentLocation:qe,nextLocation:Fe,historyAction:Ve});if(pt){Dr(pt,{state:"blocked",location:Fe,proceed(){Dr(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),tt(Y,ee)},reset(){let bn=new Map(T.blockers);bn.set(pt,hf),Me({blockers:bn})}});return}await Pt(Ve,Fe,{submission:je,pendingError:He,preventScrollReset:nt,replace:ee&&ee.replace,enableViewTransition:ee&&ee.viewTransition,flushSync:et})}function at(){J||(J=I7()),$e(),Me({revalidation:"loading"});let Y=J.promise;return T.navigation.state==="submitting"?Y:T.navigation.state==="idle"?(Pt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),Y):(Pt(D||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:K===!0}),Y)}async function Pt(Y,ee,le){$&&$.abort(),$=null,D=Y,q=(le&&le.startUninterruptedRevalidation)===!0,We(T.location,T.matches),L=(le&&le.preventScrollReset)===!0,K=(le&&le.enableViewTransition)===!0;let Ce=f||u,je=le&&le.overrideNavigation,He=le!=null&&le.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Zi(Ce,ee,h),qe=(le&&le.flushSync)===!0;if(He&&T.initialized&&!z&&E7(T.location,ee)&&!(le&&le.submission&&aa(le.submission.formMethod))){ke(ee,{matches:He},{flushSync:qe});return}let Fe=Ht(He,Ce,ee.pathname);if(Fe.active&&Fe.matches&&(He=Fe.matches),!He){let{error:$n,notFoundMatches:mn,route:rn}=es(ee.pathname);ke(ee,{matches:mn,loaderData:{},errors:{[rn.id]:$n}},{flushSync:qe});return}$=new AbortController;let Ue=Eu(e.history,ee,$.signal,le&&le.submission),Ve=e.getContext?await e.getContext():new vj,nt;if(le&&le.pendingError)nt=[Yi(He).route.id,{type:"error",error:le.pendingError}];else if(le&&le.submission&&aa(le.submission.formMethod)){let $n=await fn(Ue,ee,le.submission,He,Ve,Fe.active,le&&le.initialHydration===!0,{replace:le.replace,flushSync:qe});if($n.shortCircuited)return;if($n.pendingActionResult){let[mn,rn]=$n.pendingActionResult;if(Ha(rn)&&Gf(rn.error)&&rn.error.status===404){$=null,ke(ee,{matches:$n.matches,loaderData:{},errors:{[mn]:rn.error}});return}}He=$n.matches||He,nt=$n.pendingActionResult,je=v0(ee,le.submission),qe=!1,Fe.active=!1,Ue=Eu(e.history,Ue.url,Ue.signal)}let{shortCircuited:et,matches:pt,loaderData:bn,errors:Yn}=await Dn(Ue,ee,He,Ve,Fe.active,je,le&&le.submission,le&&le.fetcherSubmission,le&&le.replace,le&&le.initialHydration===!0,qe,nt);et||($=null,ke(ee,{matches:pt||He,...kj(nt),loaderData:bn,errors:Yn}))}async function fn(Y,ee,le,Ce,je,He,qe,Fe={}){$e();let Ue=N7(ee,le);if(Me({navigation:Ue},{flushSync:Fe.flushSync===!0}),He){let et=await qt(Ce,ee.pathname,Y.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:bn,route:Yn}=sp(u);return{matches:bn,pendingActionResult:[Yn.id,{type:"error",error:et.error}]}}let pt=Yi(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[pt,{type:"error",error:et.error}]}}else if(et.matches)Ce=et.matches;else{let{notFoundMatches:pt,error:bn,route:Yn}=es(ee.pathname);return{matches:pt,pendingActionResult:[Yn.id,{type:"error",error:bn}]}}}let Ve,nt=Lp(Ce,ee);if(!nt.route.action&&!nt.route.lazy)Ve={type:"error",error:ds(405,{method:Y.method,pathname:ee.pathname,routeId:nt.route.id})};else{let et=ku(i,c,Y,Ce,nt,qe?[]:r,je),pt=await Ee(Y,et,je,null);if(Ve=pt[nt.route.id],!Ve){for(let bn of Ce)if(pt[bn.route.id]){Ve=pt[bn.route.id];break}}if(Y.signal.aborted)return{shortCircuited:!0}}if(tc(Ve)){let et;return Fe&&Fe.replace!=null?et=Fe.replace:et=Dj(Ve.response.headers.get("Location"),new URL(Y.url),h)===T.location.pathname+T.location.search,await Ne(Y,Ve,!0,{submission:le,replace:et}),{shortCircuited:!0}}if(Ha(Ve)){let et=Yi(Ce,nt.route.id);return(Fe&&Fe.replace)!==!0&&(D="PUSH"),{matches:Ce,pendingActionResult:[et.route.id,Ve,nt.route.id]}}return{matches:Ce,pendingActionResult:[nt.route.id,Ve]}}async function Dn(Y,ee,le,Ce,je,He,qe,Fe,Ue,Ve,nt,et){let pt=He||v0(ee,qe),bn=qe||Fe||Pj(pt),Yn=!q&&!Ve;if(je){if(Yn){let pr=ln(et);Me({navigation:pt,...pr!==void 0?{actionData:pr}:{}},{flushSync:nt})}let $t=await qt(le,ee.pathname,Y.signal);if($t.type==="aborted")return{shortCircuited:!0};if($t.type==="error"){if($t.partialMatches.length===0){let{matches:xi,route:ts}=sp(u);return{matches:xi,loaderData:{},errors:{[ts.id]:$t.error}}}let pr=Yi($t.partialMatches).route.id;return{matches:$t.partialMatches,loaderData:{},errors:{[pr]:$t.error}}}else if($t.matches)le=$t.matches;else{let{error:pr,notFoundMatches:xi,route:ts}=es(ee.pathname);return{matches:xi,loaderData:{},errors:{[ts.id]:pr}}}}let $n=f||u,{dsMatches:mn,revalidatingFetchers:rn}=jj(Y,Ce,i,c,e.history,T,le,bn,ee,Ve?[]:r,Ve===!0,z,M,W,U,P,$n,h,e.patchRoutesOnNavigation!=null,et);if(se=++V,!e.dataStrategy&&!mn.some($t=>$t.shouldLoad)&&!mn.some($t=>$t.route.middleware&&$t.route.middleware.length>0)&&rn.length===0){let $t=or();return ke(ee,{matches:le,loaderData:{},errors:et&&Ha(et[1])?{[et[0]]:et[1].error}:null,...kj(et),...$t?{fetchers:new Map(T.fetchers)}:{}},{flushSync:nt}),{shortCircuited:!0}}if(Yn){let $t={};if(!je){$t.navigation=pt;let pr=ln(et);pr!==void 0&&($t.actionData=pr)}rn.length>0&&($t.fetchers=Ie(rn)),Me($t,{flushSync:nt})}rn.forEach($t=>{Gn($t.key),$t.controller&&H.set($t.key,$t.controller)});let ga=()=>rn.forEach($t=>Gn($t.key));$&&$.signal.addEventListener("abort",ga);let{loaderResults:bs,fetcherResults:Jr}=await Te(mn,rn,Y,Ce);if(Y.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",ga),rn.forEach($t=>H.delete($t.key));let pn=op(bs);if(pn)return await Ne(Y,pn.result,!0,{replace:Ue}),{shortCircuited:!0};if(pn=op(Jr),pn)return P.add(pn.key),await Ne(Y,pn.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:Mc,errors:yi}=Ij(T,le,bs,et,rn,Jr);Ve&&T.errors&&(yi={...T.errors,...yi});let ea=or(),Ss=kn(se),kc=ea||Ss||rn.length>0;return{matches:le,loaderData:Mc,errors:yi,...kc?{fetchers:new Map(T.fetchers)}:{}}}function ln(Y){if(Y&&!Ha(Y[1]))return{[Y[0]]:Y[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Ie(Y){return Y.forEach(ee=>{let le=T.fetchers.get(ee.key),Ce=mf(void 0,le?le.data:void 0);T.fetchers.set(ee.key,Ce)}),new Map(T.fetchers)}async function B(Y,ee,le,Ce){Gn(Y);let je=(Ce&&Ce.flushSync)===!0,He=f||u,qe=C1(T.location,T.matches,h,le,ee,Ce==null?void 0:Ce.relative),Fe=Zi(He,qe,h),Ue=Ht(Fe,He,qe);if(Ue.active&&Ue.matches&&(Fe=Ue.matches),!Fe){ot(Y,ee,ds(404,{pathname:qe}),{flushSync:je});return}let{path:Ve,submission:nt,error:et}=Rj(!0,qe,Ce);if(et){ot(Y,ee,et,{flushSync:je});return}let pt=e.getContext?await e.getContext():new vj,bn=(Ce&&Ce.preventScrollReset)===!0;if(nt&&aa(nt.formMethod)){await ne(Y,ee,Ve,Fe,pt,Ue.active,je,bn,nt);return}U.set(Y,{routeId:ee,path:Ve}),await ue(Y,ee,Ve,Fe,pt,Ue.active,je,bn,nt)}async function ne(Y,ee,le,Ce,je,He,qe,Fe,Ue){$e(),U.delete(Y);let Ve=T.fetchers.get(Y);st(Y,A7(Ue,Ve),{flushSync:qe});let nt=new AbortController,et=Eu(e.history,le,nt.signal,Ue);if(He){let _n=await qt(Ce,new URL(et.url).pathname,et.signal,Y);if(_n.type==="aborted")return;if(_n.type==="error"){ot(Y,ee,_n.error,{flushSync:qe});return}else if(_n.matches)Ce=_n.matches;else{ot(Y,ee,ds(404,{pathname:le}),{flushSync:qe});return}}let pt=Lp(Ce,le);if(!pt.route.action&&!pt.route.lazy){let _n=ds(405,{method:Ue.formMethod,pathname:le,routeId:ee});ot(Y,ee,_n,{flushSync:qe});return}H.set(Y,nt);let bn=V,Yn=ku(i,c,et,Ce,pt,r,je),$n=await Ee(et,Yn,je,Y),mn=$n[pt.route.id];if(!mn){for(let _n of Yn)if($n[_n.route.id]){mn=$n[_n.route.id];break}}if(et.signal.aborted){H.get(Y)===nt&&H.delete(Y);return}if(W.has(Y)){if(tc(mn)||Ha(mn)){st(Y,Go(void 0));return}}else{if(tc(mn))if(H.delete(Y),se>bn){st(Y,Go(void 0));return}else return P.add(Y),st(Y,mf(Ue)),Ne(et,mn,!1,{fetcherSubmission:Ue,preventScrollReset:Fe});if(Ha(mn)){ot(Y,ee,mn.error);return}}let rn=T.navigation.location||T.location,ga=Eu(e.history,rn,nt.signal),bs=f||u,Jr=T.navigation.state!=="idle"?Zi(bs,T.navigation.location,h):T.matches;Lt(Jr,"Didn't find any matches after fetcher action");let pn=++V;ge.set(Y,pn);let Mc=mf(Ue,mn.data);T.fetchers.set(Y,Mc);let{dsMatches:yi,revalidatingFetchers:ea}=jj(ga,je,i,c,e.history,T,Jr,Ue,rn,r,!1,z,M,W,U,P,bs,h,e.patchRoutesOnNavigation!=null,[pt.route.id,mn]);ea.filter(_n=>_n.key!==Y).forEach(_n=>{let ya=_n.key,ta=T.fetchers.get(ya),Zh=mf(void 0,ta?ta.data:void 0);T.fetchers.set(ya,Zh),Gn(ya),_n.controller&&H.set(ya,_n.controller)}),Me({fetchers:new Map(T.fetchers)});let Ss=()=>ea.forEach(_n=>Gn(_n.key));nt.signal.addEventListener("abort",Ss);let{loaderResults:kc,fetcherResults:$t}=await Te(yi,ea,ga,je);if(nt.signal.aborted)return;if(nt.signal.removeEventListener("abort",Ss),ge.delete(Y),H.delete(Y),ea.forEach(_n=>H.delete(_n.key)),T.fetchers.has(Y)){let _n=Go(mn.data);T.fetchers.set(Y,_n)}let pr=op(kc);if(pr)return Ne(ga,pr.result,!1,{preventScrollReset:Fe});if(pr=op($t),pr)return P.add(pr.key),Ne(ga,pr.result,!1,{preventScrollReset:Fe});let{loaderData:xi,errors:ts}=Ij(T,Jr,kc,void 0,ea,$t);kn(pn),T.navigation.state==="loading"&&pn>se?(Lt(D,"Expected pending action"),$&&$.abort(),ke(T.navigation.location,{matches:Jr,loaderData:xi,errors:ts,fetchers:new Map(T.fetchers)})):(Me({errors:ts,loaderData:Mj(T.loaderData,xi,Jr,ts),fetchers:new Map(T.fetchers)}),z=!1)}async function ue(Y,ee,le,Ce,je,He,qe,Fe,Ue){let Ve=T.fetchers.get(Y);st(Y,mf(Ue,Ve?Ve.data:void 0),{flushSync:qe});let nt=new AbortController,et=Eu(e.history,le,nt.signal);if(He){let rn=await qt(Ce,new URL(et.url).pathname,et.signal,Y);if(rn.type==="aborted")return;if(rn.type==="error"){ot(Y,ee,rn.error,{flushSync:qe});return}else if(rn.matches)Ce=rn.matches;else{ot(Y,ee,ds(404,{pathname:le}),{flushSync:qe});return}}let pt=Lp(Ce,le);H.set(Y,nt);let bn=V,Yn=ku(i,c,et,Ce,pt,r,je),mn=(await Ee(et,Yn,je,Y))[pt.route.id];if(H.get(Y)===nt&&H.delete(Y),!et.signal.aborted){if(W.has(Y)){st(Y,Go(void 0));return}if(tc(mn))if(se>bn){st(Y,Go(void 0));return}else{P.add(Y),await Ne(et,mn,!1,{preventScrollReset:Fe});return}if(Ha(mn)){ot(Y,ee,mn.error);return}st(Y,Go(mn.data))}}async function Ne(Y,ee,le,{submission:Ce,fetcherSubmission:je,preventScrollReset:He,replace:qe}={}){ee.response.headers.has("X-Remix-Revalidate")&&(z=!0);let Fe=ee.response.headers.get("Location");Lt(Fe,"Expected a Location header on the redirect Response"),Fe=Dj(Fe,new URL(Y.url),h);let Ue=Vf(T.location,Fe,{_isRedirect:!0});if(n){let Yn=!1;if(ee.response.headers.has("X-Remix-Reload-Document"))Yn=!0;else if(Bg(Fe)){const $n=FN(Fe,!0);Yn=$n.origin!==t.location.origin||ms($n.pathname,h)==null}if(Yn){qe?t.location.replace(Fe):t.location.assign(Fe);return}}$=null;let Ve=qe===!0||ee.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:nt,formAction:et,formEncType:pt}=T.navigation;!Ce&&!je&&nt&&et&&pt&&(Ce=Pj(T.navigation));let bn=Ce||je;if(l7.has(ee.response.status)&&bn&&aa(bn.formMethod))await Pt(Ve,Ue,{submission:{...bn,formAction:Fe},preventScrollReset:He||L,enableViewTransition:le?K:void 0});else{let Yn=v0(Ue,Ce);await Pt(Ve,Ue,{overrideNavigation:Yn,fetcherSubmission:je,preventScrollReset:He||L,enableViewTransition:le?K:void 0})}}async function Ee(Y,ee,le,Ce){let je,He={};try{je=await x7(y,Y,ee,Ce,le,!1)}catch(qe){return ee.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{He[Fe.route.id]={type:"error",error:qe}}),He}if(Y.signal.aborted)return He;for(let[qe,Fe]of Object.entries(je))if(T7(Fe)){let Ue=Fe.result;He[qe]={type:"redirect",response:C7(Ue,Y,qe,ee,h)}}else He[qe]=await S7(Fe);return He}async function Te(Y,ee,le,Ce){let je=Ee(le,Y,Ce,null),He=Promise.all(ee.map(async Ue=>{if(Ue.matches&&Ue.match&&Ue.request&&Ue.controller){let nt=(await Ee(Ue.request,Ue.matches,Ce,Ue.key))[Ue.match.route.id];return{[Ue.key]:nt}}else return Promise.resolve({[Ue.key]:{type:"error",error:ds(404,{pathname:Ue.path})}})})),qe=await je,Fe=(await He).reduce((Ue,Ve)=>Object.assign(Ue,Ve),{});return{loaderResults:qe,fetcherResults:Fe}}function $e(){z=!0,U.forEach((Y,ee)=>{H.has(ee)&&M.add(ee),Gn(ee)})}function st(Y,ee,le={}){T.fetchers.set(Y,ee),Me({fetchers:new Map(T.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function ot(Y,ee,le,Ce={}){let je=Yi(T.matches,ee);On(Y),Me({errors:{[je.route.id]:le},fetchers:new Map(T.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function jn(Y){return F.set(Y,(F.get(Y)||0)+1),W.has(Y)&&W.delete(Y),T.fetchers.get(Y)||c7}function mr(Y,ee){Gn(Y,ee==null?void 0:ee.reason),st(Y,Go(null))}function On(Y){let ee=T.fetchers.get(Y);H.has(Y)&&!(ee&&ee.state==="loading"&&ge.has(Y))&&Gn(Y),U.delete(Y),ge.delete(Y),P.delete(Y),W.delete(Y),M.delete(Y),T.fetchers.delete(Y)}function Qr(Y){let ee=(F.get(Y)||0)-1;ee<=0?(F.delete(Y),W.add(Y)):F.set(Y,ee),Me({fetchers:new Map(T.fetchers)})}function Gn(Y,ee){let le=H.get(Y);le&&(le.abort(ee),H.delete(Y))}function Hn(Y){for(let ee of Y){let le=jn(ee),Ce=Go(le.data);T.fetchers.set(ee,Ce)}}function or(){let Y=[],ee=!1;for(let le of P){let Ce=T.fetchers.get(le);Lt(Ce,`Expected fetcher: ${le}`),Ce.state==="loading"&&(P.delete(le),Y.push(le),ee=!0)}return Hn(Y),ee}function kn(Y){let ee=[];for(let[le,Ce]of ge)if(Ce<Y){let je=T.fetchers.get(le);Lt(je,`Expected fetcher: ${le}`),je.state==="loading"&&(Gn(le),ge.delete(le),ee.push(le))}return Hn(ee),ee.length>0}function Eo(Y,ee){let le=T.blockers.get(Y)||hf;return X.get(Y)!==ee&&X.set(Y,ee),le}function pa(Y){T.blockers.delete(Y),X.delete(Y)}function Dr(Y,ee){let le=T.blockers.get(Y)||hf;Lt(le.state==="unblocked"&&ee.state==="blocked"||le.state==="blocked"&&ee.state==="blocked"||le.state==="blocked"&&ee.state==="proceeding"||le.state==="blocked"&&ee.state==="unblocked"||le.state==="proceeding"&&ee.state==="unblocked",`Invalid blocker state transition: ${le.state} -> ${ee.state}`);let Ce=new Map(T.blockers);Ce.set(Y,ee),Me({blockers:Ce})}function vs({currentLocation:Y,nextLocation:ee,historyAction:le}){if(X.size===0)return;X.size>1&&Kn(!1,"A router only supports one blocker at a time");let Ce=Array.from(X.entries()),[je,He]=Ce[Ce.length-1],qe=T.blockers.get(je);if(!(qe&&qe.state==="proceeding")&&He({currentLocation:Y,nextLocation:ee,historyAction:le}))return je}function es(Y){let ee=ds(404,{pathname:Y}),le=f||u,{matches:Ce,route:je}=sp(le);return{notFoundMatches:Ce,route:je,error:ee}}function In(Y,ee,le){if(C=Y,w=ee,S=le||null,!R&&T.navigation===x0){R=!0;let Ce=Ft(T.location,T.matches);Ce!=null&&Me({restoreScrollPosition:Ce})}return()=>{C=null,w=null,S=null}}function Tn(Y,ee){return S&&S(Y,ee.map(Ce=>I9(Ce,T.loaderData)))||Y.key}function We(Y,ee){if(C&&w){let le=Tn(Y,ee);C[le]=w()}}function Ft(Y,ee){if(C){let le=Tn(Y,ee),Ce=C[le];if(typeof Ce=="number")return Ce}return null}function Ht(Y,ee,le){if(e.patchRoutesOnNavigation)if(Y){if(Object.keys(Y[0].params).length>0)return{active:!0,matches:Tf(ee,le,h,!0)}}else return{active:!0,matches:Tf(ee,le,h,!0)||[]};return{active:!1,matches:null}}async function qt(Y,ee,le,Ce){if(!e.patchRoutesOnNavigation)return{type:"success",matches:Y};let je=Y;for(;;){let He=f==null,qe=f||u,Fe=c;try{await e.patchRoutesOnNavigation({signal:le,path:ee,matches:je,fetcherKey:Ce,patch:(nt,et)=>{le.aborted||Tj(nt,et,qe,Fe,i,!1)}})}catch(nt){return{type:"error",error:nt,partialMatches:je}}finally{He&&!le.aborted&&(u=[...u])}if(le.aborted)return{type:"aborted"};let Ue=Zi(qe,ee,h),Ve=null;if(Ue){if(Object.keys(Ue[0].params).length===0)return{type:"success",matches:Ue};if(Ve=Tf(qe,ee,h,!0),!(Ve&&je.length<Ve.length&&Zn(je,Ve.slice(0,je.length))))return{type:"success",matches:Ue}}if(Ve||(Ve=Tf(qe,ee,h,!0)),!Ve||Zn(je,Ve))return{type:"success",matches:null};je=Ve}}function Zn(Y,ee){return Y.length===ee.length&&Y.every((le,Ce)=>le.route.id===ee[Ce].route.id)}function nn(Y){c={},f=Bf(Y,i,void 0,c)}function Xt(Y,ee,le=!1){let Ce=f==null;Tj(Y,ee,f||u,c,i,le),Ce&&(u=[...u],Me({}))}return O={get basename(){return h},get future(){return g},get state(){return T},get routes(){return u},get window(){return t},initialize:ce,subscribe:Se,enableScrollRestoration:In,navigate:tt,fetch:B,revalidate:at,createHref:Y=>e.history.createHref(Y),encodeLocation:Y=>e.history.encodeLocation(Y),getFetcher:jn,resetFetcher:mr,deleteFetcher:Qr,dispose:ye,getBlocker:Eo,deleteBlocker:pa,patchRoutes:Xt,_internalFetchControllers:H,_internalSetRoutes:nn,_internalSetStateDoNotUseOrYouWillBreakYourApp(Y){Me(Y)}},e.unstable_instrumentations&&(O=J9(O,e.unstable_instrumentations.map(Y=>Y.router).filter(Boolean))),O}function f7(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function C1(e,t,n,r,s,i){let c,u;if(s){c=[];for(let h of t)if(c.push(h),h.route.id===s){u=h;break}}else c=t,u=t[t.length-1];let f=qg(r||".",Gg(c),ms(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=Fb(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let y=new URLSearchParams(f.search),g=y.getAll("index");y.delete("index"),g.filter(v=>v).forEach(v=>y.append("index",v));let x=y.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=q9({basename:n,pathname:f.pathname})),go(f)}function Rj(e,t,n){if(!n||!f7(n))return{path:t};if(n.formMethod&&!_7(n.formMethod))return{path:t,error:ds(405,{method:n.formMethod})};let r=()=>({path:t,error:ds(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=JN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!aa(i))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[v,C])=>`${x}${v}=${C}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!aa(i))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}Lt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=R1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=R1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Oj(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Oj(u)}catch{return r()}let h={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(aa(h.formMethod))return{path:t,submission:h};let y=yl(t);return e&&y.search&&Fb(y.search)&&u.append("index",""),y.search=`?${u}`,{path:go(y),submission:h}}function jj(e,t,n,r,s,i,c,u,f,h,y,g,x,v,C,S,w,R,j,_){var q;let I=_?Ha(_[1])?_[1].error:_[1].data:void 0,A=s.createURL(i.location),O=s.createURL(f),T;if(y&&i.errors){let z=Object.keys(i.errors)[0];T=c.findIndex(M=>M.route.id===z)}else if(_&&Ha(_[1])){let z=_[0];T=c.findIndex(M=>M.route.id===z)-1}let D=_?_[1].statusCode:void 0,L=D&&D>=400,$={currentUrl:A,currentParams:((q=i.matches[0])==null?void 0:q.params)||{},nextUrl:O,nextParams:c[0].params,...u,actionResult:I,actionStatus:D},K=Ub(c.map(z=>z.route.path)),Z=c.map((z,M)=>{let{route:H}=z,V=null;if(T!=null&&M>T?V=!1:H.lazy?V=!0:zb(H)?y?V=w1(H,i.loaderData,i.errors):h7(i.loaderData,i.matches[M],z)&&(V=!0):V=!1,V!==null)return E1(n,r,e,K,z,h,t,V);let se=L?!1:g||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||m7(i.matches[M],z),ge={...$,defaultShouldRevalidate:se},P=Qp(z,ge);return E1(n,r,e,K,z,h,t,P,ge)}),G=[];return C.forEach((z,M)=>{if(y||!c.some(W=>W.route.id===z.routeId)||v.has(M))return;let H=i.fetchers.get(M),V=H&&H.state!=="idle"&&H.data===void 0,se=Zi(w,z.path,R);if(!se){if(j&&V)return;G.push({key:M,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(S.has(M))return;let ge=Lp(se,z.path),P=new AbortController,U=Eu(s,z.path,P.signal),F=null;if(x.has(M))x.delete(M),F=ku(n,r,U,se,ge,h,t);else if(V)g&&(F=ku(n,r,U,se,ge,h,t));else{let W={...$,defaultShouldRevalidate:L?!1:g};Qp(ge,W)&&(F=ku(n,r,U,se,ge,h,t,W))}F&&G.push({key:M,routeId:z.routeId,path:z.path,matches:F,match:ge,request:U,controller:P})}),{dsMatches:Z,revalidatingFetchers:G}}function zb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function w1(e,t,n){if(e.lazy)return!0;if(!zb(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 h7(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function m7(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Tj(e,t,n,r,s,i){let c;if(e){let h=r[e];Lt(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),c=h.children}else c=n;let u=[],f=[];if(t.forEach(h=>{let y=c.find(g=>ZN(h,g));y?f.push({existingRoute:y,newRoute:h}):u.push(h)}),u.length>0){let h=Bf(u,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...h)}if(i&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:y,newRoute:g}=f[h],x=y,[v]=Bf([g],s,[],{},!0);Object.assign(x,{element:v.element?v.element:x.element,errorElement:v.errorElement?v.errorElement:x.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:x.hydrateFallbackElement})}}function ZN(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(i=>ZN(n,i))}):!1}var _j=new WeakMap,YN=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(Lt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=_j.get(s);c||(c={},_j.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let h=N9(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(h)Kn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Kn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await i();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]=f,f},Nj=new WeakMap;function p7(e,t,n,r,s){let i=n[e.id];if(Lt(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=Nj.get(i);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let g=(async()=>{Lt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),v={};for(let C in x){let S=x[C];if(S===void 0)continue;let w=D9(C),j=i[C]!==void 0&&C!=="hasErrorBoundary";w?Kn(!w,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?Kn(!j,`Route "${i.id}" has a static property "${C}" defined but its lazy function is also returning a value for this property. The lazy route property "${C}" will be ignored.`):v[C]=S}Object.assign(i,v),Object.assign(i,{...r(i),lazy:void 0})})();return Nj.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let y of c){if(s&&s.includes(y))continue;let g=YN({key:y,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),y===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function Aj(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,i)=>{n[t[i].route.id]=s}),n}async function g7(e){return e.matches.some(t=>t.route.middleware)?WN(e,()=>Aj(e)):Aj(e)}function WN(e,t){return y7(e,t,r=>r,R7,n);function n(r,s,i){if(i)return Promise.resolve(Object.assign(i.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(h=>h.route.id===s),0),Math.max(c.findIndex(h=>h.unstable_shouldCallHandler()),0)),f=Yi(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function y7(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:h}=e,y=i.flatMap(x=>x.route.middleware?x.route.middleware.map(v=>[x.route.id,v]):[]);return await XN({request:c,params:u,context:f,unstable_pattern:h},y,t,n,r,s)}async function XN(e,t,n,r,s,i,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[c];if(!f)return await n();let[h,y]=f,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await XN(e,t,n,r,s,i,c+1)},g.value}catch(v){return g={value:await i(v,h,g)},g.value}};try{let v=await y(e,x),C=v!=null?r(v):void 0;return s(C)?C:g?C??g.value:(g={value:await x()},g.value)}catch(v){return await i(v,h,g)}}function QN(e,t,n,r,s){let i=YN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=p7(r.route,aa(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function E1(e,t,n,r,s,i,c,u,f=null){let h=!1,y=QN(e,t,n,s,i);return{...s,_lazyPromises:y,shouldLoad:u,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(g){return h=!0,f?typeof g=="boolean"?Qp(s,{...f,defaultShouldRevalidate:g}):Qp(s,f):u},resolve(g){let{lazy:x,loader:v,middleware:C}=s.route,S=h||u||g&&!aa(n.method)&&(x||v),w=C&&C.length>0&&!v&&!x;return S&&(aa(n.method)||!w)?v7({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function ku(e,t,n,r,s,i,c,u=null){return r.map(f=>f.route.id!==s.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:QN(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:E1(e,t,n,Ub(r.map(h=>h.route.path)),f,i,c,!0,u))}async function x7(e,t,n,r,s,i){n.some(h=>{var y;return(y=h._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(n.map(h=>{var y;return(y=h._lazyPromises)==null?void 0:y.middleware}));let c={request:t,unstable_pattern:Ub(n.map(h=>h.route.path)),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:h=>{let y=c;return WN(y,()=>h({...y,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(h=>{var y,g;return[(y=h._lazyPromises)==null?void 0:y.handler,(g=h._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function v7({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,h=aa(e.method),y=h?"action":"loader",g=x=>{let v,C=new Promise((R,j)=>v=j);f=()=>v(),e.signal.addEventListener("abort",f);let S=R=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${n.route.id}]`)):x({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),w=(async()=>{try{return{type:"data",result:await(i?i(j=>S(j)):S())}}catch(R){return{type:"error",result:R}}})();return Promise.race([w,C])};try{let x=h?n.route.action:n.route.loader;if(r||s)if(x){let v,[C]=await Promise.all([g(x).catch(S=>{v=S}),r,s]);if(v!==void 0)throw v;u=C}else{await r;let v=h?n.route.action:n.route.loader;if(v)[u]=await Promise.all([g(v),s]);else if(y==="action"){let C=new URL(e.url),S=C.pathname+C.search;throw ds(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(x)u=await g(x);else{let v=new URL(e.url),C=v.pathname+v.search;throw ds(404,{pathname:C})}}catch(x){return{type:"error",result:x}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function b7(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 S7(e){var r,s,i,c,u,f;let{result:t,type:n}=e;if(eA(t)){let h;try{h=await b7(t)}catch(y){return{type:"error",error:y}}return n==="error"?{type:"error",error:new Xp(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?Lj(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 Xp(((i=t.init)==null?void 0:i.status)||500,void 0,t.data),statusCode:Gf(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Gf(t)?t.status:void 0}:Lj(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function C7(e,t,n,r,s){let i=e.headers.get("Location");if(Lt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bg(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=C1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function Dj(e,t,n){if(Bg(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ms(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function Eu(e,t,n,r){let s=e.createURL(JN(t)).toString(),i={signal:n};if(r&&aa(r.formMethod)){let{formMethod:c,formEncType:u}=r;i.method=c.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=R1(r.formData):i.body=r.formData}return new Request(s,i)}function R1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Oj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function w7(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,h={},y=n&&Ha(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let x=g.route.id,v=t[x];if(Lt(!tc(v),"Cannot handle redirect results in processLoaderData"),Ha(v)){let C=v.error;if(y!==void 0&&(C=y,y=void 0),c=c||{},s)c[x]=C;else{let S=Yi(e,x);c[S.route.id]==null&&(c[S.route.id]=C)}r||(i[x]=KN),f||(f=!0,u=Gf(v.error)?v.error.status:500),v.headers&&(h[x]=v.headers)}else i[x]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(h[x]=v.headers)}),y!==void 0&&n&&(c={[n[0]]:y},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:h}}function Ij(e,t,n,r,s,i){let{loaderData:c,errors:u}=w7(t,n,r);return s.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:y,controller:g}=f;if(g&&g.signal.aborted)return;let x=i[h];if(Lt(x,"Did not find corresponding fetcher result"),Ha(x)){let v=Yi(e.matches,y==null?void 0:y.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:x.error}),e.fetchers.delete(h)}else if(tc(x))Lt(!1,"Unhandled fetcher revalidation redirect");else{let v=Go(x.data);e.fetchers.set(h,v)}}),{loaderData:c,errors:u}}function Mj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==KN).reduce((i,[c,u])=>(i[c]=u,i),{});for(let i of n){let c=i.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&i.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function kj(e){return e?Ha(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yi(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 sp(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 ds(e,{pathname:t,routeId:n,method:r,type:s,message:i}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`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"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`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&&(u=`Invalid request method "${r.toUpperCase()}"`)),new Xp(e||500,c,new Error(u),!0)}function op(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(tc(s))return{key:r,result:s}}}function JN(e){let t=typeof e=="string"?yl(e):e;return go({...t,hash:""})}function E7(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function R7(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&j7(n))}function j7(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function T7(e){return eA(e.result)&&i7.has(e.result.status)}function Ha(e){return e.type==="error"}function tc(e){return(e&&e.type)==="redirect"}function Lj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function eA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function _7(e){return o7.has(e.toUpperCase())}function aa(e){return a7.has(e.toUpperCase())}function Fb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Lp(e,t){let n=typeof t=="string"?yl(t).search:t.search;if(e[e.length-1].route.index&&Fb(n||""))return e[e.length-1];let r=VN(e);return r[r.length-1]}function Pj(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,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(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,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 v0(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 N7(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 mf(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 A7(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 Go(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 D7(e,t){try{let n=e.sessionStorage.getItem(qN);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function O7(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(qN,JSON.stringify(n))}catch(r){Kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function I7(){let e,t,n=new Promise((r,s)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{s(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var bc=m.createContext(null);bc.displayName="DataRouter";var ch=m.createContext(null);ch.displayName="DataRouterState";m.createContext(!1);var Hb=m.createContext({isTransitioning:!1});Hb.displayName="ViewTransition";var tA=m.createContext(new Map);tA.displayName="Fetchers";var M7=m.createContext(null);M7.displayName="Await";var Hs=m.createContext(null);Hs.displayName="Navigation";var Kg=m.createContext(null);Kg.displayName="Location";var ps=m.createContext({outlet:null,matches:[],isDataRoute:!1});ps.displayName="Route";var $b=m.createContext(null);$b.displayName="RouteError";function k7(e,{relative:t}={}){Lt(ad(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(Hs),{hash:s,pathname:i,search:c}=uh(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:lo([n,i])),r.createHref({pathname:u,search:c,hash:s})}function ad(){return m.useContext(Kg)!=null}function $s(){return Lt(ad(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Kg).location}var nA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rA(e){m.useContext(Hs).static||m.useLayoutEffect(e)}function Sc(){let{isDataRoute:e}=m.useContext(ps);return e?Y7():L7()}function L7(){Lt(ad(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(bc),{basename:t,navigator:n}=m.useContext(Hs),{matches:r}=m.useContext(ps),{pathname:s}=$s(),i=JSON.stringify(Gg(r)),c=m.useRef(!1);return rA(()=>{c.current=!0}),m.useCallback((f,h={})=>{if(Kn(c.current,nA),!c.current)return;if(typeof f=="number"){n.go(f);return}let y=qg(f,JSON.parse(i),s,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:lo([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,i,s,e])}var aA=m.createContext(null);function gs(){return m.useContext(aA)}function P7(e){let t=m.useContext(ps).outlet;return m.useMemo(()=>t&&m.createElement(aA.Provider,{value:e},t),[t,e])}function Zg(){let{matches:e}=m.useContext(ps),t=e[e.length-1];return t?t.params:{}}function uh(e,{relative:t}={}){let{matches:n}=m.useContext(ps),{pathname:r}=$s(),s=JSON.stringify(Gg(n));return m.useMemo(()=>qg(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function U7(e,t,n,r,s){Lt(ad(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=m.useContext(Hs),{matches:c}=m.useContext(ps),u=c[c.length-1],f=u?u.params:{},h=u?u.pathname:"/",y=u?u.pathnameBase:"/",g=u&&u.route;{let j=g&&g.path||"";sA(h,!g||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let x=$s(),v;v=x;let C=v.pathname||"/",S=C;if(y!=="/"){let j=y.replace(/^\//,"").split("/");S="/"+C.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=Zi(e,{pathname:S});return Kn(g||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Kn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),V7(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:lo([y,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?y:lo([y,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,s)}function z7(){let e=Z7(),t=Gf(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},i={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:i},"ErrorBoundary")," or"," ",m.createElement("code",{style:i},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,c)}var F7=m.createElement(z7,null),H7=class extends m.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.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?m.createElement(ps.Provider,{value:this.props.routeContext},m.createElement($b.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $7({routeContext:e,match:t,children:n}){let r=m.useContext(bc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(ps.Provider,{value:e},n)}function V7(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 i=e,c=n==null?void 0:n.errors;if(c!=null){let y=i.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);Lt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,y+1))}let u=!1,f=-1;if(n)for(let y=0;y<i.length;y++){let g=i[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:v}=n,C=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||C){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}let h=n&&r?(y,g)=>{var x,v;r(y,{location:n.location,params:((v=(x=n.matches)==null?void 0:x[0])==null?void 0:v.params)??{},errorInfo:g})}:void 0;return i.reduceRight((y,g,x)=>{let v,C=!1,S=null,w=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||F7,u&&(f<0&&x===0?(sA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):f===x&&(C=!0,w=g.route.hydrateFallbackElement||null)));let R=t.concat(i.slice(0,x+1)),j=()=>{let _;return v?_=S:C?_=w:g.route.Component?_=m.createElement(g.route.Component,null):g.route.element?_=g.route.element:_=y,m.createElement($7,{match:g,routeContext:{outlet:y,matches:R,isDataRoute:n!=null},children:_})};return n&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?m.createElement(H7,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:j(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:h}):j()},null)}function Vb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function B7(e){let t=m.useContext(bc);return Lt(t,Vb(e)),t}function G7(e){let t=m.useContext(ch);return Lt(t,Vb(e)),t}function q7(e){let t=m.useContext(ps);return Lt(t,Vb(e)),t}function Bb(e){let t=q7(e),n=t.matches[t.matches.length-1];return Lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function K7(){return Bb("useRouteId")}function Z7(){var r;let e=m.useContext($b),t=G7("useRouteError"),n=Bb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Y7(){let{router:e}=B7("useNavigate"),t=Bb("useNavigate"),n=m.useRef(!1);return rA(()=>{n.current=!0}),m.useCallback(async(s,i={})=>{Kn(n.current,nA),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Uj={};function sA(e,t,n){!t&&!Uj[e]&&(Uj[e]=!0,Kn(!1,n))}var zj={};function Fj(e,t){!e&&!zj[t]&&(zj[t]=!0,console.warn(t))}function W7(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Kn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:m.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Kn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Kn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var X7=["HydrateFallback","hydrateFallbackElement"],Q7=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 J7({router:e,flushSync:t,unstable_onError:n}){let[r,s]=m.useState(e.state),[i,c]=m.useState(),[u,f]=m.useState({isTransitioning:!1}),[h,y]=m.useState(),[g,x]=m.useState(),[v,C]=m.useState(),S=m.useRef(new Map),w=m.useCallback(A=>{s(O=>(A.errors&&n&&Object.entries(A.errors).forEach(([T,D])=>{var L,$;((L=O.errors)==null?void 0:L[T])!==D&&n(D,{location:A.location,params:(($=A.matches[0])==null?void 0:$.params)??{}})}),A))},[n]),R=m.useCallback((A,{deletedFetchers:O,flushSync:T,viewTransitionOpts:D})=>{A.fetchers.forEach(($,K)=>{$.data!==void 0&&S.current.set(K,$.data)}),O.forEach($=>S.current.delete($)),Fj(T===!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 L=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Fj(D==null||L,"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."),!D||!L){t&&T?t(()=>w(A)):m.startTransition(()=>w(A));return}if(t&&T){t(()=>{g&&(h&&h.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let $=e.window.document.startViewTransition(()=>{t(()=>w(A))});$.finished.finally(()=>{t(()=>{y(void 0),x(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>x($));return}g?(h&&h.resolve(),g.skipTransition(),C({state:A,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(c(A),f({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,g,h,w]);m.useLayoutEffect(()=>e.subscribe(R),[e,R]),m.useEffect(()=>{u.isTransitioning&&!u.flushSync&&y(new Q7)},[u]),m.useEffect(()=>{if(h&&i&&e.window){let A=i,O=h.promise,T=e.window.document.startViewTransition(async()=>{m.startTransition(()=>w(A)),await O});T.finished.finally(()=>{y(void 0),x(void 0),c(void 0),f({isTransitioning:!1})}),x(T)}},[i,h,e.window,w]),m.useEffect(()=>{h&&i&&r.location.key===i.location.key&&h.resolve()},[h,g,r.location,i]),m.useEffect(()=>{!u.isTransitioning&&v&&(c(v.state),f({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),C(void 0))},[u.isTransitioning,v]);let j=m.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,O,T)=>e.navigate(A,{state:O,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(A,O,T)=>e.navigate(A,{replace:!0,state:O,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[e]),_=e.basename||"/",I=m.useMemo(()=>({router:e,navigator:j,static:!1,basename:_,unstable_onError:n}),[e,j,_,n]);return m.createElement(m.Fragment,null,m.createElement(bc.Provider,{value:I},m.createElement(ch.Provider,{value:r},m.createElement(tA.Provider,{value:S.current},m.createElement(Hb.Provider,{value:u},m.createElement(rL,{basename:_,location:r.location,navigationType:r.historyAction,navigator:j},m.createElement(eL,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var eL=m.memo(tL);function tL({routes:e,future:t,state:n,unstable_onError:r}){return U7(e,void 0,n,r,t)}function nL({to:e,replace:t,state:n,relative:r}){Lt(ad(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=m.useContext(Hs);Kn(!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:i}=m.useContext(ps),{pathname:c}=$s(),u=Sc(),f=qg(e,Gg(i),c,r==="path"),h=JSON.stringify(f);return m.useEffect(()=>{u(JSON.parse(h),{replace:t,state:n,relative:r})},[u,h,r,t,n]),null}function Gb(e){return P7(e.context)}function rL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1}){Lt(!ad(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:s,static:i,future:{}}),[c,s,i]);typeof n=="string"&&(n=yl(n));let{pathname:f="/",search:h="",hash:y="",state:g=null,key:x="default"}=n,v=m.useMemo(()=>{let C=ms(f,c);return C==null?null:{location:{pathname:C,search:h,hash:y,state:g,key:x},navigationType:r}},[c,f,h,y,g,x,r]);return Kn(v!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${y}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:m.createElement(Hs.Provider,{value:u},m.createElement(Kg.Provider,{children:t,value:v}))}var Pp="get",Up="application/x-www-form-urlencoded";function Yg(e){return e!=null&&typeof e.tagName=="string"}function aL(e){return Yg(e)&&e.tagName.toLowerCase()==="button"}function sL(e){return Yg(e)&&e.tagName.toLowerCase()==="form"}function oL(e){return Yg(e)&&e.tagName.toLowerCase()==="input"}function iL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lL(e,t){return e.button===0&&(!t||t==="_self")&&!iL(e)}function j1(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function cL(e,t){let n=j1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var ip=null;function uL(){if(ip===null)try{new FormData(document.createElement("form"),0),ip=!1}catch{ip=!0}return ip}var dL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function b0(e){return e!=null&&!dL.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Up}"`),null):e}function fL(e,t){let n,r,s,i,c;if(sL(e)){let u=e.getAttribute("action");r=u?ms(u,t):null,n=e.getAttribute("method")||Pp,s=b0(e.getAttribute("enctype"))||Up,i=new FormData(e)}else if(aL(e)||oL(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?ms(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Pp,s=b0(e.getAttribute("formenctype"))||b0(u.getAttribute("enctype"))||Up,i=new FormData(u,e),!uL()){let{name:h,type:y,value:g}=e;if(y==="image"){let x=h?`${h}.`:"";i.append(`${x}x`,"0"),i.append(`${x}y`,"0")}else h&&i.append(h,g)}}else{if(Yg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Pp,r=null,s=Up,c=e}return i&&s==="text/plain"&&(c=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function qb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hL(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&&ms(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function mL(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 pL(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 gL(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await mL(i,n);return c.links?c.links():[]}return[]}));return bL(r.flat(1).filter(pL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Hj(e,t,n,r,s,i){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var y;return n[h].pathname!==f.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,h)=>c(f,h)||u(f,h)):i==="data"?t.filter((f,h)=>{var g;let y=r.routes[f.route.id];if(!y||!y.hasLoader)return!1;if(c(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function yL(e,t,{includeHydrateFallback:n}={}){return xL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function xL(e){return[...new Set(e)]}function vL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(vL(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function oA(){let e=m.useContext(bc);return qb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function SL(){let e=m.useContext(ch);return qb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Kb=m.createContext(void 0);Kb.displayName="FrameworkContext";function iA(){let e=m.useContext(Kb);return qb(e,"You must render this element inside a <HydratedRouter> element"),e}function CL(e,t){let n=m.useContext(Kb),[r,s]=m.useState(!1),[i,c]=m.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,x=m.useRef(null);m.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=R=>{R.forEach(j=>{c(j.isIntersecting)})},w=new IntersectionObserver(S,{threshold:.5});return x.current&&w.observe(x.current),()=>{w.disconnect()}}},[e]),m.useEffect(()=>{if(r){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[r]);let v=()=>{s(!0)},C=()=>{s(!1),c(!1)};return n?e!=="intent"?[i,x,{}]:[i,x,{onFocus:pf(u,v),onBlur:pf(f,C),onMouseEnter:pf(h,v),onMouseLeave:pf(y,C),onTouchStart:pf(g,v)}]:[!1,x,{}]}function pf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function wL({page:e,...t}){let{router:n}=oA(),r=m.useMemo(()=>Zi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(RL,{page:e,matches:r,...t}):null}function EL(e){let{manifest:t,routeModules:n}=iA(),[r,s]=m.useState([]);return m.useEffect(()=>{let i=!1;return gL(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function RL({page:e,matches:t,...n}){let r=$s(),{manifest:s,routeModules:i}=iA(),{basename:c}=oA(),{loaderData:u,matches:f}=SL(),h=m.useMemo(()=>Hj(e,t,f,s,r,"data"),[e,t,f,s,r]),y=m.useMemo(()=>Hj(e,t,f,s,r,"assets"),[e,t,f,s,r]),g=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,S=!1;if(t.forEach(R=>{var _;let j=s.routes[R.route.id];!j||!j.hasLoader||(!h.some(I=>I.route.id===R.route.id)&&R.route.id in u&&((_=i[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?S=!0:C.add(R.route.id))}),C.size===0)return[];let w=hL(e,c,"data");return S&&C.size>0&&w.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[w.pathname+w.search]},[c,u,r,s,h,t,e,i]),x=m.useMemo(()=>yL(y,s),[y,s]),v=EL(y);return m.createElement(m.Fragment,null,g.map(C=>m.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),x.map(C=>m.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),v.map(({key:C,link:S})=>m.createElement("link",{key:C,nonce:n.nonce,...S})))}function jL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var lA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{lA&&(window.__reactRouterVersion="7.9.6")}catch{}function TL(e,t){return d7({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:R9({window:t==null?void 0:t.window}),hydrationData:_L(),routes:e,mapRouteProperties:W7,hydrationRouteProperties:X7,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function _L(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:NL(e.errors)}),e}function NL(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 Xp(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let c=new i(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}var cA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yr=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:h,preventScrollReset:y,viewTransition:g,...x},v){let{basename:C}=m.useContext(Hs),S=typeof h=="string"&&cA.test(h),w,R=!1;if(typeof h=="string"&&S&&(w=h,lA))try{let L=new URL(window.location.href),$=h.startsWith("//")?new URL(L.protocol+h):new URL(h),K=ms($.pathname,C);$.origin===L.origin&&K!=null?h=K+$.search+$.hash:R=!0}catch{Kn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=k7(h,{relative:s}),[_,I,A]=CL(r,x),O=OL(h,{replace:c,state:u,target:f,preventScrollReset:y,relative:s,viewTransition:g});function T(L){t&&t(L),L.defaultPrevented||O(L)}let D=m.createElement("a",{...x,...A,href:w||j,onClick:R||i?t:T,ref:jL(v,I),target:f,"data-discover":!S&&n==="render"?"true":void 0});return _&&!S?m.createElement(m.Fragment,null,D,m.createElement(wL,{page:j})):D});Yr.displayName="Link";var dh=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...h},y){let g=uh(c,{relative:h.relative}),x=$s(),v=m.useContext(ch),{navigator:C,basename:S}=m.useContext(Hs),w=v!=null&&UL(g)&&u===!0,R=C.encodeLocation?C.encodeLocation(g).pathname:g.pathname,j=x.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&S&&(_=ms(_,S)||_);const I=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=j===R||!s&&j.startsWith(R)&&j.charAt(I)==="/",O=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:A,isPending:O,isTransitioning:w},D=A?t:void 0,L;typeof r=="function"?L=r(T):L=[r,A?"active":null,O?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let $=typeof i=="function"?i(T):i;return m.createElement(Yr,{...h,"aria-current":D,className:L,ref:y,style:$,to:c,viewTransition:u},typeof f=="function"?f(T):f)});dh.displayName="NavLink";var AL=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=Pp,action:u,onSubmit:f,relative:h,preventScrollReset:y,viewTransition:g,...x},v)=>{let C=LL(),S=PL(u,{relative:h}),w=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&cA.test(u),j=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let I=_.nativeEvent.submitter,A=(I==null?void 0:I.getAttribute("formmethod"))||c;C(I||_.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:s,state:i,relative:h,preventScrollReset:y,viewTransition:g})};return m.createElement("form",{ref:v,method:w,action:S,onSubmit:r?f:j,...x,"data-discover":!R&&e==="render"?"true":void 0})});AL.displayName="Form";function DL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uA(e){let t=m.useContext(bc);return Lt(t,DL(e)),t}function OL(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c}={}){let u=Sc(),f=$s(),h=uh(e,{relative:i});return m.useCallback(y=>{if(lL(y,t)){y.preventDefault();let g=n!==void 0?n:go(f)===go(h);u(e,{replace:g,state:r,preventScrollReset:s,relative:i,viewTransition:c})}},[f,u,h,n,r,t,e,s,i,c])}function IL(e){Kn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(j1(e)),n=m.useRef(!1),r=$s(),s=m.useMemo(()=>cL(r.search,n.current?null:t.current),[r.search]),i=Sc(),c=m.useCallback((u,f)=>{const h=j1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+h,f)},[i,s]);return[s,c]}var ML=0,kL=()=>`__${String(++ML)}__`;function LL(){let{router:e}=uA("useSubmit"),{basename:t}=m.useContext(Hs),n=K7();return m.useCallback(async(r,s={})=>{let{action:i,method:c,encType:u,formData:f,body:h}=fL(r,t);if(s.navigate===!1){let y=s.fetcherKey||kL();await e.fetch(y,n,s.action||i,{preventScrollReset:s.preventScrollReset,formData:f,body:h,formMethod:s.method||c,formEncType:s.encType||u,flushSync:s.flushSync})}else await e.navigate(s.action||i,{preventScrollReset:s.preventScrollReset,formData:f,body:h,formMethod:s.method||c,formEncType:s.encType||u,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function PL(e,{relative:t}={}){let{basename:n}=m.useContext(Hs),r=m.useContext(ps);Lt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...uh(e||".",{relative:t})},c=$s();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(y=>y==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let y=u.toString();i.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:lo([n,i.pathname])),go(i)}function UL(e,{relative:t}={}){let n=m.useContext(Hb);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=uA("useViewTransitionState"),s=uh(e,{relative:t});if(!n.isTransitioning)return!1;let i=ms(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ms(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Wp(s.pathname,c)!=null||Wp(s.pathname,i)!=null}var Os=UN();const dA=PN(Os);function zL(e){return m.createElement(J7,{flushSync:Os.flushSync,...e})}function $j(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=$j(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():$j(e[s],null)}}}}function mt(...e){return m.useCallback(Wr(...e),e)}var FL=Symbol.for("react.lazy"),Jp=Vg[" use ".trim().toString()];function HL(e){return typeof e=="object"&&e!==null&&"then"in e}function fA(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===FL&&"_payload"in e&&HL(e._payload)}function Zb(e){const t=$L(e),n=m.forwardRef((r,s)=>{let{children:i,...c}=r;fA(i)&&typeof Jp=="function"&&(i=Jp(i._payload));const u=m.Children.toArray(i),f=u.find(BL);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var fh=Zb("Slot");function $L(e){const t=m.forwardRef((n,r)=>{let{children:s,...i}=n;if(fA(s)&&typeof Jp=="function"&&(s=Jp(s._payload)),m.isValidElement(s)){const c=qL(s),u=GL(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VL=Symbol("radix.slottable");function BL(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VL}function GL(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function qL(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 hA(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=hA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mA(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=hA(e))&&(r&&(r+=" "),r+=t);return r}const Vj=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Bj=mA,Cc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Bj(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,c=Object.keys(s).map(h=>{const y=n==null?void 0:n[h],g=i==null?void 0:i[h];if(y===null)return null;const x=Vj(y)||Vj(g);return s[h][x]}),u=n&&Object.entries(n).reduce((h,y)=>{let[g,x]=y;return x===void 0||(h[g]=x),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,y)=>{let{class:g,className:x,...v}=y;return Object.entries(v).every(C=>{let[S,w]=C;return Array.isArray(w)?w.includes({...i,...u}[S]):{...i,...u}[S]===w})?[...h,g,x]:h},[]);return Bj(e,c,f,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 KL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pA=(...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 ZL={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 YL=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:c,...u},f)=>m.createElement("svg",{ref:f,...ZL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:pA("lucide",s),...u},[...c.map(([h,y])=>m.createElement(h,y)),...Array.isArray(i)?i:[i]]));/**
|
|
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 De=(e,t)=>{const n=m.forwardRef(({className:r,...s},i)=>m.createElement(YL,{ref:i,iconNode:t,className:pA(`lucide-${KL(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 WL=[["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"}]],Yb=De("ArchiveRestore",WL);/**
|
|
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 XL=[["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"}]],Gj=De("ArrowDownZA",XL);/**
|
|
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 QL=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],JL=De("ArrowLeft",QL);/**
|
|
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 eP=[["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"}]],tP=De("ArrowRightLeft",eP);/**
|
|
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 nP=[["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"}]],qj=De("ArrowUpAZ",nP);/**
|
|
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 rP=[["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"}]],Kj=De("ArrowUpDown",rP);/**
|
|
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 aP=[["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"}]],sP=De("Asterisk",aP);/**
|
|
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 oP=[["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"}]],iP=De("BadgeAlert",oP);/**
|
|
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 lP=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],cP=De("Blocks",lP);/**
|
|
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 uP=[["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"}]],dP=De("BookOpen",uP);/**
|
|
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 fP=[["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"}]],eg=De("Box",fP);/**
|
|
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 hP=[["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"}]],mP=De("BriefcaseBusiness",hP);/**
|
|
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 pP=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Wb=De("CalendarClock",pP);/**
|
|
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 gP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ia=De("Check",gP);/**
|
|
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 yP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vs=De("ChevronDown",yP);/**
|
|
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 xP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vP=De("ChevronLeft",xP);/**
|
|
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 bP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Da=De("ChevronRight",bP);/**
|
|
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 SP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qu=De("ChevronUp",SP);/**
|
|
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 CP=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],wP=De("ChevronsDownUp",CP);/**
|
|
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 EP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Xb=De("ChevronsUpDown",EP);/**
|
|
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 RP=[["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"}]],hh=De("CircleAlert",RP);/**
|
|
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 jP=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],TP=De("CircleCheckBig",jP);/**
|
|
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 _P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mh=De("CircleCheck",_P);/**
|
|
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 NP=[["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"}]],tg=De("CircleX",NP);/**
|
|
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 AP=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Qb=De("Code",AP);/**
|
|
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 DP=[["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"}]],OP=De("Columns3",DP);/**
|
|
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 IP=[["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"}]],Ku=De("Copy",IP);/**
|
|
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 MP=[["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"}]],gA=De("DatabaseZap",MP);/**
|
|
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 kP=[["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"}]],lc=De("Database",kP);/**
|
|
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 LP=[["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"}]],PP=De("Download",LP);/**
|
|
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 UP=[["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"}]],yA=De("EllipsisVertical",UP);/**
|
|
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 zP=[["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"}]],Bs=De("Ellipsis",zP);/**
|
|
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 FP=[["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"}]],ri=De("ExternalLink",FP);/**
|
|
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 HP=[["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"}]],$P=De("EyeOff",HP);/**
|
|
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 VP=[["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"}]],xA=De("Eye",VP);/**
|
|
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 BP=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],GP=De("FilePenLine",BP);/**
|
|
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 qP=[["path",{d:"M20 10V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4",key:"1rdf37"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M16 14a2 2 0 0 0-2 2",key:"ceaadl"}],["path",{d:"M20 14a2 2 0 0 1 2 2",key:"1ny6zw"}],["path",{d:"M20 22a2 2 0 0 0 2-2",key:"1l9q4k"}],["path",{d:"M16 22a2 2 0 0 1-2-2",key:"1wqh5n"}]],KP=De("FileScan",qP);/**
|
|
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 ZP=[["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"}]],YP=De("FileText",ZP);/**
|
|
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 WP=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],XP=De("FlaskConical",WP);/**
|
|
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 QP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],JP=De("FolderTree",QP);/**
|
|
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 eU=[["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"}]],Zj=De("Gem",eU);/**
|
|
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 tU=[["path",{d:"M12 13V2l8 4-8 4",key:"5wlwwj"}],["path",{d:"M20.561 10.222a9 9 0 1 1-12.55-5.29",key:"1c0wjv"}],["path",{d:"M8.002 9.997a5 5 0 1 0 8.9 2.02",key:"gb1g7m"}]],nU=De("Goal",tU);/**
|
|
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 rU=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],aU=De("GraduationCap",rU);/**
|
|
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 sU=[["path",{d:"M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3",key:"11za1p"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],oU=De("Grid2x2Check",sU);/**
|
|
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 iU=[["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"}]],vA=De("GripVertical",iU);/**
|
|
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 lU=[["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"}]],cU=De("Grip",lU);/**
|
|
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 uU=[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2",key:"adw53z"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2",key:"an4l38"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2",key:"144t0e"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2",key:"rtnfgi"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1",key:"1eyiv7"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1",key:"1qlmkx"}]],dU=De("Group",uU);/**
|
|
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 fU=[["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"}]],hU=De("History",fU);/**
|
|
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 mU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],zr=De("Info",mU);/**
|
|
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 pU=[["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"}]],T1=De("KeyRound",pU);/**
|
|
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 gU=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],yU=De("Layers",gU);/**
|
|
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 xU=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],vU=De("ListChecks",xU);/**
|
|
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 bU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wc=De("LoaderCircle",bU);/**
|
|
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 SU=[["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"}]],CU=De("Lock",SU);/**
|
|
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 wU=[["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"}]],EU=De("LogOut",wU);/**
|
|
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 RU=[["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"}]],jU=De("Menu",RU);/**
|
|
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 TU=[["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"}]],_U=De("MessageCircleQuestion",TU);/**
|
|
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 NU=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],AU=De("MessageCircle",NU);/**
|
|
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 DU=[["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"}]],bA=De("Monitor",DU);/**
|
|
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 OU=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],SA=De("Moon",OU);/**
|
|
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 IU=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],MU=De("Network",IU);/**
|
|
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 kU=[["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"}]],LU=De("OctagonAlert",kU);/**
|
|
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 PU=[["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"}]],CA=De("OctagonX",PU);/**
|
|
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 UU=[["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]],zU=De("PackageSearch",UU);/**
|
|
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 FU=[["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"}]],HU=De("PenLine",FU);/**
|
|
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 $U=[["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"}]],sd=De("Pencil",$U);/**
|
|
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 VU=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Wg=De("Play",VU);/**
|
|
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 BU=[["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"}]],Jb=De("Plug",BU);/**
|
|
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 GU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ma=De("Plus",GU);/**
|
|
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 qU=[["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"}]],KU=De("RefreshCw",qU);/**
|
|
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 ZU=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],YU=De("Route",ZU);/**
|
|
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 WU=[["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"}]],XU=De("Scale",WU);/**
|
|
442
|
-
* @license lucide-react v0.475.0 - ISC
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the ISC license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const QU=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],JU=De("ScanSearch",QU);/**
|
|
447
|
-
* @license lucide-react v0.475.0 - ISC
|
|
448
|
-
*
|
|
449
|
-
* This source code is licensed under the ISC license.
|
|
450
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
-
*/const ez=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],tz=De("ScanText",ez);/**
|
|
452
|
-
* @license lucide-react v0.475.0 - ISC
|
|
453
|
-
*
|
|
454
|
-
* This source code is licensed under the ISC license.
|
|
455
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const nz=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Ec=De("Search",nz);/**
|
|
457
|
-
* @license lucide-react v0.475.0 - ISC
|
|
458
|
-
*
|
|
459
|
-
* This source code is licensed under the ISC license.
|
|
460
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
-
*/const rz=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],az=De("Send",rz);/**
|
|
462
|
-
* @license lucide-react v0.475.0 - ISC
|
|
463
|
-
*
|
|
464
|
-
* This source code is licensed under the ISC license.
|
|
465
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
-
*/const sz=[["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"}]],wA=De("Settings",sz);/**
|
|
467
|
-
* @license lucide-react v0.475.0 - ISC
|
|
468
|
-
*
|
|
469
|
-
* This source code is licensed under the ISC license.
|
|
470
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/const oz=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],el=De("Sparkles",oz);/**
|
|
472
|
-
* @license lucide-react v0.475.0 - ISC
|
|
473
|
-
*
|
|
474
|
-
* This source code is licensed under the ISC license.
|
|
475
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/const iz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 8h7",key:"kbo1nt"}],["path",{d:"M8 12h6",key:"ikassy"}],["path",{d:"M11 16h5",key:"oq65wt"}]],lz=De("SquareChartGantt",iz);/**
|
|
477
|
-
* @license lucide-react v0.475.0 - ISC
|
|
478
|
-
*
|
|
479
|
-
* This source code is licensed under the ISC license.
|
|
480
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
481
|
-
*/const cz=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],uz=De("SquareCheckBig",cz);/**
|
|
482
|
-
* @license lucide-react v0.475.0 - ISC
|
|
483
|
-
*
|
|
484
|
-
* This source code is licensed under the ISC license.
|
|
485
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
486
|
-
*/const dz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],EA=De("SquarePlay",dz);/**
|
|
487
|
-
* @license lucide-react v0.475.0 - ISC
|
|
488
|
-
*
|
|
489
|
-
* This source code is licensed under the ISC license.
|
|
490
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
491
|
-
*/const fz=[["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"}]],RA=De("Sun",fz);/**
|
|
492
|
-
* @license lucide-react v0.475.0 - ISC
|
|
493
|
-
*
|
|
494
|
-
* This source code is licensed under the ISC license.
|
|
495
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
496
|
-
*/const hz=[["path",{d:"M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z",key:"1ldrpk"}],["path",{d:"M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7",key:"11i5po"}],["path",{d:"M 7 17h.01",key:"1euzgo"}],["path",{d:"m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8",key:"o2gii7"}]],mz=De("SwatchBook",hz);/**
|
|
497
|
-
* @license lucide-react v0.475.0 - ISC
|
|
498
|
-
*
|
|
499
|
-
* This source code is licensed under the ISC license.
|
|
500
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
501
|
-
*/const pz=[["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"}]],jA=De("Table",pz);/**
|
|
502
|
-
* @license lucide-react v0.475.0 - ISC
|
|
503
|
-
*
|
|
504
|
-
* This source code is licensed under the ISC license.
|
|
505
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
506
|
-
*/const gz=[["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"}]],yz=De("Telescope",gz);/**
|
|
507
|
-
* @license lucide-react v0.475.0 - ISC
|
|
508
|
-
*
|
|
509
|
-
* This source code is licensed under the ISC license.
|
|
510
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
511
|
-
*/const xz=[["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"}]],Qa=De("Trash2",xz);/**
|
|
512
|
-
* @license lucide-react v0.475.0 - ISC
|
|
513
|
-
*
|
|
514
|
-
* This source code is licensed under the ISC license.
|
|
515
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
516
|
-
*/const vz=[["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"}]],ph=De("TriangleAlert",vz);/**
|
|
517
|
-
* @license lucide-react v0.475.0 - ISC
|
|
518
|
-
*
|
|
519
|
-
* This source code is licensed under the ISC license.
|
|
520
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
521
|
-
*/const bz=[["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"}]],qf=De("Unplug",bz);/**
|
|
522
|
-
* @license lucide-react v0.475.0 - ISC
|
|
523
|
-
*
|
|
524
|
-
* This source code is licensed under the ISC license.
|
|
525
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
526
|
-
*/const Sz=[["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"}]],Yj=De("Users",Sz);/**
|
|
527
|
-
* @license lucide-react v0.475.0 - ISC
|
|
528
|
-
*
|
|
529
|
-
* This source code is licensed under the ISC license.
|
|
530
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
531
|
-
*/const Cz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zu=De("X",Cz),S0=768;function wz(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${S0-1}px)`),r=()=>{t(window.innerWidth<S0)};return n.addEventListener("change",r),t(window.innerWidth<S0),()=>n.removeEventListener("change",r)},[]),!!e}const Ez=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Rz=(e,t)=>({classGroupId:e,validator:t}),TA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ng="-",Wj=[],jz="arbitrary..",Tz=e=>{const t=Nz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return _z(c);const u=c.split(ng),f=u[0]===""&&u.length>1?1:0;return _A(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],h=n[c];return f?h?Ez(h,f):f:h||Wj}return n[c]||Wj}}},_A=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const h=_A(e,t+1,i);if(h)return h}const c=n.validators;if(c===null)return;const u=t===0?e.join(ng):e.slice(t).join(ng),f=c.length;for(let h=0;h<f;h++){const y=c[h];if(y.validator(u))return y.classGroupId}},_z=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?jz+r:void 0})(),Nz=e=>{const{theme:t,classGroups:n}=e;return Az(n,t)},Az=(e,t)=>{const n=TA();for(const r in e){const s=e[r];eS(s,n,r,t)}return n},eS=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];Dz(c,t,n,r)}},Dz=(e,t,n,r)=>{if(typeof e=="string"){Oz(e,t,n);return}if(typeof e=="function"){Iz(e,t,n,r);return}Mz(e,t,n,r)},Oz=(e,t,n)=>{const r=e===""?t:NA(t,e);r.classGroupId=n},Iz=(e,t,n,r)=>{if(kz(e)){eS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Rz(n,e))},Mz=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];eS(f,NA(t,u),n,r)}},NA=(e,t)=>{let n=e;const r=t.split(ng),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=TA(),n.nextPart.set(c,u)),n=u}return n},kz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Lz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,c)=>{n[i]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let c=n[i];if(c!==void 0)return c;if((c=r[i])!==void 0)return s(i,c),c},set(i,c){i in n?n[i]=c:s(i,c)}}},_1="!",Xj=":",Pz=[],Qj=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Uz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let c=0,u=0,f=0,h;const y=s.length;for(let S=0;S<y;S++){const w=s[S];if(c===0&&u===0){if(w===Xj){i.push(s.slice(f,S)),f=S+1;continue}if(w==="/"){h=S;continue}}w==="["?c++:w==="]"?c--:w==="("?u++:w===")"&&u--}const g=i.length===0?s:s.slice(f);let x=g,v=!1;g.endsWith(_1)?(x=g.slice(0,-1),v=!0):g.startsWith(_1)&&(x=g.slice(1),v=!0);const C=h&&h>f?h-f:void 0;return Qj(i,v,x,C)};if(t){const s=t+Xj,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):Qj(Pz,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},zz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const c=n[i],u=c[0]==="[",f=t.has(c);u||f?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(c)):s.push(c)}return s.length>0&&(s.sort(),r.push(...s)),r}},Fz=e=>({cache:Lz(e.cacheSize),parseClassName:Uz(e),sortModifiers:zz(e),...Tz(e)}),Hz=/\s+/,$z=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(Hz);let f="";for(let h=u.length-1;h>=0;h-=1){const y=u[h],{isExternal:g,modifiers:x,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:S}=n(y);if(g){f=y+(f.length>0?" "+f:f);continue}let w=!!S,R=r(w?C.substring(0,S):C);if(!R){if(!w){f=y+(f.length>0?" "+f:f);continue}if(R=r(C),!R){f=y+(f.length>0?" "+f:f);continue}w=!1}const j=x.length===0?"":x.length===1?x[0]:i(x).join(":"),_=v?j+_1:j,I=_+R;if(c.indexOf(I)>-1)continue;c.push(I);const A=s(R,w);for(let O=0;O<A.length;++O){const T=A[O];c.push(_+T)}f=y+(f.length>0?" "+f:f)}return f},Vz=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=AA(n))&&(s&&(s+=" "),s+=r);return s},AA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=AA(e[r]))&&(n&&(n+=" "),n+=t);return n},Bz=(e,...t)=>{let n,r,s,i;const c=f=>{const h=t.reduce((y,g)=>g(y),e());return n=Fz(h),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const h=r(f);if(h)return h;const y=$z(f,n);return s(f,y),y};return i=c,(...f)=>i(Vz(...f))},Gz=[],yr=e=>{const t=n=>n[e]||Gz;return t.isThemeGetter=!0,t},DA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qz=/^\d+\/\d+$/,Kz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zz=/\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$/,Yz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pu=e=>qz.test(e),kt=e=>!!e&&!Number.isNaN(Number(e)),$i=e=>!!e&&Number.isInteger(Number(e)),C0=e=>e.endsWith("%")&&kt(e.slice(0,-1)),$o=e=>Kz.test(e),Qz=()=>!0,Jz=e=>Zz.test(e)&&!Yz.test(e),IA=()=>!1,eF=e=>Wz.test(e),tF=e=>Xz.test(e),nF=e=>!Ze(e)&&!Ye(e),rF=e=>od(e,LA,IA),Ze=e=>DA.test(e),Wl=e=>od(e,PA,Jz),w0=e=>od(e,lF,kt),Jj=e=>od(e,MA,IA),aF=e=>od(e,kA,tF),lp=e=>od(e,UA,eF),Ye=e=>OA.test(e),gf=e=>id(e,PA),sF=e=>id(e,cF),eT=e=>id(e,MA),oF=e=>id(e,LA),iF=e=>id(e,kA),cp=e=>id(e,UA,!0),od=(e,t,n)=>{const r=DA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},id=(e,t,n=!1)=>{const r=OA.exec(e);return r?r[1]?t(r[1]):n:!1},MA=e=>e==="position"||e==="percentage",kA=e=>e==="image"||e==="url",LA=e=>e==="length"||e==="size"||e==="bg-size",PA=e=>e==="length",lF=e=>e==="number",cF=e=>e==="family-name",UA=e=>e==="shadow",uF=()=>{const e=yr("color"),t=yr("font"),n=yr("text"),r=yr("font-weight"),s=yr("tracking"),i=yr("leading"),c=yr("breakpoint"),u=yr("container"),f=yr("spacing"),h=yr("radius"),y=yr("shadow"),g=yr("inset-shadow"),x=yr("text-shadow"),v=yr("drop-shadow"),C=yr("blur"),S=yr("perspective"),w=yr("aspect"),R=yr("ease"),j=yr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...I(),Ye,Ze],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],D=()=>[Ye,Ze,f],L=()=>[pu,"full","auto",...D()],$=()=>[$i,"none","subgrid",Ye,Ze],K=()=>["auto",{span:["full",$i,Ye,Ze]},$i,Ye,Ze],Z=()=>[$i,"auto",Ye,Ze],G=()=>["auto","min","max","fr",Ye,Ze],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...D()],H=()=>[pu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],V=()=>[e,Ye,Ze],se=()=>[...I(),eT,Jj,{position:[Ye,Ze]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",oF,rF,{size:[Ye,Ze]}],U=()=>[C0,gf,Wl],F=()=>["","none","full",h,Ye,Ze],W=()=>["",kt,gf,Wl],X=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[kt,C0,eT,Jj],ce=()=>["","none",C,Ye,Ze],ye=()=>["none",kt,Ye,Ze],Se=()=>["none",kt,Ye,Ze],Me=()=>[kt,Ye,Ze],ke=()=>[pu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$o],breakpoint:[$o],color:[Qz],container:[$o],"drop-shadow":[$o],ease:["in","out","in-out"],font:[nF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$o],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$o],shadow:[$o],spacing:["px",kt],text:[$o],"text-shadow":[$o],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pu,Ze,Ye,w]}],container:["container"],columns:[{columns:[kt,Ze,Ye,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:A()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[$i,"auto",Ye,Ze]}],basis:[{basis:[pu,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[kt,pu,"auto","initial","none",Ze]}],grow:[{grow:["",kt,Ye,Ze]}],shrink:[{shrink:["",kt,Ye,Ze]}],order:[{order:[$i,"first","last","none",Ye,Ze]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[u,"screen",...H()]}],"min-w":[{"min-w":[u,"screen","none",...H()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,gf,Wl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,w0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",C0,Ze]}],"font-family":[{font:[sF,Ze,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,Ye,Ze]}],"line-clamp":[{"line-clamp":[kt,"none",Ye,w0]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",Ye,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[kt,"from-font","auto",Ye,Wl]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[kt,"auto",Ye,Ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ze]}],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",Ye,Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$i,Ye,Ze],radial:["",Ye,Ze],conic:[$i,Ye,Ze]},iF,aF]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[kt,Ye,Ze]}],"outline-w":[{outline:["",kt,gf,Wl]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",y,cp,lp]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",g,cp,lp]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[kt,Wl]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",x,cp,lp]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[kt,Ye,Ze]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"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":[kt]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Ye,Ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"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":I()}],"mask-image-conic-pos":[{"mask-conic":[kt]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ze]}],filter:[{filter:["","none",Ye,Ze]}],blur:[{blur:ce()}],brightness:[{brightness:[kt,Ye,Ze]}],contrast:[{contrast:[kt,Ye,Ze]}],"drop-shadow":[{"drop-shadow":["","none",v,cp,lp]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",kt,Ye,Ze]}],"hue-rotate":[{"hue-rotate":[kt,Ye,Ze]}],invert:[{invert:["",kt,Ye,Ze]}],saturate:[{saturate:[kt,Ye,Ze]}],sepia:[{sepia:["",kt,Ye,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ze]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[kt,Ye,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[kt,Ye,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",kt,Ye,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[kt,Ye,Ze]}],"backdrop-invert":[{"backdrop-invert":["",kt,Ye,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[kt,Ye,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[kt,Ye,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",kt,Ye,Ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[kt,"initial",Ye,Ze]}],ease:[{ease:["linear","initial",R,Ye,Ze]}],delay:[{delay:[kt,Ye,Ze]}],animate:[{animate:["none",j,Ye,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ye,Ze]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Ye,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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",Ye,Ze]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Ye,Ze]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[kt,gf,Wl,w0]}],stroke:[{stroke:["none",...V()]}],"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"]}},dF=Bz(uF);function oe(...e){return dF(mA(e))}const tS=Cc("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","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?fh:"button";return a.jsx(i,{"data-slot":"button",className:oe(tS({variant:t,size:n,className:e})),...s})}function It({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:oe("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 fF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hF=fF.reduce((e,t)=>{const n=Zb(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),mF="Separator",tT="horizontal",pF=["horizontal","vertical"],zA=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=tT,...s}=e,i=gF(r)?r:tT,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(hF.div,{"data-orientation":i,...u,...s,ref:t})});zA.displayName=mF;function gF(e){return pF.includes(e)}var yF=zA;function FA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(yF,{"data-slot":"separator",decorative:n,orientation:t,className:oe("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 Oe(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 xF(e,t){const n=m.createContext(t),r=i=>{const{children:c,...u}=i,f=m.useMemo(()=>u,Object.values(u));return a.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(i){const c=m.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function wr(e,t=[]){let n=[];function r(i,c){const u=m.createContext(c),f=n.length;n=[...n,c];const h=g=>{var R;const{scope:x,children:v,...C}=g,S=((R=x==null?void 0:x[e])==null?void 0:R[f])||u,w=m.useMemo(()=>C,Object.values(C));return a.jsx(S.Provider,{value:w,children:v})};h.displayName=i+"Provider";function y(g,x){var S;const v=((S=x==null?void 0:x[e])==null?void 0:S[f])||u,C=m.useContext(v);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[h,y]}const s=()=>{const i=n.map(c=>m.createContext(c));return function(u){const f=(u==null?void 0:u[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return s.scopeName=e,[r,vF(s,...t)]}function vF(...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(i){const c=r.reduce((u,{useScope:f,scopeName:h})=>{const g=f(i)[`__scope${h}`];return{...u,...g}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Fr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},bF=Vg[" useId ".trim().toString()]||(()=>{}),SF=0;function tr(e){const[t,n]=m.useState(bF());return Fr(()=>{n(r=>r??String(SF++))},[e]),e||(t?`radix-${t}`:"")}var CF=Vg[" useInsertionEffect ".trim().toString()]||Fr;function la({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=wF({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const y=m.useRef(e!==void 0);m.useEffect(()=>{const g=y.current;g!==u&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${u?"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.`),y.current=u},[u,r])}const h=m.useCallback(y=>{var g;if(u){const x=EF(y)?y(e):y;x!==e&&((g=c.current)==null||g.call(c,x))}else i(y)},[u,e,i,c]);return[f,h]}function wF({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),i=m.useRef(t);return CF(()=>{i.current=t},[t]),m.useEffect(()=>{var c;s.current!==n&&((c=i.current)==null||c.call(i,n),s.current=n)},[n,s]),[n,r,i]}function EF(e){return typeof e=="function"}function RF(e){const t=jF(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(_F);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function jF(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=AF(s),u=NF(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TF=Symbol("radix.slottable");function _F(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TF}function NF(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function AF(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 DF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=DF.reduce((e,t)=>{const n=RF(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function HA(e,t){e&&Os.flushSync(()=>e.dispatchEvent(t))}function Ls(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function OF(e,t=globalThis==null?void 0:globalThis.document){const n=Ls(e);m.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 IF="DismissableLayer",N1="dismissableLayer.update",MF="dismissableLayer.pointerDownOutside",kF="dismissableLayer.focusOutside",nT,$A=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rc=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,h=m.useContext($A),[y,g]=m.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=m.useState({}),C=mt(t,T=>g(T)),S=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(w),j=y?S.indexOf(y):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,I=j>=R,A=UF(T=>{const D=T.target,L=[...h.branches].some($=>$.contains(D));!I||L||(s==null||s(T),c==null||c(T),T.defaultPrevented||u==null||u())},x),O=zF(T=>{const D=T.target;[...h.branches].some($=>$.contains(D))||(i==null||i(T),c==null||c(T),T.defaultPrevented||u==null||u())},x);return OF(T=>{j===h.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},x),m.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(nT=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),rT(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=nT)}},[y,x,n,h]),m.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),rT())},[y,h]),m.useEffect(()=>{const T=()=>v({});return document.addEventListener(N1,T),()=>document.removeEventListener(N1,T)},[]),a.jsx(Je.div,{...f,ref:C,style:{pointerEvents:_?I?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,A.onPointerDownCapture)})});Rc.displayName=IF;var LF="DismissableLayerBranch",PF=m.forwardRef((e,t)=>{const n=m.useContext($A),r=m.useRef(null),s=mt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(Je.div,{...e,ref:s})});PF.displayName=LF;function UF(e,t=globalThis==null?void 0:globalThis.document){const n=Ls(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){VA(MF,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zF(e,t=globalThis==null?void 0:globalThis.document){const n=Ls(e),r=m.useRef(!1);return m.useEffect(()=>{const s=i=>{i.target&&!r.current&&VA(kF,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rT(){const e=new CustomEvent(N1);document.dispatchEvent(e)}function VA(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?HA(s,i):s.dispatchEvent(i)}var E0="focusScope.autoFocusOnMount",R0="focusScope.autoFocusOnUnmount",aT={bubbles:!1,cancelable:!0},FF="FocusScope",gh=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=m.useState(null),h=Ls(s),y=Ls(i),g=m.useRef(null),x=mt(t,S=>f(S)),v=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let S=function(_){if(v.paused||!u)return;const I=_.target;u.contains(I)?g.current=I:Bi(g.current,{select:!0})},w=function(_){if(v.paused||!u)return;const I=_.relatedTarget;I!==null&&(u.contains(I)||Bi(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Bi(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",w);const j=new MutationObserver(R);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",w),j.disconnect()}}},[r,u,v.paused]),m.useEffect(()=>{if(u){oT.add(v);const S=document.activeElement;if(!u.contains(S)){const R=new CustomEvent(E0,aT);u.addEventListener(E0,h),u.dispatchEvent(R),R.defaultPrevented||(HF(qF(BA(u)),{select:!0}),document.activeElement===S&&Bi(u))}return()=>{u.removeEventListener(E0,h),setTimeout(()=>{const R=new CustomEvent(R0,aT);u.addEventListener(R0,y),u.dispatchEvent(R),R.defaultPrevented||Bi(S??document.body,{select:!0}),u.removeEventListener(R0,y),oT.remove(v)},0)}}},[u,h,y,v]);const C=m.useCallback(S=>{if(!n&&!r||v.paused)return;const w=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,R=document.activeElement;if(w&&R){const j=S.currentTarget,[_,I]=$F(j);_&&I?!S.shiftKey&&R===I?(S.preventDefault(),n&&Bi(_,{select:!0})):S.shiftKey&&R===_&&(S.preventDefault(),n&&Bi(I,{select:!0})):R===j&&S.preventDefault()}},[n,r,v.paused]);return a.jsx(Je.div,{tabIndex:-1,...c,ref:x,onKeyDown:C})});gh.displayName=FF;function HF(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bi(r,{select:t}),document.activeElement!==n)return}function $F(e){const t=BA(e),n=sT(t,e),r=sT(t.reverse(),e);return[n,r]}function BA(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 sT(e,t){for(const n of e)if(!VF(n,{upTo:t}))return n}function VF(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 BF(e){return e instanceof HTMLInputElement&&"select"in e}function Bi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&BF(e)&&t&&e.select()}}var oT=GF();function GF(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=iT(e,t),e.unshift(t)},remove(t){var n;e=iT(e,t),(n=e[0])==null||n.resume()}}}function iT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qF(e){return e.filter(t=>t.tagName!=="A")}var KF="Portal",jc=m.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=m.useState(!1);Fr(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?dA.createPortal(a.jsx(Je.div,{...r,ref:t}),c):null});jc.displayName=KF;function ZF(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var $r=e=>{const{present:t,children:n}=e,r=YF(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=mt(r.ref,WF(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null};$r.displayName="Presence";function YF(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),i=m.useRef("none"),c=e?"mounted":"unmounted",[u,f]=ZF(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const h=up(r.current);i.current=u==="mounted"?h:"none"},[u]),Fr(()=>{const h=r.current,y=s.current;if(y!==e){const x=i.current,v=up(h);e?f("MOUNT"):v==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(y&&x!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Fr(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=v=>{const S=up(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(f("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},x=v=>{v.target===t&&(i.current=up(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function up(e){return(e==null?void 0:e.animationName)||"none"}function WF(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 j0=0;function Xg(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lT()),document.body.insertAdjacentElement("beforeend",e[1]??lT()),j0++,()=>{j0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),j0--}},[])}function lT(){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 ao=function(){return ao=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ao.apply(this,arguments)};function GA(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 XF(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var zp="right-scroll-bar-position",Fp="width-before-scroll-bar",QF="with-scroll-bars-hidden",JF="--removed-body-scroll-bar-size";function T0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function eH(e,t){var n=m.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 tH=typeof window<"u"?m.useLayoutEffect:m.useEffect,cT=new WeakMap;function nH(e,t){var n=eH(null,function(r){return e.forEach(function(s){return T0(s,r)})});return tH(function(){var r=cT.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||T0(u,null)}),i.forEach(function(u){s.has(u)||T0(u,c)})}cT.set(n,e)},[e]),n}function rH(e){return e}function aH(e,t){t===void 0&&(t=rH);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(i){var c=t(i,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(i){for(r=!0;n.length;){var c=n;n=[],c.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(i),c=n}var f=function(){var y=c;c=[],y.forEach(i)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return s}function sH(e){e===void 0&&(e={});var t=aH(null);return t.options=ao({async:!0,ssr:!1},e),t}var qA=function(e){var t=e.sideCar,n=GA(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 m.createElement(r,ao({},n))};qA.isSideCarExport=!0;function oH(e,t){return e.useMedium(t),qA}var KA=sH(),_0=function(){},Qg=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:_0,onWheelCapture:_0,onTouchMoveCapture:_0}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,v=e.noRelative,C=e.noIsolation,S=e.inert,w=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,I=GA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,O=nH([n,t]),T=ao(ao({},I),s);return m.createElement(m.Fragment,null,y&&m.createElement(A,{sideCar:KA,removeScrollBar:h,shards:g,noRelative:v,noIsolation:C,inert:S,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:_}),c?m.cloneElement(m.Children.only(u),ao(ao({},T),{ref:O})):m.createElement(j,ao({},T,{className:f,ref:O}),u))});Qg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qg.classNames={fullWidth:Fp,zeroRight:zp};var iH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iH();return t&&e.setAttribute("nonce",t),e}function cH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lH())&&(cH(t,n),uH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fH=function(){var e=dH();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ZA=function(){var e=fH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},hH={left:0,top:0,right:0,gap:0},N0=function(e){return parseInt(e||"",10)||0},mH=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[N0(n),N0(r),N0(s)]},pH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return hH;var t=mH(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])}},gH=ZA(),Lu="data-scroll-locked",yH=function(e,t,n,r){var s=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
532
|
-
.`.concat(QF,` {
|
|
533
|
-
overflow: hidden `).concat(r,`;
|
|
534
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
535
|
-
}
|
|
536
|
-
body[`).concat(Lu,`] {
|
|
537
|
-
overflow: hidden `).concat(r,`;
|
|
538
|
-
overscroll-behavior: contain;
|
|
539
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
540
|
-
padding-left: `.concat(s,`px;
|
|
541
|
-
padding-top: `).concat(i,`px;
|
|
542
|
-
padding-right: `).concat(c,`px;
|
|
543
|
-
margin-left:0;
|
|
544
|
-
margin-top:0;
|
|
545
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
546
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.`).concat(zp,` {
|
|
550
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
.`).concat(Fp,` {
|
|
554
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
.`).concat(zp," .").concat(zp,` {
|
|
558
|
-
right: 0 `).concat(r,`;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
.`).concat(Fp," .").concat(Fp,` {
|
|
562
|
-
margin-right: 0 `).concat(r,`;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
body[`).concat(Lu,`] {
|
|
566
|
-
`).concat(JF,": ").concat(u,`px;
|
|
567
|
-
}
|
|
568
|
-
`)},uT=function(){var e=parseInt(document.body.getAttribute(Lu)||"0",10);return isFinite(e)?e:0},xH=function(){m.useEffect(function(){return document.body.setAttribute(Lu,(uT()+1).toString()),function(){var e=uT()-1;e<=0?document.body.removeAttribute(Lu):document.body.setAttribute(Lu,e.toString())}},[])},vH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;xH();var i=m.useMemo(function(){return pH(s)},[s]);return m.createElement(gH,{styles:yH(i,!t,s,n?"":"!important")})},A1=!1;if(typeof window<"u")try{var dp=Object.defineProperty({},"passive",{get:function(){return A1=!0,!0}});window.addEventListener("test",dp,dp),window.removeEventListener("test",dp,dp)}catch{A1=!1}var gu=A1?{passive:!1}:!1,bH=function(e){return e.tagName==="TEXTAREA"},YA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bH(e)&&n[t]==="visible")},SH=function(e){return YA(e,"overflowY")},CH=function(e){return YA(e,"overflowX")},dT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=WA(e,r);if(s){var i=XA(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},EH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},WA=function(e,t){return e==="v"?SH(t):CH(t)},XA=function(e,t){return e==="v"?wH(t):EH(t)},RH=function(e,t){return e==="h"&&t==="rtl"?-1:1},jH=function(e,t,n,r,s){var i=RH(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),h=!1,y=c>0,g=0,x=0;do{if(!u)break;var v=XA(e,u),C=v[0],S=v[1],w=v[2],R=S-w-i*C;(C||R)&&WA(e,u)&&(g+=R,x+=C);var j=u.parentNode;u=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(h=!0),h},fp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fT=function(e){return[e.deltaX,e.deltaY]},hT=function(e){return e&&"current"in e?e.current:e},TH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_H=function(e){return`
|
|
569
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
570
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
571
|
-
`)},NH=0,yu=[];function AH(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(NH++)[0],i=m.useState(ZA)[0],c=m.useRef(e);m.useEffect(function(){c.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=XF([e.lockRef.current],(e.shards||[]).map(hT),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=m.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var R=fp(S),j=n.current,_="deltaX"in S?S.deltaX:j[0]-R[0],I="deltaY"in S?S.deltaY:j[1]-R[1],A,O=S.target,T=Math.abs(_)>Math.abs(I)?"h":"v";if("touches"in S&&T==="h"&&O.type==="range")return!1;var D=window.getSelection(),L=D&&D.anchorNode,$=L?L===O||L.contains(O):!1;if($)return!1;var K=dT(T,O);if(!K)return!0;if(K?A=T:(A=T==="v"?"h":"v",K=dT(T,O)),!K)return!1;if(!r.current&&"changedTouches"in S&&(_||I)&&(r.current=A),!A)return!0;var Z=r.current||A;return jH(Z,w,S,Z==="h"?_:I)},[]),f=m.useCallback(function(S){var w=S;if(!(!yu.length||yu[yu.length-1]!==i)){var R="deltaY"in w?fT(w):fp(w),j=t.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&TH(A.delta,R)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(hT).filter(Boolean).filter(function(A){return A.contains(w.target)}),I=_.length>0?u(w,_[0]):!c.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),h=m.useCallback(function(S,w,R,j){var _={name:S,delta:w,target:R,should:j,shadowParent:DH(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(I){return I!==_})},1)},[]),y=m.useCallback(function(S){n.current=fp(S),r.current=void 0},[]),g=m.useCallback(function(S){h(S.type,fT(S),S.target,u(S,e.lockRef.current))},[]),x=m.useCallback(function(S){h(S.type,fp(S),S.target,u(S,e.lockRef.current))},[]);m.useEffect(function(){return yu.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,gu),document.addEventListener("touchmove",f,gu),document.addEventListener("touchstart",y,gu),function(){yu=yu.filter(function(S){return S!==i}),document.removeEventListener("wheel",f,gu),document.removeEventListener("touchmove",f,gu),document.removeEventListener("touchstart",y,gu)}},[]);var v=e.removeScrollBar,C=e.inert;return m.createElement(m.Fragment,null,C?m.createElement(i,{styles:_H(s)}):null,v?m.createElement(vH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const OH=oH(KA,AH);var yh=m.forwardRef(function(e,t){return m.createElement(Qg,ao({},e,{ref:t,sideCar:OH}))});yh.classNames=Qg.classNames;var IH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xu=new WeakMap,hp=new WeakMap,mp={},A0=0,QA=function(e){return e&&(e.host||QA(e.parentNode))},MH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=QA(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})},kH=function(e,t,n,r){var s=MH(t,Array.isArray(e)?e:[e]);mp[n]||(mp[n]=new WeakMap);var i=mp[n],c=[],u=new Set,f=new Set(s),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};s.forEach(h);var y=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(x){if(u.has(x))y(x);else try{var v=x.getAttribute(r),C=v!==null&&v!=="false",S=(xu.get(x)||0)+1,w=(i.get(x)||0)+1;xu.set(x,S),i.set(x,w),c.push(x),S===1&&C&&hp.set(x,!0),w===1&&x.setAttribute(n,"true"),C||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return y(t),u.clear(),A0++,function(){c.forEach(function(g){var x=xu.get(g)-1,v=i.get(g)-1;xu.set(g,x),i.set(g,v),x||(hp.has(g)||g.removeAttribute(r),hp.delete(g)),v||g.removeAttribute(n)}),A0--,A0||(xu=new WeakMap,xu=new WeakMap,hp=new WeakMap,mp={})}},Jg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=IH(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),kH(r,s,n,"aria-hidden")):function(){return null}};function LH(e){const t=PH(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(zH);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function PH(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=HH(s),u=FH(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UH=Symbol("radix.slottable");function zH(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UH}function FH(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function HH(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 ey="Dialog",[JA,e4]=wr(ey),[$H,Gs]=JA(ey),t4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=m.useRef(null),f=m.useRef(null),[h,y]=la({prop:r,defaultProp:s??!1,onChange:i,caller:ey});return a.jsx($H,{scope:t,triggerRef:u,contentRef:f,contentId:tr(),titleId:tr(),descriptionId:tr(),open:h,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};t4.displayName=ey;var n4="DialogTrigger",r4=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gs(n4,n),i=mt(t,s.triggerRef);return a.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":aS(s.open),...r,ref:i,onClick:Oe(e.onClick,s.onOpenToggle)})});r4.displayName=n4;var nS="DialogPortal",[VH,a4]=JA(nS,{forceMount:void 0}),s4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Gs(nS,t);return a.jsx(VH,{scope:t,forceMount:n,children:m.Children.map(r,c=>a.jsx($r,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:c})}))})};s4.displayName=nS;var rg="DialogOverlay",o4=m.forwardRef((e,t)=>{const n=a4(rg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Gs(rg,e.__scopeDialog);return i.modal?a.jsx($r,{present:r||i.open,children:a.jsx(GH,{...s,ref:t})}):null});o4.displayName=rg;var BH=LH("DialogOverlay.RemoveScroll"),GH=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gs(rg,n);return a.jsx(yh,{as:BH,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Je.div,{"data-state":aS(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cc="DialogContent",i4=m.forwardRef((e,t)=>{const n=a4(cc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Gs(cc,e.__scopeDialog);return a.jsx($r,{present:r||i.open,children:i.modal?a.jsx(qH,{...s,ref:t}):a.jsx(KH,{...s,ref:t})})});i4.displayName=cc;var qH=m.forwardRef((e,t)=>{const n=Gs(cc,e.__scopeDialog),r=m.useRef(null),s=mt(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Jg(i)},[]),a.jsx(l4,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,i=>i.preventDefault())})}),KH=m.forwardRef((e,t)=>{const n=Gs(cc,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(l4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),l4=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=Gs(cc,n),f=m.useRef(null),h=mt(t,f);return Xg(),a.jsxs(a.Fragment,{children:[a.jsx(gh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Rc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":aS(u.open),...c,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(YH,{titleId:u.titleId}),a.jsx(XH,{contentRef:f,descriptionId:u.descriptionId})]})]})}),rS="DialogTitle",c4=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gs(rS,n);return a.jsx(Je.h2,{id:s.titleId,...r,ref:t})});c4.displayName=rS;var u4="DialogDescription",d4=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gs(u4,n);return a.jsx(Je.p,{id:s.descriptionId,...r,ref:t})});d4.displayName=u4;var f4="DialogClose",h4=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gs(f4,n);return a.jsx(Je.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})});h4.displayName=f4;function aS(e){return e?"open":"closed"}var m4="DialogTitleWarning",[ZH,p4]=xF(m4,{contentName:cc,titleName:rS,docsSlug:"dialog"}),YH=({titleId:e})=>{const t=p4(m4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
572
|
-
|
|
573
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
574
|
-
|
|
575
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},WH="DialogDescriptionWarning",XH=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${p4(WH).contentName}}.`;return m.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ty=t4,QH=r4,ny=s4,ry=o4,ay=i4,sS=c4,oS=d4,sy=h4;function li({...e}){return a.jsx(ty,{"data-slot":"sheet",...e})}function JH({...e}){return a.jsx(ny,{"data-slot":"sheet-portal",...e})}function e$({className:e,...t}){return a.jsx(ry,{"data-slot":"sheet-overlay",className:oe("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 ci({className:e,children:t,side:n="right",...r}){return a.jsxs(JH,{children:[a.jsx(e$,{}),a.jsxs(ay,{"data-slot":"sheet-content",className:oe("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]",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]",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,a.jsxs(sy,{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:[a.jsx(Zu,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ui({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:oe("flex flex-col gap-1 border-b p-4",e),...t})}function di({className:e,...t}){return a.jsx(sS,{"data-slot":"sheet-title",className:oe("text-foreground font-semibold",e),...t})}function xl({className:e,...t}){return a.jsx(oS,{"data-slot":"sheet-description",className:oe("text-muted-foreground text-sm",e),...t})}function Pr({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:oe("bg-accent animate-pulse rounded-md",e),...t})}const t$=["top","right","bottom","left"],fl=Math.min,Ga=Math.max,ag=Math.round,pp=Math.floor,co=e=>({x:e,y:e}),n$={left:"right",right:"left",bottom:"top",top:"bottom"},r$={start:"end",end:"start"};function D1(e,t,n){return Ga(e,fl(t,n))}function ai(e,t){return typeof e=="function"?e(t):e}function si(e){return e.split("-")[0]}function ld(e){return e.split("-")[1]}function iS(e){return e==="x"?"y":"x"}function lS(e){return e==="y"?"height":"width"}const a$=new Set(["top","bottom"]);function so(e){return a$.has(si(e))?"y":"x"}function cS(e){return iS(so(e))}function s$(e,t,n){n===void 0&&(n=!1);const r=ld(e),s=cS(e),i=lS(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=sg(c)),[c,sg(c)]}function o$(e){const t=sg(e);return[O1(e),t,O1(t)]}function O1(e){return e.replace(/start|end/g,t=>r$[t])}const mT=["left","right"],pT=["right","left"],i$=["top","bottom"],l$=["bottom","top"];function c$(e,t,n){switch(e){case"top":case"bottom":return n?t?pT:mT:t?mT:pT;case"left":case"right":return t?i$:l$;default:return[]}}function u$(e,t,n,r){const s=ld(e);let i=c$(si(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(O1)))),i}function sg(e){return e.replace(/left|right|bottom|top/g,t=>n$[t])}function d$(e){return{top:0,right:0,bottom:0,left:0,...e}}function g4(e){return typeof e!="number"?d$(e):{top:e,right:e,bottom:e,left:e}}function og(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 gT(e,t,n){let{reference:r,floating:s}=e;const i=so(t),c=cS(t),u=lS(c),f=si(t),h=i==="y",y=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,x=r[u]/2-s[u]/2;let v;switch(f){case"top":v={x:y,y:r.y-s.height};break;case"bottom":v={x:y,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:g};break;case"left":v={x:r.x-s.width,y:g};break;default:v={x:r.x,y:r.y}}switch(ld(t)){case"start":v[c]-=x*(n&&h?-1:1);break;case"end":v[c]+=x*(n&&h?-1:1);break}return v}const f$=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:c}=n,u=i.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:y,y:g}=gT(h,r,f),x=r,v={},C=0;for(let S=0;S<u.length;S++){const{name:w,fn:R}=u[S],{x:j,y:_,data:I,reset:A}=await R({x:y,y:g,initialPlacement:r,placement:x,strategy:s,middlewareData:v,rects:h,platform:c,elements:{reference:e,floating:t}});y=j??y,g=_??g,v={...v,[w]:{...v[w],...I}},A&&C<=50&&(C++,typeof A=="object"&&(A.placement&&(x=A.placement),A.rects&&(h=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:y,y:g}=gT(h,x,f)),S=-1)}return{x:y,y:g,placement:x,strategy:s,middlewareData:v}};async function Kf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:c,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:x=!1,padding:v=0}=ai(t,e),C=g4(v),w=u[x?g==="floating"?"reference":"floating":g],R=og(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:h,rootBoundary:y,strategy:f})),j=g==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),I=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},A=og(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-A.top+C.top)/I.y,bottom:(A.bottom-R.bottom+C.bottom)/I.y,left:(R.left-A.left+C.left)/I.x,right:(A.right-R.right+C.right)/I.x}}const h$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:y=0}=ai(e,t)||{};if(h==null)return{};const g=g4(y),x={x:n,y:r},v=cS(s),C=lS(v),S=await c.getDimensions(h),w=v==="y",R=w?"top":"left",j=w?"bottom":"right",_=w?"clientHeight":"clientWidth",I=i.reference[C]+i.reference[v]-x[v]-i.floating[C],A=x[v]-i.reference[v],O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let T=O?O[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(O)))&&(T=u.floating[_]||i.floating[C]);const D=I/2-A/2,L=T/2-S[C]/2-1,$=fl(g[R],L),K=fl(g[j],L),Z=$,G=T-S[C]-K,q=T/2-S[C]/2+D,z=D1(Z,q,G),M=!f.arrow&&ld(s)!=null&&q!==z&&i.reference[C]/2-(q<Z?$:K)-S[C]/2<0,H=M?q<Z?q-Z:q-G:0;return{[v]:x[v]+H,data:{[v]:z,centerOffset:q-z-H,...M&&{alignmentOffset:H}},reset:M}}}),m$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:c,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...w}=ai(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const R=si(s),j=so(u),_=si(u)===u,I=await(f.isRTL==null?void 0:f.isRTL(h.floating)),A=x||(_||!S?[sg(u)]:o$(u)),O=C!=="none";!x&&O&&A.push(...u$(u,S,C,I));const T=[u,...A],D=await Kf(t,w),L=[];let $=((r=i.flip)==null?void 0:r.overflows)||[];if(y&&L.push(D[R]),g){const q=s$(s,c,I);L.push(D[q[0]],D[q[1]])}if($=[...$,{placement:s,overflows:L}],!L.every(q=>q<=0)){var K,Z;const q=(((K=i.flip)==null?void 0:K.index)||0)+1,z=T[q];if(z&&(!(g==="alignment"?j!==so(z):!1)||$.every(V=>so(V.placement)===j?V.overflows[0]>0:!0)))return{data:{index:q,overflows:$},reset:{placement:z}};let M=(Z=$.filter(H=>H.overflows[0]<=0).sort((H,V)=>H.overflows[1]-V.overflows[1])[0])==null?void 0:Z.placement;if(!M)switch(v){case"bestFit":{var G;const H=(G=$.filter(V=>{if(O){const se=so(V.placement);return se===j||se==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(se=>se>0).reduce((se,ge)=>se+ge,0)]).sort((V,se)=>V[1]-se[1])[0])==null?void 0:G[0];H&&(M=H);break}case"initialPlacement":M=u;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function yT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xT(e){return t$.some(t=>e[t]>=0)}const p$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=ai(e,t);switch(r){case"referenceHidden":{const i=await Kf(t,{...s,elementContext:"reference"}),c=yT(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:xT(c)}}}case"escaped":{const i=await Kf(t,{...s,altBoundary:!0}),c=yT(i,n.floating);return{data:{escapedOffsets:c,escaped:xT(c)}}}default:return{}}}}},y4=new Set(["left","top"]);async function g$(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=si(n),u=ld(n),f=so(n)==="y",h=y4.has(c)?-1:1,y=i&&f?-1:1,g=ai(t,e);let{mainAxis:x,crossAxis:v,alignmentAxis:C}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof C=="number"&&(v=u==="end"?C*-1:C),f?{x:v*y,y:x*h}:{x:x*h,y:v*y}}const y$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:c,middlewareData:u}=t,f=await g$(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:i+f.y,data:{...f,placement:c}}}}},x$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:w=>{let{x:R,y:j}=w;return{x:R,y:j}}},...f}=ai(e,t),h={x:n,y:r},y=await Kf(t,f),g=so(si(s)),x=iS(g);let v=h[x],C=h[g];if(i){const w=x==="y"?"top":"left",R=x==="y"?"bottom":"right",j=v+y[w],_=v-y[R];v=D1(j,v,_)}if(c){const w=g==="y"?"top":"left",R=g==="y"?"bottom":"right",j=C+y[w],_=C-y[R];C=D1(j,C,_)}const S=u.fn({...t,[x]:v,[g]:C});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:i,[g]:c}}}}}},v$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=ai(e,t),y={x:n,y:r},g=so(s),x=iS(g);let v=y[x],C=y[g];const S=ai(u,t),w=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const _=x==="y"?"height":"width",I=i.reference[x]-i.floating[_]+w.mainAxis,A=i.reference[x]+i.reference[_]-w.mainAxis;v<I?v=I:v>A&&(v=A)}if(h){var R,j;const _=x==="y"?"width":"height",I=y4.has(si(s)),A=i.reference[g]-i.floating[_]+(I&&((R=c.offset)==null?void 0:R[g])||0)+(I?0:w.crossAxis),O=i.reference[g]+i.reference[_]+(I?0:((j=c.offset)==null?void 0:j[g])||0)-(I?w.crossAxis:0);C<A?C=A:C>O&&(C=O)}return{[x]:v,[g]:C}}}},b$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:c,elements:u}=t,{apply:f=()=>{},...h}=ai(e,t),y=await Kf(t,h),g=si(s),x=ld(s),v=so(s)==="y",{width:C,height:S}=i.floating;let w,R;g==="top"||g==="bottom"?(w=g,R=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,w=x==="end"?"top":"bottom");const j=S-y.top-y.bottom,_=C-y.left-y.right,I=fl(S-y[w],j),A=fl(C-y[R],_),O=!t.middlewareData.shift;let T=I,D=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),O&&!x){const $=Ga(y.left,0),K=Ga(y.right,0),Z=Ga(y.top,0),G=Ga(y.bottom,0);v?D=C-2*($!==0||K!==0?$+K:Ga(y.left,y.right)):T=S-2*(Z!==0||G!==0?Z+G:Ga(y.top,y.bottom))}await f({...t,availableWidth:D,availableHeight:T});const L=await c.getDimensions(u.floating);return C!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function oy(){return typeof window<"u"}function cd(e){return x4(e)?(e.nodeName||"").toLowerCase():"#document"}function Za(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bo(e){var t;return(t=(x4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function x4(e){return oy()?e instanceof Node||e instanceof Za(e).Node:!1}function Ps(e){return oy()?e instanceof Element||e instanceof Za(e).Element:!1}function yo(e){return oy()?e instanceof HTMLElement||e instanceof Za(e).HTMLElement:!1}function vT(e){return!oy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Za(e).ShadowRoot}const S$=new Set(["inline","contents"]);function xh(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Us(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!S$.has(s)}const C$=new Set(["table","td","th"]);function w$(e){return C$.has(cd(e))}const E$=[":popover-open",":modal"];function iy(e){return E$.some(t=>{try{return e.matches(t)}catch{return!1}})}const R$=["transform","translate","scale","rotate","perspective"],j$=["transform","translate","scale","rotate","perspective","filter"],T$=["paint","layout","strict","content"];function uS(e){const t=dS(),n=Ps(e)?Us(e):e;return R$.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)||j$.some(r=>(n.willChange||"").includes(r))||T$.some(r=>(n.contain||"").includes(r))}function _$(e){let t=hl(e);for(;yo(t)&&!Yu(t);){if(uS(t))return t;if(iy(t))return null;t=hl(t)}return null}function dS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const N$=new Set(["html","body","#document"]);function Yu(e){return N$.has(cd(e))}function Us(e){return Za(e).getComputedStyle(e)}function ly(e){return Ps(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hl(e){if(cd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vT(e)&&e.host||bo(e);return vT(t)?t.host:t}function v4(e){const t=hl(e);return Yu(t)?e.ownerDocument?e.ownerDocument.body:e.body:yo(t)&&xh(t)?t:v4(t)}function Zf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=v4(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=Za(s);if(i){const u=I1(c);return t.concat(c,c.visualViewport||[],xh(s)?s:[],u&&n?Zf(u):[])}return t.concat(s,Zf(s,[],n))}function I1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function b4(e){const t=Us(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=yo(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=ag(n)!==i||ag(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function fS(e){return Ps(e)?e:e.contextElement}function Pu(e){const t=fS(e);if(!yo(t))return co(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=b4(t);let c=(i?ag(n.width):n.width)/r,u=(i?ag(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const A$=co(0);function S4(e){const t=Za(e);return!dS()||!t.visualViewport?A$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Za(e)?!1:t}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=fS(e);let c=co(1);t&&(r?Ps(r)&&(c=Pu(r)):c=Pu(e));const u=D$(i,n,r)?S4(i):co(0);let f=(s.left+u.x)/c.x,h=(s.top+u.y)/c.y,y=s.width/c.x,g=s.height/c.y;if(i){const x=Za(i),v=r&&Ps(r)?Za(r):r;let C=x,S=I1(C);for(;S&&r&&v!==C;){const w=Pu(S),R=S.getBoundingClientRect(),j=Us(S),_=R.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,I=R.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;f*=w.x,h*=w.y,y*=w.x,g*=w.y,f+=_,h+=I,C=Za(S),S=I1(C)}}return og({width:y,height:g,x:f,y:h})}function cy(e,t){const n=ly(e).scrollLeft;return t?t.left+n:uc(bo(e)).left+n}function C4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cy(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function O$(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=bo(r),u=t?iy(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},h=co(1);const y=co(0),g=yo(r);if((g||!g&&!i)&&((cd(r)!=="body"||xh(c))&&(f=ly(r)),yo(r))){const v=uc(r);h=Pu(r),y.x=v.x+r.clientLeft,y.y=v.y+r.clientTop}const x=c&&!g&&!i?C4(c,f):co(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+y.x+x.x,y:n.y*h.y-f.scrollTop*h.y+y.y+x.y}}function I$(e){return Array.from(e.getClientRects())}function M$(e){const t=bo(e),n=ly(e),r=e.ownerDocument.body,s=Ga(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ga(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+cy(e);const u=-n.scrollTop;return Us(r).direction==="rtl"&&(c+=Ga(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const bT=25;function k$(e,t){const n=Za(e),r=bo(e),s=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,u=0,f=0;if(s){i=s.width,c=s.height;const y=dS();(!y||y&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const h=cy(r);if(h<=0){const y=r.ownerDocument,g=y.body,x=getComputedStyle(g),v=y.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,C=Math.abs(r.clientWidth-g.clientWidth-v);C<=bT&&(i-=C)}else h<=bT&&(i+=h);return{width:i,height:c,x:u,y:f}}const L$=new Set(["absolute","fixed"]);function P$(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=yo(e)?Pu(e):co(1),c=e.clientWidth*i.x,u=e.clientHeight*i.y,f=s*i.x,h=r*i.y;return{width:c,height:u,x:f,y:h}}function ST(e,t,n){let r;if(t==="viewport")r=k$(e,n);else if(t==="document")r=M$(bo(e));else if(Ps(t))r=P$(t,n);else{const s=S4(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return og(r)}function w4(e,t){const n=hl(e);return n===t||!Ps(n)||Yu(n)?!1:Us(n).position==="fixed"||w4(n,t)}function U$(e,t){const n=t.get(e);if(n)return n;let r=Zf(e,[],!1).filter(u=>Ps(u)&&cd(u)!=="body"),s=null;const i=Us(e).position==="fixed";let c=i?hl(e):e;for(;Ps(c)&&!Yu(c);){const u=Us(c),f=uS(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&L$.has(s.position)||xh(c)&&!f&&w4(e,c))?r=r.filter(y=>y!==c):s=u,c=hl(c)}return t.set(e,r),r}function z$(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?iy(t)?[]:U$(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((h,y)=>{const g=ST(t,y,s);return h.top=Ga(g.top,h.top),h.right=fl(g.right,h.right),h.bottom=fl(g.bottom,h.bottom),h.left=Ga(g.left,h.left),h},ST(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function F$(e){const{width:t,height:n}=b4(e);return{width:t,height:n}}function H$(e,t,n){const r=yo(t),s=bo(t),i=n==="fixed",c=uc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=co(0);function h(){f.x=cy(s)}if(r||!r&&!i)if((cd(t)!=="body"||xh(s))&&(u=ly(t)),r){const v=uc(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&h();i&&!r&&s&&h();const y=s&&!r&&!i?C4(s,u):co(0),g=c.left+u.scrollLeft-f.x-y.x,x=c.top+u.scrollTop-f.y-y.y;return{x:g,y:x,width:c.width,height:c.height}}function D0(e){return Us(e).position==="static"}function CT(e,t){if(!yo(e)||Us(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bo(e)===n&&(n=n.ownerDocument.body),n}function E4(e,t){const n=Za(e);if(iy(e))return n;if(!yo(e)){let s=hl(e);for(;s&&!Yu(s);){if(Ps(s)&&!D0(s))return s;s=hl(s)}return n}let r=CT(e,t);for(;r&&w$(r)&&D0(r);)r=CT(r,t);return r&&Yu(r)&&D0(r)&&!uS(r)?n:r||_$(e)||n}const $$=async function(e){const t=this.getOffsetParent||E4,n=this.getDimensions,r=await n(e.floating);return{reference:H$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function V$(e){return Us(e).direction==="rtl"}const B$={convertOffsetParentRelativeRectToViewportRelativeRect:O$,getDocumentElement:bo,getClippingRect:z$,getOffsetParent:E4,getElementRects:$$,getClientRects:I$,getDimensions:F$,getScale:Pu,isElement:Ps,isRTL:V$};function R4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function G$(e,t){let n=null,r;const s=bo(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const h=e.getBoundingClientRect(),{left:y,top:g,width:x,height:v}=h;if(u||t(),!x||!v)return;const C=pp(g),S=pp(s.clientWidth-(y+x)),w=pp(s.clientHeight-(g+v)),R=pp(y),_={rootMargin:-C+"px "+-S+"px "+-w+"px "+-R+"px",threshold:Ga(0,fl(1,f))||1};let I=!0;function A(O){const T=O[0].intersectionRatio;if(T!==f){if(!I)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!R4(h,e.getBoundingClientRect())&&c(),I=!1}try{n=new IntersectionObserver(A,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),i}function q$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=fS(e),y=s||i?[...h?Zf(h):[],...Zf(t)]:[];y.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=h&&u?G$(h,n):null;let x=-1,v=null;c&&(v=new ResizeObserver(R=>{let[j]=R;j&&j.target===h&&v&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),h&&!f&&v.observe(h),v.observe(t));let C,S=f?uc(e):null;f&&w();function w(){const R=uc(e);S&&!R4(S,R)&&n(),S=R,C=requestAnimationFrame(w)}return n(),()=>{var R;y.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),g==null||g(),(R=v)==null||R.disconnect(),v=null,f&&cancelAnimationFrame(C)}}const K$=y$,Z$=x$,Y$=m$,W$=b$,X$=p$,wT=h$,Q$=v$,J$=(e,t,n)=>{const r=new Map,s={platform:B$,...n},i={...s.platform,_c:r};return f$(e,t,{...s,platform:i})};var eV=typeof document<"u",tV=function(){},Hp=eV?m.useLayoutEffect:tV;function ig(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(!ig(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 i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!ig(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function j4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ET(e,t){const n=j4(e);return Math.round(t*n)/n}function O0(e){const t=m.useRef(e);return Hp(()=>{t.current=e}),t}function nV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[y,g]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=m.useState(r);ig(x,r)||v(r);const[C,S]=m.useState(null),[w,R]=m.useState(null),j=m.useCallback(V=>{V!==O.current&&(O.current=V,S(V))},[]),_=m.useCallback(V=>{V!==T.current&&(T.current=V,R(V))},[]),I=i||C,A=c||w,O=m.useRef(null),T=m.useRef(null),D=m.useRef(y),L=f!=null,$=O0(f),K=O0(s),Z=O0(h),G=m.useCallback(()=>{if(!O.current||!T.current)return;const V={placement:t,strategy:n,middleware:x};K.current&&(V.platform=K.current),J$(O.current,T.current,V).then(se=>{const ge={...se,isPositioned:Z.current!==!1};q.current&&!ig(D.current,ge)&&(D.current=ge,Os.flushSync(()=>{g(ge)}))})},[x,t,n,K,Z]);Hp(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(V=>({...V,isPositioned:!1})))},[h]);const q=m.useRef(!1);Hp(()=>(q.current=!0,()=>{q.current=!1}),[]),Hp(()=>{if(I&&(O.current=I),A&&(T.current=A),I&&A){if($.current)return $.current(I,A,G);G()}},[I,A,G,$,L]);const z=m.useMemo(()=>({reference:O,floating:T,setReference:j,setFloating:_}),[j,_]),M=m.useMemo(()=>({reference:I,floating:A}),[I,A]),H=m.useMemo(()=>{const V={position:n,left:0,top:0};if(!M.floating)return V;const se=ET(M.floating,y.x),ge=ET(M.floating,y.y);return u?{...V,transform:"translate("+se+"px, "+ge+"px)",...j4(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:ge}},[n,u,M.floating,y.x,y.y]);return m.useMemo(()=>({...y,update:G,refs:z,elements:M,floatingStyles:H}),[y,G,z,M,H])}const rV=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?wT({element:r.current,padding:s}).fn(n):{}:r?wT({element:r,padding:s}).fn(n):{}}}},aV=(e,t)=>({...K$(e),options:[e,t]}),sV=(e,t)=>({...Z$(e),options:[e,t]}),oV=(e,t)=>({...Q$(e),options:[e,t]}),iV=(e,t)=>({...Y$(e),options:[e,t]}),lV=(e,t)=>({...W$(e),options:[e,t]}),cV=(e,t)=>({...X$(e),options:[e,t]}),uV=(e,t)=>({...rV(e),options:[e,t]});var dV="Arrow",T4=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(Je.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});T4.displayName=dV;var fV=T4;function hS(e){const[t,n]=m.useState(void 0);return Fr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let c,u;if("borderBoxSize"in i){const f=i.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var mS="Popper",[_4,So]=wr(mS),[hV,N4]=_4(mS),A4=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return a.jsx(hV,{scope:t,anchor:r,onAnchorChange:s,children:n})};A4.displayName=mS;var D4="PopperAnchor",O4=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=N4(D4,n),c=m.useRef(null),u=mt(t,c),f=m.useRef(null);return m.useEffect(()=>{const h=f.current;f.current=(r==null?void 0:r.current)||c.current,h!==f.current&&i.onAnchorChange(f.current)}),r?null:a.jsx(Je.div,{...s,ref:u})});O4.displayName=D4;var pS="PopperContent",[mV,pV]=_4(pS),I4=m.forwardRef((e,t)=>{var J,ce,ye,Se,Me,ke;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:C,...S}=e,w=N4(pS,n),[R,j]=m.useState(null),_=mt(t,tt=>j(tt)),[I,A]=m.useState(null),O=hS(I),T=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,L=r+(i!=="center"?"-"+i:""),$=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},K=Array.isArray(h)?h:[h],Z=K.length>0,G={padding:$,boundary:K.filter(yV),altBoundary:Z},{refs:q,floatingStyles:z,placement:M,isPositioned:H,middlewareData:V}=nV({strategy:"fixed",placement:L,whileElementsMounted:(...tt)=>q$(...tt,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[aV({mainAxis:s+D,alignmentAxis:c}),f&&sV({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?oV():void 0,...G}),f&&iV({...G}),lV({...G,apply:({elements:tt,rects:at,availableWidth:Pt,availableHeight:fn})=>{const{width:Dn,height:ln}=at.reference,Ie=tt.floating.style;Ie.setProperty("--radix-popper-available-width",`${Pt}px`),Ie.setProperty("--radix-popper-available-height",`${fn}px`),Ie.setProperty("--radix-popper-anchor-width",`${Dn}px`),Ie.setProperty("--radix-popper-anchor-height",`${ln}px`)}}),I&&uV({element:I,padding:u}),xV({arrowWidth:T,arrowHeight:D}),x&&cV({strategy:"referenceHidden",...G})]}),[se,ge]=L4(M),P=Ls(C);Fr(()=>{H&&(P==null||P())},[H,P]);const U=(J=V.arrow)==null?void 0:J.x,F=(ce=V.arrow)==null?void 0:ce.y,W=((ye=V.arrow)==null?void 0:ye.centerOffset)!==0,[X,ae]=m.useState();return Fr(()=>{R&&ae(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:H?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(Se=V.transformOrigin)==null?void 0:Se.x,(Me=V.transformOrigin)==null?void 0:Me.y].join(" "),...((ke=V.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(mV,{scope:n,placedSide:se,onArrowChange:A,arrowX:U,arrowY:F,shouldHideArrow:W,children:a.jsx(Je.div,{"data-side":se,"data-align":ge,...S,ref:_,style:{...S.style,animation:H?void 0:"none"}})})})});I4.displayName=pS;var M4="PopperArrow",gV={top:"bottom",right:"left",bottom:"top",left:"right"},k4=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=pV(M4,r),c=gV[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(fV,{...s,ref:n,style:{...s.style,display:"block"}})})});k4.displayName=M4;function yV(e){return e!==null}var xV=e=>({name:"transformOrigin",options:e,fn(t){var w,R,j;const{placement:n,rects:r,middlewareData:s}=t,c=((w=s.arrow)==null?void 0:w.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,y]=L4(n),g={start:"0%",center:"50%",end:"100%"}[y],x=(((R=s.arrow)==null?void 0:R.x)??0)+u/2,v=(((j=s.arrow)==null?void 0:j.y)??0)+f/2;let C="",S="";return h==="bottom"?(C=c?g:`${x}px`,S=`${-f}px`):h==="top"?(C=c?g:`${x}px`,S=`${r.floating.height+f}px`):h==="right"?(C=`${-f}px`,S=c?g:`${v}px`):h==="left"&&(C=`${r.floating.width+f}px`,S=c?g:`${v}px`),{data:{x:C,y:S}}}});function L4(e){const[t,n="center"]=e.split("-");return[t,n]}var ud=A4,dd=O4,vh=I4,bh=k4,vV=Symbol("radix.slottable");function bV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=vV,t}var P4=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"}),SV="VisuallyHidden",U4=m.forwardRef((e,t)=>a.jsx(Je.span,{...e,ref:t,style:{...P4,...e.style}}));U4.displayName=SV;var CV=U4,[uy]=wr("Tooltip",[So]),dy=So(),z4="TooltipProvider",wV=700,M1="tooltip.open",[EV,gS]=uy(z4),F4=e=>{const{__scopeTooltip:t,delayDuration:n=wV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,c=m.useRef(!0),u=m.useRef(!1),f=m.useRef(0);return m.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),a.jsx(EV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:m.useCallback(h=>{u.current=h},[]),disableHoverableContent:s,children:i})};F4.displayName=z4;var Yf="Tooltip",[RV,Sh]=uy(Yf),H4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=gS(Yf,e.__scopeTooltip),h=dy(t),[y,g]=m.useState(null),x=tr(),v=m.useRef(0),C=c??f.disableHoverableContent,S=u??f.delayDuration,w=m.useRef(!1),[R,j]=la({prop:r,defaultProp:s??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(M1))):f.onClose(),i==null||i(T)},caller:Yf}),_=m.useMemo(()=>R?w.current?"delayed-open":"instant-open":"closed",[R]),I=m.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,j(!0)},[j]),A=m.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),O=m.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,j(!0),v.current=0},S)},[S,j]);return m.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(ud,{...h,children:a.jsx(RV,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:y,onTriggerChange:g,onTriggerEnter:m.useCallback(()=>{f.isOpenDelayedRef.current?O():I()},[f.isOpenDelayedRef,O,I]),onTriggerLeave:m.useCallback(()=>{C?A():(window.clearTimeout(v.current),v.current=0)},[A,C]),onOpen:I,onClose:A,disableHoverableContent:C,children:n})})};H4.displayName=Yf;var k1="TooltipTrigger",$4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Sh(k1,n),i=gS(k1,n),c=dy(n),u=m.useRef(null),f=mt(t,u,s.onTriggerChange),h=m.useRef(!1),y=m.useRef(!1),g=m.useCallback(()=>h.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),a.jsx(dd,{asChild:!0,...c,children:a.jsx(Je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Oe(e.onPointerMove,x=>{x.pointerType!=="touch"&&!y.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Oe(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:Oe(e.onBlur,s.onClose),onClick:Oe(e.onClick,s.onClose)})})});$4.displayName=k1;var yS="TooltipPortal",[jV,TV]=uy(yS,{forceMount:void 0}),V4=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Sh(yS,t);return a.jsx(jV,{scope:t,forceMount:n,children:a.jsx($r,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};V4.displayName=yS;var Wu="TooltipContent",B4=m.forwardRef((e,t)=>{const n=TV(Wu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=Sh(Wu,e.__scopeTooltip);return a.jsx($r,{present:r||c.open,children:c.disableHoverableContent?a.jsx(G4,{side:s,...i,ref:t}):a.jsx(_V,{side:s,...i,ref:t})})}),_V=m.forwardRef((e,t)=>{const n=Sh(Wu,e.__scopeTooltip),r=gS(Wu,e.__scopeTooltip),s=m.useRef(null),i=mt(t,s),[c,u]=m.useState(null),{trigger:f,onClose:h}=n,y=s.current,{onPointerInTransitChange:g}=r,x=m.useCallback(()=>{u(null),g(!1)},[g]),v=m.useCallback((C,S)=>{const w=C.currentTarget,R={x:C.clientX,y:C.clientY},j=OV(R,w.getBoundingClientRect()),_=IV(R,j),I=MV(S.getBoundingClientRect()),A=LV([..._,...I]);u(A),g(!0)},[g]);return m.useEffect(()=>()=>x(),[x]),m.useEffect(()=>{if(f&&y){const C=w=>v(w,y),S=w=>v(w,f);return f.addEventListener("pointerleave",C),y.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",C),y.removeEventListener("pointerleave",S)}}},[f,y,v,x]),m.useEffect(()=>{if(c){const C=S=>{const w=S.target,R={x:S.clientX,y:S.clientY},j=(f==null?void 0:f.contains(w))||(y==null?void 0:y.contains(w)),_=!kV(R,c);j?x():_&&(x(),h())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[f,y,c,h,x]),a.jsx(G4,{...e,ref:i})}),[NV,AV]=uy(Yf,{isInside:!1}),DV=bV("TooltipContent"),G4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=Sh(Wu,n),h=dy(n),{onClose:y}=f;return m.useEffect(()=>(document.addEventListener(M1,y),()=>document.removeEventListener(M1,y)),[y]),m.useEffect(()=>{if(f.trigger){const g=x=>{const v=x.target;v!=null&&v.contains(f.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,y]),a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:a.jsxs(vh,{"data-state":f.stateAttribute,...h,...u,ref:t,style:{...u.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:[a.jsx(DV,{children:r}),a.jsx(NV,{scope:n,isInside:!0,children:a.jsx(CV,{id:f.contentId,role:"tooltip",children:s||r})})]})})});B4.displayName=Wu;var q4="TooltipArrow",K4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=dy(n);return AV(q4,n).isInside?null:a.jsx(bh,{...s,...r,ref:t})});K4.displayName=q4;function OV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function IV(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 MV(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 kV(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],h=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-h)*(r-y)/(x-y)+h&&(s=!s)}return s}function LV(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),PV(t)}function PV(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 i=t[t.length-1],c=t[t.length-2];if((i.x-c.x)*(s.y-c.y)>=(i.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 i=n[n.length-1],c=n[n.length-2];if((i.x-c.x)*(s.y-c.y)>=(i.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 UV=F4,zV=H4,FV=$4,HV=V4,$V=B4,VV=K4;function Ka({delayDuration:e=0,...t}){return a.jsx(UV,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function wt({...e}){return a.jsx(Ka,{children:a.jsx(zV,{"data-slot":"tooltip",...e})})}function Et({...e}){return a.jsx(FV,{"data-slot":"tooltip-trigger",...e})}function Rt({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(HV,{children:a.jsxs($V,{"data-slot":"tooltip-content",sideOffset:t,className:oe("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,a.jsx(VV,{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 BV="sidebar_state",GV=3600*24*7,qV="16rem",KV="18rem",ZV="3rem",YV="b",Z4=m.createContext(null);function Ch(){const e=m.useContext(Z4);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function WV({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=wz(),[f,h]=m.useState(!1),[y,g]=m.useState(e),x=t??y,v=m.useCallback(R=>{const j=typeof R=="function"?R(x):R;n?n(j):g(j),document.cookie=`${BV}=${j}; path=/; max-age=${GV}`},[n,x]),C=m.useCallback(()=>u?h(R=>!R):v(R=>!R),[u,v,h]);m.useEffect(()=>{const R=j=>{j.key===YV&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),C())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[C]);const S=x?"expanded":"collapsed",w=m.useMemo(()=>({state:S,open:x,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:h,toggleSidebar:C}),[S,x,v,u,f,h,C]);return a.jsx(Z4.Provider,{value:w,children:a.jsx(Ka,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":qV,"--sidebar-width-icon":ZV,...s},className:oe("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function XV({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:h}=Ch();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:oe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):c?a.jsx(li,{open:f,onOpenChange:h,...i,children:a.jsxs(ci,{"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":KV},side:e,children:[a.jsxs(ui,{className:"sr-only",children:[a.jsx(di,{children:"Sidebar"}),a.jsx(xl,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:oe("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)")}),a.jsx("div",{"data-slot":"sidebar-container",className:oe("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),...i,children:a.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 QV({className:e,onClick:t,...n}){const{toggleSidebar:r}=Ch();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(we,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:oe("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[a.jsx(jU,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function JV({className:e,...t}){const{toggleSidebar:n}=Ch();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:oe("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 eB({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:oe("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 tB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:oe("flex flex-col gap-2 p-2",e),...t})}function nB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:oe("flex flex-col gap-2 p-2",e),...t})}function rB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:oe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function RT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:oe("relative flex w-full min-w-0 flex-col p-2",e),...t})}function jT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:oe("w-full text-sm",e),...t})}function aB({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:oe("flex w-full min-w-0 flex-col gap-1",e),...t})}function sB({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:oe("group/menu-item relative",e),...t})}const oB=Cc("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 iB({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?fh:"button",{isMobile:f,state:h}=Ch(),y=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:oe(oB({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:y}),a.jsx(Rt,{side:"right",align:"center",hidden:h!=="collapsed"||f,...s})]})):y}function L1(e){const t=lB(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(uB);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function lB(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=fB(s),u=dB(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cB=Symbol("radix.slottable");function uB(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cB}function dB(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function fB(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 hB(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=L1(u),h=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),I=mt(w,_.collectionRef);return a.jsx(f,{ref:I,children:j})});h.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=L1(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=mt(w,I),O=i(y,R);return re.useEffect(()=>(O.itemMap.set(I,{ref:I,..._}),()=>void O.itemMap.delete(I))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:h,ItemSlot:v},C,r]}var mB=m.createContext(void 0);function wh(e){const t=m.useContext(mB);return e||t||"ltr"}function TT(e){const t=pB(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(yB);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function pB(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=vB(s),u=xB(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gB=Symbol("radix.slottable");function yB(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gB}function xB(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function vB(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 bB(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=TT(u),h=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),I=mt(w,_.collectionRef);return a.jsx(f,{ref:I,children:j})});h.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=TT(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=mt(w,I),O=i(y,R);return re.useEffect(()=>(O.itemMap.set(I,{ref:I,..._}),()=>void O.itemMap.delete(I))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:h,ItemSlot:v},C,r]}var I0="rovingFocusGroup.onEntryFocus",SB={bubbles:!1,cancelable:!0},Eh="RovingFocusGroup",[P1,Y4,CB]=bB(Eh),[wB,fy]=wr(Eh,[CB]),[EB,RB]=wB(Eh),W4=m.forwardRef((e,t)=>a.jsx(P1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(P1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(jB,{...e,ref:t})})}));W4.displayName=Eh;var jB=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:y=!1,...g}=e,x=m.useRef(null),v=mt(t,x),C=wh(i),[S,w]=la({prop:c,defaultProp:u??null,onChange:f,caller:Eh}),[R,j]=m.useState(!1),_=Ls(h),I=Y4(n),A=m.useRef(!1),[O,T]=m.useState(0);return m.useEffect(()=>{const D=x.current;if(D)return D.addEventListener(I0,_),()=>D.removeEventListener(I0,_)},[_]),a.jsx(EB,{scope:n,orientation:r,dir:C,loop:s,currentTabStopId:S,onItemFocus:m.useCallback(D=>w(D),[w]),onItemShiftTab:m.useCallback(()=>j(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(D=>D+1),[]),onFocusableItemRemove:m.useCallback(()=>T(D=>D-1),[]),children:a.jsx(Je.div,{tabIndex:R||O===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{A.current=!0}),onFocus:Oe(e.onFocus,D=>{const L=!A.current;if(D.target===D.currentTarget&&L&&!R){const $=new CustomEvent(I0,SB);if(D.currentTarget.dispatchEvent($),!$.defaultPrevented){const K=I().filter(M=>M.focusable),Z=K.find(M=>M.active),G=K.find(M=>M.id===S),z=[Z,G,...K].filter(Boolean).map(M=>M.ref.current);J4(z,y)}}A.current=!1}),onBlur:Oe(e.onBlur,()=>j(!1))})})}),X4="RovingFocusGroupItem",Q4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=tr(),h=i||f,y=RB(X4,n),g=y.currentTabStopId===h,x=Y4(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:S}=y;return m.useEffect(()=>{if(r)return v(),()=>C()},[r,v,C]),a.jsx(P1.ItemSlot,{scope:n,id:h,focusable:r,active:s,children:a.jsx(Je.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...u,ref:t,onMouseDown:Oe(e.onMouseDown,w=>{r?y.onItemFocus(h):w.preventDefault()}),onFocus:Oe(e.onFocus,()=>y.onItemFocus(h)),onKeyDown:Oe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){y.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const R=NB(w,y.orientation,y.dir);if(R!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let _=x().filter(I=>I.focusable).map(I=>I.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const I=_.indexOf(w.currentTarget);_=y.loop?AB(_,I+1):_.slice(I+1)}setTimeout(()=>J4(_))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:S!=null}):c})})});Q4.displayName=X4;var TB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _B(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NB(e,t,n){const r=_B(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TB[r]}function J4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function AB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var e3=W4,t3=Q4,U1=["Enter"," "],DB=["ArrowDown","PageUp","Home"],n3=["ArrowUp","PageDown","End"],OB=[...DB,...n3],IB={ltr:[...U1,"ArrowRight"],rtl:[...U1,"ArrowLeft"]},MB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Rh="Menu",[Wf,kB,LB]=hB(Rh),[Tc,r3]=wr(Rh,[LB,So,fy]),jh=So(),a3=fy(),[s3,vl]=Tc(Rh),[PB,Th]=Tc(Rh),o3=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:c=!0}=e,u=jh(t),[f,h]=m.useState(null),y=m.useRef(!1),g=Ls(i),x=wh(s);return m.useEffect(()=>{const v=()=>{y.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>y.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),a.jsx(ud,{...u,children:a.jsx(s3,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:h,children:a.jsx(PB,{scope:t,onClose:m.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:x,modal:c,children:r})})})};o3.displayName=Rh;var UB="MenuAnchor",xS=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=jh(n);return a.jsx(dd,{...s,...r,ref:t})});xS.displayName=UB;var vS="MenuPortal",[zB,i3]=Tc(vS,{forceMount:void 0}),l3=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=vl(vS,t);return a.jsx(zB,{scope:t,forceMount:n,children:a.jsx($r,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};l3.displayName=vS;var hs="MenuContent",[FB,bS]=Tc(hs),c3=m.forwardRef((e,t)=>{const n=i3(hs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=vl(hs,e.__scopeMenu),c=Th(hs,e.__scopeMenu);return a.jsx(Wf.Provider,{scope:e.__scopeMenu,children:a.jsx($r,{present:r||i.open,children:a.jsx(Wf.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(HB,{...s,ref:t}):a.jsx($B,{...s,ref:t})})})})}),HB=m.forwardRef((e,t)=>{const n=vl(hs,e.__scopeMenu),r=m.useRef(null),s=mt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Jg(i)},[]),a.jsx(SS,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$B=m.forwardRef((e,t)=>{const n=vl(hs,e.__scopeMenu);return a.jsx(SS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),VB=L1("MenuContent.ScrollLock"),SS=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:h,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,disableOutsideScroll:C,...S}=e,w=vl(hs,n),R=Th(hs,n),j=jh(n),_=a3(n),I=kB(n),[A,O]=m.useState(null),T=m.useRef(null),D=mt(t,T,w.onContentChange),L=m.useRef(0),$=m.useRef(""),K=m.useRef(0),Z=m.useRef(null),G=m.useRef("right"),q=m.useRef(0),z=C?yh:m.Fragment,M=C?{as:VB,allowPinchZoom:!0}:void 0,H=se=>{var J,ce;const ge=$.current+se,P=I().filter(ye=>!ye.disabled),U=document.activeElement,F=(J=P.find(ye=>ye.ref.current===U))==null?void 0:J.textValue,W=P.map(ye=>ye.textValue),X=tG(W,ge,F),ae=(ce=P.find(ye=>ye.textValue===X))==null?void 0:ce.ref.current;(function ye(Se){$.current=Se,window.clearTimeout(L.current),Se!==""&&(L.current=window.setTimeout(()=>ye(""),1e3))})(ge),ae&&setTimeout(()=>ae.focus())};m.useEffect(()=>()=>window.clearTimeout(L.current),[]),Xg();const V=m.useCallback(se=>{var P,U;return G.current===((P=Z.current)==null?void 0:P.side)&&rG(se,(U=Z.current)==null?void 0:U.area)},[]);return a.jsx(FB,{scope:n,searchRef:$,onItemEnter:m.useCallback(se=>{V(se)&&se.preventDefault()},[V]),onItemLeave:m.useCallback(se=>{var ge;V(se)||((ge=T.current)==null||ge.focus(),O(null))},[V]),onTriggerLeave:m.useCallback(se=>{V(se)&&se.preventDefault()},[V]),pointerGraceTimerRef:K,onPointerGraceIntentChange:m.useCallback(se=>{Z.current=se},[]),children:a.jsx(z,{...M,children:a.jsx(gh,{asChild:!0,trapped:s,onMountAutoFocus:Oe(i,se=>{var ge;se.preventDefault(),(ge=T.current)==null||ge.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,children:a.jsx(e3,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Oe(f,se=>{R.isUsingKeyboardRef.current||se.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(vh,{role:"menu","aria-orientation":"vertical","data-state":j3(w.open),"data-radix-menu-content":"",dir:R.dir,...j,...S,ref:D,style:{outline:"none",...S.style},onKeyDown:Oe(S.onKeyDown,se=>{const P=se.target.closest("[data-radix-menu-content]")===se.currentTarget,U=se.ctrlKey||se.altKey||se.metaKey,F=se.key.length===1;P&&(se.key==="Tab"&&se.preventDefault(),!U&&F&&H(se.key));const W=T.current;if(se.target!==W||!OB.includes(se.key))return;se.preventDefault();const ae=I().filter(J=>!J.disabled).map(J=>J.ref.current);n3.includes(se.key)&&ae.reverse(),JB(ae)}),onBlur:Oe(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(L.current),$.current="")}),onPointerMove:Oe(e.onPointerMove,Xf(se=>{const ge=se.target,P=q.current!==se.clientX;if(se.currentTarget.contains(ge)&&P){const U=se.clientX>q.current?"right":"left";G.current=U,q.current=se.clientX}}))})})})})})})});c3.displayName=hs;var BB="MenuGroup",CS=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{role:"group",...r,ref:t})});CS.displayName=BB;var GB="MenuLabel",u3=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{...r,ref:t})});u3.displayName=GB;var lg="MenuItem",_T="menu.itemSelect",hy=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=m.useRef(null),c=Th(lg,e.__scopeMenu),u=bS(lg,e.__scopeMenu),f=mt(t,i),h=m.useRef(!1),y=()=>{const g=i.current;if(!n&&g){const x=new CustomEvent(_T,{bubbles:!0,cancelable:!0});g.addEventListener(_T,v=>r==null?void 0:r(v),{once:!0}),HA(g,x),x.defaultPrevented?h.current=!1:c.onClose()}};return a.jsx(d3,{...s,ref:f,disabled:n,onClick:Oe(e.onClick,y),onPointerDown:g=>{var x;(x=e.onPointerDown)==null||x.call(e,g),h.current=!0},onPointerUp:Oe(e.onPointerUp,g=>{var x;h.current||(x=g.currentTarget)==null||x.click()}),onKeyDown:Oe(e.onKeyDown,g=>{const x=u.searchRef.current!=="";n||x&&g.key===" "||U1.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});hy.displayName=lg;var d3=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=bS(lg,n),u=a3(n),f=m.useRef(null),h=mt(t,f),[y,g]=m.useState(!1),[x,v]=m.useState("");return m.useEffect(()=>{const C=f.current;C&&v((C.textContent??"").trim())},[i.children]),a.jsx(Wf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(t3,{asChild:!0,...u,focusable:!r,children:a.jsx(Je.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:h,onPointerMove:Oe(e.onPointerMove,Xf(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(e.onPointerLeave,Xf(C=>c.onItemLeave(C))),onFocus:Oe(e.onFocus,()=>g(!0)),onBlur:Oe(e.onBlur,()=>g(!1))})})})}),qB="MenuCheckboxItem",f3=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(y3,{scope:e.__scopeMenu,checked:n,children:a.jsx(hy,{role:"menuitemcheckbox","aria-checked":cg(n)?"mixed":n,...s,ref:t,"data-state":RS(n),onSelect:Oe(s.onSelect,()=>r==null?void 0:r(cg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});f3.displayName=qB;var h3="MenuRadioGroup",[KB,ZB]=Tc(h3,{value:void 0,onValueChange:()=>{}}),m3=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Ls(r);return a.jsx(KB,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(CS,{...s,ref:t})})});m3.displayName=h3;var p3="MenuRadioItem",g3=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=ZB(p3,e.__scopeMenu),i=n===s.value;return a.jsx(y3,{scope:e.__scopeMenu,checked:i,children:a.jsx(hy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":RS(i),onSelect:Oe(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});g3.displayName=p3;var wS="MenuItemIndicator",[y3,YB]=Tc(wS,{checked:!1}),x3=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=YB(wS,n);return a.jsx($r,{present:r||cg(i.checked)||i.checked===!0,children:a.jsx(Je.span,{...s,ref:t,"data-state":RS(i.checked)})})});x3.displayName=wS;var WB="MenuSeparator",v3=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});v3.displayName=WB;var XB="MenuArrow",b3=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=jh(n);return a.jsx(bh,{...s,...r,ref:t})});b3.displayName=XB;var ES="MenuSub",[QB,S3]=Tc(ES),C3=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=vl(ES,t),c=jh(t),[u,f]=m.useState(null),[h,y]=m.useState(null),g=Ls(s);return m.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),a.jsx(ud,{...c,children:a.jsx(s3,{scope:t,open:r,onOpenChange:g,content:h,onContentChange:y,children:a.jsx(QB,{scope:t,contentId:tr(),triggerId:tr(),trigger:u,onTriggerChange:f,children:n})})})};C3.displayName=ES;var _f="MenuSubTrigger",w3=m.forwardRef((e,t)=>{const n=vl(_f,e.__scopeMenu),r=Th(_f,e.__scopeMenu),s=S3(_f,e.__scopeMenu),i=bS(_f,e.__scopeMenu),c=m.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,h={__scopeMenu:e.__scopeMenu},y=m.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return m.useEffect(()=>y,[y]),m.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),a.jsx(xS,{asChild:!0,...h,children:a.jsx(d3,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":j3(n.open),...e,ref:Wr(t,s.onTriggerChange),onClick:g=>{var x;(x=e.onClick)==null||x.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(e.onPointerMove,Xf(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),y()},100))})),onPointerLeave:Oe(e.onPointerLeave,Xf(g=>{var v,C;y();const x=(v=n.content)==null?void 0:v.getBoundingClientRect();if(x){const S=(C=n.content)==null?void 0:C.dataset.side,w=S==="right",R=w?-5:5,j=x[w?"left":"right"],_=x[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+R,y:g.clientY},{x:j,y:x.top},{x:_,y:x.top},{x:_,y:x.bottom},{x:j,y:x.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(g),g.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(e.onKeyDown,g=>{var v;const x=i.searchRef.current!=="";e.disabled||x&&g.key===" "||IB[r.dir].includes(g.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),g.preventDefault())})})})});w3.displayName=_f;var E3="MenuSubContent",R3=m.forwardRef((e,t)=>{const n=i3(hs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=vl(hs,e.__scopeMenu),c=Th(hs,e.__scopeMenu),u=S3(E3,e.__scopeMenu),f=m.useRef(null),h=mt(t,f);return a.jsx(Wf.Provider,{scope:e.__scopeMenu,children:a.jsx($r,{present:r||i.open,children:a.jsx(Wf.Slot,{scope:e.__scopeMenu,children:a.jsx(SS,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:h,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{var g;c.isUsingKeyboardRef.current&&((g=f.current)==null||g.focus()),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:Oe(e.onFocusOutside,y=>{y.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Oe(e.onEscapeKeyDown,y=>{c.onClose(),y.preventDefault()}),onKeyDown:Oe(e.onKeyDown,y=>{var v;const g=y.currentTarget.contains(y.target),x=MB[c.dir].includes(y.key);g&&x&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),y.preventDefault())})})})})})});R3.displayName=E3;function j3(e){return e?"open":"closed"}function cg(e){return e==="indeterminate"}function RS(e){return cg(e)?"indeterminate":e?"checked":"unchecked"}function JB(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tG(e,t,n){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=eG(e,Math.max(i,0));s.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function nG(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],h=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-h)*(r-y)/(x-y)+h&&(s=!s)}return s}function rG(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nG(n,t)}function Xf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var aG=o3,sG=xS,oG=l3,iG=c3,lG=CS,cG=u3,uG=hy,dG=f3,fG=m3,hG=g3,mG=x3,pG=v3,gG=b3,yG=C3,xG=w3,vG=R3,my="DropdownMenu",[bG]=wr(my,[r3]),Xr=r3(),[SG,T3]=bG(my),_3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Xr(t),h=m.useRef(null),[y,g]=la({prop:s,defaultProp:i??!1,onChange:c,caller:my});return a.jsx(SG,{scope:t,triggerId:tr(),triggerRef:h,contentId:tr(),open:y,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(x=>!x),[g]),modal:u,children:a.jsx(aG,{...f,open:y,onOpenChange:g,dir:r,modal:u,children:n})})};_3.displayName=my;var N3="DropdownMenuTrigger",A3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=T3(N3,n),c=Xr(n);return a.jsx(sG,{asChild:!0,...c,children:a.jsx(Je.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Wr(t,i.triggerRef),onPointerDown:Oe(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Oe(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});A3.displayName=N3;var CG="DropdownMenuPortal",D3=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Xr(t);return a.jsx(oG,{...r,...n})};D3.displayName=CG;var O3="DropdownMenuContent",I3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=T3(O3,n),i=Xr(n),c=m.useRef(!1);return a.jsx(iG,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Oe(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Oe(e.onInteractOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,y=f.button===2||h;(!s.modal||y)&&(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)"}})});I3.displayName=O3;var wG="DropdownMenuGroup",EG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(lG,{...s,...r,ref:t})});EG.displayName=wG;var RG="DropdownMenuLabel",jG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(cG,{...s,...r,ref:t})});jG.displayName=RG;var TG="DropdownMenuItem",M3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(uG,{...s,...r,ref:t})});M3.displayName=TG;var _G="DropdownMenuCheckboxItem",NG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(dG,{...s,...r,ref:t})});NG.displayName=_G;var AG="DropdownMenuRadioGroup",DG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(fG,{...s,...r,ref:t})});DG.displayName=AG;var OG="DropdownMenuRadioItem",IG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(hG,{...s,...r,ref:t})});IG.displayName=OG;var MG="DropdownMenuItemIndicator",kG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(mG,{...s,...r,ref:t})});kG.displayName=MG;var LG="DropdownMenuSeparator",k3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(pG,{...s,...r,ref:t})});k3.displayName=LG;var PG="DropdownMenuArrow",UG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(gG,{...s,...r,ref:t})});UG.displayName=PG;var zG=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=Xr(t),[u,f]=la({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx(yG,{...c,open:u,onOpenChange:f,children:n})},FG="DropdownMenuSubTrigger",L3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(xG,{...s,...r,ref:t})});L3.displayName=FG;var HG="DropdownMenuSubContent",P3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Xr(n);return a.jsx(vG,{...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)"}})});P3.displayName=HG;var $G=_3,VG=A3,U3=D3,BG=I3,GG=M3,qG=k3,KG=zG,ZG=L3,YG=P3;function _r({...e}){return a.jsx($G,{"data-slot":"dropdown-menu",...e})}function WG({...e}){return a.jsx(U3,{"data-slot":"dropdown-menu-portal",...e})}function Nr({...e}){return a.jsx(VG,{"data-slot":"dropdown-menu-trigger",...e})}function Ar({className:e,sideOffset:t=4,...n}){return a.jsx(U3,{children:a.jsx(BG,{"data-slot":"dropdown-menu-content",sideOffset:t,className:oe("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 Nt({className:e,inset:t,variant:n="default",...r}){return a.jsx(GG,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:oe("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 Na({className:e,...t}){return a.jsx(qG,{"data-slot":"dropdown-menu-separator",className:oe("bg-border -mx-1 my-1 h-px",e),...t})}function jS({...e}){return a.jsx(KG,{"data-slot":"dropdown-menu-sub",...e})}function TS({className:e,inset:t,children:n,...r}){return a.jsxs(ZG,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:oe("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,a.jsx(Da,{className:"ml-auto size-4"})]})}function _S({className:e,...t}){return a.jsx(YG,{"data-slot":"dropdown-menu-sub-content",className:oe("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 XG="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",QG=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:XG,alt:"OWOX Logo",width:e,height:t,className:n}),z3=m.createContext(null),F3=m.createContext(()=>{});function JG(){return m.useContext(F3)}function ug(e){const t=m.useContext(z3);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function H3(){return ug(e=>e.project)}function _h(){const{data:e,callState:t,error:n}=ug(r=>r.flags);return{flags:e,callState:t,error:n}}function eq({isOpen:e}){const{title:t}=H3();return a.jsx(Nr,{asChild:!0,children:a.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:[a.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:a.jsx(QG,{width:24,height:24})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),a.jsx(Vs,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Kr=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Kr||{});function $3(e,t){return function(){return e.apply(t,arguments)}}const{toString:tq}=Object.prototype,{getPrototypeOf:NS}=Object,{iterator:py,toStringTag:V3}=Symbol,gy=(e=>t=>{const n=tq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qs=e=>(e=e.toLowerCase(),t=>gy(t)===e),yy=e=>t=>typeof t===e,{isArray:fd}=Array,Xu=yy("undefined");function Nh(e){return e!==null&&!Xu(e)&&e.constructor!==null&&!Xu(e.constructor)&&Ta(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const B3=qs("ArrayBuffer");function nq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&B3(e.buffer),t}const rq=yy("string"),Ta=yy("function"),G3=yy("number"),Ah=e=>e!==null&&typeof e=="object",aq=e=>e===!0||e===!1,$p=e=>{if(gy(e)!=="object")return!1;const t=NS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(V3 in e)&&!(py in e)},sq=e=>{if(!Ah(e)||Nh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},oq=qs("Date"),iq=qs("File"),lq=qs("Blob"),cq=qs("FileList"),uq=e=>Ah(e)&&Ta(e.pipe),dq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ta(e.append)&&((t=gy(e))==="formdata"||t==="object"&&Ta(e.toString)&&e.toString()==="[object FormData]"))},fq=qs("URLSearchParams"),[hq,mq,pq,gq]=["ReadableStream","Request","Response","Headers"].map(qs),yq=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Dh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),fd(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Nh(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),c=i.length;let u;for(r=0;r<c;r++)u=i[r],t.call(null,e[u],u,e)}}function q3(e,t){if(Nh(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 nc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,K3=e=>!Xu(e)&&e!==nc;function z1(){const{caseless:e,skipUndefined:t}=K3(this)&&this||{},n={},r=(s,i)=>{const c=e&&q3(n,i)||i;$p(n[c])&&$p(s)?n[c]=z1(n[c],s):$p(s)?n[c]=z1({},s):fd(s)?n[c]=s.slice():(!t||!Xu(s))&&(n[c]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Dh(arguments[s],r);return n}const xq=(e,t,n,{allOwnKeys:r}={})=>(Dh(t,(s,i)=>{n&&Ta(s)?e[i]=$3(s,n):e[i]=s},{allOwnKeys:r}),e),vq=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bq=(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)},Sq=(e,t,n,r)=>{let s,i,c;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)c=s[i],(!r||r(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&NS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Cq=(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},wq=e=>{if(!e)return null;if(fd(e))return e;let t=e.length;if(!G3(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Eq=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&NS(Uint8Array)),Rq=(e,t)=>{const r=(e&&e[py]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},jq=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Tq=qs("HTMLFormElement"),_q=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),NT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nq=qs("RegExp"),Z3=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Dh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},Aq=e=>{Z3(e,(t,n)=>{if(Ta(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ta(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+"'")})}})},Dq=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return fd(e)?r(e):r(String(e).split(t)),n},Oq=()=>{},Iq=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Mq(e){return!!(e&&Ta(e.append)&&e[V3]==="FormData"&&e[py])}const kq=e=>{const t=new Array(10),n=(r,s)=>{if(Ah(r)){if(t.indexOf(r)>=0)return;if(Nh(r))return r;if(!("toJSON"in r)){t[s]=r;const i=fd(r)?[]:{};return Dh(r,(c,u)=>{const f=n(c,s+1);!Xu(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},Lq=qs("AsyncFunction"),Pq=e=>e&&(Ah(e)||Ta(e))&&Ta(e.then)&&Ta(e.catch),Y3=((e,t)=>e?setImmediate:t?((n,r)=>(nc.addEventListener("message",({source:s,data:i})=>{s===nc&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),nc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ta(nc.postMessage)),Uq=typeof queueMicrotask<"u"?queueMicrotask.bind(nc):typeof process<"u"&&process.nextTick||Y3,zq=e=>e!=null&&Ta(e[py]),me={isArray:fd,isArrayBuffer:B3,isBuffer:Nh,isFormData:dq,isArrayBufferView:nq,isString:rq,isNumber:G3,isBoolean:aq,isObject:Ah,isPlainObject:$p,isEmptyObject:sq,isReadableStream:hq,isRequest:mq,isResponse:pq,isHeaders:gq,isUndefined:Xu,isDate:oq,isFile:iq,isBlob:lq,isRegExp:Nq,isFunction:Ta,isStream:uq,isURLSearchParams:fq,isTypedArray:Eq,isFileList:cq,forEach:Dh,merge:z1,extend:xq,trim:yq,stripBOM:vq,inherits:bq,toFlatObject:Sq,kindOf:gy,kindOfTest:qs,endsWith:Cq,toArray:wq,forEachEntry:Rq,matchAll:jq,isHTMLForm:Tq,hasOwnProperty:NT,hasOwnProp:NT,reduceDescriptors:Z3,freezeMethods:Aq,toObjectSet:Dq,toCamelCase:_q,noop:Oq,toFiniteNumber:Iq,findKey:q3,global:nc,isContextDefined:K3,isSpecCompliantForm:Mq,toJSONObject:kq,isAsyncFn:Lq,isThenable:Pq,setImmediate:Y3,asap:Uq,isIterable:zq};function St(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)}me.inherits(St,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:me.toJSONObject(this.config),code:this.code,status:this.status}}});const W3=St.prototype,X3={};["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=>{X3[e]={value:e}});Object.defineProperties(St,X3);Object.defineProperty(W3,"isAxiosError",{value:!0});St.from=(e,t,n,r,s,i)=>{const c=Object.create(W3);me.toFlatObject(e,c,function(y){return y!==Error.prototype},h=>h!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return St.call(c,u,f,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",i&&Object.assign(c,i),c};const Fq=null;function F1(e){return me.isPlainObject(e)||me.isArray(e)}function Q3(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function AT(e,t,n){return e?e.concat(t).map(function(s,i){return s=Q3(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Hq(e){return me.isArray(e)&&!e.some(F1)}const $q=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function xy(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,w){return!me.isUndefined(w[S])});const r=n.metaTokens,s=n.visitor||y,i=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(s))throw new TypeError("visitor must be a function");function h(C){if(C===null)return"";if(me.isDate(C))return C.toISOString();if(me.isBoolean(C))return C.toString();if(!f&&me.isBlob(C))throw new St("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(C)||me.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function y(C,S,w){let R=C;if(C&&!w&&typeof C=="object"){if(me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),C=JSON.stringify(C);else if(me.isArray(C)&&Hq(C)||(me.isFileList(C)||me.endsWith(S,"[]"))&&(R=me.toArray(C)))return S=Q3(S),R.forEach(function(_,I){!(me.isUndefined(_)||_===null)&&t.append(c===!0?AT([S],I,i):c===null?S:S+"[]",h(_))}),!1}return F1(C)?!0:(t.append(AT(w,S,i),h(C)),!1)}const g=[],x=Object.assign($q,{defaultVisitor:y,convertValue:h,isVisitable:F1});function v(C,S){if(!me.isUndefined(C)){if(g.indexOf(C)!==-1)throw Error("Circular reference detected in "+S.join("."));g.push(C),me.forEach(C,function(R,j){(!(me.isUndefined(R)||R===null)&&s.call(t,R,me.isString(j)?j.trim():j,S,x))===!0&&v(R,S?S.concat(j):[j])}),g.pop()}}if(!me.isObject(e))throw new TypeError("data must be an object");return v(e),t}function DT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function AS(e,t){this._pairs=[],e&&xy(e,this,t)}const J3=AS.prototype;J3.append=function(t,n){this._pairs.push([t,n])};J3.toString=function(t){const n=t?function(r){return t.call(this,r,DT)}:DT;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Vq(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function eD(e,t,n){if(!t)return e;const r=n&&n.encode||Vq;me.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=me.isURLSearchParams(t)?t.toString():new AS(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class OT{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){me.forEach(this.handlers,function(r){r!==null&&t(r)})}}const tD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bq=typeof URLSearchParams<"u"?URLSearchParams:AS,Gq=typeof FormData<"u"?FormData:null,qq=typeof Blob<"u"?Blob:null,Kq={isBrowser:!0,classes:{URLSearchParams:Bq,FormData:Gq,Blob:qq},protocols:["http","https","file","blob","url","data"]},DS=typeof window<"u"&&typeof document<"u",H1=typeof navigator=="object"&&navigator||void 0,Zq=DS&&(!H1||["ReactNative","NativeScript","NS"].indexOf(H1.product)<0),Yq=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wq=DS&&window.location.href||"http://localhost",Xq=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:DS,hasStandardBrowserEnv:Zq,hasStandardBrowserWebWorkerEnv:Yq,navigator:H1,origin:Wq},Symbol.toStringTag,{value:"Module"})),qr={...Xq,...Kq};function Qq(e,t){return xy(e,new qr.classes.URLSearchParams,{visitor:function(n,r,s,i){return qr.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Jq(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function eK(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function nD(e){function t(n,r,s,i){let c=n[i++];if(c==="__proto__")return!0;const u=Number.isFinite(+c),f=i>=n.length;return c=!c&&me.isArray(s)?s.length:c,f?(me.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!u):((!s[c]||!me.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],i)&&me.isArray(s[c])&&(s[c]=eK(s[c])),!u)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,s)=>{t(Jq(r),s,n,0)}),n}return null}function tK(e,t,n){if(me.isString(e))try{return(t||JSON.parse)(e),me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Oh={transitional:tD,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=me.isObject(t);if(i&&me.isHTMLForm(t)&&(t=new FormData(t)),me.isFormData(t))return s?JSON.stringify(nD(t)):t;if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t))return t;if(me.isArrayBufferView(t))return t.buffer;if(me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Qq(t,this.formSerializer).toString();if((u=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return xy(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),tK(t)):t}],transformResponse:[function(t){const n=this.transitional||Oh.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t))return t;if(t&&me.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(u){if(c)throw u.name==="SyntaxError"?St.from(u,St.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qr.classes.FormData,Blob:qr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],e=>{Oh.headers[e]={}});const nK=me.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"]),rK=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
576
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&nK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},IT=Symbol("internals");function yf(e){return e&&String(e).trim().toLowerCase()}function Vp(e){return e===!1||e==null?e:me.isArray(e)?e.map(Vp):String(e)}function aK(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 sK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function M0(e,t,n,r,s){if(me.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!me.isString(t)){if(me.isString(r))return t.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(t)}}function oK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function iK(e,t){const n=me.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,c){return this[r].call(this,t,s,i,c)},configurable:!0})})}let _a=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,h){const y=yf(f);if(!y)throw new Error("header name must be a non-empty string");const g=me.findKey(s,y);(!g||s[g]===void 0||h===!0||h===void 0&&s[g]!==!1)&&(s[g||f]=Vp(u))}const c=(u,f)=>me.forEach(u,(h,y)=>i(h,y,f));if(me.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(me.isString(t)&&(t=t.trim())&&!sK(t))c(rK(t),n);else if(me.isObject(t)&&me.isIterable(t)){let u={},f,h;for(const y of t){if(!me.isArray(y))throw TypeError("Object iterator must return a key-value pair");u[h=y[0]]=(f=u[h])?me.isArray(f)?[...f,y[1]]:[f,y[1]]:y[1]}c(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=yf(t),t){const r=me.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return aK(s);if(me.isFunction(n))return n.call(this,s,r);if(me.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=yf(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||M0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=yf(c),c){const u=me.findKey(r,c);u&&(!n||M0(r,r[u],u,n))&&(delete r[u],s=!0)}}return me.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||M0(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return me.forEach(this,(s,i)=>{const c=me.findKey(r,i);if(c){n[c]=Vp(s),delete n[i];return}const u=t?oK(i):String(i).trim();u!==i&&delete n[i],n[u]=Vp(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return me.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&me.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(`
|
|
577
|
-
`)}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[IT]=this[IT]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=yf(c);r[u]||(iK(s,c),r[u]=!0)}return me.isArray(t)?t.forEach(i):i(t),this}};_a.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(_a.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(_a);function k0(e,t){const n=this||Oh,r=t||n,s=_a.from(r.headers);let i=r.data;return me.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function rD(e){return!!(e&&e.__CANCEL__)}function hd(e,t,n){St.call(this,e??"canceled",St.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(hd,St,{__CANCEL__:!0});function aD(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new St("Request failed with status code "+n.status,[St.ERR_BAD_REQUEST,St.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function lK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function cK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),y=r[i];c||(c=h),n[s]=f,r[s]=h;let g=i,x=0;for(;g!==s;)x+=n[g++],g=g%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),h-c<t)return;const v=y&&h-y;return v?Math.round(x*1e3/v):void 0}}function uK(e,t){let n=0,r=1e3/t,s,i;const c=(h,y=Date.now())=>{n=y,s=null,i&&(clearTimeout(i),i=null),e(...h)};return[(...h)=>{const y=Date.now(),g=y-n;g>=r?c(h,y):(s=h,i||(i=setTimeout(()=>{i=null,c(s)},r-g)))},()=>s&&c(s)]}const dg=(e,t,n=3)=>{let r=0;const s=cK(50,250);return uK(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,h=s(f),y=c<=u;r=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u&&y?(u-c)/h:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},MT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kT=e=>(...t)=>me.asap(()=>e(...t)),dK=qr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,qr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qr.origin),qr.navigator&&/(msie|trident)/i.test(qr.navigator.userAgent)):()=>!0,fK=qr.hasStandardBrowserEnv?{write(e,t,n,r,s,i,c){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];me.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),me.isString(r)&&u.push(`path=${r}`),me.isString(s)&&u.push(`domain=${s}`),i===!0&&u.push("secure"),me.isString(c)&&u.push(`SameSite=${c}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function hK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function sD(e,t,n){let r=!hK(t);return e&&(r||n==!1)?mK(e,t):t}const LT=e=>e instanceof _a?{...e}:e;function dc(e,t){t=t||{};const n={};function r(h,y,g,x){return me.isPlainObject(h)&&me.isPlainObject(y)?me.merge.call({caseless:x},h,y):me.isPlainObject(y)?me.merge({},y):me.isArray(y)?y.slice():y}function s(h,y,g,x){if(me.isUndefined(y)){if(!me.isUndefined(h))return r(void 0,h,g,x)}else return r(h,y,g,x)}function i(h,y){if(!me.isUndefined(y))return r(void 0,y)}function c(h,y){if(me.isUndefined(y)){if(!me.isUndefined(h))return r(void 0,h)}else return r(void 0,y)}function u(h,y,g){if(g in t)return r(h,y);if(g in e)return r(void 0,h)}const f={url:i,method:i,data:i,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:u,headers:(h,y,g)=>s(LT(h),LT(y),g,!0)};return me.forEach(Object.keys({...e,...t}),function(y){const g=f[y]||s,x=g(e[y],t[y],y);me.isUndefined(x)&&g!==u||(n[y]=x)}),n}const oD=e=>{const t=dc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=_a.from(c),t.url=eD(sD(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),me.isFormData(n)){if(qr.hasStandardBrowserEnv||qr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const f=n.getHeaders(),h=["content-type","content-length"];Object.entries(f).forEach(([y,g])=>{h.includes(y.toLowerCase())&&c.set(y,g)})}}if(qr.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&dK(t.url))){const f=s&&i&&fK.read(i);f&&c.set(s,f)}return t},pK=typeof XMLHttpRequest<"u",gK=pK&&function(e){return new Promise(function(n,r){const s=oD(e);let i=s.data;const c=_a.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:h}=s,y,g,x,v,C;function S(){v&&v(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(y),s.signal&&s.signal.removeEventListener("abort",y)}let w=new XMLHttpRequest;w.open(s.method.toUpperCase(),s.url,!0),w.timeout=s.timeout;function R(){if(!w)return;const _=_a.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),A={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:_,config:e,request:w};aD(function(T){n(T),S()},function(T){r(T),S()},A),w=null}"onloadend"in w?w.onloadend=R:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(R)},w.onabort=function(){w&&(r(new St("Request aborted",St.ECONNABORTED,e,w)),w=null)},w.onerror=function(I){const A=I&&I.message?I.message:"Network Error",O=new St(A,St.ERR_NETWORK,e,w);O.event=I||null,r(O),w=null},w.ontimeout=function(){let I=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||tD;s.timeoutErrorMessage&&(I=s.timeoutErrorMessage),r(new St(I,A.clarifyTimeoutError?St.ETIMEDOUT:St.ECONNABORTED,e,w)),w=null},i===void 0&&c.setContentType(null),"setRequestHeader"in w&&me.forEach(c.toJSON(),function(I,A){w.setRequestHeader(A,I)}),me.isUndefined(s.withCredentials)||(w.withCredentials=!!s.withCredentials),u&&u!=="json"&&(w.responseType=s.responseType),h&&([x,C]=dg(h,!0),w.addEventListener("progress",x)),f&&w.upload&&([g,v]=dg(f),w.upload.addEventListener("progress",g),w.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(y=_=>{w&&(r(!_||_.type?new hd(null,e,w):_),w.abort(),w=null)},s.cancelToken&&s.cancelToken.subscribe(y),s.signal&&(s.signal.aborted?y():s.signal.addEventListener("abort",y)));const j=lK(s.url);if(j&&qr.protocols.indexOf(j)===-1){r(new St("Unsupported protocol "+j+":",St.ERR_BAD_REQUEST,e));return}w.send(i||null)})},yK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(h){if(!s){s=!0,u();const y=h instanceof Error?h:this.reason;r.abort(y instanceof St?y:new hd(y instanceof Error?y.message:y))}};let c=t&&setTimeout(()=>{c=null,i(new St(`timeout ${t} of ms exceeded`,St.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),e=null)};e.forEach(h=>h.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>me.asap(u),f}},xK=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},vK=async function*(e,t){for await(const n of bK(e))yield*xK(n,t)},bK=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()}},PT=(e,t,n,r)=>{const s=vK(e,t);let i=0,c,u=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:h,value:y}=await s.next();if(h){u(),f.close();return}let g=y.byteLength;if(n){let x=i+=g;n(x)}f.enqueue(new Uint8Array(y))}catch(h){throw u(h),h}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},UT=64*1024,{isFunction:gp}=me,SK=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:zT,TextEncoder:FT}=me.global,HT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},CK=e=>{e=me.merge.call({skipUndefined:!0},SK,e);const{fetch:t,Request:n,Response:r}=e,s=t?gp(t):typeof fetch=="function",i=gp(n),c=gp(r);if(!s)return!1;const u=s&&gp(zT),f=s&&(typeof FT=="function"?(C=>S=>C.encode(S))(new FT):async C=>new Uint8Array(await new n(C).arrayBuffer())),h=i&&u&&HT(()=>{let C=!1;const S=new n(qr.origin,{body:new zT,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!S}),y=c&&u&&HT(()=>me.isReadableStream(new r("").body)),g={stream:y&&(C=>C.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(S,w)=>{let R=S&&S[C];if(R)return R.call(S);throw new St(`Response type '${C}' is not supported`,St.ERR_NOT_SUPPORT,w)})});const x=async C=>{if(C==null)return 0;if(me.isBlob(C))return C.size;if(me.isSpecCompliantForm(C))return(await new n(qr.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(me.isArrayBufferView(C)||me.isArrayBuffer(C))return C.byteLength;if(me.isURLSearchParams(C)&&(C=C+""),me.isString(C))return(await f(C)).byteLength},v=async(C,S)=>{const w=me.toFiniteNumber(C.getContentLength());return w??x(S)};return async C=>{let{url:S,method:w,data:R,signal:j,cancelToken:_,timeout:I,onDownloadProgress:A,onUploadProgress:O,responseType:T,headers:D,withCredentials:L="same-origin",fetchOptions:$}=oD(C),K=t||fetch;T=T?(T+"").toLowerCase():"text";let Z=yK([j,_&&_.toAbortSignal()],I),G=null;const q=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let z;try{if(O&&h&&w!=="get"&&w!=="head"&&(z=await v(D,R))!==0){let P=new n(S,{method:"POST",body:R,duplex:"half"}),U;if(me.isFormData(R)&&(U=P.headers.get("content-type"))&&D.setContentType(U),P.body){const[F,W]=MT(z,dg(kT(O)));R=PT(P.body,UT,F,W)}}me.isString(L)||(L=L?"include":"omit");const M=i&&"credentials"in n.prototype,H={...$,signal:Z,method:w.toUpperCase(),headers:D.normalize().toJSON(),body:R,duplex:"half",credentials:M?L:void 0};G=i&&new n(S,H);let V=await(i?K(G,$):K(S,H));const se=y&&(T==="stream"||T==="response");if(y&&(A||se&&q)){const P={};["status","statusText","headers"].forEach(X=>{P[X]=V[X]});const U=me.toFiniteNumber(V.headers.get("content-length")),[F,W]=A&&MT(U,dg(kT(A),!0))||[];V=new r(PT(V.body,UT,F,()=>{W&&W(),q&&q()}),P)}T=T||"text";let ge=await g[me.findKey(g,T)||"text"](V,C);return!se&&q&&q(),await new Promise((P,U)=>{aD(P,U,{data:ge,headers:_a.from(V.headers),status:V.status,statusText:V.statusText,config:C,request:G})})}catch(M){throw q&&q(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new St("Network Error",St.ERR_NETWORK,C,G),{cause:M.cause||M}):St.from(M,M&&M.code,C,G)}}},wK=new Map,iD=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let c=i.length,u=c,f,h,y=wK;for(;u--;)f=i[u],h=y.get(f),h===void 0&&y.set(f,h=u?new Map:CK(t)),y=h;return h};iD();const OS={http:Fq,xhr:gK,fetch:{get:iD}};me.forEach(OS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $T=e=>`- ${e}`,EK=e=>me.isFunction(e)||e===null||e===!1;function RK(e,t){e=me.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let c=0;c<n;c++){r=e[c];let u;if(s=r,!EK(r)&&(s=OS[(u=String(r)).toLowerCase()],s===void 0))throw new St(`Unknown adapter '${u}'`);if(s&&(me.isFunction(s)||(s=s.get(t))))break;i[u||"#"+c]=s}if(!s){const c=Object.entries(i).map(([f,h])=>`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let u=n?c.length>1?`since :
|
|
578
|
-
`+c.map($T).join(`
|
|
579
|
-
`):" "+$T(c[0]):"as no adapter specified";throw new St("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}const lD={getAdapter:RK,adapters:OS};function L0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hd(null,e)}function VT(e){return L0(e),e.headers=_a.from(e.headers),e.data=k0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),lD.getAdapter(e.adapter||Oh.adapter,e)(e).then(function(r){return L0(e),r.data=k0.call(e,e.transformResponse,r),r.headers=_a.from(r.headers),r},function(r){return rD(r)||(L0(e),r&&r.response&&(r.response.data=k0.call(e,e.transformResponse,r.response),r.response.headers=_a.from(r.response.headers))),Promise.reject(r)})}const cD="1.13.2",vy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{vy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const BT={};vy.transitional=function(t,n,r){function s(i,c){return"[Axios v"+cD+"] Transitional option '"+i+"'"+c+(r?". "+r:"")}return(i,c,u)=>{if(t===!1)throw new St(s(c," has been removed"+(n?" in "+n:"")),St.ERR_DEPRECATED);return n&&!BT[c]&&(BT[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,c,u):!0}};vy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function jK(e,t,n){if(typeof e!="object")throw new St("options must be an object",St.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],c=t[i];if(c){const u=e[i],f=u===void 0||c(u,i,e);if(f!==!0)throw new St("option "+i+" must be "+f,St.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new St("Unknown option "+i,St.ERR_BAD_OPTION)}}const Bp={assertOptions:jK,validators:vy},Js=Bp.validators;let sc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new OT,response:new OT}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
580
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=dc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Bp.assertOptions(r,{silentJSONParsing:Js.transitional(Js.boolean),forcedJSONParsing:Js.transitional(Js.boolean),clarifyTimeoutError:Js.transitional(Js.boolean)},!1),s!=null&&(me.isFunction(s)?n.paramsSerializer={serialize:s}:Bp.assertOptions(s,{encode:Js.function,serialize:Js.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Bp.assertOptions(n,{baseUrl:Js.spelling("baseURL"),withXsrfToken:Js.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=i&&me.merge(i.common,i[n.method]);i&&me.forEach(["delete","get","head","post","put","patch","common"],C=>{delete i[C]}),n.headers=_a.concat(c,i);const u=[];let f=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(f=f&&S.synchronous,u.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let y,g=0,x;if(!f){const C=[VT.bind(this),void 0];for(C.unshift(...u),C.push(...h),x=C.length,y=Promise.resolve(n);g<x;)y=y.then(C[g++],C[g++]);return y}x=u.length;let v=n;for(;g<x;){const C=u[g++],S=u[g++];try{v=C(v)}catch(w){S.call(this,w);break}}try{y=VT.call(this,v)}catch(C){return Promise.reject(C)}for(g=0,x=h.length;g<x;)y=y.then(h[g++],h[g++]);return y}getUri(t){t=dc(this.defaults,t);const n=sD(t.baseURL,t.url,t.allowAbsoluteUrls);return eD(n,t.params,t.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(t){sc.prototype[t]=function(n,r){return this.request(dc(r||{},{method:t,url:n,data:(r||{}).data}))}});me.forEach(["post","put","patch"],function(t){function n(r){return function(i,c,u){return this.request(dc(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:c}))}}sc.prototype[t]=n(),sc.prototype[t+"Form"]=n(!0)});let TK=class uD{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const c=new Promise(u=>{r.subscribe(u),i=u}).then(s);return c.cancel=function(){r.unsubscribe(i)},c},t(function(i,c,u){r.reason||(r.reason=new hd(i,c,u),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 uD(function(s){t=s}),cancel:t}}};function _K(e){return function(n){return e.apply(null,n)}}function NK(e){return me.isObject(e)&&e.isAxiosError===!0}const $1={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($1).forEach(([e,t])=>{$1[t]=e});function dD(e){const t=new sc(e),n=$3(sc.prototype.request,t);return me.extend(n,sc.prototype,t,{allOwnKeys:!0}),me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return dD(dc(e,s))},n}const nr=dD(Oh);nr.Axios=sc;nr.CanceledError=hd;nr.CancelToken=TK;nr.isCancel=rD;nr.VERSION=cD;nr.toFormData=xy;nr.AxiosError=St;nr.Cancel=nr.CanceledError;nr.all=function(t){return Promise.all(t)};nr.spread=_K;nr.isAxiosError=NK;nr.mergeConfig=dc;nr.AxiosHeaders=_a;nr.formToJSON=e=>nD(me.isHTMLForm(e)?new FormData(e):e);nr.getAdapter=lD.getAdapter;nr.HttpStatusCode=$1;nr.default=nr;const{Axios:$he,AxiosError:GT,CanceledError:Vhe,isCancel:Bhe,CancelToken:Ghe,VERSION:qhe,all:Khe,Cancel:Zhe,isAxiosError:Yhe,spread:Whe,toFormData:Xhe,AxiosHeaders:AK,HttpStatusCode:Qhe,formToJSON:Jhe,getAdapter:eme,mergeConfig:tme}=nr;function DK(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const Qu={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 OK(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 IS=nr.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function IK(){const e=window.location.pathname+window.location.search,t=new URL(Qu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function MK(){const e=new URL(Qu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",Qu.SIGN_IN),window.location.href=e.toString()}async function kK(){try{return(await IS.post(Qu.ACCESS_TOKEN,{})).data}catch(e){const t=OK(e);throw new Error(t.message)}}async function LK(e){const t=await IS.get(Qu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return DK(t.data)}async function PK(e){return(await IS.get(Qu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const fD=m.createContext(null);class UK{constructor(t,n){Qs(this,"getToken");Qs(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let MS=null;function zK(e){MS=e}function kS(){return MS}function yp(){MS=null}const FK=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Le=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",hD(e)},HK=e=>{Le({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},$K=()=>{Le({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},hD=e=>{var t;if(typeof window<"u"){FK();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function VK(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Kr.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Kr.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Kr.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Kr.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const BK={status:Kr.LOADING,session:null,user:null};function GK({children:e}){var y;const[t,n]=m.useReducer(VK,BK);m.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const x=new UK(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());zK(x)}else yp()},[(y=t.session)==null?void 0:y.accessToken]);const r=m.useCallback(()=>{IK()},[]);async function s(){try{const x=(await kK()).accessToken;if(!x)throw new Error("Invalid token received");const v={accessToken:x},C=await LK(x);return n({type:"SET_USER",payload:{user:C}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),x}catch(g){throw yp(),n({type:"SET_UNAUTHENTICATED"}),g}}const i=m.useCallback(async()=>{await s()},[]),c=m.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await i()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(g){console.error("Failed to initialize auth:",g),yp(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=m.useCallback(()=>{try{$K()}finally{MK()}},[]),f=m.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);m.useEffect(()=>{c()},[c]),m.useEffect(()=>{t.user&&(hD({projectId:t.user.projectId}),HK({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),m.useEffect(()=>{const g=()=>{u()};return window.addEventListener("auth:logout",g),()=>{window.removeEventListener("auth:logout",g),yp()}},[u]);const h={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(fD.Provider,{value:h,children:e})}function fi(){const e=m.useContext(fD);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function mD(){const{status:e,session:t,user:n,error:r}=fi();return{status:e,session:t,user:n,error:r,isLoading:e===Kr.LOADING,isAuthenticated:e===Kr.AUTHENTICATED,isUnauthenticated:e===Kr.UNAUTHENTICATED,hasError:e===Kr.ERROR}}function qK(){const{user:e}=fi();return e}function Uu({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 a.jsx("div",{className:s,children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&a.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function qT({message:e}){return a.jsx(Uu,{fullScreen:!0,message:e})}function KT(){return a.jsx("div",{className:"flex h-screen items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),a.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),a.jsx(we,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function KK({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=mD();return r?a.jsx(qT,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(qT,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(KT,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(KT,{})}const pD=m.createContext(null);function gD(){const e=m.useContext(pD);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const ZK="/ui",YK=()=>ZK,fg=(e,t)=>{const n=YK(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function WK(){const{projects:e,loadProjects:t,error:n,isLoading:r}=gD(),{user:s}=fi();return a.jsxs(jS,{children:[a.jsx(Na,{}),a.jsxs(TS,{className:"flex items-center gap-2",children:[a.jsx(tP,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(WG,{children:a.jsxs(_S,{children:[r&&a.jsx(Nt,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(wc,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(Nt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(i=>{const c=i.id===(s==null?void 0:s.projectId);return a.jsx(Nt,{asChild:!0,children:a.jsxs(dh,{to:fg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(ia,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function XK(){return a.jsx(WK,{})}const QK=({className:e,size:t=24})=>a.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:a.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"})}),yD=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]}),xD=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),a.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),a.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),a.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),a.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),a.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),a.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),a.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),a.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),a.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),a.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),a.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),a.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),a.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),a.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"})]}),JK=({className:e,size:t=24})=>a.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:[a.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"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),eZ=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"})]}),tZ=({className:e,size:t=24})=>a.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:[a.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"}),a.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),a.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),a.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),a.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),a.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),a.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),a.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),a.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),a.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),a.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"})]}),vD=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]}),nZ=({className:e,size:t=24})=>a.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:a.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"})}),rZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),a.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),a.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),a.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),a.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),a.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),a.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),aZ=({className:e,size:t=24})=>a.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:[a.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"}),a.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)"}),a.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"}),a.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)"}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),a.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),a.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),_c=({className:e="",size:t=24,base64:n})=>a.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),sZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.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"}),a.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"}),a.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"})]}),oZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M5.14132 15.1175C5.14132 16.4971 4.02636 17.612 2.64683 17.612C1.2673 17.612 0.152344 16.4971 0.152344 15.1175C0.152344 13.738 1.2673 12.623 2.64683 12.623H5.14132V15.1175ZM6.38856 15.1175C6.38856 13.738 7.50352 12.623 8.88305 12.623C10.2626 12.623 11.3775 13.738 11.3775 15.1175V21.3538C11.3775 22.7333 10.2626 23.8482 8.88305 23.8482C7.50352 23.8482 6.38856 22.7333 6.38856 21.3538V15.1175Z",fill:"#E01E5A"}),a.jsx("path",{d:"M8.88242 5.10226C7.50289 5.10226 6.38793 3.9873 6.38793 2.60777C6.38793 1.22824 7.50289 0.113281 8.88242 0.113281C10.2619 0.113281 11.3769 1.22824 11.3769 2.60777V5.10226H8.88242ZM8.88242 6.3684C10.2619 6.3684 11.3769 7.48336 11.3769 8.86289C11.3769 10.2424 10.2619 11.3574 8.88242 11.3574H2.6273C1.24777 11.3574 0.132812 10.2424 0.132812 8.86289C0.132812 7.48336 1.24777 6.3684 2.6273 6.3684H8.88242Z",fill:"#36C5F0"}),a.jsx("path",{d:"M18.8768 8.86289C18.8768 7.48336 19.9918 6.3684 21.3713 6.3684C22.7509 6.3684 23.8658 7.48336 23.8658 8.86289C23.8658 10.2424 22.7509 11.3574 21.3713 11.3574H18.8768V8.86289ZM17.6296 8.86289C17.6296 10.2424 16.5146 11.3574 15.1351 11.3574C13.7556 11.3574 12.6406 10.2424 12.6406 8.86289V2.60777C12.6406 1.22824 13.7556 0.113281 15.1351 0.113281C16.5146 0.113281 17.6296 1.22824 17.6296 2.60777V8.86289Z",fill:"#2EB67D"}),a.jsx("path",{d:"M15.1351 18.8593C16.5146 18.8593 17.6296 19.9742 17.6296 21.3538C17.6296 22.7333 16.5146 23.8482 15.1351 23.8482C13.7556 23.8482 12.6406 22.7333 12.6406 21.3538V18.8593H15.1351ZM15.1351 17.612C13.7556 17.612 12.6406 16.4971 12.6406 15.1175C12.6406 13.738 13.7556 12.623 15.1351 12.623H21.3902C22.7698 12.623 23.8847 13.738 23.8847 15.1175C23.8847 16.4971 22.7698 17.612 21.3902 17.612H15.1351Z",fill:"#ECB22E"})]}),iZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),lZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.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"}),a.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),cZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M24 12C24 5.37308 18.6269 0 12 0C5.37308 0 0 5.37308 0 12C0 17.989 4.38757 22.9537 10.1252 23.8549V15.4696H7.07749V12H10.1252V9.35565C10.1252 6.34847 11.9173 4.68626 14.6579 4.68626C15.9707 4.68626 17.3444 4.92083 17.3444 4.92083V7.874H15.8307C14.3406 7.874 13.8748 8.79876 13.8748 9.74884V12H17.2026L16.6711 15.4696H13.8748V23.8549C19.6124 22.9554 24 17.9907 24 12Z",fill:"#1977F3"}),a.jsx("path",{d:"M16.6717 15.4708L17.2033 12.0012H13.8755V9.75008C13.8755 8.80169 14.3396 7.87524 15.8313 7.87524H17.345V4.92207C17.345 4.92207 15.9714 4.6875 14.6585 4.6875C11.918 4.6875 10.1258 6.34803 10.1258 9.35689V12.0012H7.07812V15.4708H10.1258V23.8561C10.7367 23.9523 11.3628 24.0012 12.0006 24.0012C12.6385 24.0012 13.2646 23.9506 13.8755 23.8561V15.4708H16.6717Z",fill:"#FEFEFE"})]}),uZ=({className:e,size:t=24})=>a.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:[a.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),a.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),dZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),a.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),a.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),a.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),fZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),a.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),a.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),a.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]}),hZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsxs("g",{"clip-path":"url(#clip0_377_3451)",children:[a.jsx("path",{d:"M16.4954 9.25H22.6042C23.1814 9.25 23.6492 9.71786 23.6492 10.295V15.8593C23.6492 17.9805 21.9297 19.7 19.8086 19.7H19.7904C17.6693 19.7003 15.9495 17.981 15.9492 15.8599C15.9492 15.8597 15.9492 15.8595 15.9492 15.8593V9.79616C15.9492 9.49452 16.1937 9.25 16.4954 9.25Z",fill:"#5059C9"}),a.jsx("path",{d:"M20.6234 8.14922C21.9903 8.14922 23.0984 7.04112 23.0984 5.67422C23.0984 4.30731 21.9903 3.19922 20.6234 3.19922C19.2565 3.19922 18.1484 4.30731 18.1484 5.67422C18.1484 7.04112 19.2565 8.14922 20.6234 8.14922Z",fill:"#5059C9"}),a.jsx("path",{d:"M12.9266 8.15001C14.901 8.15001 16.5016 6.54942 16.5016 4.575C16.5016 2.60058 14.901 1 12.9266 1C10.9521 1 9.35156 2.60058 9.35156 4.575C9.35156 6.54942 10.9521 8.15001 12.9266 8.15001Z",fill:"#7B83EB"}),a.jsx("path",{d:"M17.6912 9.25H7.60751C7.03725 9.26411 6.58614 9.73737 6.59937 10.3077V16.6541C6.51973 20.0763 9.22724 22.9163 12.6494 23C16.0715 22.9163 18.779 20.0763 18.6994 16.6541V10.3077C18.7126 9.73737 18.2615 9.26411 17.6912 9.25Z",fill:"#7B83EB"}),a.jsx("path",{opacity:"0.1",d:"M13.2019 9.25V18.1435C13.1991 18.5513 12.952 18.9177 12.5749 19.073C12.4548 19.1238 12.3257 19.15 12.1954 19.15H7.08585C7.01436 18.9685 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H13.2019Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V18.6935C12.6518 18.8239 12.6257 18.9529 12.5749 19.073C12.4196 19.4501 12.0532 19.6973 11.6454 19.7H7.34436C7.25085 19.5185 7.16286 19.337 7.08585 19.15C7.00885 18.963 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V17.5935C12.6477 18.1476 12.1995 18.5958 11.6454 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1018 9.25V17.5935C12.0977 18.1476 11.6495 18.5958 11.0953 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.1018Z",fill:"black"}),a.jsx("path",{opacity:"0.1",d:"M13.2002 6.40688V8.13938C13.1067 8.14488 13.0187 8.15038 12.9252 8.15038C12.8317 8.15038 12.7437 8.14489 12.6502 8.13938C12.4646 8.12706 12.2805 8.09761 12.1002 8.05138C10.9865 7.78763 10.0663 7.00654 9.62522 5.95039C9.54932 5.77303 9.4904 5.58886 9.44922 5.40039H12.1937C12.7487 5.40249 13.1981 5.85188 13.2002 6.40688Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1 6.95572V8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.0935C11.6485 5.95133 12.0979 6.40072 12.1 6.95572Z",fill:"black"}),a.jsx("path",{d:"M1.00814 5.94922H11.0918C11.6486 5.94922 12.1 6.40059 12.1 6.95736V17.0411C12.1 17.5978 11.6486 18.0492 11.0918 18.0492H1.00814C0.451357 18.0492 0 17.5978 0 17.0411V6.95736C0 6.40059 0.451368 5.94922 1.00814 5.94922Z",fill:"url(#paint0_linear_377_3451)"}),a.jsx("path",{d:"M8.70484 9.78745H6.68908V15.2765H5.40484V9.78745H3.39844V8.72266H8.70484V9.78745Z",fill:"white"})]}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_377_3451",x1:"2.10202",y1:"5.16147",x2:"9.99799",y2:"18.837",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#5A62C3"}),a.jsx("stop",{offset:"0.5","stop-color":"#4D55BD"}),a.jsx("stop",{offset:"1","stop-color":"#3940AB"})]}),a.jsx("clipPath",{id:"clip0_377_3451",children:a.jsx("rect",{width:"23.65",height:"22",fill:"white",transform:"translate(0 1)"})})]})]}),mZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6.22775 0.0390625L6.2285 5.77431L0.5 5.77281V1.55856C0.5425 1.26056 0.63075 1.01031 0.76475 0.807812C1.09525 0.306812 1.57575 0.0545625 2.20625 0.0510625C3.53925 0.0440625 4.87975 0.0400625 6.22775 0.0390625Z",fill:"#0066DA"}),a.jsx("path",{d:"M6.22656 0.0390625L18.0331 0.0405625C18.0579 0.0405527 18.082 0.0481525 18.1021 0.0623125L18.1298 0.0825625C18.1218 0.0855625 18.1151 0.0888125 18.1096 0.0923125C18.1011 0.0968125 18.0968 0.103813 18.0968 0.113313L18.0953 5.77656C18.0943 5.77656 18.0931 5.77656 18.0916 5.77656H6.22956C6.22906 5.77606 6.22831 5.77531 6.22731 5.77431L6.22656 0.0390625Z",fill:"#FBBC04"}),a.jsx("path",{d:"M18.1322 0.0820312L23.7909 5.75803L18.0977 5.77603L18.0992 0.112781C18.0992 0.103281 18.1034 0.0962812 18.1119 0.0917812C18.1174 0.0882812 18.1242 0.0850312 18.1322 0.0820312Z",fill:"#EA4335"}),a.jsx("path",{d:"M0.5 5.77148L6.2285 5.77298C6.2295 5.77398 6.23025 5.77473 6.23075 5.77523L6.23225 13.7012L0.5 13.6997V5.77148Z",fill:"#2684FC"}),a.jsx("path",{d:"M23.788 5.75781L23.8232 5.78331V17.9258C23.6902 18.6523 23.3137 19.1216 22.6937 19.3336C22.4727 19.4096 22.147 19.4471 21.7165 19.4461C18.922 19.4416 16.099 19.4373 13.2475 19.4333C12.8335 19.4328 12.4135 19.4358 11.9875 19.4423C11.964 19.4428 11.944 19.4513 11.9275 19.4678C10.5325 20.8563 9.13247 22.2568 7.72747 23.6693C7.51222 23.8861 7.26847 24.0068 6.95947 23.9611C6.67147 23.9186 6.45922 23.7701 6.32272 23.5156C6.26522 23.4076 6.23597 23.2106 6.23497 22.9246C6.23147 21.7651 6.23022 20.6018 6.23122 19.4348L6.23047 16.5638L9.06397 13.7303C9.07632 13.718 9.09102 13.7081 9.10723 13.7015C9.12345 13.6948 9.14086 13.6913 9.15847 13.6913L18.031 13.6943C18.0475 13.6943 18.0633 13.6878 18.075 13.6761C18.0867 13.6644 18.0932 13.6486 18.0932 13.6321L18.091 5.77581C18.0925 5.77581 18.0937 5.77581 18.0947 5.77581L23.788 5.75781Z",fill:"#00AC47"}),a.jsx("path",{d:"M6.23225 13.7027V16.5647L6.233 19.4357C5.0345 19.4427 3.84625 19.4449 2.66825 19.4424C2.17725 19.4414 1.8235 19.4029 1.607 19.3269C1 19.1149 0.631 18.6449 0.5 17.9169V13.7012L6.23225 13.7027Z",fill:"#00832D"})]}),pZ=({className:e,size:t=24,strokeWidth:n=2,strokeColor:r="#1E88E5"})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:r,"stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",children:[a.jsx("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),a.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]});function Co({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:oe("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 bD({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(w,R)=>{if(!w||R.length===0)return!1;try{const j=JSON.parse(w),_=I=>typeof I!="object"||I===null?!1:Array.isArray(I)?I.some(A=>typeof A=="object"&&A!==null&&_(A)):Object.keys(I).some(A=>R.includes(A)||typeof I[A]=="object"&&I[A]!==null&&_(I[A]));return _(j)}catch{return!1}},f=i?!1:!e||n.length===0||!u(e,n),[h,y]=m.useState(f),[g,x]=m.useState(!1);m.useEffect(()=>{i?y(!1):(!e||n.length===0||!u(e,n))&&y(!0)},[e,n,i]),m.useEffect(()=>{if(g){const w=setTimeout(()=>{x(!1)},2e3);return()=>{clearTimeout(w)}}},[g]);const v=()=>{navigator.clipboard.writeText(e),x(!0)},C=w=>{if(!w)return"";try{const R=JSON.parse(w),j=A=>{if(typeof A!="object"||A===null)return A;const O=Array.isArray(A)?[...A]:{...A};return Array.isArray(O)?O.forEach((T,D)=>{typeof T=="object"&&T!==null&&(O[D]=j(T))}):Object.entries(O).forEach(([T,D])=>{if(n.includes(T))if(typeof D=="string"){const L=D.length;L>30?O[T]="*".repeat(Math.min(20,Math.ceil(L/3))):L>10?O[T]="*".repeat(Math.min(10,Math.ceil(L/2))):O[T]="*".repeat(L)}else O[T]="***";else typeof D=="object"&&D!==null&&(O[T]=j(D))}),O},I=j(typeof R=="object"?R:{});return JSON.stringify(I,null,2)}catch{return w}},S=e&&n.length>0&&u(e,n);return a.jsxs("div",{className:"relative",children:[!h&&S&&!i&&a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(CU,{className:"h-4 w-4 text-gray-500"})})}),a.jsx(Rt,{children:a.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),i?a.jsx("div",{className:`p-2 font-mono ${r??""} ${s} cursor-not-allowed whitespace-pre-wrap opacity-70`,children:C(e)}):a.jsx(Co,{value:h?e:C(e),onChange:w=>{(h||!S)&&t&&t(w.target.value)},onFocus:w=>{!h&&S&&w.target.blur()},readOnly:!!(!h&&S),className:`font-mono ${r??""} ${!h&&S?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),S&&!i&&a.jsx(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{y(!h)},children:h?a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx($P,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),a.jsx(Rt,{children:a.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(xA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),a.jsx(Rt,{children:a.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&a.jsx(we,{type:"button",variant:"ghost",className:`absolute ${S&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:g?a.jsxs(a.Fragment,{children:[a.jsx(ia,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ku,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copy"})]})})}),a.jsx(Rt,{children:a.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var en;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const c of s)i[c]=c;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of i)c[u]=s[u];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&i.push(c);return i},e.find=(s,i)=>{for(const c of s)if(i(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,i=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(en||(en={}));var ZT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(ZT||(ZT={}));const Ge=en.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qi=e=>{switch(typeof e){case"undefined":return Ge.undefined;case"string":return Ge.string;case"number":return Number.isNaN(e)?Ge.nan:Ge.number;case"boolean":return Ge.boolean;case"function":return Ge.function;case"bigint":return Ge.bigint;case"symbol":return Ge.symbol;case"object":return Array.isArray(e)?Ge.array:e===null?Ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ge.promise:typeof Map<"u"&&e instanceof Map?Ge.map:typeof Set<"u"&&e instanceof Set?Ge.set:typeof Date<"u"&&e instanceof Date?Ge.date:Ge.object;default:return Ge.unknown}},_e=en.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 oi 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(i){return i.message},r={_errors:[]},s=i=>{for(const c of i.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 u=r,f=0;for(;f<c.path.length;){const h=c.path[f];f===c.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(n(c))):u[h]=u[h]||{_errors:[]},u=u[h],f++}}};return s(this),r}static assert(t){if(!(t instanceof oi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,en.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 i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}oi.create=e=>new oi(e);const V1=(e,t)=>{let n;switch(e.code){case _e.invalid_type:e.received===Ge.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case _e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,en.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:n=`Unrecognized key(s) in object: ${en.joinValues(e.keys,", ")}`;break;case _e.invalid_union:n="Invalid input";break;case _e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${en.joinValues(e.options)}`;break;case _e.invalid_enum_value:n=`Invalid enum value. Expected ${en.joinValues(e.options)}, received '${e.received}'`;break;case _e.invalid_arguments:n="Invalid function arguments";break;case _e.invalid_return_type:n="Invalid function return type";break;case _e.invalid_date:n="Invalid date";break;case _e.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}"`:en.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case _e.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 _e.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 _e.custom:n="Invalid input";break;case _e.invalid_intersection_types:n="Intersection results could not be merged";break;case _e.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case _e.not_finite:n="Number must be finite";break;default:n=t.defaultError,en.assertNever(e)}return{message:n}};let gZ=V1;function yZ(){return gZ}const xZ=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],c={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let u="";const f=r.filter(h=>!!h).slice().reverse();for(const h of f)u=h(c,{data:t,defaultError:u}).message;return{...s,path:i,message:u}};function ze(e,t){const n=yZ(),r=xZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===V1?void 0:V1].filter(s=>!!s)});e.common.issues.push(r)}class ca{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 dt;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 i=await s.key,c=await s.value;r.push({key:i,value:c})}return ca.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:c}=s;if(i.status==="aborted"||c.status==="aborted")return dt;i.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[i.value]=c.value)}return{status:t.value,value:r}}}const dt=Object.freeze({status:"aborted"}),Nf=e=>({status:"dirty",value:e}),ys=e=>({status:"valid",value:e}),YT=e=>e.status==="aborted",WT=e=>e.status==="dirty",Ju=e=>e.status==="valid",hg=e=>typeof Promise<"u"&&e instanceof Promise;var Qe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Qe||(Qe={}));class xo{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 XT=(e,t)=>{if(Ju(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 oi(e.common.issues);return this._error=n,this._error}}};function At(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,u)=>{const{message:f}=e;return c.code==="invalid_enum_value"?{message:f??u.defaultError}:typeof u.data>"u"?{message:f??r??u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:f??n??u.defaultError}},description:s}}class Gt{get description(){return this._def.description}_getType(t){return qi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:qi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ca,ctx:{common:t.parent.common,data:t.data,parsedType:qi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(hg(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:qi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return XT(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:qi(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return Ju(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.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(i=>Ju(i)?{value:i.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:qi(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(hg(s)?s:Promise.resolve(s));return XT(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const c=t(s),u=()=>i.addIssue({code:_e.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(u(),!1)):c?!0:(u(),!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 mc({schema:this,typeName:ft.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 Jo.create(this,this._def)}nullable(){return pc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return uo.create(this)}promise(){return Sg.create(this,this._def)}or(t){return gg.create([this,t],this._def)}and(t){return yg.create(this,t,this._def)}transform(t){return new mc({...At(this._def),schema:this,typeName:ft.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Cg({...At(this._def),innerType:this,defaultValue:n,typeName:ft.ZodDefault})}brand(){return new ED({typeName:ft.ZodBranded,type:this,...At(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new wg({...At(this._def),innerType:this,catchValue:n,typeName:ft.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return PS.create(this,t)}readonly(){return Eg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const vZ=/^c[^\s-]{8,}$/i,bZ=/^[0-9a-z]+$/,SZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,CZ=/^[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,wZ=/^[a-z0-9_-]{21}$/i,EZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,RZ=/^[-+]?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)?)??$/,jZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,TZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let P0;const _Z=/^(?:(?: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])$/,NZ=/^(?:(?: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])$/,AZ=/^(([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]))$/,DZ=/^(([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])$/,OZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,IZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,SD="((\\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])))",MZ=new RegExp(`^${SD}$`);function CD(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 kZ(e){return new RegExp(`^${CD(e)}$`)}function LZ(e){let t=`${SD}T${CD(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 PZ(e,t){return!!((t==="v4"||!t)&&_Z.test(e)||(t==="v6"||!t)&&AZ.test(e))}function UZ(e,t){if(!EZ.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 zZ(e,t){return!!((t==="v4"||!t)&&NZ.test(e)||(t==="v6"||!t)&&DZ.test(e))}class Qo extends Gt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ge.string){const i=this._getOrReturnCtx(t);return ze(i,{code:_e.invalid_type,expected:Ge.string,received:i.parsedType}),dt}const r=new ca;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const c=t.data.length>i.value,u=t.data.length<i.value;(c||u)&&(s=this._getOrReturnCtx(t,s),c?ze(s,{code:_e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&ze(s,{code:_e.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")jZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"email",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")P0||(P0=new RegExp(TZ,"u")),P0.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"emoji",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")CZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"uuid",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")wZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"nanoid",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")vZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"cuid",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")bZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"cuid2",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")SZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"ulid",code:_e.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ze(s,{validation:"url",code:_e.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"regex",code:_e.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?LZ(i).test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?MZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?kZ(i).test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?RZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"duration",code:_e.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?PZ(t.data,i.version)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"ip",code:_e.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?UZ(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"jwt",code:_e.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?zZ(t.data,i.version)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"cidr",code:_e.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?OZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"base64",code:_e.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?IZ.test(t.data)||(s=this._getOrReturnCtx(t,s),ze(s,{validation:"base64url",code:_e.invalid_string,message:i.message}),r.dirty()):en.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:_e.invalid_string,...Qe.errToObj(r)})}_addCheck(t){return new Qo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Qe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Qe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Qe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Qe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Qe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Qe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Qe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Qe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Qe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Qe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Qe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Qe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Qe.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,...Qe.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,...Qe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Qe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Qe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Qe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Qe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Qe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Qe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Qe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Qe.errToObj(n)})}nonempty(t){return this.min(1,Qe.errToObj(t))}trim(){return new Qo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Qo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Qo({...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}}Qo.create=e=>new Qo({checks:[],typeName:ft.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});function FZ(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return i%c/10**s}class ed extends Gt{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)!==Ge.number){const i=this._getOrReturnCtx(t);return ze(i,{code:_e.invalid_type,expected:Ge.number,received:i.parsedType}),dt}let r;const s=new ca;for(const i of this._def.checks)i.kind==="int"?en.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?FZ(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.not_finite,message:i.message}),s.dirty()):en.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qe.toString(n))}setLimit(t,n,r,s){return new ed({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new ed({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Qe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Qe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qe.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"&&en.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)}}ed.create=e=>new ed({checks:[],typeName:ft.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class Qf extends Gt{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)!==Ge.bigint)return this._getInvalidInput(t);let r;const s=new ca;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ze(r,{code:_e.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):en.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ze(n,{code:_e.invalid_type,expected:Ge.bigint,received:n.parsedType}),dt}gte(t,n){return this.setLimit("min",t,!0,Qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qe.toString(n))}setLimit(t,n,r,s){return new Qf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new Qf({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qe.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}}Qf.create=e=>new Qf({checks:[],typeName:ft.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});class B1 extends Gt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ge.boolean){const r=this._getOrReturnCtx(t);return ze(r,{code:_e.invalid_type,expected:Ge.boolean,received:r.parsedType}),dt}return ys(t.data)}}B1.create=e=>new B1({typeName:ft.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class mg extends Gt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ge.date){const i=this._getOrReturnCtx(t);return ze(i,{code:_e.invalid_type,expected:Ge.date,received:i.parsedType}),dt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ze(i,{code:_e.invalid_date}),dt}const r=new ca;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),ze(s,{code:_e.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):en.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new mg({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Qe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Qe.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}}mg.create=e=>new mg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ft.ZodDate,...At(e)});class QT extends Gt{_parse(t){if(this._getType(t)!==Ge.symbol){const r=this._getOrReturnCtx(t);return ze(r,{code:_e.invalid_type,expected:Ge.symbol,received:r.parsedType}),dt}return ys(t.data)}}QT.create=e=>new QT({typeName:ft.ZodSymbol,...At(e)});class G1 extends Gt{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return ze(r,{code:_e.invalid_type,expected:Ge.undefined,received:r.parsedType}),dt}return ys(t.data)}}G1.create=e=>new G1({typeName:ft.ZodUndefined,...At(e)});class pg extends Gt{_parse(t){if(this._getType(t)!==Ge.null){const r=this._getOrReturnCtx(t);return ze(r,{code:_e.invalid_type,expected:Ge.null,received:r.parsedType}),dt}return ys(t.data)}}pg.create=e=>new pg({typeName:ft.ZodNull,...At(e)});class JT extends Gt{constructor(){super(...arguments),this._any=!0}_parse(t){return ys(t.data)}}JT.create=e=>new JT({typeName:ft.ZodAny,...At(e)});class q1 extends Gt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ys(t.data)}}q1.create=e=>new q1({typeName:ft.ZodUnknown,...At(e)});class ml extends Gt{_parse(t){const n=this._getOrReturnCtx(t);return ze(n,{code:_e.invalid_type,expected:Ge.never,received:n.parsedType}),dt}}ml.create=e=>new ml({typeName:ft.ZodNever,...At(e)});class e_ extends Gt{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return ze(r,{code:_e.invalid_type,expected:Ge.void,received:r.parsedType}),dt}return ys(t.data)}}e_.create=e=>new e_({typeName:ft.ZodVoid,...At(e)});class uo extends Gt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ge.array)return ze(n,{code:_e.invalid_type,expected:Ge.array,received:n.parsedType}),dt;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ze(n,{code:c?_e.too_big:_e.too_small,minimum:u?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&&(ze(n,{code:_e.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&&(ze(n,{code:_e.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,u)=>s.type._parseAsync(new xo(n,c,n.path,u)))).then(c=>ca.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new xo(n,c,n.path,u)));return ca.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new uo({...this._def,minLength:{value:t,message:Qe.toString(n)}})}max(t,n){return new uo({...this._def,maxLength:{value:t,message:Qe.toString(n)}})}length(t,n){return new uo({...this._def,exactLength:{value:t,message:Qe.toString(n)}})}nonempty(t){return this.min(1,t)}}uo.create=(e,t)=>new uo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ft.ZodArray,...At(t)});function Ru(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Jo.create(Ru(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof uo?new uo({...e._def,type:Ru(e.element)}):e instanceof Jo?Jo.create(Ru(e.unwrap())):e instanceof pc?pc.create(Ru(e.unwrap())):e instanceof fc?fc.create(e.items.map(t=>Ru(t))):e}class fr extends Gt{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=en.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ge.object){const h=this._getOrReturnCtx(t);return ze(h,{code:_e.invalid_type,expected:Ge.object,received:h.parsedType}),dt}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof ml&&this._def.unknownKeys==="strip"))for(const h in s.data)c.includes(h)||u.push(h);const f=[];for(const h of c){const y=i[h],g=s.data[h];f.push({key:{status:"valid",value:h},value:y._parse(new xo(s,g,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof ml){const h=this._def.unknownKeys;if(h==="passthrough")for(const y of u)f.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(h==="strict")u.length>0&&(ze(s,{code:_e.unrecognized_keys,keys:u}),r.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const y of u){const g=s.data[y];f.push({key:{status:"valid",value:y},value:h._parse(new xo(s,g,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const h=[];for(const y of f){const g=await y.key,x=await y.value;h.push({key:g,value:x,alwaysSet:y.alwaysSet})}return h}).then(h=>ca.mergeObjectSync(r,h)):ca.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Qe.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,c;const s=((c=(i=this._def).errorMap)==null?void 0:c.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Qe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ft.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};for(const r of en.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new fr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of en.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new fr({...this._def,shape:()=>n})}deepPartial(){return Ru(this)}partial(t){const n={};for(const r of en.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new fr({...this._def,shape:()=>n})}required(t){const n={};for(const r of en.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Jo;)i=i._def.innerType;n[r]=i}return new fr({...this._def,shape:()=>n})}keyof(){return wD(en.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:ml.create(),typeName:ft.ZodObject,...At(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:ml.create(),typeName:ft.ZodObject,...At(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:ml.create(),typeName:ft.ZodObject,...At(t)});class gg extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=i.map(u=>new oi(u.ctx.common.issues));return ze(n,{code:_e.invalid_union,unionErrors:c}),dt}if(n.common.async)return Promise.all(r.map(async i=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let i;const c=[];for(const f of r){const h={...n,common:{...n.common,issues:[]},parent:null},y=f._parseSync({data:n.data,path:n.path,parent:h});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=c.map(f=>new oi(f));return ze(n,{code:_e.invalid_union,unionErrors:u}),dt}}get options(){return this._def.options}}gg.create=(e,t)=>new gg({options:e,typeName:ft.ZodUnion,...At(t)});const qo=e=>e instanceof Z1?qo(e.schema):e instanceof mc?qo(e.innerType()):e instanceof vg?[e.value]:e instanceof hc?e.options:e instanceof bg?en.objectValues(e.enum):e instanceof Cg?qo(e._def.innerType):e instanceof G1?[void 0]:e instanceof pg?[null]:e instanceof Jo?[void 0,...qo(e.unwrap())]:e instanceof pc?[null,...qo(e.unwrap())]:e instanceof ED||e instanceof Eg?qo(e.unwrap()):e instanceof wg?qo(e._def.innerType):[];class LS extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.object)return ze(n,{code:_e.invalid_type,expected:Ge.object,received:n.parsedType}),dt;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(ze(n,{code:_e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),dt)}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 i of n){const c=qo(i.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,i)}}return new LS({typeName:ft.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...At(r)})}}function K1(e,t){const n=qi(e),r=qi(t);if(e===t)return{valid:!0,data:e};if(n===Ge.object&&r===Ge.object){const s=en.objectKeys(t),i=en.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=K1(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===Ge.array&&r===Ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const c=e[i],u=t[i],f=K1(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Ge.date&&r===Ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class yg extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(YT(i)||YT(c))return dt;const u=K1(i.value,c.value);return u.valid?((WT(i)||WT(c))&&n.dirty(),{status:n.value,value:u.data}):(ze(r,{code:_e.invalid_intersection_types}),dt)};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(([i,c])=>s(i,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}))}}yg.create=(e,t,n)=>new yg({left:e,right:t,typeName:ft.ZodIntersection,...At(n)});class fc extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.array)return ze(r,{code:_e.invalid_type,expected:Ge.array,received:r.parsedType}),dt;if(r.data.length<this._def.items.length)return ze(r,{code:_e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&r.data.length>this._def.items.length&&(ze(r,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((c,u)=>{const f=this._def.items[u]||this._def.rest;return f?f._parse(new xo(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>ca.mergeArray(n,c)):ca.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new fc({...this._def,rest:t})}}fc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fc({items:e,typeName:ft.ZodTuple,rest:null,...At(t)})};class xg extends Gt{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!==Ge.object)return ze(r,{code:_e.invalid_type,expected:Ge.object,received:r.parsedType}),dt;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new xo(r,u,r.path,u)),value:c._parse(new xo(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?ca.mergeObjectAsync(n,s):ca.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Gt?new xg({keyType:t,valueType:n,typeName:ft.ZodRecord,...At(r)}):new xg({keyType:Qo.create(),valueType:t,typeName:ft.ZodRecord,...At(n)})}}class t_ extends Gt{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!==Ge.map)return ze(r,{code:_e.invalid_type,expected:Ge.map,received:r.parsedType}),dt;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],h)=>({key:s._parse(new xo(r,u,r.path,[h,"key"])),value:i._parse(new xo(r,f,r.path,[h,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const f of c){const h=await f.key,y=await f.value;if(h.status==="aborted"||y.status==="aborted")return dt;(h.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(h.value,y.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const h=f.key,y=f.value;if(h.status==="aborted"||y.status==="aborted")return dt;(h.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(h.value,y.value)}return{status:n.value,value:u}}}}t_.create=(e,t,n)=>new t_({valueType:t,keyType:e,typeName:ft.ZodMap,...At(n)});class Jf extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.set)return ze(r,{code:_e.invalid_type,expected:Ge.set,received:r.parsedType}),dt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ze(r,{code:_e.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&&(ze(r,{code:_e.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function c(f){const h=new Set;for(const y of f){if(y.status==="aborted")return dt;y.status==="dirty"&&n.dirty(),h.add(y.value)}return{status:n.value,value:h}}const u=[...r.data.values()].map((f,h)=>i._parse(new xo(r,f,r.path,h)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new Jf({...this._def,minSize:{value:t,message:Qe.toString(n)}})}max(t,n){return new Jf({...this._def,maxSize:{value:t,message:Qe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Jf.create=(e,t)=>new Jf({valueType:e,minSize:null,maxSize:null,typeName:ft.ZodSet,...At(t)});class Z1 extends Gt{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})}}Z1.create=(e,t)=>new Z1({getter:e,typeName:ft.ZodLazy,...At(t)});class vg extends Gt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ze(n,{received:n.data,code:_e.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:t.data}}get value(){return this._def.value}}vg.create=(e,t)=>new vg({value:e,typeName:ft.ZodLiteral,...At(t)});function wD(e,t){return new hc({values:e,typeName:ft.ZodEnum,...At(t)})}class hc extends Gt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ze(n,{expected:en.joinValues(r),received:n.parsedType,code:_e.invalid_type}),dt}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 ze(n,{received:n.data,code:_e.invalid_enum_value,options:r}),dt}return ys(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 hc.create(t,{...this._def,...n})}exclude(t,n=this._def){return hc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}hc.create=wD;class bg extends Gt{_parse(t){const n=en.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ge.string&&r.parsedType!==Ge.number){const s=en.objectValues(n);return ze(r,{expected:en.joinValues(s),received:r.parsedType,code:_e.invalid_type}),dt}if(this._cache||(this._cache=new Set(en.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=en.objectValues(n);return ze(r,{received:r.data,code:_e.invalid_enum_value,options:s}),dt}return ys(t.data)}get enum(){return this._def.values}}bg.create=(e,t)=>new bg({values:e,typeName:ft.ZodNativeEnum,...At(t)});class Sg extends Gt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.promise&&n.common.async===!1)return ze(n,{code:_e.invalid_type,expected:Ge.promise,received:n.parsedType}),dt;const r=n.parsedType===Ge.promise?n.data:Promise.resolve(n.data);return ys(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Sg.create=(e,t)=>new Sg({type:e,typeName:ft.ZodPromise,...At(t)});class mc extends Gt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ft.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:c=>{ze(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const c=s.transform(r.data,i);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return dt;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?dt:f.status==="dirty"||n.value==="dirty"?Nf(f.value):f});{if(n.value==="aborted")return dt;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?dt:u.status==="dirty"||n.value==="dirty"?Nf(u.value):u}}if(s.type==="refinement"){const c=u=>{const f=s.refinement(u,i);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?dt:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?dt:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.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(!Ju(c))return dt;const u=s.transform(c.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>Ju(c)?Promise.resolve(s.transform(c.value,i)).then(u=>({status:n.value,value:u})):dt);en.assertNever(s)}}mc.create=(e,t,n)=>new mc({schema:e,typeName:ft.ZodEffects,effect:t,...At(n)});mc.createWithPreprocess=(e,t,n)=>new mc({schema:t,effect:{type:"preprocess",transform:e},typeName:ft.ZodEffects,...At(n)});class Jo extends Gt{_parse(t){return this._getType(t)===Ge.undefined?ys(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jo.create=(e,t)=>new Jo({innerType:e,typeName:ft.ZodOptional,...At(t)});class pc extends Gt{_parse(t){return this._getType(t)===Ge.null?ys(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}pc.create=(e,t)=>new pc({innerType:e,typeName:ft.ZodNullable,...At(t)});class Cg extends Gt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ge.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Cg.create=(e,t)=>new Cg({innerType:e,typeName:ft.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...At(t)});class wg extends Gt{_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 hg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new oi(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new oi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}wg.create=(e,t)=>new wg({innerType:e,typeName:ft.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...At(t)});class n_ extends Gt{_parse(t){if(this._getType(t)!==Ge.nan){const r=this._getOrReturnCtx(t);return ze(r,{code:_e.invalid_type,expected:Ge.nan,received:r.parsedType}),dt}return{status:"valid",value:t.data}}}n_.create=e=>new n_({typeName:ft.ZodNaN,...At(e)});class ED extends Gt{_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 PS extends Gt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?dt:i.status==="dirty"?(n.dirty(),Nf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?dt: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 PS({in:t,out:n,typeName:ft.ZodPipeline})}}class Eg extends Gt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Ju(s)&&(s.value=Object.freeze(s.value)),s);return hg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Eg.create=(e,t)=>new Eg({innerType:e,typeName:ft.ZodReadonly,...At(t)});var ft;(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"})(ft||(ft={}));const Dt=Qo.create,HZ=ed.create,$Z=B1.create,VZ=pg.create,BZ=q1.create;ml.create;const Y1=uo.create,tn=fr.create,GZ=gg.create,US=LS.create;yg.create;fc.create;const qZ=xg.create,Vr=vg.create;hc.create;const by=bg.create;Sg.create;Jo.create;const KZ=pc.create,U0=dt,RD=tn({serviceAccount:Dt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:_e.custom,message:"Service Account must be a valid JSON object"}),U0):n.client_email?e:(t.addIssue({code:_e.custom,message:"Service Account must contain a client_email field"}),U0)}catch(n){return console.error(n),t.addIssue({code:_e.custom,message:"Service Account must be a valid JSON string"}),U0}})}),ZZ=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:QK,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:Zj,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:wA,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:Zj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:mP,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:Yj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:Yj,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:zr,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:zr,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:AU,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:iP,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:iZ,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:XU,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:sZ,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function r_(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function YZ(){const{flags:e}=_h(),{loadProjects:t,projects:n}=gD(),{id:r}=H3(),s=r_("IDP_PROVIDER","owox",e);m.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:m.useMemo(()=>{const f=ZZ.filter(x=>typeof x.visible=="boolean"?x.visible:r_(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const v=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:v}}catch{return x}return x}),h=new Map;f.forEach(x=>{const v=x.group||"default";h.has(v)||h.set(v,[]);const C=h.get(v);C&&C.push(x)});const y=[],g=Array.from(h.entries()).filter(([,x])=>x.length>0);return g.forEach(([,x],v)=>{y.push(...x),v<g.length-1&&y.push({type:"separator",visible:!0})}),y},[e,r]),canSwitchProject:i}}function WZ(){const{visibleMenuItems:e,canSwitchProject:t}=YZ();return a.jsxs(Ar,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(Na,{},`separator-${String(r)}`);const s=n.icon;return a.jsx(Nt,{asChild:!0,children:a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[a.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&a.jsx(XK,{},"switch-project")]})}var bt=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(bt||{});let XZ={data:""},QZ=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||XZ},JZ=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,eY=/\/\*[^]*?\*\/| +/g,a_=/\n+/g,Wi=(e,t)=>{let n="",r="",s="";for(let i in e){let c=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+c+";":r+=i[1]=="f"?Wi(c,i):i+"{"+Wi(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=Wi(c,t?t.replace(/([^,])+/g,u=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,u):u?u+" "+f:f)):i):c!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Wi.p?Wi.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Vo={},jD=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+jD(e[n]);return t}return e},tY=(e,t,n,r,s)=>{let i=jD(e),c=Vo[i]||(Vo[i]=(f=>{let h=0,y=11;for(;h<f.length;)y=101*y+f.charCodeAt(h++)>>>0;return"go"+y})(i));if(!Vo[c]){let f=i!==e?e:(h=>{let y,g,x=[{}];for(;y=JZ.exec(h.replace(eY,""));)y[4]?x.shift():y[3]?(g=y[3].replace(a_," ").trim(),x.unshift(x[0][g]=x[0][g]||{})):x[0][y[1]]=y[2].replace(a_," ").trim();return x[0]})(e);Vo[c]=Wi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&Vo.g?Vo.g:null;return n&&(Vo.g=Vo[c]),((f,h,y,g)=>{g?h.data=h.data.replace(g,f):h.data.indexOf(f)===-1&&(h.data=y?f+h.data:h.data+f)})(Vo[c],t,r,u),c},nY=(e,t,n)=>e.reduce((r,s,i)=>{let c=t[i];if(c&&c.call){let u=c(n),f=u&&u.props&&u.props.className||/^go/.test(u)&&u;c=f?"."+f:u&&typeof u=="object"?u.props?"":Wi(u,""):u===!1?"":u}return r+s+(c??"")},"");function Sy(e){let t=this||{},n=e.call?e(t.p):e;return tY(n.unshift?n.raw?nY(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,QZ(t.target),t.g,t.o,t.k)}let TD,W1,X1;Sy.bind({g:1});let ii=Sy.bind({k:1});function rY(e,t,n,r){Wi.p=t,TD=e,W1=n,X1=r}function bl(e,t){let n=this||{};return function(){let r=arguments;function s(i,c){let u=Object.assign({},i),f=u.className||s.className;n.p=Object.assign({theme:W1&&W1()},u),n.o=/ *go\d+/.test(f),u.className=Sy.apply(n,r)+(f?" "+f:"");let h=e;return e[0]&&(h=u.as||e,delete u.as),X1&&h[0]&&X1(u),TD(h,u)}return s}}var aY=e=>typeof e=="function",Rg=(e,t)=>aY(e)?e(t):e,sY=(()=>{let e=0;return()=>(++e).toString()})(),_D=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),oY=20,zS="default",ND=(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 ND(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 i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+i}))}}},Gp=[],AD={toasts:[],pausedAt:void 0,settings:{toastLimit:oY}},oo={},DD=(e,t=zS)=>{oo[t]=ND(oo[t]||AD,e),Gp.forEach(([n,r])=>{n===t&&r(oo[t])})},OD=e=>Object.keys(oo).forEach(t=>DD(e,t)),iY=e=>Object.keys(oo).find(t=>oo[t].toasts.some(n=>n.id===e)),Cy=(e=zS)=>t=>{DD(t,e)},lY={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},cY=(e={},t=zS)=>{let[n,r]=m.useState(oo[t]||AD),s=m.useRef(oo[t]);m.useEffect(()=>(s.current!==oo[t]&&r(oo[t]),Gp.push([t,r]),()=>{let c=Gp.findIndex(([u])=>u===t);c>-1&&Gp.splice(c,1)}),[t]);let i=n.toasts.map(c=>{var u,f,h;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((u=e[c.type])==null?void 0:u.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((f=e[c.type])==null?void 0:f.duration)||(e==null?void 0:e.duration)||lY[c.type],style:{...e.style,...(h=e[c.type])==null?void 0:h.style,...c.style}}});return{...n,toasts:i}},uY=(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)||sY()}),Ih=e=>(t,n)=>{let r=uY(t,e,n);return Cy(r.toasterId||iY(r.id))({type:2,toast:r}),r.id},An=(e,t)=>Ih("blank")(e,t);An.error=Ih("error");An.success=Ih("success");An.loading=Ih("loading");An.custom=Ih("custom");An.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Cy(t)(n):OD(n)};An.dismissAll=e=>An.dismiss(void 0,e);An.remove=(e,t)=>{let n={type:4,toastId:e};t?Cy(t)(n):OD(n)};An.removeAll=e=>An.remove(void 0,e);An.promise=(e,t,n)=>{let r=An.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Rg(t.success,s):void 0;return i?An.success(i,{id:r,...n,...n==null?void 0:n.success}):An.dismiss(r),s}).catch(s=>{let i=t.error?Rg(t.error,s):void 0;i?An.error(i,{id:r,...n,...n==null?void 0:n.error}):An.dismiss(r)}),e};var dY=1e3,fY=(e,t="default")=>{let{toasts:n,pausedAt:r}=cY(e,t),s=m.useRef(new Map).current,i=m.useCallback((g,x=dY)=>{if(s.has(g))return;let v=setTimeout(()=>{s.delete(g),c({type:4,toastId:g})},x);s.set(g,v)},[]);m.useEffect(()=>{if(r)return;let g=Date.now(),x=n.map(v=>{if(v.duration===1/0)return;let C=(v.duration||0)+v.pauseDuration-(g-v.createdAt);if(C<0){v.visible&&An.dismiss(v.id);return}return setTimeout(()=>An.dismiss(v.id,t),C)});return()=>{x.forEach(v=>v&&clearTimeout(v))}},[n,r,t]);let c=m.useCallback(Cy(t),[t]),u=m.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=m.useCallback((g,x)=>{c({type:1,toast:{id:g,height:x}})},[c]),h=m.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),y=m.useCallback((g,x)=>{let{reverseOrder:v=!1,gutter:C=8,defaultPosition:S}=x||{},w=n.filter(_=>(_.position||S)===(g.position||S)&&_.height),R=w.findIndex(_=>_.id===g.id),j=w.filter((_,I)=>I<R&&_.visible).length;return w.filter(_=>_.visible).slice(...v?[j+1]:[0,j]).reduce((_,I)=>_+(I.height||0)+C,0)},[n]);return m.useEffect(()=>{n.forEach(g=>{if(g.dismissed)i(g.id,g.removeDelay);else{let x=s.get(g.id);x&&(clearTimeout(x),s.delete(g.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:f,startPause:u,endPause:h,calculateOffset:y}}},hY=ii`
|
|
581
|
-
from {
|
|
582
|
-
transform: scale(0) rotate(45deg);
|
|
583
|
-
opacity: 0;
|
|
584
|
-
}
|
|
585
|
-
to {
|
|
586
|
-
transform: scale(1) rotate(45deg);
|
|
587
|
-
opacity: 1;
|
|
588
|
-
}`,mY=ii`
|
|
589
|
-
from {
|
|
590
|
-
transform: scale(0);
|
|
591
|
-
opacity: 0;
|
|
592
|
-
}
|
|
593
|
-
to {
|
|
594
|
-
transform: scale(1);
|
|
595
|
-
opacity: 1;
|
|
596
|
-
}`,pY=ii`
|
|
597
|
-
from {
|
|
598
|
-
transform: scale(0) rotate(90deg);
|
|
599
|
-
opacity: 0;
|
|
600
|
-
}
|
|
601
|
-
to {
|
|
602
|
-
transform: scale(1) rotate(90deg);
|
|
603
|
-
opacity: 1;
|
|
604
|
-
}`,gY=bl("div")`
|
|
605
|
-
width: 20px;
|
|
606
|
-
opacity: 0;
|
|
607
|
-
height: 20px;
|
|
608
|
-
border-radius: 10px;
|
|
609
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
610
|
-
position: relative;
|
|
611
|
-
transform: rotate(45deg);
|
|
612
|
-
|
|
613
|
-
animation: ${hY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
614
|
-
forwards;
|
|
615
|
-
animation-delay: 100ms;
|
|
616
|
-
|
|
617
|
-
&:after,
|
|
618
|
-
&:before {
|
|
619
|
-
content: '';
|
|
620
|
-
animation: ${mY} 0.15s ease-out forwards;
|
|
621
|
-
animation-delay: 150ms;
|
|
622
|
-
position: absolute;
|
|
623
|
-
border-radius: 3px;
|
|
624
|
-
opacity: 0;
|
|
625
|
-
background: ${e=>e.secondary||"#fff"};
|
|
626
|
-
bottom: 9px;
|
|
627
|
-
left: 4px;
|
|
628
|
-
height: 2px;
|
|
629
|
-
width: 12px;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
&:before {
|
|
633
|
-
animation: ${pY} 0.15s ease-out forwards;
|
|
634
|
-
animation-delay: 180ms;
|
|
635
|
-
transform: rotate(90deg);
|
|
636
|
-
}
|
|
637
|
-
`,yY=ii`
|
|
638
|
-
from {
|
|
639
|
-
transform: rotate(0deg);
|
|
640
|
-
}
|
|
641
|
-
to {
|
|
642
|
-
transform: rotate(360deg);
|
|
643
|
-
}
|
|
644
|
-
`,xY=bl("div")`
|
|
645
|
-
width: 12px;
|
|
646
|
-
height: 12px;
|
|
647
|
-
box-sizing: border-box;
|
|
648
|
-
border: 2px solid;
|
|
649
|
-
border-radius: 100%;
|
|
650
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
651
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
652
|
-
animation: ${yY} 1s linear infinite;
|
|
653
|
-
`,vY=ii`
|
|
654
|
-
from {
|
|
655
|
-
transform: scale(0) rotate(45deg);
|
|
656
|
-
opacity: 0;
|
|
657
|
-
}
|
|
658
|
-
to {
|
|
659
|
-
transform: scale(1) rotate(45deg);
|
|
660
|
-
opacity: 1;
|
|
661
|
-
}`,bY=ii`
|
|
662
|
-
0% {
|
|
663
|
-
height: 0;
|
|
664
|
-
width: 0;
|
|
665
|
-
opacity: 0;
|
|
666
|
-
}
|
|
667
|
-
40% {
|
|
668
|
-
height: 0;
|
|
669
|
-
width: 6px;
|
|
670
|
-
opacity: 1;
|
|
671
|
-
}
|
|
672
|
-
100% {
|
|
673
|
-
opacity: 1;
|
|
674
|
-
height: 10px;
|
|
675
|
-
}`,SY=bl("div")`
|
|
676
|
-
width: 20px;
|
|
677
|
-
opacity: 0;
|
|
678
|
-
height: 20px;
|
|
679
|
-
border-radius: 10px;
|
|
680
|
-
background: ${e=>e.primary||"#61d345"};
|
|
681
|
-
position: relative;
|
|
682
|
-
transform: rotate(45deg);
|
|
683
|
-
|
|
684
|
-
animation: ${vY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
685
|
-
forwards;
|
|
686
|
-
animation-delay: 100ms;
|
|
687
|
-
&:after {
|
|
688
|
-
content: '';
|
|
689
|
-
box-sizing: border-box;
|
|
690
|
-
animation: ${bY} 0.2s ease-out forwards;
|
|
691
|
-
opacity: 0;
|
|
692
|
-
animation-delay: 200ms;
|
|
693
|
-
position: absolute;
|
|
694
|
-
border-right: 2px solid;
|
|
695
|
-
border-bottom: 2px solid;
|
|
696
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
697
|
-
bottom: 6px;
|
|
698
|
-
left: 6px;
|
|
699
|
-
height: 10px;
|
|
700
|
-
width: 6px;
|
|
701
|
-
}
|
|
702
|
-
`,CY=bl("div")`
|
|
703
|
-
position: absolute;
|
|
704
|
-
`,wY=bl("div")`
|
|
705
|
-
position: relative;
|
|
706
|
-
display: flex;
|
|
707
|
-
justify-content: center;
|
|
708
|
-
align-items: center;
|
|
709
|
-
min-width: 20px;
|
|
710
|
-
min-height: 20px;
|
|
711
|
-
`,EY=ii`
|
|
712
|
-
from {
|
|
713
|
-
transform: scale(0.6);
|
|
714
|
-
opacity: 0.4;
|
|
715
|
-
}
|
|
716
|
-
to {
|
|
717
|
-
transform: scale(1);
|
|
718
|
-
opacity: 1;
|
|
719
|
-
}`,RY=bl("div")`
|
|
720
|
-
position: relative;
|
|
721
|
-
transform: scale(0.6);
|
|
722
|
-
opacity: 0.4;
|
|
723
|
-
min-width: 20px;
|
|
724
|
-
animation: ${EY} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
725
|
-
forwards;
|
|
726
|
-
`,jY=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(RY,null,t):t:n==="blank"?null:m.createElement(wY,null,m.createElement(xY,{...r}),n!=="loading"&&m.createElement(CY,null,n==="error"?m.createElement(gY,{...r}):m.createElement(SY,{...r})))},TY=e=>`
|
|
727
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
728
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
729
|
-
`,_Y=e=>`
|
|
730
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
731
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
732
|
-
`,NY="0%{opacity:0;} 100%{opacity:1;}",AY="0%{opacity:1;} 100%{opacity:0;}",DY=bl("div")`
|
|
733
|
-
display: flex;
|
|
734
|
-
align-items: center;
|
|
735
|
-
background: #fff;
|
|
736
|
-
color: #363636;
|
|
737
|
-
line-height: 1.3;
|
|
738
|
-
will-change: transform;
|
|
739
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
740
|
-
max-width: 350px;
|
|
741
|
-
pointer-events: auto;
|
|
742
|
-
padding: 8px 10px;
|
|
743
|
-
border-radius: 8px;
|
|
744
|
-
`,OY=bl("div")`
|
|
745
|
-
display: flex;
|
|
746
|
-
justify-content: center;
|
|
747
|
-
margin: 4px 10px;
|
|
748
|
-
color: inherit;
|
|
749
|
-
flex: 1 1 auto;
|
|
750
|
-
white-space: pre-line;
|
|
751
|
-
`,IY=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=_D()?[NY,AY]:[TY(n),_Y(n)];return{animation:t?`${ii(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ii(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},MY=m.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?IY(e.position||t||"top-center",e.visible):{opacity:0},i=m.createElement(jY,{toast:e}),c=m.createElement(OY,{...e.ariaProps},Rg(e.message,e));return m.createElement(DY,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):m.createElement(m.Fragment,null,i,c))});rY(m.createElement);var kY=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=m.useCallback(c=>{if(c){let u=()=>{let f=c.getBoundingClientRect().height;r(e,f)};u(),new MutationObserver(u).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:i,className:t,style:n},s)},LY=(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:_D()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},PY=Sy`
|
|
752
|
-
z-index: 9999;
|
|
753
|
-
> * {
|
|
754
|
-
pointer-events: auto;
|
|
755
|
-
}
|
|
756
|
-
`,xp=16,UY=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:h}=fY(n,i);return m.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:xp,left:xp,right:xp,bottom:xp,pointerEvents:"none",...c},className:u,onMouseEnter:h.startPause,onMouseLeave:h.endPause},f.map(y=>{let g=y.position||t,x=h.calculateOffset(y,{reverseOrder:e,gutter:r,defaultPosition:t}),v=LY(g,x);return m.createElement(kY,{id:y.id,key:y.id,onHeightUpdate:h.updateHeight,className:y.visible?PY:"",style:v},y.type==="custom"?Rg(y.message,y):s?s(y):m.createElement(MY,{toast:y,position:g}))}))},Tt=An;const on=e=>{var n;return(n=e.response)==null?void 0:n.data};function s_(e,t="Something went wrong"){var s,i;const n=on(e);let r=n.message.trim()||t;(i=(s=n.errorDetails)==null?void 0:s.error)!=null&&i.trim()&&(r=`${r}. ${n.errorDetails.error}`),Tt.error(r)}function ID(e,t){var n,r,s,i;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():((i=(s=c[0])==null?void 0:s[0])==null?void 0:i.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"}class zY{constructor(){Qs(this,"isRefreshingToken",!1);Qs(this,"refreshTokenPromise",null);Qs(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 FY={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},ja=nr.create(FY),Q1=new zY;ja.interceptors.request.use(e=>{if(e.skipAuthHeader||new AK(e.headers).has("X-OWOX-Authorization"))return e;const n=kS(),r=(n==null?void 0:n.getAccessToken())??Q1.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));ja.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 i=kS();if(!i)throw new Error("No token provider available");const c=await Q1.refreshToken(()=>i.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await ja(t)}catch{return Q1.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&&s_(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&s_(e,"Bad request"),Promise.reject(e)});const MD={projects:[],callState:bt.IDLE,error:null};function HY(e,t){switch(t.type){case"LOADING":return{...e,callState:bt.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:bt.LOADED,error:null};case"ERROR":return{...e,callState:bt.ERROR,error:t.payload};case"RESET":return{...MD};default:return e}}function $Y({children:e}){const[t,n]=m.useReducer(HY,MD),r=m.useCallback(async()=>{n({type:"LOADING"});try{const u=kS();if(!u){n({type:"ERROR",payload:on(new GT("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:on(new GT("Unable to obtain access token"))});return}const h=await PK(f);n({type:"SUCCESS",payload:h})}catch(u){n({type:"ERROR",payload:on(u)})}},[]),s=m.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===bt.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(pD.Provider,{value:c,children:e})}function VY(){const[e,t]=m.useState(!1);return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(_r,{open:e,onOpenChange:t,children:[a.jsx(eq,{isOpen:e}),a.jsx($Y,{children:a.jsx(WZ,{})})]})})})})}var BY=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,h=["light","dark"];function y(v){(Array.isArray(e)?e:[e]).forEach(C=>{let S=C==="class",w=S&&i?s.map(R=>i[R]||R):s;S?(f.classList.remove(...w),f.classList.add(i&&i[v]?i[v]:v)):f.setAttribute(C,v)}),g(v)}function g(v){u&&h.includes(v)&&(f.style.colorScheme=v)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)y(r);else try{let v=localStorage.getItem(t)||n,C=c&&v==="system"?x():v;y(C)}catch{}},o_=["light","dark"],kD="(prefers-color-scheme: dark)",GY=typeof window>"u",FS=m.createContext(void 0),qY={setTheme:e=>{},themes:[]},md=()=>{var e;return(e=m.useContext(FS))!=null?e:qY},KY=e=>m.useContext(FS)?m.createElement(m.Fragment,null,e.children):m.createElement(YY,{...e}),ZY=["light","dark"],YY=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=ZY,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:h,nonce:y,scriptProps:g})=>{let[x,v]=m.useState(()=>XY(s,c)),[C,S]=m.useState(()=>x==="system"?z0():x),w=f?Object.values(f):i,R=m.useCallback(A=>{let O=A;if(!O)return;A==="system"&&n&&(O=z0());let T=f?f[O]:O,D=t?QY(y):null,L=document.documentElement,$=K=>{K==="class"?(L.classList.remove(...w),T&&L.classList.add(T)):K.startsWith("data-")&&(T?L.setAttribute(K,T):L.removeAttribute(K))};if(Array.isArray(u)?u.forEach($):$(u),r){let K=o_.includes(c)?c:null,Z=o_.includes(O)?O:K;L.style.colorScheme=Z}D==null||D()},[y]),j=m.useCallback(A=>{let O=typeof A=="function"?A(x):A;v(O);try{localStorage.setItem(s,O)}catch{}},[x]),_=m.useCallback(A=>{let O=z0(A);S(O),x==="system"&&n&&!e&&R("system")},[x,e]);m.useEffect(()=>{let A=window.matchMedia(kD);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),m.useEffect(()=>{let A=O=>{O.key===s&&(O.newValue?v(O.newValue):j(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[j]),m.useEffect(()=>{R(e??x)},[e,x]);let I=m.useMemo(()=>({theme:x,setTheme:j,forcedTheme:e,resolvedTheme:x==="system"?C:x,themes:n?[...i,"system"]:i,systemTheme:n?C:void 0}),[x,j,e,C,n,i]);return m.createElement(FS.Provider,{value:I},m.createElement(WY,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:y,scriptProps:g}),h)},WY=m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:h})=>{let y=JSON.stringify([n,t,i,e,u,c,r,s]).slice(1,-1);return m.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${BY.toString()})(${y})`}})}),XY=(e,t)=>{if(GY)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},QY=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)}},z0=e=>(e||(e=window.matchMedia(kD)),e.matches?"dark":"light");const JY=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:eW(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:bA},{value:"light",label:"Light",icon:RA},{value:"dark",label:"Dark",icon:SA}]}},{type:"separator"},{type:"item",title:"Sign out",icon:EU,onClick:n,className:"text-red-600 focus:text-red-600"}];function eW(e){switch(e){case"light":return RA;case"dark":return SA;case"system":default:return bA}}var zu=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))(zu||{});function J1({avatar:e,initials:t,displayName:n,size:r=zu.NORMAL}){let s,i,c;switch(r){case zu.SMALL:s="w-6 h-6",i="w-5 h-5",c="text-[10px]";break;case zu.LARGE:s="w-16 h-16",i="w-15 h-15",c="text-2xl";break;default:s="size-8",i="size-full",c="text-sm"}return a.jsx("div",{className:`${s} flex aspect-square items-center justify-center rounded-full border bg-white dark:bg-white/10`,children:e?a.jsx("img",{src:e,alt:n,className:`${i} rounded-full object-cover`}):a.jsx("span",{className:`${c} text-muted-foreground font-medium`,children:t})})}function tW({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return a.jsx(Nr,{asChild:!0,children:a.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:[a.jsx(J1,{avatar:r,initials:s,displayName:t}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[a.jsx("span",{className:"truncate font-medium",children:t}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),a.jsx(Vs,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function nW({items:e}){return a.jsx(Ar,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(Na,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(jS,{children:[a.jsxs(TS,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(_S,{children:r.options.map(s=>a.jsxs(Nt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&a.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&a.jsx(ia,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return a.jsxs(Nt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[a.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function rW(){const{user:e,signOut:t}=fi(),{setTheme:n,theme:r}=md(),[s,i]=m.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,h=c??u??"Unknown User",y=ID(c,u);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(_r,{open:s,onOpenChange:i,children:[a.jsx(tW,{isOpen:s,displayName:h,email:u,avatar:f,initials:y}),a.jsx(nW,{items:JY({theme:r,setTheme:n,signOut:t})})]})})}function aW(){const{user:e,status:t}=fi();return t===Kr.LOADING||t===Kr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function hi(){const e=Sc(),t=aW(),n=m.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=fg(t,i);e(u,c)},[e,t]),r=m.useCallback(i=>t?fg(t,i):i,[t]);return m.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function sW(e,t=500){const[n,r]=m.useState(!1),s=m.useRef(!1),i=m.useRef(null),c=m.useCallback(async(...u)=>{if(s.current)return Promise.reject(new Error("Action is locked"));s.current=!0,r(!0);try{return await e(...u)}finally{i.current=setTimeout(()=>{s.current=!1,r(!1)},t)}},[e,t]);return m.useEffect(()=>()=>{i.current&&clearTimeout(i.current),s.current=!1},[]),{trigger:c,isLocked:n}}function oW(){const{scope:e}=hi();return a.jsxs(dh,{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:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:a.jsx(ma,{className:"size-4 shrink-0"})}),a.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:a.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const iW=[{title:"Data Marts",url:"/data-marts",icon:eg},{title:"Storages",url:"/data-storages",icon:lc},{title:"Destinations",url:"/data-destinations",icon:Yb}];function lW(){const{scope:e}=hi();return a.jsx(aB,{children:iW.map(t=>{const n=t.icon;return a.jsx(sB,{children:a.jsx(dh,{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})=>a.jsxs(wt,{delayDuration:500,children:[a.jsx(Et,{asChild:!0,children:a.jsxs(iB,{className:`${r?"hover:bg-transparent":""}`,children:[a.jsx(n,{className:"size-4 shrink-0 transition-all"}),a.jsx("span",{children:t.title}),t.badge&&a.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),a.jsx(Rt,{side:"right",children:t.title})]})})},t.title)})})}function cW({variant:e="inset",collapsible:t="icon"}){return a.jsxs(XV,{variant:e,collapsible:t,children:[a.jsx(tB,{children:a.jsx(VY,{})}),a.jsxs(rB,{children:[a.jsx(RT,{children:a.jsx(jT,{children:a.jsx(oW,{})})}),a.jsx(RT,{children:a.jsx(jT,{children:a.jsx(lW,{})})})]}),a.jsx(nB,{children:a.jsx(rW,{})}),a.jsx(JV,{})]})}function uW({children:e,...t}){return a.jsx(KY,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class Sl{constructor(t){Qs(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await ja.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await ja.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await ja.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await ja.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await ja.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class dW{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 io=new dW;class fW{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),i=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),u=this.getDisplayName(r,i);return{identifier:r,displayName:u,offsetMinutes:s,offsetString:i,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}),i=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-i.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),i=r%60;return`${n}${s.toString().padStart(2,"0")}:${i.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),i=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),u=this.getTimezoneOffset(t,n),f=Math.min(i,c);return u>f}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),i=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:i}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const hW=new fW;function mW({isLoading:e,className:t}){const[n,r]=m.useState(0),[s,i]=m.useState(!1);return m.useEffect(()=>{let c,u;return e?(i(!0),r(0),c=setInterval(()=>{r(f=>f<90?f+(90-f)/10:f)},200)):(r(100),u=setTimeout(()=>{i(!1)},300)),()=>{clearInterval(c),clearTimeout(u)}},[e]),a.jsx("div",{className:oe("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:a.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const LD=m.createContext({isLoading:!1});function pW({children:e}){const[t,n]=m.useState(0),r=t>0;return m.useEffect(()=>{const s=ja.interceptors.request.use(c=>(c.skipLoadingIndicator||n(u=>u+1),c),c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),Promise.reject(c))),i=ja.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),c),c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),Promise.reject(c)));return()=>{ja.interceptors.request.eject(s),ja.interceptors.response.eject(i)}},[]),a.jsx(LD.Provider,{value:{isLoading:r},children:e})}function gW(){return m.useContext(LD)}function yW(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const xW=e=>{switch(e){case"success":return SW;case"info":return wW;case"warning":return CW;case"error":return EW;default:return null}},vW=Array(12).fill(0),bW=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},vW.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),SW=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),CW=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),wW=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),EW=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),RW=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jW=()=>{const[e,t]=re.useState(document.hidden);return re.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let eb=1;class TW{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:eb++,c=this.toasts.find(f=>f.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),c?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:r}),{...f,...t,id:i,dismissible:u,title:r}):f):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,c;const u=s.then(async h=>{if(c=["resolve",h],re.isValidElement(h))i=!1,this.create({id:r,type:"default",message:h});else if(NW(h)&&!h.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(h instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(h):n.error,x=typeof n.description=="function"?await n.description(h):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(h):n.success,x=typeof n.description=="function"?await n.description(h):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:x,...C})}}).catch(async h=>{if(c=["reject",h],n.error!==void 0){i=!1;const y=typeof n.error=="function"?await n.error(h):n.error,g=typeof n.description=="function"?await n.description(h):n.description,v=typeof y=="object"&&!re.isValidElement(y)?y:{message:y};this.create({id:r,type:"error",description:g,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((h,y)=>u.then(()=>c[0]==="reject"?y(c[1]):h(c[1])).catch(y));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||eb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ea=new TW,_W=(e,t)=>{const n=(t==null?void 0:t.id)||eb++;return Ea.addToast({title:e,...t,id:n}),n},NW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",AW=_W,DW=()=>Ea.toasts,OW=()=>Ea.getActiveToasts(),i_=Object.assign(AW,{success:Ea.success,info:Ea.info,warning:Ea.warning,error:Ea.error,custom:Ea.custom,message:Ea.message,promise:Ea.promise,dismiss:Ea.dismiss,loading:Ea.loading},{getHistory:DW,getToasts:OW});yW("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function vp(e){return e.label!==void 0}const IW=3,MW="24px",kW="16px",l_=4e3,LW=356,PW=14,UW=45,zW=200;function eo(...e){return e.filter(Boolean).join(" ")}function FW(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const HW=e=>{var t,n,r,s,i,c,u,f,h;const{invert:y,toast:g,unstyled:x,interacting:v,setHeights:C,visibleToasts:S,heights:w,index:R,toasts:j,expanded:_,removeToast:I,defaultRichColors:A,closeButton:O,style:T,cancelButtonStyle:D,actionButtonStyle:L,className:$="",descriptionClassName:K="",duration:Z,position:G,gap:q,expandByDefault:z,classNames:M,icons:H,closeButtonAriaLabel:V="Close toast"}=e,[se,ge]=re.useState(null),[P,U]=re.useState(null),[F,W]=re.useState(!1),[X,ae]=re.useState(!1),[J,ce]=re.useState(!1),[ye,Se]=re.useState(!1),[Me,ke]=re.useState(!1),[tt,at]=re.useState(0),[Pt,fn]=re.useState(0),Dn=re.useRef(g.duration||Z||l_),ln=re.useRef(null),Ie=re.useRef(null),B=R===0,ne=R+1<=S,ue=g.type,Ne=g.dismissible!==!1,Ee=g.className||"",Te=g.descriptionClassName||"",$e=re.useMemo(()=>w.findIndex(We=>We.toastId===g.id)||0,[w,g.id]),st=re.useMemo(()=>{var We;return(We=g.closeButton)!=null?We:O},[g.closeButton,O]),ot=re.useMemo(()=>g.duration||Z||l_,[g.duration,Z]),jn=re.useRef(0),mr=re.useRef(0),On=re.useRef(0),Qr=re.useRef(null),[Gn,Hn]=G.split("-"),or=re.useMemo(()=>w.reduce((We,Ft,Ht)=>Ht>=$e?We:We+Ft.height,0),[w,$e]),kn=jW(),Eo=g.invert||y,pa=ue==="loading";mr.current=re.useMemo(()=>$e*q+or,[$e,or]),re.useEffect(()=>{Dn.current=ot},[ot]),re.useEffect(()=>{W(!0)},[]),re.useEffect(()=>{const We=Ie.current;if(We){const Ft=We.getBoundingClientRect().height;return fn(Ft),C(Ht=>[{toastId:g.id,height:Ft,position:g.position},...Ht]),()=>C(Ht=>Ht.filter(qt=>qt.toastId!==g.id))}},[C,g.id]),re.useLayoutEffect(()=>{if(!F)return;const We=Ie.current,Ft=We.style.height;We.style.height="auto";const Ht=We.getBoundingClientRect().height;We.style.height=Ft,fn(Ht),C(qt=>qt.find(nn=>nn.toastId===g.id)?qt.map(nn=>nn.toastId===g.id?{...nn,height:Ht}:nn):[{toastId:g.id,height:Ht,position:g.position},...qt])},[F,g.title,g.description,C,g.id,g.jsx,g.action,g.cancel]);const Dr=re.useCallback(()=>{ae(!0),at(mr.current),C(We=>We.filter(Ft=>Ft.toastId!==g.id)),setTimeout(()=>{I(g)},zW)},[g,I,C,mr]);re.useEffect(()=>{if(g.promise&&ue==="loading"||g.duration===1/0||g.type==="loading")return;let We;return _||v||kn?(()=>{if(On.current<jn.current){const qt=new Date().getTime()-jn.current;Dn.current=Dn.current-qt}On.current=new Date().getTime()})():(()=>{Dn.current!==1/0&&(jn.current=new Date().getTime(),We=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),Dr()},Dn.current))})(),()=>clearTimeout(We)},[_,v,g,ue,kn,Dr]),re.useEffect(()=>{g.delete&&(Dr(),g.onDismiss==null||g.onDismiss.call(g,g))},[Dr,g.delete]);function vs(){var We;if(H!=null&&H.loading){var Ft;return re.createElement("div",{className:eo(M==null?void 0:M.loader,g==null||(Ft=g.classNames)==null?void 0:Ft.loader,"sonner-loader"),"data-visible":ue==="loading"},H.loading)}return re.createElement(bW,{className:eo(M==null?void 0:M.loader,g==null||(We=g.classNames)==null?void 0:We.loader),visible:ue==="loading"})}const es=g.icon||(H==null?void 0:H[ue])||xW(ue);var In,Tn;return re.createElement("li",{tabIndex:0,ref:Ie,className:eo($,Ee,M==null?void 0:M.toast,g==null||(t=g.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[ue],g==null||(n=g.classNames)==null?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":(In=g.richColors)!=null?In:A,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":F,"data-promise":!!g.promise,"data-swiped":Me,"data-removed":X,"data-visible":ne,"data-y-position":Gn,"data-x-position":Hn,"data-index":R,"data-front":B,"data-swiping":J,"data-dismissible":Ne,"data-type":ue,"data-invert":Eo,"data-swipe-out":ye,"data-swipe-direction":P,"data-expanded":!!(_||z&&F),"data-testid":g.testId,style:{"--index":R,"--toasts-before":R,"--z-index":j.length-R,"--offset":`${X?tt:mr.current}px`,"--initial-height":z?"auto":`${Pt}px`,...T,...g.style},onDragEnd:()=>{ce(!1),ge(null),Qr.current=null},onPointerDown:We=>{We.button!==2&&(pa||!Ne||(ln.current=new Date,at(mr.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(ce(!0),Qr.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Ft,Ht;if(ye||!Ne)return;Qr.current=null;const qt=Number(((We=Ie.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Zn=Number(((Ft=Ie.current)==null?void 0:Ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nn=new Date().getTime()-((Ht=ln.current)==null?void 0:Ht.getTime()),Xt=se==="x"?qt:Zn,Y=Math.abs(Xt)/nn;if(Math.abs(Xt)>=UW||Y>.11){at(mr.current),g.onDismiss==null||g.onDismiss.call(g,g),U(se==="x"?qt>0?"right":"left":Zn>0?"down":"up"),Dr(),Se(!0);return}else{var ee,le;(ee=Ie.current)==null||ee.style.setProperty("--swipe-amount-x","0px"),(le=Ie.current)==null||le.style.setProperty("--swipe-amount-y","0px")}ke(!1),ce(!1),ge(null)},onPointerMove:We=>{var Ft,Ht,qt;if(!Qr.current||!Ne||((Ft=window.getSelection())==null?void 0:Ft.toString().length)>0)return;const nn=We.clientY-Qr.current.y,Xt=We.clientX-Qr.current.x;var Y;const ee=(Y=e.swipeDirections)!=null?Y:FW(G);!se&&(Math.abs(Xt)>1||Math.abs(nn)>1)&&ge(Math.abs(Xt)>Math.abs(nn)?"x":"y");let le={x:0,y:0};const Ce=je=>1/(1.5+Math.abs(je)/20);if(se==="y"){if(ee.includes("top")||ee.includes("bottom"))if(ee.includes("top")&&nn<0||ee.includes("bottom")&&nn>0)le.y=nn;else{const je=nn*Ce(nn);le.y=Math.abs(je)<Math.abs(nn)?je:nn}}else if(se==="x"&&(ee.includes("left")||ee.includes("right")))if(ee.includes("left")&&Xt<0||ee.includes("right")&&Xt>0)le.x=Xt;else{const je=Xt*Ce(Xt);le.x=Math.abs(je)<Math.abs(Xt)?je:Xt}(Math.abs(le.x)>0||Math.abs(le.y)>0)&&ke(!0),(Ht=Ie.current)==null||Ht.style.setProperty("--swipe-amount-x",`${le.x}px`),(qt=Ie.current)==null||qt.style.setProperty("--swipe-amount-y",`${le.y}px`)}},st&&!g.jsx&&ue!=="loading"?re.createElement("button",{"aria-label":V,"data-disabled":pa,"data-close-button":!0,onClick:pa||!Ne?()=>{}:()=>{Dr(),g.onDismiss==null||g.onDismiss.call(g,g)},className:eo(M==null?void 0:M.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(Tn=H==null?void 0:H.close)!=null?Tn:RW):null,(ue||g.icon||g.promise)&&g.icon!==null&&((H==null?void 0:H[ue])!==null||g.icon)?re.createElement("div",{"data-icon":"",className:eo(M==null?void 0:M.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||vs():null,g.type!=="loading"?es:null):null,re.createElement("div",{"data-content":"",className:eo(M==null?void 0:M.content,g==null||(i=g.classNames)==null?void 0:i.content)},re.createElement("div",{"data-title":"",className:eo(M==null?void 0:M.title,g==null||(c=g.classNames)==null?void 0:c.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?re.createElement("div",{"data-description":"",className:eo(K,Te,M==null?void 0:M.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),re.isValidElement(g.cancel)?g.cancel:g.cancel&&vp(g.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||D,onClick:We=>{vp(g.cancel)&&Ne&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,We),Dr())},className:eo(M==null?void 0:M.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,re.isValidElement(g.action)?g.action:g.action&&vp(g.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||L,onClick:We=>{vp(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,We),!We.defaultPrevented&&Dr())},className:eo(M==null?void 0:M.actionButton,g==null||(h=g.classNames)==null?void 0:h.actionButton)},g.action.label):null)};function c_(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function $W(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",u=i?kW:MW;function f(h){["top","right","bottom","left"].forEach(y=>{n[`${c}-${y}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${c}-${h}`]=u:n[`${c}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):f(u)}),n}const VW=re.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:h,offset:y,mobileOffset:g,theme:x="light",richColors:v,duration:C,style:S,visibleToasts:w=IW,toastOptions:R,dir:j=c_(),gap:_=PW,icons:I,containerAriaLabel:A="Notifications"}=t,[O,T]=re.useState([]),D=re.useMemo(()=>r?O.filter(F=>F.toasterId===r):O.filter(F=>!F.toasterId),[O,r]),L=re.useMemo(()=>Array.from(new Set([i].concat(D.filter(F=>F.position).map(F=>F.position)))),[D,i]),[$,K]=re.useState([]),[Z,G]=re.useState(!1),[q,z]=re.useState(!1),[M,H]=re.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=re.useRef(null),se=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ge=re.useRef(null),P=re.useRef(!1),U=re.useCallback(F=>{T(W=>{var X;return(X=W.find(ae=>ae.id===F.id))!=null&&X.delete||Ea.dismiss(F.id),W.filter(({id:ae})=>ae!==F.id)})},[]);return re.useEffect(()=>Ea.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(W=>W.map(X=>X.id===F.id?{...X,delete:!0}:X))});return}setTimeout(()=>{dA.flushSync(()=>{T(W=>{const X=W.findIndex(ae=>ae.id===F.id);return X!==-1?[...W.slice(0,X),{...W[X],...F},...W.slice(X+1)]:[F,...W]})})})}),[O]),re.useEffect(()=>{if(x!=="system"){H(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:W})=>{H(W?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{H(X?"dark":"light")}catch(ae){console.error(ae)}})}},[x]),re.useEffect(()=>{O.length<=1&&G(!1)},[O]),re.useEffect(()=>{const F=W=>{var X;if(c.every(ce=>W[ce]||W.code===ce)){var J;G(!0),(J=V.current)==null||J.focus()}W.code==="Escape"&&(document.activeElement===V.current||(X=V.current)!=null&&X.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[c]),re.useEffect(()=>{if(V.current)return()=>{ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null,P.current=!1)}},[V.current]),re.createElement("section",{ref:n,"aria-label":`${A} ${se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((F,W)=>{var X;const[ae,J]=F.split("-");return D.length?re.createElement("ol",{key:F,dir:j==="auto"?c_():j,tabIndex:-1,ref:V,className:h,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ae,"data-x-position":J,style:{"--front-toast-height":`${((X=$[0])==null?void 0:X.height)||0}px`,"--width":`${LW}px`,"--gap":`${_}px`,...S,...$W(y,g)},onBlur:ce=>{P.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(P.current=!1,ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||P.current||(P.current=!0,ge.current=ce.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{q||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},D.filter(ce=>!ce.position&&W===0||ce.position===F).map((ce,ye)=>{var Se,Me;return re.createElement(HW,{key:ce.id,icons:I,index:ye,toast:ce,defaultRichColors:v,duration:(Se=R==null?void 0:R.duration)!=null?Se:C,className:R==null?void 0:R.className,descriptionClassName:R==null?void 0:R.descriptionClassName,invert:s,visibleToasts:w,closeButton:(Me=R==null?void 0:R.closeButton)!=null?Me:f,interacting:q,position:F,style:R==null?void 0:R.style,unstyled:R==null?void 0:R.unstyled,classNames:R==null?void 0:R.classNames,cancelButtonStyle:R==null?void 0:R.cancelButtonStyle,actionButtonStyle:R==null?void 0:R.actionButtonStyle,closeButtonAriaLabel:R==null?void 0:R.closeButtonAriaLabel,removeToast:U,toasts:D.filter(ke=>ke.position==ce.position),heights:$.filter(ke=>ke.position==ce.position),setHeights:K,expandByDefault:u,gap:_,expanded:Z,swipeDirections:t.swipeDirections})})):null}))}),BW=({...e})=>{const{theme:t="system"}=md();return a.jsx(VW,{theme:t,className:"toaster group",icons:{success:a.jsx(mh,{className:"size-4"}),info:a.jsx(zr,{className:"size-4"}),warning:a.jsx(ph,{className:"size-4"}),error:a.jsx(CA,{className:"size-4"}),loading:a.jsx(wc,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})};function GW(){return a.jsx(UY,{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 qW({children:e}){const{isLoading:t}=mD(),n=qK(),r=Zg(),s=$s();return m.useEffect(()=>{if(t)return;const i=r.projectId,c=n==null?void 0:n.projectId;if(i&&!s.pathname.startsWith("/auth")&&n&&c&&c!==i){const u=new URLSearchParams({projectId:i}).toString();window.location.href=`/auth/sign-in?${u}`}},[t,n,r.projectId,s.pathname]),a.jsx(a.Fragment,{children:e})}const u_="sidebar_state";function KW(){const{state:e,isMobile:t}=Ch(),r=t||e==="collapsed",{isLoading:s}=gW();return a.jsxs(a.Fragment,{children:[a.jsx(BW,{position:"bottom-right",closeButton:!0}),a.jsx(GW,{}),a.jsx(mW,{isLoading:s}),a.jsxs(KK,{redirectTo:"/auth/sign-in",children:[a.jsx(cW,{variant:"inset",collapsible:"icon"}),a.jsxs(eB,{children:[r&&a.jsx(QV,{}),a.jsx(qW,{children:a.jsx(Gb,{})})]})]})]})}function ZW(){const[e,t]=m.useState(()=>io.get(u_,"boolean")??!0),n=r=>{t(r),io.set(u_,r)};return a.jsx(uW,{children:a.jsx(pW,{children:a.jsx(WV,{open:e,onOpenChange:n,children:a.jsx(KW,{})})})})}function YW(){return a.jsxs("div",{className:"app-container",children:[a.jsx("h1",{children:"About OWOX"}),a.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function d_(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(yz,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),a.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",a.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",a.jsx("i",{children:"yesterday"}),".",a.jsx("br",{}),"Escape while you can!"]}),a.jsx(we,{variant:"default",asChild:!0,children:a.jsxs(Yr,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(Da,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const WW={items:[],loading:!1,error:null};function XW(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 PD=m.createContext(void 0);function QW({children:e}){const[t,n]=m.useReducer(XW,WW);return a.jsx(PD.Provider,{value:{state:t,dispatch:n},children:e})}function JW(){const e=m.useContext(PD);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class eX extends Sl{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 createSqlDryRunTrigger(t,n){return this.post(`/${t}/sql-dry-run-triggers`,{sql:n},{skipLoadingIndicator:!0})}async getSqlDryRunTriggerStatus(t,n){return(await this.get(`/${t}/sql-dry-run-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSqlDryRunTriggerResponse(t,n){return this.get(`/${t}/sql-dry-run-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSqlDryRunTrigger(t,n){await this.delete(`/${t}/sql-dry-run-triggers/${n}`,{skipLoadingIndicator:!0})}async createSchemaActualizeTrigger(t){return this.post(`/${t}/schema-actualize-triggers`,void 0,{skipLoadingIndicator:!0})}async getSchemaActualizeTriggerStatus(t,n){return(await this.get(`/${t}/schema-actualize-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSchemaActualizeTriggerResponse(t,n){return this.get(`/${t}/schema-actualize-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSchemaActualizeTrigger(t,n){await this.delete(`/${t}/schema-actualize-triggers/${n}`,{skipLoadingIndicator:!0})}async getDataMartRuns(t,n=5,r=0,s){return await this.get(`/${t}/runs`,{limit:n,offset:r},s)}async getDataMartRunById(t,n,r){return this.get(`/${t}/runs/${n}`,void 0,r)}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const En=new eX;var Ur=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Ur||{}),Be=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Be||{}),qp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(qp||{});const tX={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION:"Data Mart must have an input source configured"};var UD=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(UD||{}),Lr=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e.INSIGHT="INSIGHT",e))(Lr||{}),qn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(qn||{});const zD={statuses:{[Ur.DRAFT]:{code:Ur.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Ur.PUBLISHED]:{code:Ur.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},FD=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,HD=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,nX=e=>e?FD(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",rX=e=>e?HD(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",$D=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)},VD=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)},aX=e=>e?$D(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",sX=e=>e?VD(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var Is=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(Is||{});const oX=[{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 iX(e){return"projectId"in e}function lX(e){return"outputBucket"in e}var Re=(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))(Re||{}),Wo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Wo||{});const cX=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return a.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[a.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?a.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):a.jsx("span",{className:"text-sm",children:s||r===void 0?a.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},uX=({type:e,config:t})=>{const n={[Re.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Re.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Re.SNOWFLAKE]:[],[Re.DATABRICKS]:[],[Re.AWS_REDSHIFT]:[],[Re.AZURE_SYNAPSE]:[]},r=t&&(e===Re.GOOGLE_BIGQUERY&&iX(t)||e===Re.AWS_ATHENA&&lX(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:i})=>{let c;return r&&(c=(e===Re.GOOGLE_BIGQUERY,t[i])),a.jsx(cX,{label:s,value:c},i)})})},dX=({type:e,config:t})=>a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),a.jsx(uX,{type:e,config:t})]})}),fX=Cc("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 jr({className:e,variant:t,asChild:n=!1,...r}){const s=n?fh:"span";return a.jsx(s,{"data-slot":"badge",className:oe(fX({variant:t}),e),...r})}function BD(e){return e.type===Re.GOOGLE_BIGQUERY}function GD(e){return e.type===Re.AWS_ATHENA}function qD(e){return e.type===Re.SNOWFLAKE}const Cl={types:{[Re.GOOGLE_BIGQUERY]:{type:Re.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:yD,status:Wo.ACTIVE},[Re.AWS_ATHENA]:{type:Re.AWS_ATHENA,displayName:"AWS Athena",icon:xD,status:Wo.ACTIVE},[Re.SNOWFLAKE]:{type:Re.SNOWFLAKE,displayName:"Snowflake",icon:vD,status:Wo.ACTIVE},[Re.DATABRICKS]:{type:Re.DATABRICKS,displayName:"Databricks",icon:nZ,status:Wo.COMING_SOON},[Re.AWS_REDSHIFT]:{type:Re.AWS_REDSHIFT,displayName:"AWS Redshift",icon:rZ,status:Wo.COMING_SOON},[Re.AZURE_SYNAPSE]:{type:Re.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:aZ,status:Wo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function hX({dataStorage:e,isLoading:t=!1}){if(t)return a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,u)=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pr,{className:"h-5 w-24"}),a.jsx(Pr,{className:"h-6 w-40"})]},u))})});if(!e)return a.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:i}=e;return a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{children:e.title}),a.jsx(jr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:u}=Cl.getInfo(n);return a.jsxs(a.Fragment,{children:[a.jsx(u,{}),c]})})()})]}),a.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:a.jsx(dX,{type:n,config:r})}),a.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[a.jsxs("div",{children:[a.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))]}),a.jsxs("div",{children:[a.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(i))]})]})]})})}function mX(e){const t=e.split(".");return t.length===2?{dataset:t[0],table:t[1]}:t.length===3?{dataset:t[0],schema:t[1],table:t[2]}:(console.error("Invalid fully qualified name format:",e),null)}function pX(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),i=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${i}`}function gX(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function yX(e){return`https://${e}.snowflakecomputing.com/`}function xX(e,t){const n=mX(t);if(!n)return null;const{dataset:r,table:s}=n;return BD(e)?pX(e.config.projectId,r,s):GD(e)?gX(e.config.region):qD(e)?yX(e.config.account):null}function vX(e,t){const n=xX(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function bX(e){return BD(e)?"Open table in Google BigQuery":GD(e)?"Open region in AWS Athena":qD(e)?"Open console in Snowflake":"Open data in storage"}function KD(e){switch(e.type){case Re.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Re.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);case Re.SNOWFLAKE:return!!(e.config.account&&e.config.warehouse);default:return!1}}const SX=tn({accessKeyId:Dt().min(1,"Access Key ID is required"),secretAccessKey:Dt().min(1,"Secret Access Key is required")}),CX=tn({authMethod:Vr(Is.PASSWORD),username:Dt().min(1,"Username is required"),password:Dt().min(1,"Password is required")}),wX=tn({authMethod:Vr(Is.KEY_PAIR),username:Dt().min(1,"Username is required"),privateKey:Dt().min(1,"Private Key is required"),privateKeyPassphrase:Dt().optional()}),EX=US("authMethod",[CX,wX]),RX=tn({projectId:Dt().min(1,"Project ID is required"),location:Dt().min(1,"Location is required")}),jX=tn({region:Dt().min(1,"Region is required"),outputBucket:Dt().min(1,"Output Bucket is required")}),TX=tn({account:Dt().min(1,"Account is required"),warehouse:Dt().min(1,"Warehouse is required")}),HS=tn({title:Dt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),_X=HS.extend({type:Vr(Re.GOOGLE_BIGQUERY),credentials:RD,config:RX}),NX=HS.extend({type:Vr(Re.AWS_ATHENA),credentials:SX,config:jX}),AX=HS.extend({type:Vr(Re.SNOWFLAKE),credentials:EX,config:TX}),DX=US("type",[_X,NX,AX]),ZD=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},YD=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")',n='(?:[a-zA-Z0-9_$*]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${n}$`).test(e)},OX=e=>e?ZD(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",IX=e=>e?YD(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",MX=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return FD(e);case Re.AWS_ATHENA:return $D(e);case Re.SNOWFLAKE:return ZD(e);default:return!1}},kX=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return HD(e);case Re.AWS_ATHENA:return VD(e);case Re.SNOWFLAKE:return YD(e);default:return!1}},LX=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Re.GOOGLE_BIGQUERY:return nX(e);case Re.AWS_ATHENA:return aX(e);case Re.SNOWFLAKE:return OX(e);default:return"Unsupported storage type"}},PX=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Re.GOOGLE_BIGQUERY:return rX(e);case Re.AWS_ATHENA:return sX(e);case Re.SNOWFLAKE:return IX(e);default:return"Unsupported storage type"}},WD=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"project.dataset.table";case Re.AWS_ATHENA:return"database.table or catalog.database.table";case Re.SNOWFLAKE:return"database.schema.table";default:return""}},UX=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Re.AWS_ATHENA:return"database.table_* or catalog.database.table_*";case Re.SNOWFLAKE:return"database.schema.table_*";default:return""}},XD=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Re.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";case Re.SNOWFLAKE:return"Enter the fully qualified name of the table (e.g., database.schema.table)";default:return""}},zX=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Re.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';case Re.SNOWFLAKE:return'Enter a pattern to match multiple tables (e.g., database.schema.table_* will match all tables starting with "table_")';default:return""}};var er=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(er||{});const FX={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:""},HX=e=>FX[e],$X={[er.SUCCESS]:{icon:mh,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"}},[er.ERROR]:{icon:CA,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"}},[er.WARNING]:{icon:ph,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"}},[er.INFO]:{icon:zr,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"}},[er.NEUTRAL]:{icon:zr,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 Mh({type:e=er.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=$X[e],u=f=>{const h="inline-flex items-center gap-1 text-sm",y=HX(f),g=c[f];return oe(h,y,g,s)};return a.jsxs("span",{className:u(t),children:[n&&a.jsx(i,{className:"h-4 w-4","data-testid":"icon"}),r]})}const QD=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,VX=/[#&]gid=([0-9]+)/;function JD(e){return QD.test(e)}function BX(e){const t=QD.exec(e);return t?t[2]:""}function GX(e){const t=VX.exec(e);return t?t[1]:"0"}function qX(e){return{spreadsheetId:BX(e),sheetId:parseInt(GX(e),10)}}function $S(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function KX(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 F0(e){return KX(e,"client_email")}const eO=m.createContext(void 0);var lt=(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))(lt||{}),Tr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(Tr||{}),Mn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(Mn||{}),Rn=(e=>(e.EDIT="edit",e.CREATE="create",e))(Rn||{});const ZX={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function YX(e,t){switch(t.type){case lt.FETCH_REPORTS_START:case lt.FETCH_REPORT_START:case lt.CREATE_REPORT_START:case lt.UPDATE_REPORT_START:case lt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case lt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case lt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case lt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case lt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case lt.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 lt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case lt.FETCH_REPORTS_ERROR:case lt.FETCH_REPORT_ERROR:case lt.FETCH_DESTINATIONS_ERROR:case lt.CREATE_REPORT_ERROR:case lt.UPDATE_REPORT_ERROR:case lt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case lt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case lt.CLEAR_ERROR:return{...e,error:null};case lt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case lt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case lt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case lt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==Mn.RUNNING||(n==null?void 0:n.lastRunStatus)!==Mn.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 VS({children:e}){const[t,n]=m.useReducer(YX,ZX);return a.jsx(eO.Provider,{value:{state:t,dispatch:n},children:e})}function WX(){const e=m.useContext(eO);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class XX extends Sl{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t,n){return this.get(`/data-mart/${t}`,void 0,n)}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 Zo=new XX,QX={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class JX{constructor(){Qs(this,"pollingTimers",new Map);Qs(this,"pollCounters",new Map);Qs(this,"config",QX)}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 i=await Zo.getReportById(t);if(n(i),i.lastRunStatus!==Mn.RUNNING){this.stopPolling(t);return}const u=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},u);this.pollingTimers.set(t,f)}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 bp=new JX;var Ae=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e))(Ae||{}),js=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(js||{}),fo=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(fo||{});class eQ extends Sl{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 Ql=new eQ,sa={types:{[Ae.GOOGLE_SHEETS]:{type:Ae.GOOGLE_SHEETS,displayName:"Google Sheets",icon:JK,status:js.ACTIVE},[Ae.LOOKER_STUDIO]:{type:Ae.LOOKER_STUDIO,displayName:"Looker Studio",icon:eZ,status:js.ACTIVE},[Ae.EMAIL]:{type:Ae.EMAIL,displayName:"Email",icon:pZ,status:js.CLOUD_ONLY},[Ae.SLACK]:{type:Ae.SLACK,displayName:"Slack",icon:oZ,status:js.CLOUD_ONLY},[Ae.MS_TEAMS]:{type:Ae.MS_TEAMS,displayName:"Microsoft Teams",icon:hZ,status:js.CLOUD_ONLY},[Ae.GOOGLE_CHAT]:{type:Ae.GOOGLE_CHAT,displayName:"Google Chat",icon:mZ,status:js.CLOUD_ONLY},[Ae.ODATA]:{type:Ae.ODATA,displayName:"OData",icon:tZ,status:js.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},tQ=tn({deploymentUrl:Dt().optional(),destinationId:Dt().optional(),destinationSecretKey:Dt().optional()}),nQ=tn({to:Y1(Dt().email()).min(1)}),BS=tn({title:Dt().min(1,"Title is required"),type:by(Ae)}),rQ=BS.extend({type:Vr(Ae.GOOGLE_SHEETS),credentials:RD}),aQ=BS.extend({type:Vr(Ae.LOOKER_STUDIO),credentials:tQ.optional()}),wy=BS.extend({credentials:nQ.optional()}),sQ=wy.extend({type:Vr(Ae.EMAIL)}),oQ=wy.extend({type:Vr(Ae.SLACK)}),iQ=wy.extend({type:Vr(Ae.MS_TEAMS)}),lQ=wy.extend({type:Vr(Ae.GOOGLE_CHAT)}),cQ=US("type",[rQ,aQ,sQ,oQ,iQ,lQ]),tO=m.createContext(void 0);var Qt=(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))(Qt||{});const uQ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function dQ(e,t){switch(t.type){case Qt.FETCH_DESTINATIONS_START:case Qt.FETCH_DESTINATION_START:case Qt.CREATE_DESTINATION_START:case Qt.UPDATE_DESTINATION_START:case Qt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Qt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Qt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Qt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Qt.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 Qt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Qt.FETCH_DESTINATIONS_ERROR:case Qt.FETCH_DESTINATION_ERROR:case Qt.CREATE_DESTINATION_ERROR:case Qt.UPDATE_DESTINATION_ERROR:case Qt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Qt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Qt.CLEAR_ERROR:return{...e,error:null};default:return e}}function kh({children:e}){const[t,n]=m.useReducer(dQ,uQ);return a.jsx(tO.Provider,{value:{state:t,dispatch:n},children:e})}function fQ(){const e=m.useContext(tO);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Sp{constructor(t){this.type=t}mapFromDto(t){const n=this.extractCredentials(t.credentials);return{id:t.id,title:t.title,type:this.type,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};if(n.credentials!==void 0){const s=n.credentials.to;r.credentials={type:fo.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:fo.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===fo.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class hQ{mapFromDto(t){let n="";try{t.credentials.type===fo.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:Ae.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:fo.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Ae.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:fo.GOOGLE_SHEETS_CREDENTIALS}}}}class mQ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Ae.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:fo.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Ae.LOOKER_STUDIO,credentials:{type:fo.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===fo.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const nO={getMapper(e){switch(e){case Ae.GOOGLE_SHEETS:return new hQ;case Ae.LOOKER_STUDIO:return new mQ;case Ae.EMAIL:return new Sp(Ae.EMAIL);case Ae.SLACK:return new Sp(Ae.SLACK);case Ae.MS_TEAMS:return new Sp(Ae.MS_TEAMS);case Ae.GOOGLE_CHAT:return new Sp(Ae.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function ju(e){return nO.getMapper(e.type).mapFromDto(e)}function Lh(){const{state:e,dispatch:t}=fQ(),n=m.useCallback(async()=>{t({type:Qt.FETCH_DESTINATIONS_START});try{const y=(await Ql.getDataDestinations()).map(ju);t({type:Qt.FETCH_DESTINATIONS_SUCCESS,payload:y})}catch(h){const y=h instanceof Error?h.message:"Failed to load destinations";t({type:Qt.FETCH_DESTINATIONS_ERROR,payload:y}),Le({event:"data_destination_error",category:"DataDestination",action:"ListError",label:y})}},[t]),r=m.useCallback(async h=>{try{const y=await Ql.getDataDestinationById(h),g=ju(y);t({type:Qt.FETCH_DESTINATION_SUCCESS,payload:g})}catch(y){const g=y instanceof Error?y.message:"Failed to load destination";t({type:Qt.FETCH_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"GetError",label:g})}},[t]),s=m.useCallback(async h=>{t({type:Qt.CREATE_DESTINATION_START});try{const y=await Ql.createDataDestination(h),g=ju(y);return t({type:Qt.CREATE_DESTINATION_SUCCESS,payload:g}),Le({event:"data_destination_created",category:"DataDestination",action:"Create",label:g.type}),Tt.success("Destination created"),g}catch(y){const g=y instanceof Error?y.message:"Failed to create destination";return t({type:Qt.CREATE_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:h.type}),null}},[t]),i=m.useCallback(async(h,y)=>{t({type:Qt.UPDATE_DESTINATION_START});try{const g=await Ql.updateDataDestination(h,y),x=ju(g);return t({type:Qt.UPDATE_DESTINATION_SUCCESS,payload:x}),Le({event:"data_destination_updated",category:"DataDestination",action:"Update",label:x.type}),Tt.success("Destination updated"),x}catch(g){const x=g instanceof Error?g.message:"Failed to update destination";return t({type:Qt.UPDATE_DESTINATION_ERROR,payload:x}),Le({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:x}),null}},[t]),c=m.useCallback(async h=>{t({type:Qt.DELETE_DESTINATION_START});try{await Ql.deleteDataDestination(h),t({type:Qt.DELETE_DESTINATION_SUCCESS,payload:h}),Le({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),Tt.success("Destination deleted")}catch(y){const g=y instanceof Error?y.message:"Failed to delete destination";throw t({type:Qt.DELETE_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:g}),y}},[t]),u=m.useCallback(()=>{t({type:Qt.CLEAR_CURRENT_DESTINATION})},[t]),f=m.useCallback(async h=>{try{const y=await Ql.rotateSecretKey(h),g=ju(y);return Le({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:g.type}),g}catch(y){const g=y instanceof Error?y.message:"Failed to rotate secret key";throw Le({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:g}),console.error("Failed to rotate secret key:",y),y}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:i,deleteDataDestination:c,clearCurrentDataDestination:u,rotateSecretKey:f}}function pQ(e){const t=sa.getInfo(e.type),n=t.status!==js.COMING_SOON;return{destinationInfo:t,isVisible:n}}function gQ(){const{dataMart:e}=gs(),{fetchReportsByDataMartId:t}=Ja(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Lh(),[i,c]=m.useState(!0);return m.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(h){console.error("Failed to fetch Data Mart destinations or reports:",h)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:i||s}}function GS(e){return JSON.stringify(e,null,2)}class yQ{mapFromDto(t){if(t.type!==Tr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:Tr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class xQ{mapFromDto(t){if(t.type!==Tr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:Tr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class vQ{mapFromDto(t){if(t.type!==Tr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:Tr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const bQ={getMapper(e){switch(e){case Tr.GOOGLE_SHEETS_CONFIG:return new xQ;case Tr.LOOKER_STUDIO_CONFIG:return new vQ;case Tr.EMAIL_CONFIG:return new yQ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function SQ(e){return bQ.getMapper(e.type).mapFromDto(e)}function Jl(e){const t=SQ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:ju(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)}}const rO=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"—";return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)},Ey=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(g=>[g.type,g.value])),i=s.get("year")??"",c=s.get("month")??"",u=s.get("day")??"",f=s.get("hour")??"",h=s.get("minute")??"",y=s.get("second")??"";return`${i}-${c}-${u} ${f}:${h}:${y}`},vu=e=>Ey(aO(e).toISOString()),aO=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},CQ=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),s=Math.floor(r/60),i=Math.floor(s/60),c=s%60,u=r%60,f=[];return i>0&&f.push(`${String(i)} h`),c>0&&f.push(`${String(c)} min`),f.push(`${String(u)} sec`),f.join(" ")};function sO(e){return JSON.parse(JSON.stringify(e))}function wQ(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]}`}const oO=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}};function EQ(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function RQ(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}const jQ=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[];function Ja(){const{state:e,dispatch:t}=WX(),n=m.useCallback(async()=>{t({type:lt.FETCH_DESTINATIONS_START});try{const w=await Ql.getDataDestinations();t({type:lt.FETCH_DESTINATIONS_SUCCESS,payload:w})}catch(w){const R=w instanceof Error?w.message:"Failed to fetch destinations";t({type:lt.FETCH_DESTINATIONS_ERROR,payload:R}),Le({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=m.useCallback(async()=>{t({type:lt.FETCH_REPORTS_START});try{const R=(await Zo.getReportsByProject()).map(Jl);t({type:lt.FETCH_REPORTS_SUCCESS,payload:R})}catch(w){const R=w instanceof Error?w.message:"Failed to fetch reports";t({type:lt.FETCH_REPORTS_ERROR,payload:R}),Le({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=m.useCallback(async(w,R)=>{R!=null&&R.silent||t({type:lt.FETCH_REPORTS_START});try{const _=(await Zo.getReportsByDataMartId(w,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(Jl);t({type:lt.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:lt.FETCH_REPORTS_ERROR,payload:_}),Le({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),i=m.useCallback(async w=>{t({type:lt.FETCH_REPORT_START});try{const R=await Zo.getReportById(w),j=Jl(R);t({type:lt.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:lt.FETCH_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"GetError",label:j})}},[t]),c=m.useCallback(async w=>{t({type:lt.CREATE_REPORT_START});try{const R=await Zo.createReport(w),j=Jl(R);return t({type:lt.CREATE_REPORT_SUCCESS,payload:j}),Le({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type}),Tt.success("Report created"),j}catch(R){const j=R instanceof Error?R.message:"Failed to create report";return t({type:lt.CREATE_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"CreateError",label:w.destinationConfig.type}),null}},[t]),u=m.useCallback(async(w,R)=>{t({type:lt.UPDATE_REPORT_START});try{const j=await Zo.updateReport(w,R),_=Jl(j);return t({type:lt.UPDATE_REPORT_SUCCESS,payload:_}),Le({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),Tt.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:lt.UPDATE_REPORT_ERROR,payload:_}),Le({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=m.useCallback(async w=>{t({type:lt.DELETE_REPORT_START});try{await Zo.deleteReport(w),t({type:lt.DELETE_REPORT_SUCCESS,payload:w}),Le({event:"report_deleted",category:"Report",action:"Delete"}),Tt.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:lt.DELETE_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"DeleteError",label:j})}},[t]),h=m.useCallback(()=>{t({type:lt.CLEAR_CURRENT_REPORT})},[t]),y=m.useCallback(()=>{t({type:lt.CLEAR_ERROR})},[t]),g=m.useCallback(w=>{bp.stopPolling(w),t({type:lt.STOP_POLLING_REPORT,payload:w})},[t]),x=m.useCallback(w=>{e.polledReportIds.includes(w)&&g(w),t({type:lt.START_POLLING_REPORT,payload:w}),bp.startPolling(w,R=>{const j=Jl(R);t({type:lt.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,g]),v=m.useCallback(()=>{bp.stopAllPolling(),t({type:lt.STOP_ALL_POLLING})},[t]),C=m.useCallback(w=>{bp.setConfig(w)},[]),S=m.useCallback(async w=>{try{g(w),await Zo.runReport(w),await i(w),x(w),Le({event:"report_run_started",category:"Report",action:"Run",label:w}),Tt.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";Le({event:"report_error",category:"Report",action:"RunError",label:j}),console.error("Failed to run report:",R)}},[i,x,g]);return m.useEffect(()=>()=>{v()},[v]),{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:i,createReport:c,updateReport:u,deleteReport:f,runReport:S,startPollingReport:x,stopPollingReport:g,stopAllPolling:v,setPollingConfig:C,clearCurrentReport:h,clearError:y}}Mn.SUCCESS+"",Mn.SUCCESS,Mn.RUNNING+"",Mn.RUNNING,Mn.ERROR+"",Mn.ERROR,Mn.CANCELLED+"",Mn.CANCELLED;var H0,Ry="HoverCard",[iO]=wr(Ry,[So]),jy=So(),[TQ,Ty]=iO(Ry),lO=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=jy(t),h=m.useRef(0),y=m.useRef(0),g=m.useRef(!1),x=m.useRef(!1),[v,C]=la({prop:r,defaultProp:s??!1,onChange:i,caller:Ry}),S=m.useCallback(()=>{clearTimeout(y.current),h.current=window.setTimeout(()=>C(!0),c)},[c,C]),w=m.useCallback(()=>{clearTimeout(h.current),!g.current&&!x.current&&(y.current=window.setTimeout(()=>C(!1),u))},[u,C]),R=m.useCallback(()=>C(!1),[C]);return m.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(y.current)},[]),a.jsx(TQ,{scope:t,open:v,onOpenChange:C,onOpen:S,onClose:w,onDismiss:R,hasSelectionRef:g,isPointerDownOnContentRef:x,children:a.jsx(ud,{...f,children:n})})};lO.displayName=Ry;var cO="HoverCardTrigger",uO=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Ty(cO,n),i=jy(n);return a.jsx(dd,{asChild:!0,...i,children:a.jsx(Je.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Oe(e.onPointerEnter,Tg(s.onOpen)),onPointerLeave:Oe(e.onPointerLeave,Tg(s.onClose)),onFocus:Oe(e.onFocus,s.onOpen),onBlur:Oe(e.onBlur,s.onClose),onTouchStart:Oe(e.onTouchStart,c=>c.preventDefault())})})});uO.displayName=cO;var qS="HoverCardPortal",[_Q,NQ]=iO(qS,{forceMount:void 0}),dO=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=Ty(qS,t);return a.jsx(_Q,{scope:t,forceMount:n,children:a.jsx($r,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};dO.displayName=qS;var jg="HoverCardContent",fO=m.forwardRef((e,t)=>{const n=NQ(jg,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=Ty(jg,e.__scopeHoverCard);return a.jsx($r,{present:r||i.open,children:a.jsx(AQ,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Oe(e.onPointerEnter,Tg(i.onOpen)),onPointerLeave:Oe(e.onPointerLeave,Tg(i.onClose)),ref:t})})});fO.displayName=jg;var AQ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=Ty(jg,n),h=jy(n),y=m.useRef(null),g=mt(t,y),[x,v]=m.useState(!1);return m.useEffect(()=>{if(x){const C=document.body;return H0=C.style.userSelect||C.style.webkitUserSelect,C.style.userSelect="none",C.style.webkitUserSelect="none",()=>{C.style.userSelect=H0,C.style.webkitUserSelect=H0}}},[x]),m.useEffect(()=>{if(y.current){const C=()=>{v(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var w;((w=document.getSelection())==null?void 0:w.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",C),()=>{document.removeEventListener("pointerup",C),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),m.useEffect(()=>{y.current&&IQ(y.current).forEach(S=>S.setAttribute("tabindex","-1"))}),a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Oe(i,C=>{C.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(vh,{...h,...u,onPointerDown:Oe(u.onPointerDown,C=>{C.currentTarget.contains(C.target)&&v(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:g,style:{...u.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)"}})})}),DQ="HoverCardArrow",OQ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=jy(n);return a.jsx(bh,{...s,...r,ref:t})});OQ.displayName=DQ;function Tg(e){return t=>t.pointerType==="touch"?void 0:e()}function IQ(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 MQ=lO,kQ=uO,LQ=dO,PQ=fO;const _y=({...e})=>a.jsx(MQ,{"data-slot":"hover-card",...e});_y.displayName="HoverCard";const Ny=m.forwardRef(({...e},t)=>a.jsx(kQ,{"data-slot":"hover-card-trigger",ref:t,...e}));Ny.displayName="HoverCardTrigger";const Ay=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},i)=>{const c=u=>{u.stopPropagation(),r&&r(u)};return a.jsx(LQ,{children:a.jsx(PQ,{ref:i,align:t,sideOffset:n,className:oe("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})})});Ay.displayName="HoverCardContent";const KS=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("border-border flex gap-4 border-b pb-4",e),...t}));KS.displayName="HoverCardHeader";const ZS=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));ZS.displayName="HoverCardHeaderIcon";const YS=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("flex flex-col space-y-1",e),...t}));YS.displayName="HoverCardHeaderText";const WS=m.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:oe("text-md pt-1 leading-snug font-semibold",e),...t}));WS.displayName="HoverCardHeaderTitle";const XS=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:oe("text-muted-foreground text-sm",e),...t}));XS.displayName="HoverCardHeaderDescription";const QS=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("flex flex-col",e),...t}));QS.displayName="HoverCardBody";const tl=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("border-border flex items-center justify-between border-b py-4",e),...t}));tl.displayName="HoverCardItem";const nl=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:oe("text-muted-foreground text-sm",e),...t}));nl.displayName="HoverCardItemLabel";const rl=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:oe("text-sm",e),...t}));rl.displayName="HoverCardItemValue";const JS=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("pt-4 pb-2",e),...t}));JS.displayName="HoverCardFooter";function Dy(e){return e.type===Tr.GOOGLE_SHEETS_CONFIG}function hO(e){return e.type===Tr.LOOKER_STUDIO_CONFIG}function $0(e){return e.type===Tr.EMAIL_CONFIG}function zs({date:e,className:t=""}){const n=m.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),i=Math.abs(s),c=s<0,u=Math.floor(i/(1e3*60)),f=Math.floor(i/(1e3*60*60)),h=Math.floor(i/(1e3*60*60*24)),y=Math.floor(h/7),g=Math.floor(h/30),x=Math.floor(h/365),v=S=>S.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),C=S=>S.toLocaleDateString("en-US",{weekday:"long"});if(u<1)return c?"Just now":"In a moment";if(u<60)return c?u===1?"1 minute ago":`${u} minutes ago`:u===1?"In 1 minute":`In ${u} minutes`;if(f<24)return c?f===1?"1 hour ago":`${f} hours ago`:f===1?"In 1 hour":`In ${f} hours`;if(h===1){const S=v(e);return c?`Yesterday at ${S}`:`Tomorrow at ${S}`}if(h<7){const S=C(e),w=v(e);return c?`Last ${S} at ${w}`:`This ${S} at ${w}`}if(h<14){const S=C(e),w=v(e);return c?`Last ${S} at ${w}`:`Next ${S} at ${w}`}return y<4?c?y===2?"2 weeks ago":"3 weeks ago":y===2?"In 2 weeks":"In 3 weeks":g<12?c?g===1?"1 month ago":`${g} months ago`:g===1?"In 1 month":`In ${g} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const UQ=()=>{const e=m.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=m.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},zQ=re.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=UQ(),i=m.useMemo(()=>t.lastRunStatus?{statusType:$Q(t.lastRunStatus),statusText:BQ(t.lastRunStatus)}:null,[t.lastRunStatus]),c=m.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),u=m.useMemo(()=>sa.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=m.useMemo(()=>Dy(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),h=m.useCallback(()=>{if(!f.isGoogleSheets||!f.spreadsheetId||!f.sheetId)return;const y=$S(f.spreadsheetId,f.sheetId);window.open(y,"_blank","noopener,noreferrer")},[f]);return a.jsxs(_y,{children:[a.jsx(Ny,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Ay,{children:[a.jsxs(KS,{children:[a.jsx(ZS,{children:a.jsx(u,{size:20})}),a.jsxs(YS,{children:[a.jsx(WS,{children:t.title||"Unnamed Report"}),a.jsxs(XS,{children:["Last modified ",a.jsx(zs,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(QS,{children:[a.jsxs(tl,{children:[a.jsx(nl,{children:"Last run status:"}),a.jsx(rl,{children:i?a.jsx(Mh,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(tl,{children:[a.jsx(nl,{children:"Last run date:"}),a.jsx(rl,{children:t.lastRunDate?a.jsx(zs,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(tl,{children:[a.jsx(nl,{children:"Error message:"}),a.jsx(rl,{children:t.lastRunError})]}),a.jsxs(tl,{children:[a.jsx(nl,{children:"Total runs:"}),a.jsxs(rl,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(JS,{children:a.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",a.jsx(ri,{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));var Ya=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Ya||{});const FQ=e=>{switch(e){case Ur.DRAFT:return er.NEUTRAL;case Ur.PUBLISHED:return er.SUCCESS;default:return er.NEUTRAL}},HQ=e=>{switch(e){case qn.SUCCESS:return er.SUCCESS;case qn.RUNNING:return er.INFO;case qn.FAILED:case qn.CANCELLED:case qn.INTERRUPTED:return er.ERROR;default:return er.NEUTRAL}},$Q=e=>{switch(e){case Mn.SUCCESS:return er.SUCCESS;case Mn.RUNNING:return er.INFO;case Mn.ERROR:return er.ERROR;default:return er.NEUTRAL}},VQ=e=>{switch(e){case qn.SUCCESS:return"Success";case qn.RUNNING:return"Running";case qn.FAILED:return"Failed";case qn.CANCELLED:return"Cancelled";case qn.INTERRUPTED:return"Interrupted";case qn.PENDING:return"Pending";default:return"Unknown"}},BQ=e=>{switch(e){case Mn.SUCCESS:return"Success";case Mn.RUNNING:return"Running";case Mn.ERROR:return"Failed";default:return"Unknown"}},GQ=e=>e?[qn.SUCCESS,qn.FAILED,qn.CANCELLED,qn.INTERRUPTED].includes(e):!0,qQ=e=>e?[Ya.SUCCESS,Ya.ERROR,Ya.CANCELLED].includes(e):!0,mO=e=>tn({fullyQualifiedName:Dt().min(1,"Fully qualified name is required").refine(t=>MX(t,e),t=>({message:LX(t,e)}))}),KQ=e=>tn({pattern:Dt().min(1,"Table pattern is required").refine(t=>kX(t,e),t=>({message:PX(t,e)}))}),ZQ=e=>{const t=[];return e.status.code===Ur.PUBLISHED&&t.push(qp.ALREADY_PUBLISHED),KD(e.storage)||t.push(qp.INVALID_STORAGE),e.definition||t.push(qp.MISSING_DEFINITION),t},YQ=e=>e.map(t=>tX[t]);function WQ(e){return e.map(t=>({id:t.id,title:t.title,status:zD.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdByUser:t.createdByUser,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function pO(){const{state:e,dispatch:t}=JW(),n=m.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await En.getDataMarts(),c=WQ(i);t({type:"SET_ITEMS",payload:c})}catch(i){t({type:"SET_ERROR",payload:i instanceof Error?i.message:"Failed to load data marts"})}},[t]),r=m.useCallback(async i=>{t({type:"SET_LOADING"});try{await En.deleteDataMart(i),Le({event:"data_mart_deleted",category:"DataMart",action:"Delete"})}catch(c){const u=c instanceof Error?c.message:"Failed to delete data mart";throw t({type:"SET_ERROR",payload:u}),Le({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:u}),c}},[t]),s=m.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
|
|
757
|
-
* table-core
|
|
758
|
-
*
|
|
759
|
-
* Copyright (c) TanStack
|
|
760
|
-
*
|
|
761
|
-
* This source code is licensed under the MIT license found in the
|
|
762
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
763
|
-
*
|
|
764
|
-
* @license MIT
|
|
765
|
-
*/function al(e,t){return typeof e=="function"?e(t):e}function Xa(e,t){return n=>{t.setState(r=>({...r,[e]:al(n,r[e])}))}}function Oy(e){return e instanceof Function}function XQ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function QQ(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const c=t(i);c!=null&&c.length&&r(c)})};return r(e),n}function ct(e,t,n){let r=[],s;return i=>{let c;n.key&&n.debug&&(c=Date.now());const u=e(i);if(!(u.length!==r.length||u.some((y,g)=>r[g]!==y)))return s;r=u;let h;if(n.key&&n.debug&&(h=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const y=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-h)*100)/100,x=g/16,v=(C,S)=>{for(C=String(C);C.length<S;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(y,5)} ms`,`
|
|
766
|
-
font-size: .6rem;
|
|
767
|
-
font-weight: bold;
|
|
768
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function ut(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 JQ(e,t,n,r){const s=()=>{var c;return(c=i.getValue())!=null?c:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:ct(()=>[e,n,t,i],(c,u,f,h)=>({table:c,column:u,row:f,cell:h,getValue:h.getValue,renderValue:h.renderValue}),ut(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(i,n,t,e)},{}),i}function eJ(e,t,n,r){var s,i;const u={...e._getDefaultColumnDef(),...t},f=u.accessorKey;let h=(s=(i=u.id)!=null?i:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,y;if(u.accessorFn?y=u.accessorFn:f&&(f.includes(".")?y=x=>{let v=x;for(const S of f.split(".")){var C;v=(C=v)==null?void 0:C[S]}return v}:y=x=>x[u.accessorKey]),!h)throw new Error;let g={id:`${String(h)}`,accessorFn:y,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:ct(()=>[!0],()=>{var x;return[g,...(x=g.columns)==null?void 0:x.flatMap(v=>v.getFlatColumns())]},ut(e.options,"debugColumns")),getLeafColumns:ct(()=>[e._getOrderColumnsFn()],x=>{var v;if((v=g.columns)!=null&&v.length){let C=g.columns.flatMap(S=>S.getLeafColumns());return x(C)}return[g]},ut(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(g,e);return g}const Gr="debugHeaders";function f_(e,t,n){var r;let i={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=[],u=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(u),c.push(f)};return u(i),c},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(i,e)}),i}const tJ={createTable:e=>{e.getHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var i,c;const u=(i=r==null?void 0:r.map(g=>n.find(x=>x.id===g)).filter(Boolean))!=null?i:[],f=(c=s==null?void 0:s.map(g=>n.find(x=>x.id===g)).filter(Boolean))!=null?c:[],h=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(s!=null&&s.includes(g.id)));return Cp(t,[...u,...h,...f],e)},ut(e.options,Gr)),e.getCenterHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),Cp(t,n,e,"center")),ut(e.options,Gr)),e.getLeftHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(c=>n.find(u=>u.id===c)).filter(Boolean))!=null?s:[];return Cp(t,i,e,"left")},ut(e.options,Gr)),e.getRightHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(c=>n.find(u=>u.id===c)).filter(Boolean))!=null?s:[];return Cp(t,i,e,"right")},ut(e.options,Gr)),e.getFooterGroups=ct(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ut(e.options,Gr)),e.getLeftFooterGroups=ct(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ut(e.options,Gr)),e.getCenterFooterGroups=ct(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ut(e.options,Gr)),e.getRightFooterGroups=ct(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ut(e.options,Gr)),e.getFlatHeaders=ct(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ut(e.options,Gr)),e.getLeftFlatHeaders=ct(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ut(e.options,Gr)),e.getCenterFlatHeaders=ct(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ut(e.options,Gr)),e.getRightFlatHeaders=ct(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ut(e.options,Gr)),e.getCenterLeafHeaders=ct(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ut(e.options,Gr)),e.getLeftLeafHeaders=ct(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ut(e.options,Gr)),e.getRightLeafHeaders=ct(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ut(e.options,Gr)),e.getLeafHeaders=ct(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,c,u,f,h;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(c=(u=n[0])==null?void 0:u.headers)!=null?c:[],...(f=(h=r[0])==null?void 0:h.headers)!=null?f:[]].map(y=>y.getLeafHeaders()).flat()},ut(e.options,Gr))}};function Cp(e,t,n,r){var s,i;let c=0;const u=function(x,v){v===void 0&&(v=1),c=Math.max(c,v),x.filter(C=>C.getIsVisible()).forEach(C=>{var S;(S=C.columns)!=null&&S.length&&u(C.columns,v+1)},0)};u(e);let f=[];const h=(x,v)=>{const C={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];x.forEach(w=>{const R=[...S].reverse()[0],j=w.column.depth===C.depth;let _,I=!1;if(j&&w.column.parent?_=w.column.parent:(_=w.column,I=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(w);else{const A=f_(n,_,{id:[r,v,_.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:I,placeholderId:I?`${S.filter(O=>O.column===_).length}`:void 0,depth:v,index:S.length});A.subHeaders.push(w),S.push(A)}C.headers.push(w),w.headerGroup=C}),f.push(C),v>0&&h(S,v-1)},y=t.map((x,v)=>f_(n,x,{depth:c,index:v}));h(y,c-1),f.reverse();const g=x=>x.filter(C=>C.column.getIsVisible()).map(C=>{let S=0,w=0,R=[0];C.subHeaders&&C.subHeaders.length?(R=[],g(C.subHeaders).forEach(_=>{let{colSpan:I,rowSpan:A}=_;S+=I,R.push(A)})):S=1;const j=Math.min(...R);return w=w+j,C.colSpan=S,C.rowSpan=w,{colSpan:S,rowSpan:w}});return g((s=(i=f[0])==null?void 0:i.headers)!=null?s:[]),f}const e2=(e,t,n,r,s,i,c)=>{let u={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(u._valuesCache.hasOwnProperty(f))return u._valuesCache[f];const h=e.getColumn(f);if(h!=null&&h.accessorFn)return u._valuesCache[f]=h.accessorFn(u.original,r),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const h=e.getColumn(f);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=h.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var h;return(h=u.getValue(f))!=null?h:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>QQ(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],h=u;for(;;){const y=h.getParentRow();if(!y)break;f.push(y),h=y}return f.reverse()},getAllCells:ct(()=>[e.getAllLeafColumns()],f=>f.map(h=>JQ(e,u,h,h.id)),ut(e.options,"debugRows")),_getAllCellsByColumnId:ct(()=>[u.getAllCells()],f=>f.reduce((h,y)=>(h[y.column.id]=y,h),{}),ut(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const h=e._features[f];h==null||h.createRow==null||h.createRow(u,e)}return u},nJ={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()}}},gO=(e,t,n)=>{var r,s;const i=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(i))};gO.autoRemove=e=>Ms(e);const yO=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};yO.autoRemove=e=>Ms(e);const xO=(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())};xO.autoRemove=e=>Ms(e);const vO=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};vO.autoRemove=e=>Ms(e);const bO=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});bO.autoRemove=e=>Ms(e)||!(e!=null&&e.length);const SO=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});SO.autoRemove=e=>Ms(e)||!(e!=null&&e.length);const CO=(e,t,n)=>e.getValue(t)===n;CO.autoRemove=e=>Ms(e);const wO=(e,t,n)=>e.getValue(t)==n;wO.autoRemove=e=>Ms(e);const t2=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};t2.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(i>c){const u=i;i=c,c=u}return[i,c]};t2.autoRemove=e=>Ms(e)||Ms(e[0])&&Ms(e[1]);const Yo={includesString:gO,includesStringSensitive:yO,equalsString:xO,arrIncludes:vO,arrIncludesAll:bO,arrIncludesSome:SO,equals:CO,weakEquals:wO,inNumberRange:t2};function Ms(e){return e==null||e===""}const rJ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xa("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"?Yo.includesString:typeof r=="number"?Yo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Yo.equals:Array.isArray(r)?Yo.arrIncludes:Yo.weakEquals},e.getFilterFn=()=>{var n,r;return Oy(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:Yo[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(),i=r==null?void 0:r.find(y=>y.id===e.id),c=al(n,i?i.value:void 0);if(h_(s,c,e)){var u;return(u=r==null?void 0:r.filter(y=>y.id!==e.id))!=null?u:[]}const f={id:e.id,value:c};if(i){var h;return(h=r==null?void 0:r.map(y=>y.id===e.id?f:y))!=null?h:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var i;return(i=al(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(h_(f,c.value,u))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 h_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const aJ=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),sJ=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},oJ=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},iJ=(e,t,n)=>{let r,s;return n.forEach(i=>{const c=i.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},lJ=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let i=s.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},cJ=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!XQ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,c)=>i-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},uJ=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),dJ=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,fJ=(e,t)=>t.length,V0={sum:aJ,min:sJ,max:oJ,extent:iJ,mean:lJ,median:cJ,unique:uJ,uniqueCount:dJ,count:fJ},hJ={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:Xa("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 V0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return V0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Oy(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:V0[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 mJ(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(c=>c.id===i)).filter(Boolean),...r]}const pJ={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xa("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ct(n=>[kf(t,n)],n=>n.findIndex(r=>r.id===e.id),ut(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=kf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=kf(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=ct(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let i=[];if(!(t!=null&&t.length))i=s;else{const c=[...t],u=[...s];for(;u.length&&c.length;){const f=c.shift(),h=u.findIndex(y=>y.id===f);h>-1&&i.push(u.splice(h,1)[0])}i=[...i,...u]}return mJ(i,n,r)},ut(e.options,"debugTable"))}},B0=()=>({left:[],right:[]}),gJ={getInitialState:e=>({columnPinning:B0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xa("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,c;if(n==="right"){var u,f;return{left:((u=s==null?void 0:s.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((f=s==null?void 0:s.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var h,y;return{left:[...((h=s==null?void 0:s.left)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((y=s==null?void 0:s.right)!=null?y:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,i,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:s}=t.getState().columnPinning,i=n.some(u=>r==null?void 0:r.includes(u)),c=n.some(u=>s==null?void 0:s.includes(u));return i?"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=ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(c=>!i.includes(c.column.id))},ut(t.options,"debugRows")),e.getLeftVisibleCells=ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(c=>c.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ut(t.options,"debugRows")),e.getRightVisibleCells=ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(c=>c.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ut(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?B0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:B0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ut(e.options,"debugColumns")),e.getRightLeafColumns=ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ut(e.options,"debugColumns")),e.getCenterLeafColumns=ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(i=>!s.includes(i.id))},ut(e.options,"debugColumns"))}};function yJ(e){return e||(typeof document<"u"?document:null)}const wp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},G0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),xJ={getDefaultColumnDef:()=>wp,getInitialState:e=>({columnSizing:{},columnSizingInfo:G0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Xa("columnSizing",e),onColumnSizingInfoChange:Xa("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:wp.minSize,(r=i??e.columnDef.size)!=null?r:wp.size),(s=e.columnDef.maxSize)!=null?s:wp.maxSize)},e.getStart=ct(n=>[n,kf(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ut(t.options,"debugColumns")),e.getAfter=ct(n=>[n,kf(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ut(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 i;n+=(i=s.column.getSize())!=null?i: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 i=>{if(!r||!s||(i.persist==null||i.persist(),q0(i)&&i.touches&&i.touches.length>1))return;const c=e.getSize(),u=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],f=q0(i)?Math.round(i.touches[0].clientX):i.clientX,h={},y=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var I,A;const O=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((I=_==null?void 0:_.startOffset)!=null?I:0))*O,D=Math.max(T/((A=_==null?void 0:_.startSize)!=null?A:0),-.999999);return _.columnSizingStart.forEach(L=>{let[$,K]=L;h[$]=Math.round(Math.max(K+K*D,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...h})))},g=R=>y("move",R),x=R=>{y("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=yJ(n),C={moveHandler:R=>g(R.clientX),upHandler:R=>{v==null||v.removeEventListener("mousemove",C.moveHandler),v==null||v.removeEventListener("mouseup",C.upHandler),x(R.clientX)}},S={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),g(R.touches[0].clientX),!1),upHandler:R=>{var j;v==null||v.removeEventListener("touchmove",S.moveHandler),v==null||v.removeEventListener("touchend",S.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((j=R.touches[0])==null?void 0:j.clientX)}},w=vJ()?{passive:!1}:!1;q0(i)?(v==null||v.addEventListener("touchmove",S.moveHandler,w),v==null||v.addEventListener("touchend",S.upHandler,w)):(v==null||v.addEventListener("mousemove",C.moveHandler,w),v==null||v.addEventListener("mouseup",C.upHandler,w)),t.setColumnSizingInfo(R=>({...R,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,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?G0():(n=e.initialState.columnSizingInfo)!=null?n:G0())},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 Ep=null;function vJ(){if(typeof Ep=="boolean")return Ep;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 Ep=e,Ep}function q0(e){return e.type==="touchstart"}const bJ={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xa("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(i=>i.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=ct(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ut(t.options,"debugRows")),e.getVisibleCells=ct(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ut(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ct(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ut(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,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.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 kf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const SJ={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()}}},CJ={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Xa("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,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Yo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Oy(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Yo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},wJ={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xa("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,i;e.setExpanded(r?{}:(s=(i=e.initialState)==null?void 0:i.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(i=>{const c=i.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 i=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{c[u]=!0}):c=r,n=(s=n)!=null?s:!i,!i&&n)return{...c,[e.id]:!0};if(i&&!n){const{[e.id]:u,...f}=c;return f}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()}}}},tb=0,nb=10,K0=()=>({pageIndex:tb,pageSize:nb}),EJ={getInitialState:e=>({...e,pagination:{...K0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xa("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=i=>al(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?K0():(s=e.initialState.pagination)!=null?s:K0())},e.setPageIndex=r=>{e.setPagination(s=>{let i=al(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,c)),{...s,pageIndex:i}})},e.resetPageIndex=r=>{var s,i;e.setPageIndex(r?tb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:tb)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?nb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:nb)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,al(r,s.pageSize)),c=s.pageSize*s.pageIndex,u=Math.floor(c/i);return{...s,pageIndex:u,pageSize:i}})},e.setPageCount=r=>e.setPagination(s=>{var i;let c=al(r,(i=e.options.pageCount)!=null?i:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=ct(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,c)=>c)),s},ut(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}}},Z0=()=>({top:[],bottom:[]}),RJ={getInitialState:e=>({rowPinning:Z0(),...e}),getDefaultOptions:e=>({onRowPinningChange:Xa("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(f=>{let{id:h}=f;return h}):[],c=s?e.getParentRows().map(f=>{let{id:h}=f;return h}):[],u=new Set([...c,e.id,...i]);t.setRowPinning(f=>{var h,y;if(n==="bottom"){var g,x;return{top:((g=f==null?void 0:f.top)!=null?g:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((x=f==null?void 0:f.bottom)!=null?x:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)]}}if(n==="top"){var v,C;return{top:[...((v=f==null?void 0:f.top)!=null?v:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)],bottom:((C=f==null?void 0:f.bottom)!=null?C:[]).filter(S=>!(u!=null&&u.has(S)))}}return{top:((h=f==null?void 0:f.top)!=null?h:[]).filter(S=>!(u!=null&&u.has(S))),bottom:((y=f==null?void 0:f.bottom)!=null?y:[]).filter(S=>!(u!=null&&u.has(S)))}})},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,i=n.some(u=>r==null?void 0:r.includes(u)),c=n.some(u=>s==null?void 0:s.includes(u));return i?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const i=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:u}=c;return u});return(r=i==null?void 0:i.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?Z0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Z0())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.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 u=e.getRow(c,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(c=>t.find(u=>u.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ut(e.options,"debugRows")),e.getBottomRows=ct(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ut(e.options,"debugRows")),e.getCenterRows=ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(i=>!s.has(i.id))},ut(e.options,"debugRows"))}},jJ={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xa("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(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(i=>{rb(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Y0(e,n):{rows:[],flatRows:[],rowsById:{}},ut(e.options,"debugTable")),e.getFilteredSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Y0(e,n):{rows:[],flatRows:[],rowsById:{}},ut(e.options,"debugTable")),e.getGroupedSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Y0(e,n):{rows:[],flatRows:[],rowsById:{}},ut(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(i=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return i;const u={...i};return rb(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return n2(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ab(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ab(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)}}}},rb=(e,t,n,r,s)=>{var i;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=c.subRows)!=null&&i.length&&c.getCanSelectSubRows()&&c.subRows.forEach(u=>rb(e,u.id,n,r,s))};function Y0(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var h;const y=n2(f,n);if(y&&(r.push(f),s[f.id]=f),(h=f.subRows)!=null&&h.length&&(f={...f,subRows:i(f.subRows)}),y)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function n2(e,t){var n;return(n=t[e.id])!=null?n:!1}function ab(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return e.subRows.forEach(c=>{if(!(i&&!s)&&(c.getCanSelect()&&(n2(c,t)?i=!0:s=!1),c.subRows&&c.subRows.length)){const u=ab(c,t);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const sb=/([0-9]+)/gm,TJ=(e,t,n)=>EO(pl(e.getValue(n)).toLowerCase(),pl(t.getValue(n)).toLowerCase()),_J=(e,t,n)=>EO(pl(e.getValue(n)),pl(t.getValue(n))),NJ=(e,t,n)=>r2(pl(e.getValue(n)).toLowerCase(),pl(t.getValue(n)).toLowerCase()),AJ=(e,t,n)=>r2(pl(e.getValue(n)),pl(t.getValue(n))),DJ=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},OJ=(e,t,n)=>r2(e.getValue(n),t.getValue(n));function r2(e,t){return e===t?0:e>t?1:-1}function pl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function EO(e,t){const n=e.split(sb).filter(Boolean),r=t.split(sb).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),c=parseInt(s,10),u=parseInt(i,10),f=[c,u].sort();if(isNaN(f[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(f[1]))return isNaN(c)?-1:1;if(c>u)return 1;if(u>c)return-1}return n.length-r.length}const xf={alphanumeric:TJ,alphanumericCaseSensitive:_J,text:NJ,textCaseSensitive:AJ,datetime:DJ,basic:OJ},IJ={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xa("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 i=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return xf.datetime;if(typeof i=="string"&&(r=!0,i.split(sb).length>1))return xf.alphanumeric}return r?xf.text:xf.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 Oy(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:xf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(c=>{const u=c==null?void 0:c.find(v=>v.id===e.id),f=c==null?void 0:c.findIndex(v=>v.id===e.id);let h=[],y,g=i?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?u?y="toggle":y="add":c!=null&&c.length&&f!==c.length-1?y="replace":u?y="toggle":y="replace",y==="toggle"&&(i||s||(y="remove")),y==="add"){var x;h=[...c,{id:e.id,desc:g}],h.splice(0,h.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else y==="toggle"?h=c.map(v=>v.id===e.id?{...v,desc:g}:v):y==="remove"?h=c.filter(v=>v.id!==e.id):h=[{id:e.id,desc:g}];return h})},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 i=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":i},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())}},MJ=[tJ,bJ,pJ,gJ,nJ,rJ,SJ,CJ,IJ,hJ,wJ,EJ,RJ,jJ,xJ];function kJ(e){var t,n;const r=[...MJ,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((x,v)=>Object.assign(x,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(i,x):{...i,...x};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var v;f=(v=x.getInitialState==null?void 0:x.getInitialState(f))!=null?v:f});const h=[];let y=!1;const g={_features:r,options:{...i,...e},initialState:f,_queue:x=>{h.push(x),y||(y=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();y=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const v=al(x,s.options);s.options=c(v)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,v,C)=>{var S;return(S=s.options.getRowId==null?void 0:s.options.getRowId(x,v,C))!=null?S:`${C?[C.id,v].join("."):v}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,v)=>{let C=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!C&&(C=s.getCoreRowModel().rowsById[x],!C))throw new Error;return C},_getDefaultColumnDef:ct(()=>[s.options.defaultColumn],x=>{var v;return x=(v=x)!=null?v:{},{header:C=>{const S=C.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:C=>{var S,w;return(S=(w=C.renderValue())==null||w.toString==null?void 0:w.toString())!=null?S:null},...s._features.reduce((C,S)=>Object.assign(C,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...x}},ut(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:ct(()=>[s._getColumnDefs()],x=>{const v=function(C,S,w){return w===void 0&&(w=0),C.map(R=>{const j=eJ(s,R,w,S),_=R;return j.columns=_.columns?v(_.columns,j,w+1):[],j})};return v(x)},ut(e,"debugColumns")),getAllFlatColumns:ct(()=>[s.getAllColumns()],x=>x.flatMap(v=>v.getFlatColumns()),ut(e,"debugColumns")),_getAllFlatColumnsById:ct(()=>[s.getAllFlatColumns()],x=>x.reduce((v,C)=>(v[C.id]=C,v),{}),ut(e,"debugColumns")),getAllLeafColumns:ct(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,v)=>{let C=x.flatMap(S=>S.getLeafColumns());return v(C)},ut(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,g);for(let x=0;x<s._features.length;x++){const v=s._features[x];v==null||v.createTable==null||v.createTable(s)}return s}function wl(){return e=>ct(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,c){i===void 0&&(i=0);const u=[];for(let h=0;h<s.length;h++){const y=e2(e,e._getRowId(s[h],h,c),s[h],h,i,void 0,c==null?void 0:c.id);if(n.flatRows.push(y),n.rowsById[y.id]=y,u.push(y),e.options.getSubRows){var f;y.originalSubRows=e.options.getSubRows(s[h],h),(f=y.originalSubRows)!=null&&f.length&&(y.subRows=r(y.originalSubRows,i+1,y))}}return u};return n.rows=r(t),n},ut(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function LJ(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 PJ(e,t,n){return n.options.filterFromLeafRows?UJ(e,t,n):zJ(e,t,n)}function UJ(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,h){h===void 0&&(h=0);const y=[];for(let x=0;x<f.length;x++){var g;let v=f[x];const C=e2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(C.columnFilters=v.columnFilters,(g=v.subRows)!=null&&g.length&&h<c){if(C.subRows=u(v.subRows,h+1),v=C,t(v)&&!C.subRows.length){y.push(v),i[v.id]=v,s.push(v);continue}if(t(v)||C.subRows.length){y.push(v),i[v.id]=v,s.push(v);continue}}else v=C,t(v)&&(y.push(v),i[v.id]=v,s.push(v))}return y};return{rows:u(e),flatRows:s,rowsById:i}}function zJ(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,h){h===void 0&&(h=0);const y=[];for(let x=0;x<f.length;x++){let v=f[x];if(t(v)){var g;if((g=v.subRows)!=null&&g.length&&h<c){const S=e2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);S.subRows=u(v.subRows,h+1),v=S}y.push(v),s.push(v),i[v.id]=v}}return y};return{rows:u(e),flatRows:s,rowsById:i}}function pd(){return e=>ct(()=>[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=[],i=[];(n??[]).forEach(x=>{var v;const C=e.getColumn(x.id);if(!C)return;const S=C.getFilterFn();S&&s.push({id:x.id,filterFn:S,resolvedValue:(v=S.resolveFilterValue==null?void 0:S.resolveFilterValue(x.value))!=null?v:x.value})});const c=(n??[]).map(x=>x.id),u=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&u&&f.length&&(c.push("__global__"),f.forEach(x=>{var v;i.push({id:x.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?v:r})}));let h,y;for(let x=0;x<t.flatRows.length;x++){const v=t.flatRows[x];if(v.columnFilters={},s.length)for(let C=0;C<s.length;C++){h=s[C];const S=h.id;v.columnFilters[S]=h.filterFn(v,S,h.resolvedValue,w=>{v.columnFiltersMeta[S]=w})}if(i.length){for(let C=0;C<i.length;C++){y=i[C];const S=y.id;if(y.filterFn(v,S,y.resolvedValue,w=>{v.columnFiltersMeta[S]=w})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const g=x=>{for(let v=0;v<c.length;v++)if(x.columnFilters[c[v]]===!1)return!1;return!0};return PJ(t.rows,g,e)},ut(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ph(e){return t=>ct(()=>[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:i}=n;let{rows:c,flatRows:u,rowsById:f}=r;const h=s*i,y=h+s;c=c.slice(h,y);let g;t.options.paginateExpandedRows?g={rows:c,flatRows:u,rowsById:f}:g=LJ({rows:c,flatRows:u,rowsById:f}),g.flatRows=[];const x=v=>{g.flatRows.push(v),v.subRows.length&&v.subRows.forEach(x)};return g.rows.forEach(x),g},ut(t.options,"debugTable"))}function Nc(){return e=>ct(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],i=r.filter(f=>{var h;return(h=e.getColumn(f.id))==null?void 0:h.getCanSort()}),c={};i.forEach(f=>{const h=e.getColumn(f.id);h&&(c[f.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const u=f=>{const h=f.map(y=>({...y}));return h.sort((y,g)=>{for(let v=0;v<i.length;v+=1){var x;const C=i[v],S=c[C.id],w=S.sortUndefined,R=(x=C==null?void 0:C.desc)!=null?x:!1;let j=0;if(w){const _=y.getValue(C.id),I=g.getValue(C.id),A=_===void 0,O=I===void 0;if(A||O){if(w==="first")return A?-1:1;if(w==="last")return A?1:-1;j=A&&O?0:A?w:-w}}if(j===0&&(j=S.sortingFn(y,g,C.id)),j!==0)return R&&(j*=-1),S.invertSorting&&(j*=-1),j}return y.index-g.index}),h.forEach(y=>{var g;s.push(y),(g=y.subRows)!=null&&g.length&&(y.subRows=u(y.subRows))}),h};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ut(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
769
|
-
* react-table
|
|
770
|
-
*
|
|
771
|
-
* Copyright (c) TanStack
|
|
772
|
-
*
|
|
773
|
-
* This source code is licensed under the MIT license found in the
|
|
774
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
775
|
-
*
|
|
776
|
-
* @license MIT
|
|
777
|
-
*/function td(e,t){return e?FJ(e)?m.createElement(e,t):e:null}function FJ(e){return HJ(e)||typeof e=="function"||$J(e)}function HJ(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function $J(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function El(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=m.useState(()=>({current:kJ(t)})),[r,s]=m.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function Rl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:oe("w-full caption-bottom text-sm",e),...t})})}function jl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:oe("[&_tr]:border-b",e),...t})}function Tl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:oe("[&_tr:last-child]:border-0",e),...t})}function Fn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:oe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function _l({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:oe("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 Hr({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:oe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var VJ=Symbol("radix.slottable");function BJ(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=VJ,t}var RO="AlertDialog",[GJ]=wr(RO,[e4]),mi=e4(),jO=e=>{const{__scopeAlertDialog:t,...n}=e,r=mi(t);return a.jsx(ty,{...r,...n,modal:!0})};jO.displayName=RO;var qJ="AlertDialogTrigger",KJ=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mi(n);return a.jsx(QH,{...s,...r,ref:t})});KJ.displayName=qJ;var ZJ="AlertDialogPortal",TO=e=>{const{__scopeAlertDialog:t,...n}=e,r=mi(t);return a.jsx(ny,{...r,...n})};TO.displayName=ZJ;var YJ="AlertDialogOverlay",_O=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mi(n);return a.jsx(ry,{...s,...r,ref:t})});_O.displayName=YJ;var Fu="AlertDialogContent",[WJ,XJ]=GJ(Fu),QJ=BJ("AlertDialogContent"),NO=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=mi(n),c=m.useRef(null),u=mt(t,c),f=m.useRef(null);return a.jsx(ZH,{contentName:Fu,titleName:AO,docsSlug:"alert-dialog",children:a.jsx(WJ,{scope:n,cancelRef:f,children:a.jsxs(ay,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Oe(s.onOpenAutoFocus,h=>{var y;h.preventDefault(),(y=f.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[a.jsx(QJ,{children:r}),a.jsx(eee,{contentRef:c})]})})})});NO.displayName=Fu;var AO="AlertDialogTitle",DO=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mi(n);return a.jsx(sS,{...s,...r,ref:t})});DO.displayName=AO;var OO="AlertDialogDescription",IO=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mi(n);return a.jsx(oS,{...s,...r,ref:t})});IO.displayName=OO;var JJ="AlertDialogAction",MO=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=mi(n);return a.jsx(sy,{...s,...r,ref:t})});MO.displayName=JJ;var kO="AlertDialogCancel",LO=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=XJ(kO,n),i=mi(n),c=mt(t,s);return a.jsx(sy,{...i,...r,ref:c})});LO.displayName=kO;var eee=({contentRef:e})=>{const t=`\`${Fu}\` requires a description for the component to be accessible for screen reader users.
|
|
778
|
-
|
|
779
|
-
You can add a description to the \`${Fu}\` by passing a \`${OO}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
780
|
-
|
|
781
|
-
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 \`${Fu}\`. 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.
|
|
782
|
-
|
|
783
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tee=jO,nee=TO,ree=_O,aee=NO,see=MO,oee=LO,iee=DO,lee=IO;function PO({...e}){return a.jsx(tee,{"data-slot":"alert-dialog",...e})}function cee({...e}){return a.jsx(nee,{"data-slot":"alert-dialog-portal",...e})}function uee({className:e,...t}){return a.jsx(ree,{"data-slot":"alert-dialog-overlay",className:oe("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 UO({className:e,...t}){return a.jsxs(cee,{children:[a.jsx(uee,{}),a.jsx(aee,{"data-slot":"alert-dialog-content",className:oe("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 zO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:oe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function FO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function HO({className:e,...t}){return a.jsx(iee,{"data-slot":"alert-dialog-title",className:oe("text-lg font-semibold",e),...t})}function $O({className:e,...t}){return a.jsx(lee,{"data-slot":"alert-dialog-description",className:oe("text-muted-foreground text-sm",e),...t})}function VO({className:e,...t}){return a.jsx(see,{className:oe(tS(),e),...t})}function BO({className:e,...t}){return a.jsx(oee,{className:oe(tS({variant:"outline"}),e),...t})}const GO=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],qO={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:Be.CONNECTOR,icon:cZ},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:Be.CONNECTOR,icon:uZ},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:Be.CONNECTOR,icon:dZ},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:Be.CONNECTOR,icon:fZ},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:Be.CONNECTOR,icon:Jb},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:Be.SQL,icon:Qb},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:eg}},m_=GO.map(e=>({key:e,...qO[e]}));function dee(e){if(!e||!GO.includes(e))return;const t=e;return{key:t,...qO[t]}}function fee({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:oe("-m-4 flex flex-col items-start justify-between gap-12 overflow-hidden px-8 py-16 lg:flex-row-reverse lg:px-16 lg:py-24 2xl:items-center",t),...n,children:e})})}function hee({children:e,className:t="",...n}){return a.jsx("div",{className:oe("pb-2",t),...n,children:e})}function mee({children:e,className:t="",...n}){return a.jsx("h2",{className:oe("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function pee({children:e,className:t="",...n}){return a.jsx("p",{className:oe("text-muted-foreground text-lg",t),...n,children:e})}function gee({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:oe("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,i)=>{const c=`${(16*(i+1)+24).toString()}vmin`;return a.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(i*.3).toString()}s`,animationDuration:"4s",opacity:.2+i*.1,filter:i===0?"blur(1px)":"none"}},i)})}),a.jsx("div",{className:"animate-glow-burst"}),a.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function yee({children:e,className:t="",...n}){return a.jsx("div",{className:oe("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function W0({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:oe("relative pb-10",e&&"after:from-border after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-gradient-to-r after:to-transparent",n),...r,children:t})}function p_({children:e,className:t="",...n}){return a.jsx("h3",{className:oe("mb-4 text-xl font-medium",t),...n,children:e})}function X0({children:e,className:t="",...n}){return a.jsx("div",{className:oe("flex flex-wrap items-center gap-4",t),...n,children:e})}function Rp({href:e,icon:t,title:n,variant:r="outline",size:s,className:i="",target:c,...u}){const f=r==="outline"?"lg":"sm",h=a.jsxs("span",{className:oe("flex items-center gap-2"),children:[t,n]});return e?a.jsx(we,{asChild:!0,variant:r,size:s??f,className:oe(r==="ghost"?"text-muted-foreground":"",i),...u,children:a.jsx(Yr,{to:e,target:c,children:h})}):a.jsx(we,{variant:r,size:s??f,className:i,...u,children:h})}function xee(){const{scope:e}=hi(),t=m_.filter(r=>r.definitionType===Be.CONNECTOR),n=m_.filter(r=>r.definitionType!==Be.CONNECTOR);return a.jsxs(fee,{children:[a.jsx(gee,{children:a.jsx(lZ,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(yee,{children:[a.jsxs(hee,{children:[a.jsx(mee,{children:"Let’s Build Your First Data Mart"}),a.jsx(pee,{children:"A Data Mart is the key element of self-service analytics — it provides both control for data analyst and freedom for business users. To get started, connect the source you need or query the data you already have in storage"})]}),a.jsxs(W0,{children:[a.jsx(p_,{children:"Connect a data source"}),a.jsx(X0,{children:t.map(r=>a.jsx(Rp,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),a.jsxs(W0,{children:[a.jsx(p_,{children:"Use existing SQL or start from scratch"}),a.jsx(X0,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(Rp,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),s<n.length-1&&a.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),a.jsx(W0,{separator:!1,children:a.jsxs(X0,{children:[a.jsx(Rp,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(EA,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(Rp,{href:"https://docs.owox.com/docs/getting-started/core-concepts/?utm_source=owox_data_marts&utm_medium=empty_data_marts_page&utm_campaign=help_buttons",icon:a.jsx(aU,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function vee(){return a.jsx(Pr,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const bu={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},bee={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 Ac({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=bu.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=bu.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:i=bu.DEFAULT_EXCLUDED_COLUMNS}){const c=m.useMemo(()=>({SORTING:`${t}${bu.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${bu.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),u=m.useMemo(()=>bee.extractColumnIds(e),[e]),f=m.useMemo(()=>u.filter(S=>!s.includes(S)),[u,s]),h=m.useCallback(()=>{const S=io.get(c.SORTING,"json");return S&&Array.isArray(S)&&S.length>0?S:[{id:f.includes(n)?n:f[0]??bu.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),y=m.useCallback(()=>{const S=io.get(c.COLUMN_VISIBILITY,"json");if(S&&typeof S=="object"&&!Array.isArray(S)){const w={};for(const R of u)i.includes(R)||(w[R]=S[R]);return w}return r},[c.COLUMN_VISIBILITY,u,i,r]),[g,x]=m.useState(h),[v,C]=m.useState(y);return m.useEffect(()=>{g.length>0&&f.includes(g[0].id)&&io.set(c.SORTING,g)},[g,f,c.SORTING]),m.useEffect(()=>{const S={};for(const w of u){if(i.includes(w))continue;const R=v[w];typeof R=="boolean"&&(S[w]=R)}io.set(c.COLUMN_VISIBILITY,S)},[v,u,i,c.COLUMN_VISIBILITY]),{sorting:g,setSorting:x,columnVisibility:v,setColumnVisibility:C}}function See({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var O;const{navigate:i,scope:c}=hi(),{sorting:u,setSorting:f,columnVisibility:h,setColumnVisibility:y}=Ac({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[g,x]=m.useState([]),[v,C]=m.useState({}),[S,w]=m.useState(!1),[R,j]=m.useState(!1),_=async()=>{try{j(!0);const D=A.getSelectedRowModel().rows.map(L=>L.original.id);for(const L of D)await n(L);An.success(`Successfully deleted ${String(D.length)} data mart${D.length!==1?"s":""}`),C({}),await r()}catch(T){console.error("Error deleting data marts:",T),An.error("Failed to delete some data marts. Please try again.")}finally{j(!1),w(!1)}},I=Object.keys(v).length>0,A=El({data:t,columns:[{id:"select",size:40,header:({table:T})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsAllRowsSelected(),"data-state":T.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:T.getToggleAllRowsSelectedHandler(),children:T.getIsAllRowsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ia,{className:"size-3.5 text-white"})})}),cell:({row:T})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsSelected(),"data-state":T.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:T.getToggleSelectedHandler(),children:T.getIsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ia,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:wl(),getPaginationRowModel:Ph(),onSortingChange:f,getSortedRowModel:Nc(),onColumnFiltersChange:x,getFilteredRowModel:pd(),onColumnVisibilityChange:y,onRowSelectionChange:C,state:{sorting:u,columnFilters:g,columnVisibility:h,rowSelection:v},enableRowSelection:!0});return s?a.jsx("div",{children:a.jsx(vee,{})}):t.length?a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsxs("div",{className:"dm-card-toolbar-left",children:[I&&a.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{w(!0)},disabled:R,children:a.jsx(Qa,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Ec,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(O=A.getColumn("title"))==null?void 0:O.getFilterValue(),onChange:T=>{var D;return(D=A.getColumn("title"))==null?void 0:D.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(Yr,{to:c("/data-marts/create"),children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(ma,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(jl,{className:"dm-card-table-header",children:A.getHeaderGroups().map(T=>a.jsx(Fn,{className:"dm-card-table-header-row",children:T.headers.map(D=>a.jsx(_l,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:D.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.getSize())}%`},children:D.isPlaceholder?null:td(D.column.columnDef.header,D.getContext())},D.id))},T.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:A.getRowModel().rows.length?A.getRowModel().rows.map(T=>a.jsx(Fn,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:D=>{if(D.target instanceof HTMLElement&&(D.target.closest('[role="checkbox"]')||D.target.closest(".actions-cell")||D.target.closest('[role="menuitem"]')||D.target.closest('[data-state="open"]')))return;const L=T.original.id;i(`/data-marts/${L}/data-setup`)},children:T.getVisibleCells().map(D=>a.jsx(Hr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${D.column.id==="actions"?"actions-cell":""} ${D.column.id==="createdAt"?"whitespace-nowrap":""}`,style:D.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.column.getSize())}%`},children:td(D.column.columnDef.cell,D.getContext())},D.id))},T.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{A.previousPage()},disabled:!A.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{A.nextPage()},disabled:!A.getCanNextPage(),children:"Next"})]}),a.jsx(PO,{open:S,onOpenChange:w,children:a.jsxs(UO,{children:[a.jsxs(zO,{children:[a.jsx(HO,{children:"Are you sure?"}),a.jsxs($O,{children:["You're about to delete ",Object.keys(v).length," selected data mart",Object.keys(v).length!==1?"s":"",". This action cannot be undone."]})]}),a.jsxs(FO,{children:[a.jsx(BO,{disabled:R,children:"Cancel"}),a.jsx(VO,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx(xee,{})}function KO({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=ID(t,n);return a.jsxs(_y,{children:[a.jsx(Ny,{asChild:!0,children:a.jsxs("div",{className:"mx-1 inline-flex min-w-max items-center gap-1 rounded-full bg-neutral-100 py-1 pr-3 pl-1 dark:bg-neutral-900",children:[a.jsx(J1,{avatar:r,initials:i,displayName:s,size:zu.SMALL}),a.jsx("span",{className:"text-muted-foreground inline text-sm leading-tight","aria-label":s,children:s})]})}),a.jsx(Ay,{side:"top",align:"start",className:"w-max p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(J1,{avatar:r,initials:i,displayName:s,size:zu.LARGE}),a.jsxs("div",{className:"grid text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:t??n??"Unknown User"}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]})]})})]})}function a2({...e}){return a.jsx(ty,{"data-slot":"dialog",...e})}function Cee({...e}){return a.jsx(ny,{"data-slot":"dialog-portal",...e})}function wee({className:e,...t}){return a.jsx(ry,{"data-slot":"dialog-overlay",className:oe("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 s2({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(Cee,{"data-slot":"dialog-portal",children:[a.jsx(wee,{}),a.jsxs(ay,{"data-slot":"dialog-content",className:oe("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&&a.jsxs(sy,{"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:[a.jsx(Zu,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function o2({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:oe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Eee({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function i2({className:e,...t}){return a.jsx(sS,{"data-slot":"dialog-title",className:oe("text-lg leading-none font-semibold",e),...t})}function l2({className:e,...t}){return a.jsx(oS,{"data-slot":"dialog-description",className:oe("text-muted-foreground text-sm",e),...t})}const Ree=Cc("",{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 Hu({className:e,variant:t,...n}){return t==="brand"?a.jsx(we,{variant:"default",className:oe(Ree({variant:t}),e),...n}):a.jsx(we,{variant:t,className:e,...n})}const Cr=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:h})=>{const y=()=>{t(!1),u==null||u()};return a.jsx(a2,{open:e,onOpenChange:t,children:a.jsxs(s2,{children:[a.jsxs(o2,{children:[a.jsx(i2,{children:n}),a.jsx(l2,{children:r})]}),h,a.jsxs(Eee,{children:[i&&a.jsx(Hu,{variant:"secondary",onClick:y,children:i}),a.jsx(Hu,{variant:f,onClick:c,children:s})]})]})})},jee=({row:e,onDeleteSuccess:t})=>{const{scope:n}=hi(),[r,s]=m.useState(!1),[i,c]=m.useState(!1),{deleteDataMart:u,refreshList:f}=pO(),h=async()=>{try{await u(e.original.id),s(!1),await f(),t==null||t()}catch(y){console.error("Failed to delete data mart:",y)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(_r,{open:i,onOpenChange:c,children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ar,{align:"end",children:[a.jsx(Nt,{children:a.jsxs(Yr,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(sd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:()=>{s(!0)},children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(Cr,{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 h(),variant:"destructive"})]})},g_={types:{[Be.SQL]:{type:Be.SQL,displayName:"SQL",icon:Qb},[Be.TABLE]:{type:Be.TABLE,displayName:"Table",icon:jA},[Be.VIEW]:{type:Be.VIEW,displayName:"View",icon:cU},[Be.TABLE_PATTERN]:{type:Be.TABLE_PATTERN,displayName:"Pattern",icon:sP},[Be.CONNECTOR]:{type:Be.CONNECTOR,displayName:"Connector",icon:Jb}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}};var Un=(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.CREATED_BY_USER="createdByUser",e))(Un||{});const Vi={[Un.TITLE]:"Title",[Un.DEFINITION_TYPE]:"Input Source",[Un.STORAGE_TYPE]:"Storage",[Un.STATUS]:"Status",[Un.TRIGGERS_COUNT]:"Triggers",[Un.REPORTS_COUNT]:"Reports",[Un.CREATED_AT]:"Created at",[Un.CREATED_BY_USER]:"Created by"};function br({column:e,children:t,label:n}){const r=e.getIsSorted(),s=m.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),i=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",u=n??(typeof t=="string"?t:"Column");return a.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(qu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Vs,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(qu,{className:"text-muted-foreground h-4 w-4"})})]})]})}function gd({table:e,getColumnLabel:t}){return a.jsx("div",{className:"text-right",children:a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ar,{align:"end",children:e.getAllColumns().filter(n=>n.getCanHide()&&n.id!=="actions").map(n=>{var s;const r=(t==null?void 0:t(n.id,n))??((s=n.columnDef.meta)==null?void 0:s.title)??n.id;return a.jsx(Nt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":n.getIsVisible(),"data-state":n.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${r}`,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:()=>{n.toggleVisibility(!n.getIsVisible())},children:n.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ia,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const Tee=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:Un.TITLE,size:40,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.TITLE]}),cell:({row:n})=>a.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===Be.CONNECTOR){const s=n.definition,i=t.find(c=>c.name===s.connector.source.name);return(i==null?void 0:i.displayName)??(i==null?void 0:i.name)??"Unknown"}else{const{displayName:s}=g_.getInfo(r);return s}},id:Un.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case Be.CONNECTOR:{const s=n.original.definition,i=t.find(c=>c.name===s.connector.source.name);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(i==null?void 0:i.logoBase64)&&a.jsx(_c,{base64:i.logoBase64,size:18}),(i==null?void 0:i.displayName)??"Unknown"]})}default:{const{displayName:s,icon:i}=g_.getInfo(r);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(i,{className:"h-4 w-4"}),s]})}}}},{accessorKey:Un.STORAGE_TYPE,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=Cl.getInfo(r),u=s??i;return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),u]})}},{accessorKey:Un.CREATED_AT,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.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 a.jsx("div",{className:"text-muted-foreground",children:s})}},{id:Un.CREATED_BY_USER,size:15,accessorFn:n=>{const r=n.createdByUser;return(r==null?void 0:r.fullName)??(r==null?void 0:r.email)},header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(KO,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:Un.STATUS,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Mh,{type:FQ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:Un.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:Un.REPORTS_COUNT,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Vi[Un.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>a.jsx(gd,{table:n}),cell:({row:n})=>a.jsx(jee,{row:n,onDeleteSuccess:e})}];var vr=(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))(vr||{});const _ee={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function Nee(e,t){switch(t.type){case vr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case vr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case vr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case vr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case vr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case vr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case vr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case vr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case vr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const ZO=m.createContext(void 0);function nd({children:e}){const[t,n]=m.useReducer(Nee,_ee);return a.jsx(ZO.Provider,{value:{state:t,dispatch:n},children:e})}function Aee(){const e=m.useContext(ZO);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 Lf extends Sl{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}async exchangeCredentials(t,n){return this.post(`/${t}/oauth/exchange`,n)}async checkOAuthStatus(t,n){return this.get(`/${t}/oauth/status/${n}`)}async getOAuthSettings(t,n){return this.get(`/${t}/oauth/settings?path=${encodeURIComponent(n)}`)}}function YO(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 Dc(){const{state:e,dispatch:t}=Aee(),n=m.useMemo(()=>YO(e.connectors),[e.connectors]),r=m.useCallback(async()=>{t({type:vr.FETCH_CONNECTORS_START});try{const u=await new Lf().getAvailableConnectors();t({type:vr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:vr.FETCH_CONNECTORS_ERROR,payload:u}),Le({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=m.useCallback(async c=>{t({type:vr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Lf().getConnectorSpecification(c);t({type:vr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:vr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Le({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=m.useCallback(async c=>{t({type:vr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Lf().getConnectorFields(c);t({type:vr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:vr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),Le({event:"connector_error",category:"Connector",action:"FieldsError",label:c})}},[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:i}}const Dee=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=pO(),{connectors:i,fetchAvailableConnectors:c}=Dc();return m.useEffect(()=>{c()},[c]),m.useEffect(()=>{t()},[t]),a.jsx(See,{columns:Tee({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function y_(){return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(QW,{children:a.jsx(nd,{children:a.jsx(Dee,{})})})})]})}const WO=m.createContext(void 0),vf=e=>{const t=ZQ(e);return{...e,canPublish:t.length===0,validationErrors:t}};var Wa=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(Wa||{}),eh=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(eh||{}),sr=(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))(sr||{}),c2=(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))(c2||{}),u2=(e=>(e.NUMBER="NUMBER",e.DECIMAL="DECIMAL",e.NUMERIC="NUMERIC",e.INT="INT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.SMALLINT="SMALLINT",e.TINYINT="TINYINT",e.BYTEINT="BYTEINT",e.FLOAT="FLOAT",e.FLOAT4="FLOAT4",e.FLOAT8="FLOAT8",e.DOUBLE="DOUBLE",e.DOUBLE_PRECISION="DOUBLE PRECISION",e.REAL="REAL",e.VARCHAR="VARCHAR",e.CHAR="CHAR",e.CHARACTER="CHARACTER",e.STRING="STRING",e.TEXT="TEXT",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIMESTAMP_LTZ="TIMESTAMP_LTZ",e.TIMESTAMP_NTZ="TIMESTAMP_NTZ",e.TIMESTAMP_TZ="TIMESTAMP_TZ",e.VARIANT="VARIANT",e.OBJECT="OBJECT",e.ARRAY="ARRAY",e.GEOGRAPHY="GEOGRAPHY",e.GEOMETRY="GEOMETRY",e))(u2||{});const Oee=(e,t)=>e!==Be.CONNECTOR||t===null?!0:t.fields.some(r=>r.status===Wa.CONNECTED),XO={dataMart:null,isLoading:!1,error:null,runs:[]};function Iee(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:vf(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:vf({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:vf({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:vf({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:vf({...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 XO;default:return e}}function xs(){const e=m.useContext(WO);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class Mee{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:Re.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 kee{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Re.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}}class Lee{mapFromDto(t){const n=t.config,r=t.credentials,s=r?r.authMethod==="KEY_PAIR"?{authMethod:Is.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:Is.PASSWORD,username:r.username??"",password:r.password??""}:void 0;return{id:t.id,title:t.title,type:Re.SNOWFLAKE,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:Is.PASSWORD,username:"",password:""},config:n?{account:n.account,warehouse:n.warehouse}:{account:"",warehouse:""}}}mapToUpdateRequest(t){const n={config:{account:t.config.account,warehouse:t.config.warehouse}};if(t.credentials){const r=t.credentials;n.credentials={authMethod:r.authMethod,username:r.username,...r.authMethod===Is.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}const QO={getMapper(e){switch(e){case Re.GOOGLE_BIGQUERY:return new Mee;case Re.AWS_ATHENA:return new kee;case Re.SNOWFLAKE:return new Lee;default:throw new Error(`Unknown storage type: ${e}`)}}};function Kp(e){return QO.getMapper(e.type).mapFromDto(e)}function Pee(e){const t=QO.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function Uee(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function zee(e){return{type:e}}let jp=null;async function Fee(){if(jp)return jp;const e=await Hee();return jp=YO(e),jp}async function Hee(){return await new Lf().getAvailableConnectors()}async function $ee(e){const t=await Fee();return t.length===0?null:t.find(r=>r.name===e)??null}function Vee(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function Bee(e){return{sqlQuery:e.sqlQuery}}function Gee(e){return{sqlQuery:e.sqlQuery}}function qee(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Kee(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Zee(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Yee(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Wee(e){return{pattern:e.pattern}}function Xee(e){return{pattern:e.pattern}}function Qee(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 Jee(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}}}}async function ete(e,t){if(!e||!t)return null;switch(e){case Be.SQL:return Gee(t);case Be.TABLE:return Kee(t);case Be.VIEW:return Yee(t);case Be.TABLE_PATTERN:return Xee(t);case Be.CONNECTOR:{const n=Jee(t);return n.connector.info=await $ee(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function Su(e){const t={id:e.id,title:e.title,description:e.description,status:zD.getInfo(e.status),storage:Kp(e.storage),definitionType:e.definitionType,definition:await ete(e.definitionType,e.definition),schema:e.schema,connectorState:e.connectorState??null,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,canActualizeSchema:!1,validationErrors:[]};return t.canActualizeSchema=Oee(t.definitionType,t.schema),t}function tte(e){return{id:e.id,title:e.title}}const nte=e=>({id:e.id,status:e.status,createdAt:new Date(e.createdAt),logs:e.logs??[],errors:e.errors??[],definitionRun:e.definitionRun,type:e.type,triggerType:e.runType,startedAt:e.startedAt?new Date(e.startedAt):null,finishedAt:e.finishedAt?new Date(e.finishedAt):null,reportDefinition:e.reportDefinition?e.reportDefinition:null,reportId:e.reportId,insightDefinition:e.insightDefinition??null,insightId:e.insightId,createdByUser:e.createdByUser}),x_=e=>e.runs.map(nte);function JO({children:e}){const[t,n]=m.useReducer(Iee,XO),r=m.useCallback(async O=>{try{n({type:"FETCH_DATA_MART_START"});const T=await En.getDataMartById(O),D=await Su(T);n({type:"FETCH_DATA_MART_SUCCESS",payload:D})}catch(T){n({type:"FETCH_DATA_MART_ERROR",payload:on(T)})}},[]),s=m.useCallback(async O=>{try{n({type:"CREATE_DATA_MART_START"});const T=await En.createDataMart(O),D=tte(T);return n({type:"CREATE_DATA_MART_SUCCESS",payload:D}),Le({event:"data_mart_created",category:"DataMart",action:"Create",label:D.id}),Tt.success("Data Mart created"),D}catch(T){const D=on(T);throw n({type:"CREATE_DATA_MART_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"CreateError",label:D.message}),T}},[]),i=m.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_START"});const D=await En.updateDataMart(O,T),L=await Su(D);n({type:"UPDATE_DATA_MART_SUCCESS",payload:L}),Le({event:"data_mart_updated",category:"DataMart",action:"Update",label:L.id})}catch(D){const L=on(D);n({type:"UPDATE_DATA_MART_ERROR",payload:L}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:L.message})}},[]),c=m.useCallback(async O=>{try{n({type:"DELETE_DATA_MART_START"}),await En.deleteDataMart(O),n({type:"DELETE_DATA_MART_SUCCESS"}),Le({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:O}),Tt.success("Data Mart deleted")}catch(T){const D=on(T);n({type:"DELETE_DATA_MART_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:D.message})}},[]),u=m.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await En.updateDataMartTitle(O,T),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:T}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:T}),Tt.success("Title updated")}catch(D){const L=on(D);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:L}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:L.message})}},[]),f=m.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await En.updateDataMartDescription(O,T),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:T??""}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),Tt.success("Description updated")}catch(D){const L=on(D);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:L}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:L.message})}},[]),h=m.useCallback(O=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:O})},[]),y=m.useCallback(async(O,T,D)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let L;switch(T){case Be.SQL:L={definitionType:T,definition:Bee(D)};break;case Be.TABLE:L={definitionType:T,definition:qee(D)};break;case Be.VIEW:L={definitionType:T,definition:Zee(D)};break;case Be.TABLE_PATTERN:L={definitionType:T,definition:Wee(D)};break;case Be.CONNECTOR:{const Z=D;let G;for(const q of Z.connector.source.configuration){const z=q;if(z._copiedFrom){G=z._copiedFrom.dataMartId;break}}L={definitionType:Be.CONNECTOR,definition:Qee(Z),sourceDataMartId:G};break}default:throw new Error(`Unsupported definition type: ${String(T)}`)}const $=await En.updateDataMartDefinition(O,L),K=await Su($);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:T,definition:D}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:K}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:T})}catch(L){const $=on(L);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:$}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:$.message})}},[]),g=m.useCallback(async O=>{try{n({type:"PUBLISH_DATA_MART_START"});const T=await En.publishDataMart(O),D=await Su(T);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:D}),Tt.success("Data Mart published")}catch(T){const D=on(T);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"PublishError",label:D.message}),T}},[]),x=m.useCallback(async(O,T=5,D=0,L)=>{try{L!=null&&L.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const $=await En.getDataMartRuns(O,T,D,L!=null&&L.silent?{skipLoadingIndicator:!0}:void 0),K=x_($);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:K}),K}catch($){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:on($)}),$}},[]),v=m.useCallback(async(O,T,D=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const L=await En.getDataMartRuns(O,D,T),$=x_(L);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:$}),$}catch(L){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:on(L)}),L}},[]),C=m.useCallback(async O=>{const T=Tt.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await En.runDataMart(O.id,O.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(D){Tt.dismiss(T);const L=on(D);n({type:"RUN_DATA_MART_ERROR",payload:L}),Le({event:"data_mart_error",category:"DataMart",action:"RunError",label:L.message})}},[]),S=m.useCallback(async(O,T)=>{try{await En.cancelDataMartRun(O,T),await x(O),Tt.success("Data Mart run canceled")}catch(D){const L=on(D);n({type:"RUN_DATA_MART_ERROR",payload:L}),Le({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:L.message})}},[x]),w=m.useCallback(async(O,T)=>{try{return await En.getDataMartRunById(O,T)}catch(D){const L=on(D);throw Le({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",label:L.message}),D}},[]),R=m.useCallback(async O=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const T=await En.actualizeDataMartSchema(O),D=await Su(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:D}),Tt.success("Output schema actualized")}catch(T){const D=on(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:D.message})}},[]),j=m.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const D=await En.updateDataMartSchema(O,{schema:T}),L=await Su(D);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:L}),Tt.success("Output schema updated")}catch(D){const L=on(D);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:L}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:L.message})}},[]),_=m.useCallback(()=>{n({type:"RESET"})},[]),I=m.useCallback(()=>t.error?t.error.message:null,[t.error]),A={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:h,updateDataMartDefinition:y,publishDataMart:g,runDataMart:C,cancelDataMartRun:S,actualizeDataMartSchema:R,updateDataMartSchema:j,getDataMartRuns:x,getDataMartRunById:w,loadMoreDataMartRuns:v,getErrorMessage:I,reset:_};return a.jsx(WO.Provider,{value:A,children:e})}var Uh=e=>e.type==="checkbox",rc=e=>e instanceof Date,Ra=e=>e==null;const e5=e=>typeof e=="object";var hr=e=>!Ra(e)&&!Array.isArray(e)&&e5(e)&&!rc(e),t5=e=>hr(e)&&e.target?Uh(e.target)?e.target.checked:e.target.value:e,rte=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,n5=(e,t)=>e.has(rte(t)),ate=e=>{const t=e.constructor&&e.constructor.prototype;return hr(t)&&t.hasOwnProperty("isPrototypeOf")},d2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function xr(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(!(d2&&(e instanceof Blob||r))&&(n||hr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!ate(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=xr(e[s]));else return e;return t}var Iy=e=>/^\w*$/.test(e),Qn=e=>e===void 0,f2=e=>Array.isArray(e)?e.filter(Boolean):[],h2=e=>f2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!hr(e))return n;const r=(Iy(t)?[t]:h2(t)).reduce((s,i)=>Ra(s)?s:s[i],e);return Qn(r)||r===e?Qn(e[t])?n:e[t]:r},$a=e=>typeof e=="boolean",xn=(e,t,n)=>{let r=-1;const s=Iy(t)?[t]:h2(t),i=s.length,c=i-1;for(;++r<i;){const u=s[r];let f=n;if(r!==c){const h=e[u];f=hr(h)||Array.isArray(h)?h:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const _g={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ns={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},m2=re.createContext(null);m2.displayName="HookFormContext";const yd=()=>re.useContext(m2),r5=e=>{const{children:t,...n}=e;return re.createElement(m2.Provider,{value:n},t)};var a5=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const c=i;return t._proxyFormState[c]!==Ns.all&&(t._proxyFormState[c]=!r||Ns.all),n&&(n[c]=!0),e[c]}});return s};const p2=typeof window<"u"?re.useLayoutEffect:re.useEffect;function s5(e){const t=yd(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[c,u]=re.useState(n._formState),f=re.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return p2(()=>n._subscribe({name:s,formState:f.current,exact:i,callback:h=>{!r&&u({...n._formState,...h})}}),[s,r,i]),re.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),re.useMemo(()=>a5(c,n,f.current,!1),[c,n])}var qa=e=>typeof e=="string",ob=(e,t,n,r,s)=>qa(e)?(r&&t.watch.add(e),Pe(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Pe(n,i))):(r&&(t.watchAll=!0),n),ib=e=>Ra(e)||!e5(e);function As(e,t,n=new WeakSet){if(ib(e)||ib(t))return Object.is(e,t);if(rc(e)&&rc(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 i of r){const c=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const u=t[i];if(rc(c)&&rc(u)||hr(c)&&hr(u)||Array.isArray(c)&&Array.isArray(u)?!As(c,u,n):!Object.is(c,u))return!1}}return!0}function ste(e){const t=yd(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=re.useRef(s),h=re.useRef(u),y=re.useRef(void 0),g=re.useRef(n),x=re.useRef(r);h.current=u;const[v,C]=re.useState(()=>{const I=n._getWatch(r,f.current);return h.current?h.current(I):I}),S=re.useCallback(I=>{const A=ob(r,n._names,I||n._formValues,!1,f.current);return h.current?h.current(A):A},[n._formValues,n._names,r]),w=re.useCallback(I=>{if(!i){const A=ob(r,n._names,I||n._formValues,!1,f.current);if(h.current){const O=h.current(A);As(O,y.current)||(C(O),y.current=O)}else C(A)}},[n._formValues,n._names,i,r]);p2(()=>((g.current!==n||!As(x.current,r))&&(g.current=n,x.current=r,w()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:I=>{w(I.values)}})),[n,c,r,w]),re.useEffect(()=>n._removeUnmounted());const R=g.current!==n,j=x.current,_=re.useMemo(()=>{if(i)return null;const I=!R&&!As(j,r);return R||I?S():null},[i,R,r,j,S]);return _!==null?_:v}function ote(e){const t=yd(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=n5(s._names.array,n),h=re.useMemo(()=>Pe(s._formValues,n,Pe(s._defaultValues,n,c)),[s,n,c]),y=ste({control:s,name:n,defaultValue:h,exact:u}),g=s5({control:s,name:n,exact:u}),x=re.useRef(e),v=re.useRef(void 0),C=re.useRef(s.register(n,{...e.rules,value:y,...$a(e.disabled)?{disabled:e.disabled}:{}}));x.current=e;const S=re.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(g.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(g.errors,n)}}),[g,n]),w=re.useCallback(I=>C.current.onChange({target:{value:t5(I),name:n},type:_g.CHANGE}),[n]),R=re.useCallback(()=>C.current.onBlur({target:{value:Pe(s._formValues,n),name:n},type:_g.BLUR}),[n,s._formValues]),j=re.useCallback(I=>{const A=Pe(s._fields,n);A&&I&&(A._f.ref={focus:()=>I.focus&&I.focus(),select:()=>I.select&&I.select(),setCustomValidity:O=>I.setCustomValidity(O),reportValidity:()=>I.reportValidity()})},[s._fields,n]),_=re.useMemo(()=>({name:n,value:y,...$a(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:w,onBlur:R,ref:j}),[n,r,g.disabled,w,R,j,y]);return re.useEffect(()=>{const I=s._options.shouldUnregister||i,A=v.current;A&&A!==n&&!f&&s.unregister(A),s.register(n,{...x.current.rules,...$a(x.current.disabled)?{disabled:x.current.disabled}:{}});const O=(T,D)=>{const L=Pe(s._fields,T);L&&L._f&&(L._f.mount=D)};if(O(n,!0),I){const T=xr(Pe(s._options.defaultValues,n,x.current.defaultValue));xn(s._defaultValues,n,T),Qn(Pe(s._formValues,n))&&xn(s._formValues,n,T)}return!f&&s.register(n),v.current=n,()=>{(f?I&&!s._state.action:I)?s.unregister(n):O(n,!1)}},[n,s,f,i]),re.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),re.useMemo(()=>({field:_,formState:g,fieldState:S}),[_,g,S])}const ite=e=>e.render(ote(e));var g2=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Pf=e=>Array.isArray(e)?e:[e],v_=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function o5(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&hr(s)&&i){const c=o5(s,i);hr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var ra=e=>hr(e)&&!Object.keys(e).length,y2=e=>e.type==="file",Ds=e=>typeof e=="function",Ng=e=>{if(!d2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},i5=e=>e.type==="select-multiple",x2=e=>e.type==="radio",lte=e=>x2(e)||Uh(e),Q0=e=>Ng(e)&&e.isConnected;function cte(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Qn(e)?r++:e[t[r++]];return e}function ute(e){for(const t in e)if(e.hasOwnProperty(t)&&!Qn(e[t]))return!1;return!0}function dr(e,t){const n=Array.isArray(t)?t:Iy(t)?[t]:h2(t),r=n.length===1?e:cte(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(hr(r)&&ra(r)||Array.isArray(r)&&ute(r))&&dr(e,n.slice(0,-1)),e}var dte=e=>{for(const t in e)if(Ds(e[t]))return!0;return!1};function l5(e){return Array.isArray(e)||hr(e)&&!dte(e)}function lb(e,t={}){for(const n in e){const r=e[n];l5(r)?(t[n]=Array.isArray(r)?[]:{},lb(r,t[n])):Qn(r)||(t[n]=!0)}return t}function Tu(e,t,n){n||(n=lb(t));for(const r in e){const s=e[r];if(l5(s))Qn(t)||ib(n[r])?n[r]=lb(s,Array.isArray(s)?[]:{}):Tu(s,Ra(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!As(s,i)}}return n}const b_={value:!1,isValid:!1},S_={value:!0,isValid:!0};var c5=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&&!Qn(e[0].attributes.value)?Qn(e[0].value)||e[0].value===""?S_:{value:e[0].value,isValid:!0}:S_:b_}return b_},u5=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Qn(e)?e:t?e===""?NaN:e&&+e:n&&qa(e)?new Date(e):r?r(e):e;const C_={isValid:!1,value:null};var d5=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,C_):C_;function w_(e){const t=e.ref;return y2(t)?t.files:x2(t)?d5(e.refs).value:i5(t)?[...t.selectedOptions].map(({value:n})=>n):Uh(t)?c5(e.refs).value:u5(Qn(t.value)?e.ref.value:t.value,e)}var fte=(e,t,n,r)=>{const s={};for(const i of e){const c=Pe(t,i);c&&xn(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Ag=e=>e instanceof RegExp,bf=e=>Qn(e)?e:Ag(e)?e.source:hr(e)?Ag(e.value)?e.value.source:e.value:e,E_=e=>({isOnSubmit:!e||e===Ns.onSubmit,isOnBlur:e===Ns.onBlur,isOnChange:e===Ns.onChange,isOnAll:e===Ns.all,isOnTouch:e===Ns.onTouched});const R_="AsyncFunction";var hte=e=>!!e&&!!e.validate&&!!(Ds(e.validate)&&e.validate.constructor.name===R_||hr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===R_)),mte=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),j_=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Uf=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=Pe(e,s);if(i){const{_f:c,...u}=i;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(Uf(u,t))break}else if(hr(u)&&Uf(u,t))break}}};function T_(e,t,n){const r=Pe(e,n);if(r||Iy(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),c=Pe(t,i),u=Pe(e,i);if(c&&!Array.isArray(c)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};s.pop()}return{name:n}}var pte=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return ra(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||Ns.all))},gte=(e,t,n)=>!e||!t||e===t||Pf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),yte=(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,xte=(e,t)=>!f2(Pe(e,t)).length&&dr(e,t),vte=(e,t,n)=>{const r=Pf(Pe(e,n));return xn(r,"root",t[n]),xn(e,n,r),e};function __(e,t,n="validate"){if(qa(e)||Array.isArray(e)&&e.every(qa)||$a(e)&&!e)return{type:n,message:qa(e)?e:"",ref:t}}var Cu=e=>hr(e)&&!Ag(e)?e:{value:e,message:""},N_=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:h,minLength:y,min:g,max:x,pattern:v,validate:C,name:S,valueAsNumber:w,mount:R}=e._f,j=Pe(n,S);if(!R||t.has(S))return{};const _=u?u[0]:c,I=Z=>{s&&_.reportValidity&&(_.setCustomValidity($a(Z)?"":Z||""),_.reportValidity())},A={},O=x2(c),T=Uh(c),D=O||T,L=(w||y2(c))&&Qn(c.value)&&Qn(j)||Ng(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,$=g2.bind(null,S,r,A),K=(Z,G,q,z=Bo.maxLength,M=Bo.minLength)=>{const H=Z?G:q;A[S]={type:Z?z:M,message:H,ref:c,...$(Z?z:M,H)}};if(i?!Array.isArray(j)||!j.length:f&&(!D&&(L||Ra(j))||$a(j)&&!j||T&&!c5(u).isValid||O&&!d5(u).isValid)){const{value:Z,message:G}=qa(f)?{value:!!f,message:f}:Cu(f);if(Z&&(A[S]={type:Bo.required,message:G,ref:_,...$(Bo.required,G)},!r))return I(G),A}if(!L&&(!Ra(g)||!Ra(x))){let Z,G;const q=Cu(x),z=Cu(g);if(!Ra(j)&&!isNaN(j)){const M=c.valueAsNumber||j&&+j;Ra(q.value)||(Z=M>q.value),Ra(z.value)||(G=M<z.value)}else{const M=c.valueAsDate||new Date(j),H=ge=>new Date(new Date().toDateString()+" "+ge),V=c.type=="time",se=c.type=="week";qa(q.value)&&j&&(Z=V?H(j)>H(q.value):se?j>q.value:M>new Date(q.value)),qa(z.value)&&j&&(G=V?H(j)<H(z.value):se?j<z.value:M<new Date(z.value))}if((Z||G)&&(K(!!Z,q.message,z.message,Bo.max,Bo.min),!r))return I(A[S].message),A}if((h||y)&&!L&&(qa(j)||i&&Array.isArray(j))){const Z=Cu(h),G=Cu(y),q=!Ra(Z.value)&&j.length>+Z.value,z=!Ra(G.value)&&j.length<+G.value;if((q||z)&&(K(q,Z.message,G.message),!r))return I(A[S].message),A}if(v&&!L&&qa(j)){const{value:Z,message:G}=Cu(v);if(Ag(Z)&&!j.match(Z)&&(A[S]={type:Bo.pattern,message:G,ref:c,...$(Bo.pattern,G)},!r))return I(G),A}if(C){if(Ds(C)){const Z=await C(j,n),G=__(Z,_);if(G&&(A[S]={...G,...$(Bo.validate,G.message)},!r))return I(G.message),A}else if(hr(C)){let Z={};for(const G in C){if(!ra(Z)&&!r)break;const q=__(await C[G](j,n),_,G);q&&(Z={...q,...$(G,q.message)},I(q.message),r&&(A[S]=Z))}if(!ra(Z)&&(A[S]={ref:_,...Z},!r))return A}}return I(!0),A};const bte={mode:Ns.onSubmit,reValidateMode:Ns.onChange,shouldFocusError:!0};function Ste(e={}){let t={...bte,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ds(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=hr(t.defaultValues)||hr(t.values)?xr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:xr(s),c={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,h=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...y};const x={array:v_(),state:v_()},v=t.criteriaMode===Ns.all,C=B=>ne=>{clearTimeout(h),h=setTimeout(B,ne)},S=async B=>{if(!t.disabled&&(y.isValid||g.isValid||B)){const ne=t.resolver?ra((await T()).errors):await L(r,!0);ne!==n.isValid&&x.state.next({isValid:ne})}},w=(B,ne)=>{!t.disabled&&(y.isValidating||y.validatingFields||g.isValidating||g.validatingFields)&&((B||Array.from(u.mount)).forEach(ue=>{ue&&(ne?xn(n.validatingFields,ue,ne):dr(n.validatingFields,ue))}),x.state.next({validatingFields:n.validatingFields,isValidating:!ra(n.validatingFields)}))},R=(B,ne=[],ue,Ne,Ee=!0,Te=!0)=>{if(Ne&&ue&&!t.disabled){if(c.action=!0,Te&&Array.isArray(Pe(r,B))){const $e=ue(Pe(r,B),Ne.argA,Ne.argB);Ee&&xn(r,B,$e)}if(Te&&Array.isArray(Pe(n.errors,B))){const $e=ue(Pe(n.errors,B),Ne.argA,Ne.argB);Ee&&xn(n.errors,B,$e),xte(n.errors,B)}if((y.touchedFields||g.touchedFields)&&Te&&Array.isArray(Pe(n.touchedFields,B))){const $e=ue(Pe(n.touchedFields,B),Ne.argA,Ne.argB);Ee&&xn(n.touchedFields,B,$e)}(y.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Tu(s,i)),x.state.next({name:B,isDirty:K(B,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else xn(i,B,ne)},j=(B,ne)=>{xn(n.errors,B,ne),x.state.next({errors:n.errors})},_=B=>{n.errors=B,x.state.next({errors:n.errors,isValid:!1})},I=(B,ne,ue,Ne)=>{const Ee=Pe(r,B);if(Ee){const Te=Pe(i,B,Qn(ue)?Pe(s,B):ue);Qn(Te)||Ne&&Ne.defaultChecked||ne?xn(i,B,ne?Te:w_(Ee._f)):q(B,Te),c.mount&&!c.action&&S()}},A=(B,ne,ue,Ne,Ee)=>{let Te=!1,$e=!1;const st={name:B};if(!t.disabled){if(!ue||Ne){(y.isDirty||g.isDirty)&&($e=n.isDirty,n.isDirty=st.isDirty=K(),Te=$e!==st.isDirty);const ot=As(Pe(s,B),ne);$e=!!Pe(n.dirtyFields,B),ot?dr(n.dirtyFields,B):xn(n.dirtyFields,B,!0),st.dirtyFields=n.dirtyFields,Te=Te||(y.dirtyFields||g.dirtyFields)&&$e!==!ot}if(ue){const ot=Pe(n.touchedFields,B);ot||(xn(n.touchedFields,B,ue),st.touchedFields=n.touchedFields,Te=Te||(y.touchedFields||g.touchedFields)&&ot!==ue)}Te&&Ee&&x.state.next(st)}return Te?st:{}},O=(B,ne,ue,Ne)=>{const Ee=Pe(n.errors,B),Te=(y.isValid||g.isValid)&&$a(ne)&&n.isValid!==ne;if(t.delayError&&ue?(f=C(()=>j(B,ue)),f(t.delayError)):(clearTimeout(h),f=null,ue?xn(n.errors,B,ue):dr(n.errors,B)),(ue?!As(Ee,ue):Ee)||!ra(Ne)||Te){const $e={...Ne,...Te&&$a(ne)?{isValid:ne}:{},errors:n.errors,name:B};n={...n,...$e},x.state.next($e)}},T=async B=>{w(B,!0);const ne=await t.resolver(i,t.context,fte(B||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(B),ne},D=async B=>{const{errors:ne}=await T(B);if(B)for(const ue of B){const Ne=Pe(ne,ue);Ne?xn(n.errors,ue,Ne):dr(n.errors,ue)}else n.errors=ne;return ne},L=async(B,ne,ue={valid:!0})=>{for(const Ne in B){const Ee=B[Ne];if(Ee){const{_f:Te,...$e}=Ee;if(Te){const st=u.array.has(Te.name),ot=Ee._f&&hte(Ee._f);ot&&y.validatingFields&&w([Te.name],!0);const jn=await N_(Ee,u.disabled,i,v,t.shouldUseNativeValidation&&!ne,st);if(ot&&y.validatingFields&&w([Te.name]),jn[Te.name]&&(ue.valid=!1,ne))break;!ne&&(Pe(jn,Te.name)?st?vte(n.errors,jn,Te.name):xn(n.errors,Te.name,jn[Te.name]):dr(n.errors,Te.name))}!ra($e)&&await L($e,ne,ue)}}return ue.valid},$=()=>{for(const B of u.unMount){const ne=Pe(r,B);ne&&(ne._f.refs?ne._f.refs.every(ue=>!Q0(ue)):!Q0(ne._f.ref))&&J(B)}u.unMount=new Set},K=(B,ne)=>!t.disabled&&(B&&ne&&xn(i,B,ne),!As(ge(),s)),Z=(B,ne,ue)=>ob(B,u,{...c.mount?i:Qn(ne)?s:qa(B)?{[B]:ne}:ne},ue,ne),G=B=>f2(Pe(c.mount?i:s,B,t.shouldUnregister?Pe(s,B,[]):[])),q=(B,ne,ue={})=>{const Ne=Pe(r,B);let Ee=ne;if(Ne){const Te=Ne._f;Te&&(!Te.disabled&&xn(i,B,u5(ne,Te)),Ee=Ng(Te.ref)&&Ra(ne)?"":ne,i5(Te.ref)?[...Te.ref.options].forEach($e=>$e.selected=Ee.includes($e.value)):Te.refs?Uh(Te.ref)?Te.refs.forEach($e=>{(!$e.defaultChecked||!$e.disabled)&&(Array.isArray(Ee)?$e.checked=!!Ee.find(st=>st===$e.value):$e.checked=Ee===$e.value||!!Ee)}):Te.refs.forEach($e=>$e.checked=$e.value===Ee):y2(Te.ref)?Te.ref.value="":(Te.ref.value=Ee,Te.ref.type||x.state.next({name:B,values:xr(i)})))}(ue.shouldDirty||ue.shouldTouch)&&A(B,Ee,ue.shouldTouch,ue.shouldDirty,!0),ue.shouldValidate&&se(B)},z=(B,ne,ue)=>{for(const Ne in ne){if(!ne.hasOwnProperty(Ne))return;const Ee=ne[Ne],Te=B+"."+Ne,$e=Pe(r,Te);(u.array.has(B)||hr(Ee)||$e&&!$e._f)&&!rc(Ee)?z(Te,Ee,ue):q(Te,Ee,ue)}},M=(B,ne,ue={})=>{const Ne=Pe(r,B),Ee=u.array.has(B),Te=xr(ne);xn(i,B,Te),Ee?(x.array.next({name:B,values:xr(i)}),(y.isDirty||y.dirtyFields||g.isDirty||g.dirtyFields)&&ue.shouldDirty&&x.state.next({name:B,dirtyFields:Tu(s,i),isDirty:K(B,Te)})):Ne&&!Ne._f&&!Ra(Te)?z(B,Te,ue):q(B,Te,ue),j_(B,u)&&x.state.next({...n,name:B}),x.state.next({name:c.mount?B:void 0,values:xr(i)})},H=async B=>{c.mount=!0;const ne=B.target;let ue=ne.name,Ne=!0;const Ee=Pe(r,ue),Te=ot=>{Ne=Number.isNaN(ot)||rc(ot)&&isNaN(ot.getTime())||As(ot,Pe(i,ue,ot))},$e=E_(t.mode),st=E_(t.reValidateMode);if(Ee){let ot,jn;const mr=ne.type?w_(Ee._f):t5(B),On=B.type===_g.BLUR||B.type===_g.FOCUS_OUT,Qr=!mte(Ee._f)&&!t.resolver&&!Pe(n.errors,ue)&&!Ee._f.deps||yte(On,Pe(n.touchedFields,ue),n.isSubmitted,st,$e),Gn=j_(ue,u,On);xn(i,ue,mr),On?(!ne||!ne.readOnly)&&(Ee._f.onBlur&&Ee._f.onBlur(B),f&&f(0)):Ee._f.onChange&&Ee._f.onChange(B);const Hn=A(ue,mr,On),or=!ra(Hn)||Gn;if(!On&&x.state.next({name:ue,type:B.type,values:xr(i)}),Qr)return(y.isValid||g.isValid)&&(t.mode==="onBlur"?On&&S():On||S()),or&&x.state.next({name:ue,...Gn?{}:Hn});if(!On&&Gn&&x.state.next({...n}),t.resolver){const{errors:kn}=await T([ue]);if(Te(mr),Ne){const Eo=T_(n.errors,r,ue),pa=T_(kn,r,Eo.name||ue);ot=pa.error,ue=pa.name,jn=ra(kn)}}else w([ue],!0),ot=(await N_(Ee,u.disabled,i,v,t.shouldUseNativeValidation))[ue],w([ue]),Te(mr),Ne&&(ot?jn=!1:(y.isValid||g.isValid)&&(jn=await L(r,!0)));Ne&&(Ee._f.deps&&(!Array.isArray(Ee._f.deps)||Ee._f.deps.length>0)&&se(Ee._f.deps),O(ue,jn,ot,Hn))}},V=(B,ne)=>{if(Pe(n.errors,ne)&&B.focus)return B.focus(),1},se=async(B,ne={})=>{let ue,Ne;const Ee=Pf(B);if(t.resolver){const Te=await D(Qn(B)?B:Ee);ue=ra(Te),Ne=B?!Ee.some($e=>Pe(Te,$e)):ue}else B?(Ne=(await Promise.all(Ee.map(async Te=>{const $e=Pe(r,Te);return await L($e&&$e._f?{[Te]:$e}:$e)}))).every(Boolean),!(!Ne&&!n.isValid)&&S()):Ne=ue=await L(r);return x.state.next({...!qa(B)||(y.isValid||g.isValid)&&ue!==n.isValid?{}:{name:B},...t.resolver||!B?{isValid:ue}:{},errors:n.errors}),ne.shouldFocus&&!Ne&&Uf(r,V,B?Ee:u.mount),Ne},ge=(B,ne)=>{let ue={...c.mount?i:s};return ne&&(ue=o5(ne.dirtyFields?n.dirtyFields:n.touchedFields,ue)),Qn(B)?ue:qa(B)?Pe(ue,B):B.map(Ne=>Pe(ue,Ne))},P=(B,ne)=>({invalid:!!Pe((ne||n).errors,B),isDirty:!!Pe((ne||n).dirtyFields,B),error:Pe((ne||n).errors,B),isValidating:!!Pe(n.validatingFields,B),isTouched:!!Pe((ne||n).touchedFields,B)}),U=B=>{B&&Pf(B).forEach(ne=>dr(n.errors,ne)),x.state.next({errors:B?n.errors:{}})},F=(B,ne,ue)=>{const Ne=(Pe(r,B,{_f:{}})._f||{}).ref,Ee=Pe(n.errors,B)||{},{ref:Te,message:$e,type:st,...ot}=Ee;xn(n.errors,B,{...ot,...ne,ref:Ne}),x.state.next({name:B,errors:n.errors,isValid:!1}),ue&&ue.shouldFocus&&Ne&&Ne.focus&&Ne.focus()},W=(B,ne)=>Ds(B)?x.state.subscribe({next:ue=>"values"in ue&&B(Z(void 0,ne),ue)}):Z(B,ne,!0),X=B=>x.state.subscribe({next:ne=>{gte(B.name,ne.name,B.exact)&&pte(ne,B.formState||y,Dn,B.reRenderRoot)&&B.callback({values:{...i},...n,...ne,defaultValues:s})}}).unsubscribe,ae=B=>(c.mount=!0,g={...g,...B.formState},X({...B,formState:g})),J=(B,ne={})=>{for(const ue of B?Pf(B):u.mount)u.mount.delete(ue),u.array.delete(ue),ne.keepValue||(dr(r,ue),dr(i,ue)),!ne.keepError&&dr(n.errors,ue),!ne.keepDirty&&dr(n.dirtyFields,ue),!ne.keepTouched&&dr(n.touchedFields,ue),!ne.keepIsValidating&&dr(n.validatingFields,ue),!t.shouldUnregister&&!ne.keepDefaultValue&&dr(s,ue);x.state.next({values:xr(i)}),x.state.next({...n,...ne.keepDirty?{isDirty:K()}:{}}),!ne.keepIsValid&&S()},ce=({disabled:B,name:ne})=>{($a(B)&&c.mount||B||u.disabled.has(ne))&&(B?u.disabled.add(ne):u.disabled.delete(ne))},ye=(B,ne={})=>{let ue=Pe(r,B);const Ne=$a(ne.disabled)||$a(t.disabled);return xn(r,B,{...ue||{},_f:{...ue&&ue._f?ue._f:{ref:{name:B}},name:B,mount:!0,...ne}}),u.mount.add(B),ue?ce({disabled:$a(ne.disabled)?ne.disabled:t.disabled,name:B}):I(B,!0,ne.value),{...Ne?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:bf(ne.min),max:bf(ne.max),minLength:bf(ne.minLength),maxLength:bf(ne.maxLength),pattern:bf(ne.pattern)}:{},name:B,onChange:H,onBlur:H,ref:Ee=>{if(Ee){ye(B,ne),ue=Pe(r,B);const Te=Qn(Ee.value)&&Ee.querySelectorAll&&Ee.querySelectorAll("input,select,textarea")[0]||Ee,$e=lte(Te),st=ue._f.refs||[];if($e?st.find(ot=>ot===Te):Te===ue._f.ref)return;xn(r,B,{_f:{...ue._f,...$e?{refs:[...st.filter(Q0),Te,...Array.isArray(Pe(s,B))?[{}]:[]],ref:{type:Te.type,name:B}}:{ref:Te}}}),I(B,!1,void 0,Te)}else ue=Pe(r,B,{}),ue._f&&(ue._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(n5(u.array,B)&&c.action)&&u.unMount.add(B)}}},Se=()=>t.shouldFocusError&&Uf(r,V,u.mount),Me=B=>{$a(B)&&(x.state.next({disabled:B}),Uf(r,(ne,ue)=>{const Ne=Pe(r,ue);Ne&&(ne.disabled=Ne._f.disabled||B,Array.isArray(Ne._f.refs)&&Ne._f.refs.forEach(Ee=>{Ee.disabled=Ne._f.disabled||B}))},0,!1))},ke=(B,ne)=>async ue=>{let Ne;ue&&(ue.preventDefault&&ue.preventDefault(),ue.persist&&ue.persist());let Ee=xr(i);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Te,values:$e}=await T();n.errors=Te,Ee=xr($e)}else await L(r);if(u.disabled.size)for(const Te of u.disabled)dr(Ee,Te);if(dr(n.errors,"root"),ra(n.errors)){x.state.next({errors:{}});try{await B(Ee,ue)}catch(Te){Ne=Te}}else ne&&await ne({...n.errors},ue),Se(),setTimeout(Se);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ra(n.errors)&&!Ne,submitCount:n.submitCount+1,errors:n.errors}),Ne)throw Ne},tt=(B,ne={})=>{Pe(r,B)&&(Qn(ne.defaultValue)?M(B,xr(Pe(s,B))):(M(B,ne.defaultValue),xn(s,B,xr(ne.defaultValue))),ne.keepTouched||dr(n.touchedFields,B),ne.keepDirty||(dr(n.dirtyFields,B),n.isDirty=ne.defaultValue?K(B,xr(Pe(s,B))):K()),ne.keepError||(dr(n.errors,B),y.isValid&&S()),x.state.next({...n}))},at=(B,ne={})=>{const ue=B?xr(B):s,Ne=xr(ue),Ee=ra(B),Te=Ee?s:Ne;if(ne.keepDefaultValues||(s=ue),!ne.keepValues){if(ne.keepDirtyValues){const $e=new Set([...u.mount,...Object.keys(Tu(s,i))]);for(const st of Array.from($e))Pe(n.dirtyFields,st)?xn(Te,st,Pe(i,st)):M(st,Pe(Te,st))}else{if(d2&&Qn(B))for(const $e of u.mount){const st=Pe(r,$e);if(st&&st._f){const ot=Array.isArray(st._f.refs)?st._f.refs[0]:st._f.ref;if(Ng(ot)){const jn=ot.closest("form");if(jn){jn.reset();break}}}}if(ne.keepFieldsRef)for(const $e of u.mount)M($e,Pe(Te,$e));else r={}}i=t.shouldUnregister?ne.keepDefaultValues?xr(s):{}:xr(Te),x.array.next({values:{...Te}}),x.state.next({values:{...Te}})}u={mount:ne.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!y.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!ra(Te),c.watch=!!t.shouldUnregister,x.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Ee?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!As(B,s)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ee?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Tu(s,i):n.dirtyFields:ne.keepDefaultValues&&B?Tu(s,B):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Pt=(B,ne)=>at(Ds(B)?B(i):B,ne),fn=(B,ne={})=>{const ue=Pe(r,B),Ne=ue&&ue._f;if(Ne){const Ee=Ne.refs?Ne.refs[0]:Ne.ref;Ee.focus&&(Ee.focus(),ne.shouldSelect&&Ds(Ee.select)&&Ee.select())}},Dn=B=>{n={...n,...B}},Ie={control:{register:ye,unregister:J,getFieldState:P,handleSubmit:ke,setError:F,_subscribe:X,_runSchema:T,_focusError:Se,_getWatch:Z,_getDirty:K,_setValid:S,_setFieldArray:R,_setDisabledField:ce,_setErrors:_,_getFieldArray:G,_reset:at,_resetDefaultValues:()=>Ds(t.defaultValues)&&t.defaultValues().then(B=>{Pt(B,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Me,_subjects:x,_proxyFormState:y,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(B){c=B},get _defaultValues(){return s},get _names(){return u},set _names(B){u=B},get _formState(){return n},get _options(){return t},set _options(B){t={...t,...B}}},subscribe:ae,trigger:se,register:ye,handleSubmit:ke,watch:W,setValue:M,getValues:ge,reset:Pt,resetField:tt,clearErrors:U,unregister:J,setError:F,setFocus:fn,getFieldState:P};return{...Ie,formControl:Ie}}function wo(e={}){const t=re.useRef(void 0),n=re.useRef(void 0),[r,s]=re.useState({isDirty:!1,isValidating:!1,isLoading:Ds(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:Ds(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Ds(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=Ste(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,p2(()=>{const c=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(u=>({...u,isReady:!0})),i._formState.isReady=!0,c},[i]),re.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),re.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),re.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),re.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),re.useEffect(()=>{if(i._proxyFormState.isDirty){const c=i._getDirty();c!==r.isDirty&&i._subjects.state.next({isDirty:c})}},[i,r.isDirty]),re.useEffect(()=>{var c;e.values&&!As(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((c=i._options.resetOptions)===null||c===void 0)&&c.keepIsValid||i._setValid(),n.current=e.values,s(u=>({...u}))):i._resetDefaultValues()},[i,e.values]),re.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=a5(r,i),t.current}var Cte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wte=Cte.reduce((e,t)=>{const n=Zb(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ete="Label",f5=m.forwardRef((e,t)=>a.jsx(wte.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())}}));f5.displayName=Ete;var Rte=f5;function Aa({className:e,...t}){return a.jsx(Rte,{"data-slot":"label",className:oe("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 Nl=r5,h5=m.createContext({}),_t=({...e})=>a.jsx(h5.Provider,{value:{name:e.name},children:a.jsx(ite,{...e})}),zh=()=>{const e=m.useContext(h5),t=m.useContext(m5),{getFieldState:n}=yd(),r=s5({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},m5=m.createContext({});function xt({className:e="",...t}){const n=m.useId();return a.jsx(m5.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:oe("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 yt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:i,formItemId:c}=zh();return a.jsxs(Aa,{"data-slot":"form-label","data-error":!!i,className:oe("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[a.jsx("span",{children:r}),t&&a.jsxs(wt,{...n,children:[a.jsx(Et,{asChild:!0,children:a.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:a.jsx(zr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(Rt,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function Ct({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=zh();return a.jsx(fh,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function hn({className:e,...t}){const{formDescriptionId:n}=zh();return a.jsx("div",{"data-slot":"form-description",id:n,className:oe("text-muted-foreground text-sm",e),...t})}function Mt({className:e,...t}){const{error:n,formMessageId:r}=zh(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?a.jsx("p",{"data-slot":"form-message",id:r,className:oe("text-destructive text-sm",e),...t,children:s}):null}function Al({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 a.jsx("div",{className:r,children:a.jsx("div",{className:oe("flex min-h-full flex-col gap-4",t),children:e})})}function Oc({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 a.jsx("div",{className:oe(r,e),children:t})}function Zr({title:e,children:t}){return a.jsxs("section",{className:"mb-4",children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function jte({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=zh();return a.jsxs("label",{htmlFor:`${u}-${e}`,className:oe("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",i==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[a.jsx("input",{type:"radio",id:`${u}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:oe("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")}),a.jsx("span",{className:oe("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function Tte({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return a.jsx("div",{tabIndex:-1,className:oe(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(i=>a.jsx(jte,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const pi=m.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:oe("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));pi.displayName="AppForm";function A_(e,[t,n]){return Math.min(n,Math.max(t,e))}function cb(e){const t=_te(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(Ate);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function _te(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=Ote(s),u=Dte(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nte=Symbol("radix.slottable");function Ate(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nte}function Dte(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Ote(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 Ite(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=cb(u),h=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),I=mt(w,_.collectionRef);return a.jsx(f,{ref:I,children:j})});h.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=cb(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=mt(w,I),O=i(y,R);return re.useEffect(()=>(O.itemMap.set(I,{ref:I,..._}),()=>void O.itemMap.delete(I))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:h,ItemSlot:v},C,r]}function v2(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mte=[" ","Enter","ArrowUp","ArrowDown"],kte=[" ","Enter"],gc="Select",[My,ky,Lte]=Ite(gc),[xd]=wr(gc,[Lte,So]),Ly=So(),[Pte,Dl]=xd(gc),[Ute,zte]=xd(gc),p5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:h,name:y,autoComplete:g,disabled:x,required:v,form:C}=e,S=Ly(t),[w,R]=m.useState(null),[j,_]=m.useState(null),[I,A]=m.useState(!1),O=wh(h),[T,D]=la({prop:r,defaultProp:s??!1,onChange:i,caller:gc}),[L,$]=la({prop:c,defaultProp:u,onChange:f,caller:gc}),K=m.useRef(null),Z=w?C||!!w.closest("form"):!0,[G,q]=m.useState(new Set),z=Array.from(G).map(M=>M.props.value).join(";");return a.jsx(ud,{...S,children:a.jsxs(Pte,{required:v,scope:t,trigger:w,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:I,onValueNodeHasChildrenChange:A,contentId:tr(),value:L,onValueChange:$,open:T,onOpenChange:D,dir:O,triggerPointerDownPosRef:K,disabled:x,children:[a.jsx(My.Provider,{scope:t,children:a.jsx(Ute,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(M=>{q(H=>new Set(H).add(M))},[]),onNativeOptionRemove:m.useCallback(M=>{q(H=>{const V=new Set(H);return V.delete(M),V})},[]),children:n})}),Z?a.jsxs(z5,{"aria-hidden":!0,required:v,tabIndex:-1,name:y,autoComplete:g,value:L,onChange:M=>$(M.target.value),disabled:x,form:C,children:[L===void 0?a.jsx("option",{value:""}):null,Array.from(G)]},z):null]})})};p5.displayName=gc;var g5="SelectTrigger",y5=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Ly(n),c=Dl(g5,n),u=c.disabled||r,f=mt(t,c.onTriggerChange),h=ky(n),y=m.useRef("touch"),[g,x,v]=H5(S=>{const w=h().filter(_=>!_.disabled),R=w.find(_=>_.value===c.value),j=$5(w,S,R);j!==void 0&&c.onValueChange(j.value)}),C=S=>{u||(c.onOpenChange(!0),v()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return a.jsx(dd,{asChild:!0,...i,children:a.jsx(Je.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:u,"data-disabled":u?"":void 0,"data-placeholder":F5(c.value)?"":void 0,...s,ref:f,onClick:Oe(s.onClick,S=>{S.currentTarget.focus(),y.current!=="mouse"&&C(S)}),onPointerDown:Oe(s.onPointerDown,S=>{y.current=S.pointerType;const w=S.target;w.hasPointerCapture(S.pointerId)&&w.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:Oe(s.onKeyDown,S=>{const w=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(w&&S.key===" ")&&Mte.includes(S.key)&&(C(),S.preventDefault())})})})});y5.displayName=g5;var x5="SelectValue",v5=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Dl(x5,n),{onValueNodeHasChildrenChange:h}=f,y=i!==void 0,g=mt(t,f.onValueNodeChange);return Fr(()=>{h(y)},[h,y]),a.jsx(Je.span,{...u,ref:g,style:{pointerEvents:"none"},children:F5(f.value)?a.jsx(a.Fragment,{children:c}):i})});v5.displayName=x5;var Fte="SelectIcon",b5=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Je.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});b5.displayName=Fte;var Hte="SelectPortal",S5=e=>a.jsx(jc,{asChild:!0,...e});S5.displayName=Hte;var yc="SelectContent",C5=m.forwardRef((e,t)=>{const n=Dl(yc,e.__scopeSelect),[r,s]=m.useState();if(Fr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Os.createPortal(a.jsx(w5,{scope:e.__scopeSelect,children:a.jsx(My.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(E5,{...e,ref:t})});C5.displayName=yc;var Rs=10,[w5,Ol]=xd(yc),$te="SelectContentImpl",Vte=cb("SelectContent.RemoveScroll"),E5=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:h,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:w,...R}=e,j=Dl(yc,n),[_,I]=m.useState(null),[A,O]=m.useState(null),T=mt(t,J=>I(J)),[D,L]=m.useState(null),[$,K]=m.useState(null),Z=ky(n),[G,q]=m.useState(!1),z=m.useRef(!1);m.useEffect(()=>{if(_)return Jg(_)},[_]),Xg();const M=m.useCallback(J=>{const[ce,...ye]=Z().map(ke=>ke.ref.current),[Se]=ye.slice(-1),Me=document.activeElement;for(const ke of J)if(ke===Me||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===ce&&A&&(A.scrollTop=0),ke===Se&&A&&(A.scrollTop=A.scrollHeight),ke==null||ke.focus(),document.activeElement!==Me))return},[Z,A]),H=m.useCallback(()=>M([D,_]),[M,D,_]);m.useEffect(()=>{G&&H()},[G,H]);const{onOpenChange:V,triggerPointerDownPosRef:se}=j;m.useEffect(()=>{if(_){let J={x:0,y:0};const ce=Se=>{var Me,ke;J={x:Math.abs(Math.round(Se.pageX)-(((Me=se.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((ke=se.current)==null?void 0:ke.y)??0))}},ye=Se=>{J.x<=10&&J.y<=10?Se.preventDefault():_.contains(Se.target)||V(!1),document.removeEventListener("pointermove",ce),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ye,{capture:!0})}}},[_,V,se]),m.useEffect(()=>{const J=()=>V(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[V]);const[ge,P]=H5(J=>{const ce=Z().filter(Me=>!Me.disabled),ye=ce.find(Me=>Me.ref.current===document.activeElement),Se=$5(ce,J,ye);Se&&setTimeout(()=>Se.ref.current.focus())}),U=m.useCallback((J,ce,ye)=>{const Se=!z.current&&!ye;(j.value!==void 0&&j.value===ce||Se)&&(L(J),Se&&(z.current=!0))},[j.value]),F=m.useCallback(()=>_==null?void 0:_.focus(),[_]),W=m.useCallback((J,ce,ye)=>{const Se=!z.current&&!ye;(j.value!==void 0&&j.value===ce||Se)&&K(J)},[j.value]),X=r==="popper"?ub:R5,ae=X===ub?{side:u,sideOffset:f,align:h,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:w}:{};return a.jsx(w5,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:U,selectedItem:D,onItemLeave:F,itemTextRefCallback:W,focusSelectedItem:H,selectedItemText:$,position:r,isPositioned:G,searchRef:ge,children:a.jsx(yh,{as:Vte,allowPinchZoom:!0,children:a.jsx(gh,{asChild:!0,trapped:j.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Oe(s,J=>{var ce;(ce=j.trigger)==null||ce.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:a.jsx(X,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:J=>J.preventDefault(),...R,...ae,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Oe(R.onKeyDown,J=>{const ce=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ce&&J.key.length===1&&P(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Se=Z().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Me=J.target,ke=Se.indexOf(Me);Se=Se.slice(ke+1)}setTimeout(()=>M(Se)),J.preventDefault()}})})})})})})});E5.displayName=$te;var Bte="SelectItemAlignedPosition",R5=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Dl(yc,n),c=Ol(yc,n),[u,f]=m.useState(null),[h,y]=m.useState(null),g=mt(t,T=>y(T)),x=ky(n),v=m.useRef(!1),C=m.useRef(!0),{viewport:S,selectedItem:w,selectedItemText:R,focusSelectedItem:j}=c,_=m.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&h&&S&&w&&R){const T=i.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),$=R.getBoundingClientRect();if(i.dir!=="rtl"){const Me=$.left-D.left,ke=L.left-Me,tt=T.left-ke,at=T.width+tt,Pt=Math.max(at,D.width),fn=window.innerWidth-Rs,Dn=A_(ke,[Rs,Math.max(Rs,fn-Pt)]);u.style.minWidth=at+"px",u.style.left=Dn+"px"}else{const Me=D.right-$.right,ke=window.innerWidth-L.right-Me,tt=window.innerWidth-T.right-ke,at=T.width+tt,Pt=Math.max(at,D.width),fn=window.innerWidth-Rs,Dn=A_(ke,[Rs,Math.max(Rs,fn-Pt)]);u.style.minWidth=at+"px",u.style.right=Dn+"px"}const K=x(),Z=window.innerHeight-Rs*2,G=S.scrollHeight,q=window.getComputedStyle(h),z=parseInt(q.borderTopWidth,10),M=parseInt(q.paddingTop,10),H=parseInt(q.borderBottomWidth,10),V=parseInt(q.paddingBottom,10),se=z+M+G+V+H,ge=Math.min(w.offsetHeight*5,se),P=window.getComputedStyle(S),U=parseInt(P.paddingTop,10),F=parseInt(P.paddingBottom,10),W=T.top+T.height/2-Rs,X=Z-W,ae=w.offsetHeight/2,J=w.offsetTop+ae,ce=z+M+J,ye=se-ce;if(ce<=W){const Me=K.length>0&&w===K[K.length-1].ref.current;u.style.bottom="0px";const ke=h.clientHeight-S.offsetTop-S.offsetHeight,tt=Math.max(X,ae+(Me?F:0)+ke+H),at=ce+tt;u.style.height=at+"px"}else{const Me=K.length>0&&w===K[0].ref.current;u.style.top="0px";const tt=Math.max(W,z+S.offsetTop+(Me?U:0)+ae)+ye;u.style.height=tt+"px",S.scrollTop=ce-W+S.offsetTop}u.style.margin=`${Rs}px 0`,u.style.minHeight=ge+"px",u.style.maxHeight=Z+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,h,S,w,R,i.dir,r]);Fr(()=>_(),[_]);const[I,A]=m.useState();Fr(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const O=m.useCallback(T=>{T&&C.current===!0&&(_(),j==null||j(),C.current=!1)},[_,j]);return a.jsx(qte,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:O,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:a.jsx(Je.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});R5.displayName=Bte;var Gte="SelectPopperPosition",ub=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Rs,...i}=e,c=Ly(n);return a.jsx(vh,{...c,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});ub.displayName=Gte;var[qte,b2]=xd(yc,{}),db="SelectViewport",j5=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Ol(db,n),c=b2(db,n),u=mt(t,i.onViewportChange),f=m.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(My.Slot,{scope:n,children:a.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Oe(s.onScroll,h=>{const y=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&g){const v=Math.abs(f.current-y.scrollTop);if(v>0){const C=window.innerHeight-Rs*2,S=parseFloat(g.style.minHeight),w=parseFloat(g.style.height),R=Math.max(S,w);if(R<C){const j=R+v,_=Math.min(C,j),I=j-_;g.style.height=_+"px",g.style.bottom==="0px"&&(y.scrollTop=I>0?I:0,g.style.justifyContent="flex-end")}}}f.current=y.scrollTop})})})]})});j5.displayName=db;var T5="SelectGroup",[Kte,Zte]=xd(T5),_5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=tr();return a.jsx(Kte,{scope:n,id:s,children:a.jsx(Je.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_5.displayName=T5;var N5="SelectLabel",Yte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Zte(N5,n);return a.jsx(Je.div,{id:s.id,...r,ref:t})});Yte.displayName=N5;var Dg="SelectItem",[Wte,A5]=xd(Dg),D5=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Dl(Dg,n),f=Ol(Dg,n),h=u.value===r,[y,g]=m.useState(i??""),[x,v]=m.useState(!1),C=mt(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,s)}),S=tr(),w=m.useRef("touch"),R=()=>{s||(u.onValueChange(r),u.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 a.jsx(Wte,{scope:n,value:r,disabled:s,textId:S,isSelected:h,onItemTextChange:m.useCallback(j=>{g(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(My.ItemSlot,{scope:n,value:r,disabled:s,textValue:y,children:a.jsx(Je.div,{role:"option","aria-labelledby":S,"data-highlighted":x?"":void 0,"aria-selected":h&&x,"data-state":h?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:C,onFocus:Oe(c.onFocus,()=>v(!0)),onBlur:Oe(c.onBlur,()=>v(!1)),onClick:Oe(c.onClick,()=>{w.current!=="mouse"&&R()}),onPointerUp:Oe(c.onPointerUp,()=>{w.current==="mouse"&&R()}),onPointerDown:Oe(c.onPointerDown,j=>{w.current=j.pointerType}),onPointerMove:Oe(c.onPointerMove,j=>{var _;w.current=j.pointerType,s?(_=f.onItemLeave)==null||_.call(f):w.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Oe(c.onKeyDown,j=>{var I;((I=f.searchRef)==null?void 0:I.current)!==""&&j.key===" "||(kte.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});D5.displayName=Dg;var Af="SelectItemText",O5=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Dl(Af,n),u=Ol(Af,n),f=A5(Af,n),h=zte(Af,n),[y,g]=m.useState(null),x=mt(t,R=>g(R),f.onItemTextChange,R=>{var j;return(j=u.itemTextRefCallback)==null?void 0:j.call(u,R,f.value,f.disabled)}),v=y==null?void 0:y.textContent,C=m.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:S,onNativeOptionRemove:w}=h;return Fr(()=>(S(C),()=>w(C)),[S,w,C]),a.jsxs(a.Fragment,{children:[a.jsx(Je.span,{id:f.textId,...i,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Os.createPortal(i.children,c.valueNode):null]})});O5.displayName=Af;var I5="SelectItemIndicator",M5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return A5(I5,n).isSelected?a.jsx(Je.span,{"aria-hidden":!0,...r,ref:t}):null});M5.displayName=I5;var fb="SelectScrollUpButton",k5=m.forwardRef((e,t)=>{const n=Ol(fb,e.__scopeSelect),r=b2(fb,e.__scopeSelect),[s,i]=m.useState(!1),c=mt(t,r.onScrollButtonChange);return Fr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollTop>0;i(h)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(P5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});k5.displayName=fb;var hb="SelectScrollDownButton",L5=m.forwardRef((e,t)=>{const n=Ol(hb,e.__scopeSelect),r=b2(hb,e.__scopeSelect),[s,i]=m.useState(!1),c=mt(t,r.onScrollButtonChange);return Fr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollHeight-f.clientHeight,y=Math.ceil(f.scrollTop)<h;i(y)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(P5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});L5.displayName=hb;var P5=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Ol("SelectScrollButton",n),c=m.useRef(null),u=ky(n),f=m.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return m.useEffect(()=>()=>f(),[f]),Fr(()=>{var y;const h=u().find(g=>g.ref.current===document.activeElement);(y=h==null?void 0:h.ref.current)==null||y.scrollIntoView({block:"nearest"})},[u]),a.jsx(Je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Oe(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Oe(s.onPointerMove,()=>{var h;(h=i.onItemLeave)==null||h.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Oe(s.onPointerLeave,()=>{f()})})}),Xte="SelectSeparator",U5=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Je.div,{"aria-hidden":!0,...r,ref:t})});U5.displayName=Xte;var mb="SelectArrow",Qte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ly(n),i=Dl(mb,n),c=Ol(mb,n);return i.open&&c.position==="popper"?a.jsx(bh,{...s,...r,ref:t}):null});Qte.displayName=mb;var Jte="SelectBubbleInput",z5=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),i=mt(r,s),c=v2(t);return m.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&y){const g=new Event("change",{bubbles:!0});y.call(u,t),u.dispatchEvent(g)}},[c,t]),a.jsx(Je.select,{...n,style:{...P4,...n.style},ref:i,defaultValue:t})});z5.displayName=Jte;function F5(e){return e===""||e===void 0}function H5(e){const t=Ls(e),n=m.useRef(""),r=m.useRef(0),s=m.useCallback(c=>{const u=n.current+c;t(u),(function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function $5(e,t,n){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=ene(e,Math.max(i,0));s.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function ene(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tne=p5,nne=y5,rne=v5,ane=b5,sne=S5,one=C5,ine=j5,lne=_5,cne=D5,une=O5,dne=M5,fne=k5,hne=L5,mne=U5;function ua({...e}){return a.jsx(tne,{"data-slot":"select",...e})}function Py({...e}){return a.jsx(lne,{"data-slot":"select-group",...e})}function da({...e}){return a.jsx(rne,{"data-slot":"select-value",...e})}function fa({className:e,size:t="default",children:n,...r}){return a.jsxs(nne,{"data-slot":"select-trigger","data-size":t,className:oe("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,a.jsx(ane,{asChild:!0,children:a.jsx(Vs,{className:"size-4 opacity-50"})})]})}function ha({className:e,children:t,position:n="popper",...r}){return a.jsx(sne,{children:a.jsxs(one,{"data-slot":"select-content",className:oe("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:[a.jsx(pne,{}),a.jsx(ine,{className:oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),a.jsx(gne,{})]})})}function Bn({className:e,children:t,...n}){return a.jsxs(cne,{"data-slot":"select-item",className:oe("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:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(dne,{children:a.jsx(ia,{className:"size-4"})})}),a.jsx(une,{children:t})]})}function V5({className:e,...t}){return a.jsx(mne,{"data-slot":"select-separator",className:oe("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function pne({className:e,...t}){return a.jsx(fne,{"data-slot":"select-scroll-up-button",className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(qu,{className:"size-4"})})}function gne({className:e,...t}){return a.jsx(hne,{"data-slot":"select-scroll-down-button",className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Vs,{className:"size-4"})})}const yne=tn({title:Dt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:Dt().min(1,"Storage is required")});function xne(){const{createDataMart:e,isLoading:t,error:n}=xs();return{handleCreate:m.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function vne(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:h,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,reset:v,dataMart:C,isLoading:S,error:w,getErrorMessage:R,runs:j}=xs();return m.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:C,isLoading:S,error:w,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:h,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,runs:j,getDataMart:t}}const D_=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},pb=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?D_(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>D_(s,n,e))}},O_=(e,t)=>{t.shouldUseNativeValidation&&pb(e,t);const n={};for(const r in e){const s=Pe(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(bne(t.names||Object.keys(e),r)){const c=Object.assign({},Pe(n,r));xn(c,"root",i),xn(n,r,c)}else xn(n,r,i)}return n},bne=(e,t)=>{const n=I_(t);return e.some(r=>I_(r).match(`^${n}\\.\\d+`))};function I_(e){return e.replace(/\]|\[/g,"")}function B5(e,t,n){function r(u,f){var h;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(h=u._zod).traits??(h.traits=new Set),u._zod.traits.add(e),t(u,f);for(const y in c.prototype)y in u||Object.defineProperty(u,y,{value:c.prototype[y].bind(u)});u._zod.constr=c,u._zod.def=f}const s=(n==null?void 0:n.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function c(u){var f;const h=n!=null&&n.Parent?new i:this;r(h,u),(f=h._zod).deferred??(f.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:u=>{var f,h;return n!=null&&n.Parent&&u instanceof n.Parent?!0:(h=(f=u==null?void 0:u._zod)==null?void 0:f.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Sne extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Cne={};function G5(e){return Cne}function wne(e,t){return typeof t=="bigint"?t.toString():t}const q5=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Tp(e){return typeof e=="string"?e:e==null?void 0:e.message}function K5(e,t,n){var s,i,c,u,f,h;const r={...e,path:e.path??[]};if(!e.message){const y=Tp((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??Tp((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??Tp((f=n.customError)==null?void 0:f.call(n,e))??Tp((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";r.message=y}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const Z5=(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,wne,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ene=B5("$ZodError",Z5),Y5=B5("$ZodError",Z5,{Parent:Error}),Rne=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise)throw new Sne;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>K5(f,i,G5())));throw q5(u,s==null?void 0:s.callee),u}return c.value},jne=Rne(Y5),Tne=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>K5(f,i,G5())));throw q5(u,s==null?void 0:s.callee),u}return c.value},_ne=Tne(Y5);function M_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function Nne(e,t){for(var n={};e.length;){var r=e[0],s=r.code,i=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[c]={message:u.message,type:u.code}}else n[c]={message:i,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(y){return y.errors.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,h=f&&f[r.code];n[c]=g2(c,t,n,s,h?[].concat(h,r.message):r.message)}e.shift()}return n}function Ane(e,t){for(var n={};e.length;){var r=e[0],s=r.code,i=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var u=r.errors[0][0];n[c]={message:u.message,type:u.code}}else n[c]={message:i,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(y){return y.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,h=f&&f[r.code];n[c]=g2(c,t,n,s,h?[].concat(h,r.message):r.message)}e.shift()}return n}function gi(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,i){try{return Promise.resolve(M_(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&pb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return Array.isArray(u==null?void 0:u.issues)})(c))return{values:{},errors:O_(Nne(c.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,i){try{return Promise.resolve(M_(function(){return Promise.resolve((n.mode==="sync"?jne:_ne)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&pb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof Ene})(c))return{values:{},errors:O_(Ane(c.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const W5=m.createContext(void 0);function Dne(){const e=m.useContext(W5);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Jt=(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))(Jt||{});const One={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function Ine(e,t){switch(t.type){case Jt.FETCH_STORAGES_START:case Jt.FETCH_STORAGE_START:case Jt.CREATE_STORAGE_START:case Jt.UPDATE_STORAGE_START:return{...e,error:null};case Jt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Jt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Jt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Jt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Jt.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 Jt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Jt.FETCH_STORAGES_ERROR:case Jt.FETCH_STORAGE_ERROR:case Jt.CREATE_STORAGE_ERROR:case Jt.UPDATE_STORAGE_ERROR:case Jt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Jt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Jt.CLEAR_ERROR:return{...e,error:null};default:return e}}function S2({children:e}){const[t,n]=m.useReducer(Ine,One);return a.jsx(W5.Provider,{value:{state:t,dispatch:n},children:e})}class Mne extends Sl{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 Sf=new Mne;function Uy(){const{state:e,dispatch:t}=Dne(),n=m.useCallback(async()=>{t({type:Jt.FETCH_STORAGES_START});try{const f=await Sf.getDataStorages();t({type:Jt.FETCH_STORAGES_SUCCESS,payload:f.map(Uee)})}catch(f){throw t({type:Jt.FETCH_STORAGES_ERROR,payload:on(f)}),f}},[t]),r=m.useCallback(async f=>{try{const h=await Sf.getDataStorageById(f),y=Kp(h);t({type:Jt.FETCH_STORAGE_SUCCESS,payload:y})}catch(h){throw t({type:Jt.FETCH_STORAGE_ERROR,payload:on(h)}),h}},[t]),s=m.useCallback(async f=>{t({type:Jt.CREATE_STORAGE_START});try{const h=zee(f),y=await Sf.createDataStorage(h),g=Kp(y);return t({type:Jt.CREATE_STORAGE_SUCCESS,payload:g}),Le({event:"data_storage_created",category:"DataStorage",action:"Create",label:g.type}),Tt.success("Storage created"),g}catch(h){return t({type:Jt.CREATE_STORAGE_ERROR,payload:on(h)}),null}},[t]),i=m.useCallback(async(f,h)=>{t({type:Jt.UPDATE_STORAGE_START});try{const y=Pee(h),g=await Sf.updateDataStorage(f,y),x=Kp(g);return t({type:Jt.UPDATE_STORAGE_SUCCESS,payload:x}),Le({event:"data_storage_updated",category:"DataStorage",action:"Update",label:x.type}),Tt.success("Storage updated"),x}catch(y){return t({type:Jt.UPDATE_STORAGE_ERROR,payload:on(y)}),null}},[t]),c=m.useCallback(async f=>{t({type:Jt.DELETE_STORAGE_START});try{await Sf.deleteDataStorage(f),t({type:Jt.DELETE_STORAGE_SUCCESS,payload:f}),Le({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),Tt.success("Storage deleted")}catch(h){throw t({type:Jt.DELETE_STORAGE_ERROR,payload:on(h)}),h}},[t]),u=m.useCallback(()=>{t({type:Jt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:i,deleteDataStorage:c,clearCurrentDataStorage:u}}const X5=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=sW(n,1e3);return a.jsx(a2,{open:e,onOpenChange:t,children:a.jsxs(s2,{className:"sm:max-w-sm",children:[a.jsxs(o2,{children:[a.jsx(i2,{children:"New Storage"}),a.jsx(l2,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:Cl.getAllTypes().map(c=>{const u=c.icon,f=c.status===Wo.ACTIVE;return a.jsxs(we,{variant:"outline",className:"flex px-4 py-6 select-none",onClick:()=>{s(c.type)},disabled:!f||r||i,onDoubleClick:h=>{h.preventDefault()},children:[a.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[a.jsx(u,{size:24}),a.jsx("span",{className:"font-medium",children:c.displayName})]}),!f&&a.jsx(jr,{variant:"secondary",children:"Coming soon"})]},c.type)})})]})})};function kne({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=xne(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:h}=Uy(),[y,g]=m.useState(!1),[x,v]=m.useState(!1);m.useEffect(()=>{u()},[u]);const C=wo({resolver:gi(yne),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),S=async j=>{const _=await n(j);_&&t&&t(_)},w=()=>{g(!0)},R=async j=>{v(!0);try{const _=await f(j);_!=null&&_.id&&(await h(_.id),C.setValue("storageId",_.id))}catch(_){console.error("Failed to create storage:",_)}g(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Nl,{...C,children:a.jsxs(pi,{onSubmit:j=>{C.handleSubmit(S)(j)},children:[a.jsxs(Al,{variant:"light",children:[s&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),a.jsx(_t,{control:C.control,name:"title",render:({field:j})=>a.jsxs(xt,{children:[a.jsx(yt,{children:"Title"}),a.jsx(Ct,{children:a.jsx(It,{id:"title",placeholder:"Enter title",...j,disabled:r})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:C.control,name:"storageId",render:({field:j})=>a.jsxs(xt,{children:[a.jsx(yt,{children:"Storage"}),a.jsx(Ct,{children:a.jsxs(ua,{onValueChange:_=>{_==="create_new"?w():j.onChange(_)},value:j.value,disabled:r||c,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a storage"})}),a.jsx(ha,{children:a.jsxs(Py,{children:[c&&a.jsx(Bn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(_=>{const I=Cl.getInfo(_.type).icon;return a.jsx(Bn,{value:_.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(I,{size:20}),a.jsx("span",{children:_.title})]})},_.id)}),!c&&i.length>0&&a.jsx(V5,{}),a.jsx(Bn,{value:"create_new",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:a.jsx(ma,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(Mt,{})]})})]}),a.jsxs(Oc,{variant:"light",children:[a.jsx(we,{type:"submit",children:"Create Data Mart"}),a.jsx(we,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(X5,{isOpen:y,onClose:()=>{g(!1)},onSelect:j=>R(j),isCreatingDataStorage:x})]})}function Q5({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[i,c]=m.useState(e),[u,f]=m.useState(!1),h=m.useRef(null);m.useEffect(()=>{c(e)},[e]),m.useEffect(()=>{h.current&&(h.current.style.height="auto",h.current.style.height=`${String(h.current.scrollHeight)}px`)},[i]);const y=async()=>{if(i.trim()===""){c(e);return}if(i.trim()!==e)try{f(!0),await t(i.trim())}catch(x){c(e),console.error(x)}finally{f(!1)}},g=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),i.trim()===""){Tt.error(r),c(e);return}y()}else x.key==="Escape"&&c(e)};return a.jsx("h2",{className:oe("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(Co,{ref:h,value:i,onChange:x=>{c(x.target.value);const v=x.target;v.style.height="auto",v.style.height=`${String(v.scrollHeight)}px`},onBlur:()=>void y(),onKeyDown:g,className:oe("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":u}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:u})})}var ec=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(ec||{}),J5=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(J5||{}),zy="Tabs",[Lne]=wr(zy,[fy]),e6=fy(),[Pne,C2]=Lne(zy),t6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...h}=e,y=wh(u),[g,x]=la({prop:r,onChange:s,defaultProp:i??"",caller:zy});return a.jsx(Pne,{scope:n,baseId:tr(),value:g,onValueChange:x,orientation:c,dir:y,activationMode:f,children:a.jsx(Je.div,{dir:y,"data-orientation":c,...h,ref:t})})});t6.displayName=zy;var n6="TabsList",r6=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=C2(n6,n),c=e6(n);return a.jsx(e3,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(Je.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});r6.displayName=n6;var a6="TabsTrigger",s6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=C2(a6,n),u=e6(n),f=l6(c.baseId,r),h=c6(c.baseId,r),y=r===c.value;return a.jsx(t3,{asChild:!0,...u,focusable:!s,active:y,children:a.jsx(Je.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":h,"data-state":y?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Oe(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:Oe(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const g=c.activationMode!=="manual";!y&&!s&&g&&c.onValueChange(r)})})})});s6.displayName=a6;var o6="TabsContent",i6=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=C2(o6,n),f=l6(u.baseId,r),h=c6(u.baseId,r),y=r===u.value,g=m.useRef(y);return m.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx($r,{present:s||y,children:({present:x})=>a.jsx(Je.div,{"data-state":y?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:x&&i})})});i6.displayName=o6;function l6(e,t){return`${e}-trigger-${t}`}function c6(e,t){return`${e}-content-${t}`}var Une=t6,zne=r6,Fne=s6,Hne=i6;function w2({className:e,...t}){return a.jsx(Une,{"data-slot":"tabs",className:oe("flex flex-col gap-2",e),...t})}function E2({className:e,...t}){return a.jsx(zne,{"data-slot":"tabs-list",className:oe("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function th({className:e,...t}){return a.jsx(Fne,{"data-slot":"tabs-trigger",className:oe("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function $ne({className:e,...t}){return a.jsx(Hne,{"data-slot":"tabs-content",className:oe("flex-1 outline-none",e),...t})}var Fy="Collapsible",[Vne,u6]=wr(Fy),[Bne,R2]=Vne(Fy),d6=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,h]=la({prop:r,defaultProp:s??!1,onChange:c,caller:Fy});return a.jsx(Bne,{scope:n,disabled:i,contentId:tr(),open:f,onOpenToggle:m.useCallback(()=>h(y=>!y),[h]),children:a.jsx(Je.div,{"data-state":N2(f),"data-disabled":i?"":void 0,...u,ref:t})})});d6.displayName=Fy;var f6="CollapsibleTrigger",j2=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=R2(f6,n);return a.jsx(Je.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":N2(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Oe(e.onClick,s.onOpenToggle)})});j2.displayName=f6;var T2="CollapsibleContent",_2=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=R2(T2,e.__scopeCollapsible);return a.jsx($r,{present:n||s.open,children:({present:i})=>a.jsx(Gne,{...r,ref:t,present:i})})});_2.displayName=T2;var Gne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=R2(T2,n),[u,f]=m.useState(r),h=m.useRef(null),y=mt(t,h),g=m.useRef(0),x=g.current,v=m.useRef(0),C=v.current,S=c.open||u,w=m.useRef(S),R=m.useRef(void 0);return m.useEffect(()=>{const j=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(j)},[]),Fr(()=>{const j=h.current;if(j){R.current=R.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const _=j.getBoundingClientRect();g.current=_.height,v.current=_.width,w.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(Je.div,{"data-state":N2(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!S,...i,ref:y,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:S&&s})});function N2(e){return e?"open":"closed"}var h6=d6,qne=j2,Kne=_2;const Zne=h6,Yne=j2,Wne=_2;function Xne({children:e,className:t="",...n}){return a.jsx("div",{className:oe("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function Qne({children:e,className:t="",...n}){return a.jsx("div",{className:oe("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:a.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function Jne({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 a.jsx("div",{className:oe(s,t),...r,children:e})}function Gi({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:oe("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 ere({label:e,children:t,className:n="",options:r,value:s,onValueChange:i,required:c=!1,tooltip:u,...f}){return a.jsx("div",{"data-slot":"wizard-step-item-one-of",className:oe("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",n),...f,children:a.jsxs(w2,{value:s,onValueChange:i,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Va,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(E2,{children:r.map(h=>a.jsx(th,{value:h.value,children:h.label},h.value))})]}),t]})})}function m6({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=m.useState(n);return a.jsxs(Zne,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:oe("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(Yne,{asChild:!0,children:a.jsxs("button",{type:"button",className:oe("flex cursor-pointer items-center gap-1"),children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx(Da,{className:oe("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(Wne,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:a.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function Va({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Aa,{"data-slot":"wizard-step-label",className:oe("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...i,children:[t?a.jsxs(wt,{...r,children:[a.jsx(Et,{asChild:!0,children:a.jsxs("span",{className:"flex items-center gap-1",children:[e,a.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),a.jsx(Rt,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):a.jsx("span",{children:e}),n&&a.jsxs(wt,{...r,children:[a.jsx(Et,{asChild:!0,children:a.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:a.jsx(zr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(Rt,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function sl({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:oe("mb-8",n),...r,children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function ei({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:i,...c}){return s==="compact"?a.jsxs("div",{"data-slot":"wizard-step-hero",className:oe("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",i),...c,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx("div",{children:e}),a.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Yr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ri,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:oe("mb-6 flex flex-col items-center justify-center text-center",i),...c,children:[e&&a.jsx("div",{className:"mt-6 mb-3",children:e}),a.jsx("h2",{className:"text-xl font-medium",children:t}),n&&a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&a.jsx(we,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(Yr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ri,{className:"h-4 w-4"})]})})]})}function ti({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:oe("space-y-4",t),...n,children:e})}function tre({children:e,className:t="",...n}){return a.jsx("div",{className:oe("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function nre({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:i,className:c="",...u}){return a.jsxs("div",{className:oe("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:i,...u,children:[e&&a.jsx("span",{className:"shrink-0",children:e}),r?a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),a.jsx(Rt,{side:"top",align:"center",children:"Coming soon"})]}):a.jsx("span",{className:"text-sm font-medium",children:t})]})}function p6({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:h,onChange:y,className:g="",...x}){const v=S=>{y&&y(e==="checkbox"?S.target.checked:S.target.value)},C=m.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:S=>{if(u)return;const w=S.target;w.tagName==="INPUT"||w.tagName==="LABEL"||w.closest("label")||C.current&&C.current.click()},className:oe("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",u?"cursor-not-allowed":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",c?"ring-primary border-transparent ring-2 dark:bg-white/8":"",g),children:[a.jsx("input",{ref:C,id:t,type:e,name:n,value:r,checked:i,disabled:u,onChange:v,className:oe("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&&a.jsx(Va,{htmlFor:t,className:oe("cursor-pointer",u&&"cursor-not-allowed"),children:s}),(f||h)&&a.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(zr,{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})}),a.jsx(Rt,{side:"top",align:"center",children:f})]}),h&&a.jsx("div",{className:"flex items-center",children:h})]})]})}function A2({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 a.jsx("div",{"data-slot":"wizard-step-loading",className:oe(s,n),children:Array.from({length:r}).map((i,c)=>a.jsx(Pr,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function k_(e){const t=rre(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(sre);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function rre(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=ire(s),u=ore(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var are=Symbol("radix.slottable");function sre(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===are}function ore(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function ire(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 lre(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=k_(u),h=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),I=mt(w,_.collectionRef);return a.jsx(f,{ref:I,children:j})});h.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=k_(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=mt(w,I),O=i(y,R);return re.useEffect(()=>(O.itemMap.set(I,{ref:I,..._}),()=>void O.itemMap.delete(I))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:h,ItemSlot:v},C,r]}var Ks="Accordion",cre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[D2,ure,dre]=lre(Ks),[Hy]=wr(Ks,[dre,u6]),O2=u6(),g6=re.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(D2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(pre,{...i,ref:t}):a.jsx(mre,{...s,ref:t})})});g6.displayName=Ks;var[y6,fre]=Hy(Ks),[x6,hre]=Hy(Ks,{collapsible:!1}),mre=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=la({prop:n,defaultProp:r??"",onChange:s,caller:Ks});return a.jsx(y6,{scope:e.__scopeAccordion,value:re.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:re.useCallback(()=>i&&f(""),[i,f]),children:a.jsx(x6,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(v6,{...c,ref:t})})})}),pre=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=la({prop:n,defaultProp:r??[],onChange:s,caller:Ks}),f=re.useCallback(y=>u((g=[])=>[...g,y]),[u]),h=re.useCallback(y=>u((g=[])=>g.filter(x=>x!==y)),[u]);return a.jsx(y6,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:a.jsx(x6,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(v6,{...i,ref:t})})})}),[gre,$y]=Hy(Ks),v6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=re.useRef(null),f=mt(u,t),h=ure(n),g=wh(s)==="ltr",x=Oe(e.onKeyDown,v=>{var D;if(!cre.includes(v.key))return;const C=v.target,S=h().filter(L=>{var $;return!(($=L.ref.current)!=null&&$.disabled)}),w=S.findIndex(L=>L.ref.current===C),R=S.length;if(w===-1)return;v.preventDefault();let j=w;const _=0,I=R-1,A=()=>{j=w+1,j>I&&(j=_)},O=()=>{j=w-1,j<_&&(j=I)};switch(v.key){case"Home":j=_;break;case"End":j=I;break;case"ArrowRight":i==="horizontal"&&(g?A():O());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(g?O():A());break;case"ArrowUp":i==="vertical"&&O();break}const T=j%R;(D=S[T].ref.current)==null||D.focus()});return a.jsx(gre,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(D2.Slot,{scope:n,children:a.jsx(Je.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:x})})})}),Og="AccordionItem",[yre,I2]=Hy(Og),b6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=$y(Og,n),c=fre(Og,n),u=O2(n),f=tr(),h=r&&c.value.includes(r)||!1,y=i.disabled||e.disabled;return a.jsx(yre,{scope:n,open:h,disabled:y,triggerId:f,children:a.jsx(h6,{"data-orientation":i.orientation,"data-state":j6(h),...u,...s,ref:t,disabled:y,open:h,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});b6.displayName=Og;var S6="AccordionHeader",C6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=$y(Ks,n),i=I2(S6,n);return a.jsx(Je.h3,{"data-orientation":s.orientation,"data-state":j6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});C6.displayName=S6;var gb="AccordionTrigger",w6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=$y(Ks,n),i=I2(gb,n),c=hre(gb,n),u=O2(n);return a.jsx(D2.ItemSlot,{scope:n,children:a.jsx(qne,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:t})})});w6.displayName=gb;var E6="AccordionContent",R6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=$y(Ks,n),i=I2(E6,n),c=O2(n);return a.jsx(Kne,{role:"region","aria-labelledby":i.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}})});R6.displayName=E6;function j6(e){return e?"open":"closed"}var xre=g6,vre=b6,bre=C6,Sre=w6,Cre=R6;const M2={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:a.jsx(_U,{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}},T6=m.createContext("default");function vn({variant:e="default",...t}){return a.jsx(T6.Provider,{value:e,children:a.jsx(xre,{"data-slot":"accordion",...t})})}function k2(e){const t=m.useContext(T6);return e??t??"default"}function Zt({className:e,variant:t,...n}){const r=k2(t),{itemClass:s}=M2[r];return a.jsx(vre,{"data-slot":"accordion-item",className:oe(s,e),...n})}function Yt({className:e,children:t,variant:n,...r}){const s=k2(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=M2[s];return a.jsx(bre,{className:f,children:a.jsxs(Sre,{"data-slot":"accordion-trigger",className:oe(i,e),...r,children:[c,t,a.jsx(Vs,{className:u,"aria-hidden":"true"})]})})}function Wt({className:e,children:t,variant:n,...r}){const s=k2(n),{contentClass:i,contentInnerClass:c}=M2[s];return a.jsx(Cre,{"data-slot":"accordion-content",className:oe(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function dn({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:oe("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(ri,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function L_(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"connector-state-details",children:[a.jsx(Yt,{children:"What’s connector state?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"The connector state stores internal data between runs and updates automatically with each execution. It’s used to track progress and ensure consistent data processing across runs."}),a.jsx("p",{className:"mb-2",children:"Connector state is available only for connectors that support incremental runs, helping add only new or updated records since the last run without reloading existing data."}),a.jsxs("p",{className:"mb-2",children:["For more details, see the"," ",a.jsx(dn,{className:"underline",href:"https://docs.owox.com/?utm_source=owox_data_marts&utm_medium=manual_run_sheet&utm_campaign=tooltip_connector_state",children:"OWOX documentation"}),"."]})]})]})})}function wre({configuration:e,connectorState:t}){const r=((e==null?void 0:e.connector.source.configuration)??[]).map((u,f)=>{const h=u;return typeof h._id=="string"?{id:h._id,index:f}:void 0}).filter(u=>!!u),s=(t==null?void 0:t.states)??[],i=new Map(s.map(u=>[u._id,u])),c=r.map(({id:u,index:f})=>{const h=i.get(u);return h?{state:h,index:f}:void 0}).filter(u=>!!u);return a.jsx(m6,{title:"State Info",children:c.length===0?a.jsxs(xt,{children:[a.jsx(yt,{children:"Connector state"}),a.jsx(Ct,{children:a.jsx("div",{className:"bg-muted min-h-[70px] cursor-not-allowed overflow-auto rounded-md px-3 py-2 font-mono text-sm whitespace-pre-wrap opacity-70",children:"No state available"})}),a.jsx(hn,{children:a.jsx(L_,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const h=u.at||"",y=h?Ey(aO(h).toISOString()):"—",g=u.state,x=(()=>{try{return JSON.stringify(g,null,2)}catch{return typeof g=="string"?g:'"—"'}})();return a.jsxs(xt,{children:[a.jsx(yt,{tooltip:`Created at ${y}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(Ct,{children:a.jsx(bD,{value:x,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(hn,{children:a.jsx(L_,{})})]},u._id)})})})}function Ere({configuration:e,onClose:t,onSubmit:n}){const[r,s]=m.useState(new Set),i=m.useId(),c=wo({defaultValues:{runType:ec.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:h,fetchConnectorSpecification:y}=Dc(),{dataMart:g}=xs(),x=m.useCallback(async w=>{!r.has(w)&&!f&&(s(R=>new Set(R).add(w)),await y(w))},[r,f,y]);m.useEffect(()=>{e!=null&&e.connector.source.name&&x(e.connector.source.name)},[e,u,x]);const v=w=>{n&&n(w)},C=()=>{t&&t()},S=w=>{if(!w)return"text";switch(w){case _s.DATE:return"date";case _s.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):h?a.jsx(Nl,{...c,children:a.jsxs(pi,{id:i,noValidate:!0,onSubmit:w=>void c.handleSubmit(v)(w),children:[a.jsxs(Al,{children:[a.jsxs(Zr,{title:"General",children:[a.jsx(_t,{control:c.control,name:"runType",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(Ct,{children:a.jsxs(a.Fragment,{children:[a.jsx(Tte,{options:[{value:ec.INCREMENTAL,label:"Incremental load"},{value:ec.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:w.value,onChange:w.onChange,orientation:"horizontal"}),a.jsx(hn,{children:c.watch("runType")===ec.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")===ec.INCREMENTAL&&a.jsx(wre,{configuration:e,connectorState:(g==null?void 0:g.connectorState)??null})]}),c.watch("runType")===ec.MANUAL_BACKFILL&&a.jsx(Zr,{title:"Run configuration",children:h.filter(w=>{var R;return(R=w.attributes)==null?void 0:R.includes(J5.MANUAL_BACKFILL)}).map(w=>a.jsx(_t,{control:c.control,name:`data.${w.name}`,render:()=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:w.description,children:w.title??w.name}),a.jsx(Ct,{children:a.jsx(It,{id:w.name,placeholder:w.description,type:S(w.requiredType),defaultValue:typeof w.default=="string"||typeof w.default=="number"?w.default.toString():void 0,...c.register(`data.${w.name}`,{required:!0})})}),a.jsx(Mt,{})]},w.name)}))})]}),a.jsxs(Oc,{children:[a.jsx(we,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(we,{type:"button",variant:"outline",onClick:C,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function Rre({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return a.jsx(li,{open:e,onOpenChange:t,children:a.jsxs(ci,{children:[a.jsx(ui,{children:a.jsx(di,{children:"Manual Run"})}),a.jsx(Ere,{configuration:n,onClose:t,onSubmit:r})]})})}function _6({children:e,configuration:t,onManualRun:n,open:r}){const[s,i]=m.useState(r??!1),c=()=>{i(!0)},u=h=>{n(h),i(!1)},f=()=>e?a.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return a.jsxs(a.Fragment,{children:[f(),s&&a.jsx(nd,{children:a.jsx(Rre,{isOpen:s,onClose:()=>{i(!1)},configuration:t,onSubmit:u})})]})}const jre=1e3;function Tre(e,t){const[n,r]=m.useState(!1),[s,i]=m.useState(null),c=m.useRef(null),u=m.useRef(null),f=m.useRef(!0),h=m.useRef(t);h.current=t;const y=m.useCallback(w=>{f.current&&r(w)},[]),g=m.useCallback(w=>{f.current&&i(w)},[]),x=m.useCallback((w,R)=>{const j=w instanceof Error?w.message:"Schema actualization failed";Tt.dismiss(R),g(j),y(!1),c.current=null,u.current=null,Tt.error(j,{duration:void 0,id:R})},[g,y]),v=m.useCallback(async()=>{var R;const w=c.current;if((R=u.current)==null||R.abort(),w){Tt.dismiss(w);try{await En.abortSchemaActualizeTrigger(e,w)}catch{}}c.current=null,u.current=null,y(!1)},[e,y]),C=m.useCallback(async(w,R)=>{var _;const j=I=>I===Ya.SUCCESS||I===Ya.ERROR||I===Ya.CANCELLED;for(;!R.aborted&&c.current===w;)try{const I=await En.getSchemaActualizeTriggerStatus(e,w);if(j(I)){try{const A=await En.getSchemaActualizeTriggerResponse(e,w);if(Tt.dismiss(w),A.success)(_=h.current)==null||_.call(h),Tt.success("Output schema actualized",{duration:void 0,id:w});else{const O=A.error??"Schema actualization failed";g(O),Tt.error(O,{duration:void 0,id:w})}}catch(A){const O=A instanceof Error?A.message:"Schema actualization failed";Tt.dismiss(w),g(O),Tt.error(O,{duration:void 0,id:w})}y(!1),c.current=null,u.current=null;return}await new Promise(A=>setTimeout(A,jre))}catch(I){x(I,w)}},[e,g,y,x]),S=m.useCallback(async()=>{c.current&&await v(),g(null),y(!0);try{const{triggerId:w}=await En.createSchemaActualizeTrigger(e);Tt.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:w}),c.current=w;const R=new AbortController;u.current=R;try{await C(w,R.signal)}catch(j){x(j,w)}}catch(w){y(!1),g(w instanceof Error?w.message:"Failed to start schema actualization")}},[e,v,C,g,y,x]);return m.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const w=c.current;(R=u.current)==null||R.abort(),w&&(Tt.dismiss(w),En.abortSchemaActualizeTrigger(e,w).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:S,isLoading:n,cancel:v,error:s}}function _re({id:e}){const{navigate:t}=hi(),{user:n}=fi(),{flags:r}=_h(),{dataMart:s,deleteDataMart:i,updateDataMartTitle:c,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:h,updateDataMartSchema:y,publishDataMart:g,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:S,isLoading:w,error:R,getErrorMessage:j,runs:_,getDataMart:I}=vne(e),[A,O]=m.useState(!1),[T,D]=m.useState(!1),{id:L="",canPublish:$=!1,canActualizeSchema:K=!1,status:Z={code:null,displayName:"",description:""},title:G="",definition:q=null,definitionType:z=null,validationErrors:M=[]}=s??{},H=m.useCallback(()=>{L&&I(L)},[L,I]),{run:V,isLoading:se}=Tre(L,H),ge=m.useCallback(async()=>{K&&await V()},[K,V]),P=r==null?void 0:r.INSIGHTS_ENABLED_PROJECT_IDS,U=(n==null?void 0:n.projectId)??"",F=U.length>0&&jQ(P??"").includes(U),W=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...F?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],X=m.useCallback(async ce=>{L&&await c(L,ce)},[L,c]),ae=m.useCallback(async()=>{if(L){D(!0);try{await g(L),ge()}catch(ce){console.log(ce instanceof Error?ce.message:"Failed to publish Data Mart")}finally{D(!1)}}},[L,g,ge]),J=m.useCallback(async ce=>{if(L){if(Z.code!==Ur.PUBLISHED){An.error("Manual run is only available for published Data Marts");return}await x({id:L,payload:ce})}},[L,Z,x]);return s?a.jsxs("div",{className:"px-12 py-6",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[a.jsx(Hu,{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:a.jsx(JL,{className:"h-5 w-5"})}),a.jsx(Q5,{title:G,onUpdate:X,className:"text-2xl font-medium"})]}),a.jsxs("div",{className:"flex items-center gap-2"+(T?" opacity-50":""),style:{minWidth:"120px"},children:[a.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{children:a.jsx(Mh,{type:Z.code===Ur.PUBLISHED?er.SUCCESS:er.NEUTRAL,variant:"subtle",children:Z.displayName})})}),a.jsx(Rt,{children:Z.code===Ur.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),Z.code===Ur.DRAFT&&a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{children:a.jsxs(Hu,{variant:"default",onClick:()=>{ae()},disabled:T||!$,className:"ml-2 flex items-center gap-1",children:[a.jsx(mh,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!$&&a.jsxs(Rt,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),M.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:YQ(M).map((ce,ye)=>a.jsx("li",{children:ce},ye))})]})]})]}),a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(Hu,{variant:"ghost",children:a.jsx(yA,{className:"h-5 w-5"})})}),a.jsxs(Ar,{align:"end",children:[z===Be.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(_6,{configuration:q??null,onManualRun:ce=>{J({runType:ce.runType,data:ce.data})},children:a.jsxs(Nt,{onClick:ce=>{ce.preventDefault()},children:[a.jsx(Wg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(Na,{})]}),a.jsxs(Nt,{onClick:()=>{O(!0)},children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),a.jsx("div",{children:a.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:W.map(ce=>a.jsx(dh,{to:ce.path,className:({isActive:ye})=>oe("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",ye?"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:ce.name},ce.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(Gb,{context:{dataMart:s,isLoading:w,error:R,getErrorMessage:j,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:h,updateDataMartSchema:y,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:S,runs:_,getDataMart:I,runSchemaActualization:ge,isSchemaActualizationLoading:se}})}),a.jsx(Cr,{open:A,onOpenChange:O,title:"Delete Data Mart",description:a.jsxs(a.Fragment,{children:["Are you sure you want to delete ",a.jsxs("strong",{children:['"',G,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await i(L),O(!1),t("/data-marts")}catch(ce){console.error("Failed to delete Data Mart:",ce)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(Pr,{className:"h-16 w-full"},0),Array.from({length:3}).map((ce,ye)=>a.jsx(Pr,{className:"h-48 w-full"},ye+1))]})}function Nre({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:i="100px"}){const[c,u]=m.useState(e??""),[f,h]=m.useState(!1),[y,g]=m.useState(!1),x=m.useRef(null);m.useEffect(()=>{u(e??"")},[e]),m.useEffect(()=>{if(x.current&&f){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),v(x.current)}},[f]);const v=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},C=R=>{u(R.target.value),v(R.target)},S=async()=>{const R=c.trim();if(R===(e??"")){h(!1);return}try{g(!0),await t(R===""?null:R),h(!1)}catch(_){console.error("Failed to update description:",_),u(e??"")}finally{g(!1)}},w=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),S()):R.key==="Escape"&&(R.preventDefault(),u(e??""),h(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(Co,{ref:x,value:c,onChange:C,onBlur:()=>void S(),onKeyDown:w,placeholder:r,className:oe("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":y}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:i,minWidth:s},disabled:y}),a.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[a.jsxs("span",{children:["Press"," ",a.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 •"," "]}),a.jsxs("span",{children:[a.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 •"," "]}),a.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):a.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:a.jsx("div",{onClick:()=>{h(!0)},className:oe("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 Are(){const{dataMart:e,updateDataMartDescription:t}=gs(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(Nre,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function P_(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 Dre(e){if(Array.isArray(e))return e}function Ore(e,t,n){return(t=zre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ire(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,c,u=[],f=!0,h=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(f=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(y){h=!0,s=y}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw s}}return u}}function Mre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
784
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U_(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 z_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U_(Object(n),!0).forEach(function(r){Ore(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kre(e,t){if(e==null)return{};var n,r,s=Lre(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Lre(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 Pre(e,t){return Dre(e)||Ire(e,t)||Fre(e,t)||Mre()}function Ure(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 zre(e){var t=Ure(e,"string");return typeof t=="symbol"?t:t+""}function Fre(e,t){if(e){if(typeof e=="string")return P_(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)?P_(e,t):void 0}}function Hre(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F_(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 H_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F_(Object(n),!0).forEach(function(r){Hre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $re(){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,i){return i(s)},r)}}function Df(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return t.apply(n,[].concat(s,u))}}}function Ig(e){return{}.toString.call(e).includes("Object")}function Vre(e){return!Object.keys(e).length}function nh(e){return typeof e=="function"}function Bre(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Gre(e,t){return Ig(t)||cl("changeType"),Object.keys(t).some(function(n){return!Bre(e,n)})&&cl("changeField"),t}function qre(e){nh(e)||cl("selectorType")}function Kre(e){nh(e)||Ig(e)||cl("handlerType"),Ig(e)&&Object.values(e).some(function(t){return!nh(t)})&&cl("handlersType")}function Zre(e){e||cl("initialIsRequired"),Ig(e)||cl("initialType"),Vre(e)&&cl("initialContent")}function Yre(e,t){throw new Error(e[t]||e.default)}var Wre={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"},cl=Df(Yre)(Wre),_p={changes:Gre,selector:qre,handler:Kre,initial:Zre};function Xre(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_p.initial(e),_p.handler(t);var n={current:e},r=Df(eae)(n,t),s=Df(Jre)(n),i=Df(_p.changes)(e),c=Df(Qre)(n);function u(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return _p.selector(h),h(n.current)}function f(h){$re(r,s,i,c)(h)}return[u,f]}function Qre(e,t){return nh(t)?t(e.current):t}function Jre(e,t){return e.current=H_(H_({},e.current),t),t}function eae(e,t,n){return nh(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 tae={create:Xre},nae={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function rae(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return t.apply(n,[].concat(s,u))}}}function aae(e){return{}.toString.call(e).includes("Object")}function sae(e){return e||$_("configIsRequired"),aae(e)||$_("configType"),e.urls?(oae(),{paths:{vs:e.urls.monacoBase}}):e}function oae(){console.warn(N6.deprecation)}function iae(e,t){throw new Error(e[t]||e.default)}var N6={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!
|
|
785
|
-
You are using deprecated way of configuration.
|
|
786
|
-
|
|
787
|
-
Instead of using
|
|
788
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
789
|
-
use
|
|
790
|
-
monaco.config({ paths: { vs: '...' } })
|
|
791
|
-
|
|
792
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
793
|
-
`},$_=rae(iae)(N6),lae={config:sae},cae=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(i,c){return c(i)},s)}};function A6(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],A6(e[n],t[n]))}),z_(z_({},e),t)}var uae={type:"cancelation",msg:"operation is manually canceled"};function J0(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(uae):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var dae=["monaco"],fae=tae.create({config:nae,isInitialized:!1,resolve:null,reject:null,monaco:null}),D6=Pre(fae,2),Fh=D6[0],Vy=D6[1];function hae(e){var t=lae.config(e),n=t.monaco,r=kre(t,dae);Vy(function(s){return{config:A6(s.config,r),monaco:n}})}function mae(){var e=Fh(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Vy({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),J0(e1);if(window.monaco&&window.monaco.editor)return O6(window.monaco),e.resolve(window.monaco),J0(e1);cae(pae,yae)(xae)}return J0(e1)}function pae(e){return document.body.appendChild(e)}function gae(e){var t=document.createElement("script");return e&&(t.src=e),t}function yae(e){var t=Fh(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=gae("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function xae(){var e=Fh(function(n){var r=n.config,s=n.resolve,i=n.reject;return{config:r,resolve:s,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;O6(r),e.resolve(r)},function(n){e.reject(n)})}function O6(e){Fh().monaco||Vy({monaco:e})}function vae(){return Fh(function(e){var t=e.monaco;return t})}var e1=new Promise(function(e,t){return Vy({resolve:e,reject:t})}),I6={config:hae,init:mae,__getMonacoInstance:vae},bae={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},t1=bae,Sae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Cae=Sae;function wae({children:e}){return re.createElement("div",{style:Cae.container},e)}var Eae=wae,Rae=Eae;function jae({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return re.createElement("section",{style:{...t1.wrapper,width:e,height:t},...c},!n&&re.createElement(Rae,null,r),re.createElement("div",{ref:s,style:{...t1.fullWidth,...!n&&t1.hide},className:i}))}var Tae=jae,M6=m.memo(Tae);function _ae(e){m.useEffect(e,[])}var k6=_ae;function Nae(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ba=Nae;function zf(){}function Iu(e,t,n,r){return Aae(e,r)||Dae(e,t,n,r)}function Aae(e,t){return e.editor.getModel(L6(e,t))}function Dae(e,t,n,r){return e.editor.createModel(t,n,r?L6(e,r):void 0)}function L6(e,t){return e.Uri.parse(t)}function Oae({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:y="Loading...",options:g={},height:x="100%",width:v="100%",className:C,wrapperProps:S={},beforeMount:w=zf,onMount:R=zf}){let[j,_]=m.useState(!1),[I,A]=m.useState(!0),O=m.useRef(null),T=m.useRef(null),D=m.useRef(null),L=m.useRef(R),$=m.useRef(w),K=m.useRef(!1);k6(()=>{let z=I6.init();return z.then(M=>(T.current=M)&&A(!1)).catch(M=>(M==null?void 0:M.type)!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>O.current?q():z.cancel()}),Ba(()=>{if(O.current&&T.current){let z=O.current.getOriginalEditor(),M=Iu(T.current,e||"",r||n||"text",i||"");M!==z.getModel()&&z.setModel(M)}},[i],j),Ba(()=>{if(O.current&&T.current){let z=O.current.getModifiedEditor(),M=Iu(T.current,t||"",s||n||"text",c||"");M!==z.getModel()&&z.setModel(M)}},[c],j),Ba(()=>{let z=O.current.getModifiedEditor();z.getOption(T.current.editor.EditorOption.readOnly)?z.setValue(t||""):t!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[t],j),Ba(()=>{var z,M;(M=(z=O.current)==null?void 0:z.getModel())==null||M.original.setValue(e||"")},[e],j),Ba(()=>{let{original:z,modified:M}=O.current.getModel();T.current.editor.setModelLanguage(z,r||n||"text"),T.current.editor.setModelLanguage(M,s||n||"text")},[n,r,s],j),Ba(()=>{var z;(z=T.current)==null||z.editor.setTheme(h)},[h],j),Ba(()=>{var z;(z=O.current)==null||z.updateOptions(g)},[g],j);let Z=m.useCallback(()=>{var H;if(!T.current)return;$.current(T.current);let z=Iu(T.current,e||"",r||n||"text",i||""),M=Iu(T.current,t||"",s||n||"text",c||"");(H=O.current)==null||H.setModel({original:z,modified:M})},[n,t,s,e,r,i,c]),G=m.useCallback(()=>{var z;!K.current&&D.current&&(O.current=T.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...g}),Z(),(z=T.current)==null||z.editor.setTheme(h),_(!0),K.current=!0)},[g,h,Z]);m.useEffect(()=>{j&&L.current(O.current,T.current)},[j]),m.useEffect(()=>{!I&&!j&&G()},[I,j,G]);function q(){var M,H,V,se;let z=(M=O.current)==null?void 0:M.getModel();u||((H=z==null?void 0:z.original)==null||H.dispose()),f||((V=z==null?void 0:z.modified)==null||V.dispose()),(se=O.current)==null||se.dispose()}return re.createElement(M6,{width:v,height:x,isEditorReady:j,loading:y,_ref:D,className:C,wrapperProps:S})}var Iae=Oae;m.memo(Iae);function Mae(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var kae=Mae,Np=new Map;function Lae({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:h={},overrideServices:y={},saveViewState:g=!0,keepCurrentModel:x=!1,width:v="100%",height:C="100%",className:S,wrapperProps:w={},beforeMount:R=zf,onMount:j=zf,onChange:_,onValidate:I=zf}){let[A,O]=m.useState(!1),[T,D]=m.useState(!0),L=m.useRef(null),$=m.useRef(null),K=m.useRef(null),Z=m.useRef(j),G=m.useRef(R),q=m.useRef(),z=m.useRef(r),M=kae(i),H=m.useRef(!1),V=m.useRef(!1);k6(()=>{let P=I6.init();return P.then(U=>(L.current=U)&&D(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>$.current?ge():P.cancel()}),Ba(()=>{var U,F,W,X;let P=Iu(L.current,e||r||"",t||s||"",i||n||"");P!==((U=$.current)==null?void 0:U.getModel())&&(g&&Np.set(M,(F=$.current)==null?void 0:F.saveViewState()),(W=$.current)==null||W.setModel(P),g&&((X=$.current)==null||X.restoreViewState(Np.get(i))))},[i],A),Ba(()=>{var P;(P=$.current)==null||P.updateOptions(h)},[h],A),Ba(()=>{!$.current||r===void 0||($.current.getOption(L.current.editor.EditorOption.readOnly)?$.current.setValue(r):r!==$.current.getValue()&&(V.current=!0,$.current.executeEdits("",[{range:$.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),$.current.pushUndoStop(),V.current=!1))},[r],A),Ba(()=>{var U,F;let P=(U=$.current)==null?void 0:U.getModel();P&&s&&((F=L.current)==null||F.editor.setModelLanguage(P,s))},[s],A),Ba(()=>{var P;u!==void 0&&((P=$.current)==null||P.revealLine(u))},[u],A),Ba(()=>{var P;(P=L.current)==null||P.editor.setTheme(c)},[c],A);let se=m.useCallback(()=>{var P;if(!(!K.current||!L.current)&&!H.current){G.current(L.current);let U=i||n,F=Iu(L.current,r||e||"",t||s||"",U||"");$.current=(P=L.current)==null?void 0:P.editor.create(K.current,{model:F,automaticLayout:!0,...h},y),g&&$.current.restoreViewState(Np.get(U)),L.current.editor.setTheme(c),u!==void 0&&$.current.revealLine(u),O(!0),H.current=!0}},[e,t,n,r,s,i,h,y,g,c,u]);m.useEffect(()=>{A&&Z.current($.current,L.current)},[A]),m.useEffect(()=>{!T&&!A&&se()},[T,A,se]),z.current=r,m.useEffect(()=>{var P,U;A&&_&&((P=q.current)==null||P.dispose(),q.current=(U=$.current)==null?void 0:U.onDidChangeModelContent(F=>{V.current||_($.current.getValue(),F)}))},[A,_]),m.useEffect(()=>{if(A){let P=L.current.editor.onDidChangeMarkers(U=>{var W;let F=(W=$.current.getModel())==null?void 0:W.uri;if(F&&U.find(X=>X.path===F.path)){let X=L.current.editor.getModelMarkers({resource:F});I==null||I(X)}});return()=>{P==null||P.dispose()}}return()=>{}},[A,I]);function ge(){var P,U;(P=q.current)==null||P.dispose(),x?g&&Np.set(i,$.current.saveViewState()):(U=$.current.getModel())==null||U.dispose(),$.current.dispose()}return re.createElement(M6,{width:v,height:C,isEditorReady:A,loading:f,_ref:K,className:S,wrapperProps:w})}var Pae=Lae,L2=m.memo(Pae);function Uae({initialValue:e,onChange:t}){const[n,r]=m.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=md();m.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function i(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return a.jsx("div",{className:"shadow-xs",children:a.jsx(L2,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:i,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function yb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:i}){const c=e;return a.jsxs("div",{className:oe("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",i),onClick:s,children:[a.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(c,{className:"h-6 w-6"})}),a.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[a.jsx("div",{className:"text-md font-medium",children:t}),n&&a.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&a.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:a.jsx(Da,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var V_=1,zae=.9,Fae=.8,Hae=.17,n1=.1,r1=.999,$ae=.9999,Vae=.99,Bae=/[\\\/_+.#"@\[\(\{&]/,Gae=/[\\\/_+.#"@\[\(\{&]/g,qae=/[\s-]/,P6=/[\s-]/g;function xb(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?V_:Vae;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),h=n.indexOf(f,s),y=0,g,x,v,C;h>=0;)g=xb(e,t,n,r,h+1,i+1,c),g>y&&(h===s?g*=V_:Bae.test(e.charAt(h-1))?(g*=Fae,v=e.slice(s,h-1).match(Gae),v&&s>0&&(g*=Math.pow(r1,v.length))):qae.test(e.charAt(h-1))?(g*=zae,C=e.slice(s,h-1).match(P6),C&&s>0&&(g*=Math.pow(r1,C.length))):(g*=Hae,s>0&&(g*=Math.pow(r1,h-s))),e.charAt(h)!==t.charAt(i)&&(g*=$ae)),(g<n1&&n.charAt(h-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(h-1)!==r.charAt(i))&&(x=xb(e,t,n,r,h+1,i+2,c),x*n1>g&&(g=x*n1)),g>y&&(y=g),h=n.indexOf(f,h+1);return c[u]=y,y}function B_(e){return e.toLowerCase().replace(P6," ")}function Kae(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,xb(e,t,B_(e),B_(t),0,0,{})}var Cf='[cmdk-group=""]',a1='[cmdk-group-items=""]',Zae='[cmdk-group-heading=""]',U6='[cmdk-item=""]',G_=`${U6}:not([aria-disabled="true"])`,vb="cmdk-item-select",_u="data-value",Yae=(e,t,n)=>Kae(e,t,n),z6=m.createContext(void 0),Hh=()=>m.useContext(z6),F6=m.createContext(void 0),P2=()=>m.useContext(F6),H6=m.createContext(void 0),$6=m.forwardRef((e,t)=>{let n=Nu(()=>{var U,F;return{search:"",value:(F=(U=e.value)!=null?U:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Nu(()=>new Set),s=Nu(()=>new Map),i=Nu(()=>new Map),c=Nu(()=>new Set),u=V6(e),{label:f,children:h,value:y,onValueChange:g,filter:x,shouldFilter:v,loop:C,disablePointerSelection:S=!1,vimBindings:w=!0,...R}=e,j=tr(),_=tr(),I=tr(),A=m.useRef(null),O=ose();xc(()=>{if(y!==void 0){let U=y.trim();n.current.value=U,T.emit()}},[y]),xc(()=>{O(6,G)},[]);let T=m.useMemo(()=>({subscribe:U=>(c.current.add(U),()=>c.current.delete(U)),snapshot:()=>n.current,setState:(U,F,W)=>{var X,ae,J,ce;if(!Object.is(n.current[U],F)){if(n.current[U]=F,U==="search")Z(),$(),O(1,K);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(I);ye?ye.focus():(X=document.getElementById(j))==null||X.focus()}if(O(7,()=>{var ye;n.current.selectedItemId=(ye=q())==null?void 0:ye.id,T.emit()}),W||O(5,G),((ae=u.current)==null?void 0:ae.value)!==void 0){let ye=F??"";(ce=(J=u.current).onValueChange)==null||ce.call(J,ye);return}}T.emit()}},emit:()=>{c.current.forEach(U=>U())}}),[]),D=m.useMemo(()=>({value:(U,F,W)=>{var X;F!==((X=i.current.get(U))==null?void 0:X.value)&&(i.current.set(U,{value:F,keywords:W}),n.current.filtered.items.set(U,L(F,W)),O(2,()=>{$(),T.emit()}))},item:(U,F)=>(r.current.add(U),F&&(s.current.has(F)?s.current.get(F).add(U):s.current.set(F,new Set([U]))),O(3,()=>{Z(),$(),n.current.value||K(),T.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let W=q();O(4,()=>{Z(),(W==null?void 0:W.getAttribute("id"))===U&&K(),T.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{i.current.delete(U),s.current.delete(U)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:j,inputId:I,labelId:_,listInnerRef:A}),[]);function L(U,F){var W,X;let ae=(X=(W=u.current)==null?void 0:W.filter)!=null?X:Yae;return U?ae(U,n.current.search,F):0}function $(){if(!n.current.search||u.current.shouldFilter===!1)return;let U=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(X=>{let ae=s.current.get(X),J=0;ae.forEach(ce=>{let ye=U.get(ce);J=Math.max(ye,J)}),F.push([X,J])});let W=A.current;z().sort((X,ae)=>{var J,ce;let ye=X.getAttribute("id"),Se=ae.getAttribute("id");return((J=U.get(Se))!=null?J:0)-((ce=U.get(ye))!=null?ce:0)}).forEach(X=>{let ae=X.closest(a1);ae?ae.appendChild(X.parentElement===ae?X:X.closest(`${a1} > *`)):W.appendChild(X.parentElement===W?X:X.closest(`${a1} > *`))}),F.sort((X,ae)=>ae[1]-X[1]).forEach(X=>{var ae;let J=(ae=A.current)==null?void 0:ae.querySelector(`${Cf}[${_u}="${encodeURIComponent(X[0])}"]`);J==null||J.parentElement.appendChild(J)})}function K(){let U=z().find(W=>W.getAttribute("aria-disabled")!=="true"),F=U==null?void 0:U.getAttribute(_u);T.setState("value",F||void 0)}function Z(){var U,F,W,X;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let J of r.current){let ce=(F=(U=i.current.get(J))==null?void 0:U.value)!=null?F:"",ye=(X=(W=i.current.get(J))==null?void 0:W.keywords)!=null?X:[],Se=L(ce,ye);n.current.filtered.items.set(J,Se),Se>0&&ae++}for(let[J,ce]of s.current)for(let ye of ce)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=ae}function G(){var U,F,W;let X=q();X&&(((U=X.parentElement)==null?void 0:U.firstChild)===X&&((W=(F=X.closest(Cf))==null?void 0:F.querySelector(Zae))==null||W.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function q(){var U;return(U=A.current)==null?void 0:U.querySelector(`${U6}[aria-selected="true"]`)}function z(){var U;return Array.from(((U=A.current)==null?void 0:U.querySelectorAll(G_))||[])}function M(U){let F=z()[U];F&&T.setState("value",F.getAttribute(_u))}function H(U){var F;let W=q(),X=z(),ae=X.findIndex(ce=>ce===W),J=X[ae+U];(F=u.current)!=null&&F.loop&&(J=ae+U<0?X[X.length-1]:ae+U===X.length?X[0]:X[ae+U]),J&&T.setState("value",J.getAttribute(_u))}function V(U){let F=q(),W=F==null?void 0:F.closest(Cf),X;for(;W&&!X;)W=U>0?ase(W,Cf):sse(W,Cf),X=W==null?void 0:W.querySelector(G_);X?T.setState("value",X.getAttribute(_u)):H(U)}let se=()=>M(z().length-1),ge=U=>{U.preventDefault(),U.metaKey?se():U.altKey?V(1):H(1)},P=U=>{U.preventDefault(),U.metaKey?M(0):U.altKey?V(-1):H(-1)};return m.createElement(Je.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:U=>{var F;(F=R.onKeyDown)==null||F.call(R,U);let W=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||W))switch(U.key){case"n":case"j":{w&&U.ctrlKey&&ge(U);break}case"ArrowDown":{ge(U);break}case"p":case"k":{w&&U.ctrlKey&&P(U);break}case"ArrowUp":{P(U);break}case"Home":{U.preventDefault(),M(0);break}case"End":{U.preventDefault(),se();break}case"Enter":{U.preventDefault();let X=q();if(X){let ae=new Event(vb);X.dispatchEvent(ae)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:lse},f),By(e,U=>m.createElement(F6.Provider,{value:T},m.createElement(z6.Provider,{value:D},U))))}),Wae=m.forwardRef((e,t)=>{var n,r;let s=tr(),i=m.useRef(null),c=m.useContext(H6),u=Hh(),f=V6(e),h=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;xc(()=>{if(!h)return u.item(s,c==null?void 0:c.id)},[h]);let y=B6(s,i,[e.value,e.children,i],e.keywords),g=P2(),x=gl(O=>O.value&&O.value===y.current),v=gl(O=>h||u.filter()===!1?!0:O.search?O.filtered.items.get(s)>0:!0);m.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(vb,C),()=>O.removeEventListener(vb,C)},[v,e.onSelect,e.disabled]);function C(){var O,T;S(),(T=(O=f.current).onSelect)==null||T.call(O,y.current)}function S(){g.setState("value",y.current,!0)}if(!v)return null;let{disabled:w,value:R,onSelect:j,forceMount:_,keywords:I,...A}=e;return m.createElement(Je.div,{ref:Wr(i,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!x,"data-disabled":!!w,"data-selected":!!x,onPointerMove:w||u.getDisablePointerSelection()?void 0:S,onClick:w?void 0:C},e.children)}),Xae=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,c=tr(),u=m.useRef(null),f=m.useRef(null),h=tr(),y=Hh(),g=gl(v=>s||y.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);xc(()=>y.group(c),[]),B6(c,u,[e.value,e.heading,f]);let x=m.useMemo(()=>({id:c,forceMount:s}),[s]);return m.createElement(Je.div,{ref:Wr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&m.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),By(e,v=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},m.createElement(H6.Provider,{value:x},v))))}),Qae=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),i=gl(c=>!c.search);return!n&&!i?null:m.createElement(Je.div,{ref:Wr(s,t),...r,"cmdk-separator":"",role:"separator"})}),Jae=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=P2(),c=gl(h=>h.search),u=gl(h=>h.selectedItemId),f=Hh();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(Je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":u,id:f.inputId,type:"text",value:s?e.value:c,onChange:h=>{s||i.setState("search",h.target.value),n==null||n(h.target.value)}})}),ese=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=m.useRef(null),c=m.useRef(null),u=gl(h=>h.selectedItemId),f=Hh();return m.useEffect(()=>{if(c.current&&i.current){let h=c.current,y=i.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=h.offsetHeight;y.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(g),x.unobserve(h)}}},[]),m.createElement(Je.div,{ref:Wr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},By(e,h=>m.createElement("div",{ref:Wr(c,f.listInnerRef),"cmdk-list-sizer":""},h)))}),tse=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return m.createElement(ty,{open:n,onOpenChange:r},m.createElement(ny,{container:c},m.createElement(ry,{"cmdk-overlay":"",className:s}),m.createElement(ay,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement($6,{ref:t,...u}))))}),nse=m.forwardRef((e,t)=>gl(n=>n.filtered.count===0)?m.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),rse=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return m.createElement(Je.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},By(e,c=>m.createElement("div",{"aria-hidden":!0},c)))}),vd=Object.assign($6,{List:ese,Item:Wae,Input:Jae,Group:Xae,Separator:Qae,Dialog:tse,Empty:nse,Loading:rse});function ase(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function sse(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function V6(e){let t=m.useRef(e);return xc(()=>{t.current=e}),t}var xc=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Nu(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function gl(e){let t=P2(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function B6(e,t,n,r=[]){let s=m.useRef(),i=Hh();return xc(()=>{var c;let u=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():s.current}})(),f=r.map(h=>h.trim());i.value(e,u,f),(c=t.current)==null||c.setAttribute(_u,u),s.current=u}),s}var ose=()=>{let[e,t]=m.useState(),n=Nu(()=>new Map);return xc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function ise(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function By({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(ise(t),{ref:t.ref},n(t.props.children)):n(t)}var lse={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function G6({className:e,...t}){return a.jsx(vd,{"data-slot":"command",className:oe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function q6({className:e,...t}){return a.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[a.jsx(Ec,{className:"size-4 shrink-0 opacity-50"}),a.jsx(vd.Input,{"data-slot":"command-input",className:oe("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 cse({className:e,...t}){return a.jsx(vd.List,{"data-slot":"command-list",className:oe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function K6({...e}){return a.jsx(vd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Z6({className:e,...t}){return a.jsx(vd.Group,{"data-slot":"command-group",className:oe("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 Y6({className:e,...t}){return a.jsx(vd.Item,{"data-slot":"command-item",className:oe("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})}function use(e){const t=dse(e),n=m.forwardRef((r,s)=>{const{children:i,...c}=r,u=m.Children.toArray(i),f=u.find(hse);if(f){const h=f.props.children,y=u.map(g=>g===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:g);return a.jsx(t,{...c,ref:s,children:m.isValidElement(h)?m.cloneElement(h,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function dse(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const c=pse(s),u=mse(i,s.props);return s.type!==m.Fragment&&(u.ref=r?Wr(r,c):c),m.cloneElement(s,u)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fse=Symbol("radix.slottable");function hse(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fse}function mse(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function pse(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 Gy="Popover",[W6]=wr(Gy,[So]),$h=So(),[gse,Il]=W6(Gy),X6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=$h(t),f=m.useRef(null),[h,y]=m.useState(!1),[g,x]=la({prop:r,defaultProp:s??!1,onChange:i,caller:Gy});return a.jsx(ud,{...u,children:a.jsx(gse,{scope:t,contentId:tr(),triggerRef:f,open:g,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:h,onCustomAnchorAdd:m.useCallback(()=>y(!0),[]),onCustomAnchorRemove:m.useCallback(()=>y(!1),[]),modal:c,children:n})})};X6.displayName=Gy;var Q6="PopoverAnchor",yse=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(Q6,n),i=$h(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return m.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(dd,{...i,...r,ref:t})});yse.displayName=Q6;var J6="PopoverTrigger",eI=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(J6,n),i=$h(n),c=mt(t,s.triggerRef),u=a.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sI(s.open),...r,ref:c,onClick:Oe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(dd,{asChild:!0,...i,children:u})});eI.displayName=J6;var U2="PopoverPortal",[xse,vse]=W6(U2,{forceMount:void 0}),tI=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Il(U2,t);return a.jsx(xse,{scope:t,forceMount:n,children:a.jsx($r,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};tI.displayName=U2;var rd="PopoverContent",nI=m.forwardRef((e,t)=>{const n=vse(rd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Il(rd,e.__scopePopover);return a.jsx($r,{present:r||i.open,children:i.modal?a.jsx(Sse,{...s,ref:t}):a.jsx(Cse,{...s,ref:t})})});nI.displayName=rd;var bse=use("PopoverContent.RemoveScroll"),Sse=m.forwardRef((e,t)=>{const n=Il(rd,e.__scopePopover),r=m.useRef(null),s=mt(t,r),i=m.useRef(!1);return m.useEffect(()=>{const c=r.current;if(c)return Jg(c)},[]),a.jsx(yh,{as:bse,allowPinchZoom:!0,children:a.jsx(rI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;i.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),Cse=m.forwardRef((e,t)=>{const n=Il(rd,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(rI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),rI=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:y,...g}=e,x=Il(rd,n),v=$h(n);return Xg(),a.jsx(gh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:y,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(vh,{"data-state":sI(x.open),role:"dialog",id:x.contentId,...v,...g,ref:t,style:{...g.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)"}})})})}),aI="PopoverClose",wse=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(aI,n);return a.jsx(Je.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})});wse.displayName=aI;var Ese="PopoverArrow",Rse=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=$h(n);return a.jsx(bh,{...s,...r,ref:t})});Rse.displayName=Ese;function sI(e){return e?"open":"closed"}var jse=X6,Tse=eI,_se=tI,Nse=nI;function z2({...e}){return a.jsx(jse,{"data-slot":"popover",...e})}function F2({...e}){return a.jsx(Tse,{"data-slot":"popover-trigger",...e})}function H2({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(_se,{children:a.jsx(Nse,{"data-slot":"popover-content",align:t,sideOffset:n,className:oe("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 $2({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:i,disabled:c=!1}){const[u,f]=m.useState(!1),[h,y]=m.useState(""),g=m.useMemo(()=>{const C={};return e.forEach(S=>{const w=S.group??"";Object.prototype.hasOwnProperty.call(C,w)||(C[w]=[]),C[w].push(S)}),C},[e]),x=e.find(C=>C.value===t),v=m.useCallback(C=>{n(C),requestAnimationFrame(()=>{y(""),f(!1)})},[n]);return a.jsxs(z2,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(F2,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":u,className:oe("w-full justify-between",!t&&"text-muted-foreground",i),disabled:c,children:[x?x.label:r,a.jsx(Xb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(H2,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(G6,{children:[a.jsx(q6,{placeholder:`Search ${r.toLowerCase()}...`,value:h,onValueChange:y}),a.jsx(K6,{children:s}),Object.entries(g).map(([C,S])=>a.jsx(Z6,{heading:C,children:S.map(w=>a.jsxs(Y6,{value:w.value,onSelect:()=>{v(w.value)},keywords:[w.label],children:[a.jsx(ia,{className:oe("mr-2 h-4 w-4",t===w.value?"opacity-100":"opacity-0")}),w.label]},w.value))},C||"default"))]})})]})}function Ase(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"service-account-details",children:[a.jsx(Yt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(dn,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Assign the ",a.jsx("strong",{children:"bigquery.dataEditor"})," and ",a.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Dse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"project-id-details",children:[a.jsx(Yt,{children:"How do I find my Project ID?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),a.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),a.jsxs("li",{children:["Find your project in the list. The ",a.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),a.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function Ose(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"gbq-location-details",children:[a.jsx(Yt,{children:"How do I find my dataset location?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),a.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),a.jsxs("li",{children:["Click each dataset name to open its details. The ",a.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",a.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),a.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."}),a.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const Ise=({form:e})=>{const[t,n]=m.useState(!1);if(e.watch("type")!==Re.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?oO(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Zr,{title:"Connection Settings",children:[a.jsx(_t,{control:e.control,name:"config.projectId",render:({field:u})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(Ct,{children:a.jsx(It,{...u,placeholder:"Enter a Project Id"})}),a.jsx(hn,{children:a.jsx(Dse,{})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:e.control,name:"config.location",render:({field:u})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(Ct,{children:a.jsx($2,{options:oX,value:u.value??"",onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(hn,{children:a.jsx(Ose,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Zr,{title:"Authentication",children:a.jsx(_t,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(Ct,{children:!t&&c?a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(dn,{href:c.url,children:c.email})}),a.jsx(Rt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Co,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(hn,{children:a.jsx(Ase,{})}),a.jsx(Mt,{})]})})})]})};function Mse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-region-details",children:[a.jsx(Yt,{children:"How do I find my Athena region?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),a.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),a.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function kse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-output-bucket-details",children:[a.jsx(Yt,{children:"How do I find a bucket?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",a.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),a.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),a.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),a.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function Lse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-access-key-id-details",children:[a.jsx(Yt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(Wt,{children:[a.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."}),a.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",a.jsx(dn,{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"}),"."]}),a.jsx(FA,{className:"my-4"}),a.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),a.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function Pse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-secret-access-key-details",children:[a.jsx(Yt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),a.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 Use=({form:e})=>{const[t,n]=m.useState("");return m.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")!==Re.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(Zr,{title:"Connection Settings",children:[a.jsx(_t,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(Ct,{children:a.jsx(It,{...r,placeholder:"Enter a region"})}),a.jsx(hn,{children:a.jsx(Mse,{})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(Ct,{children:a.jsx(It,{...r,placeholder:"Enter an output bucket"})}),a.jsx(hn,{children:a.jsx(kse,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Zr,{title:"Authentication",children:[a.jsx(_t,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(Ct,{children:a.jsx(It,{...r,placeholder:"Enter an access key id"})}),a.jsx(hn,{children:a.jsx(Lse,{})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(Ct,{children:a.jsx(It,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(hn,{children:a.jsx(Pse,{})}),a.jsx(Mt,{})]})})]})]})};function zse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-account-details",children:[a.jsx(Yt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx(dn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-region-and-locator-for-an-account",children:"Snowflake documentation"}),"."]}),a.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[a.jsx("li",{children:"Open the account selector and review the list of accounts that you previously signed in to."}),a.jsxs("li",{children:["Select ",a.jsx("strong",{children:"View account details"}),"."]}),a.jsxs("li",{children:["The ",a.jsx("strong",{children:"Account Details"})," dialog displays information about the account, including the account identifier and the account URL."]}),a.jsxs("li",{children:["Copy part of your account identifier from the ",a.jsx("strong",{children:"Account locator"})," field."]}),a.jsx("li",{children:"Find the region in the account selector (e.g. Europe West4 (Netherlands))."}),a.jsxs("li",{children:["Compare the found region with the ",a.jsx("strong",{children:"Account Identifier Region"})," in"," ",a.jsx(dn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/admin-account-identifier#non-vps-account-locator-formats-by-cloud-platform-and-region",children:"Snowflake documentation"})," ","for locator formats by cloud platform and region."]}),a.jsxs("li",{children:["Create the account identifier by combining the locator and the region like this:"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"locator.region"}),a.jsxs("div",{className:"mt-2",children:["Examples:",a.jsxs("ul",{className:"mt-1 ml-4 space-y-1",children:[a.jsx("li",{children:a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"xy12345.ap-northeast-3.aws"})}),a.jsx("li",{children:a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"xy12345.north-europe.azure"})})]})]})]})]}),a.jsxs("div",{className:"mt-4 text-sm",children:["More details in"," ",a.jsx(dn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function Fse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-warehouse-details",children:[a.jsx(Yt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"A warehouse in Snowflake is a cluster of compute resources that executes queries and performs data loading operations."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your warehouse:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:'Log in to your Snowflake account and navigate to the "Warehouses" section in the left sidebar.'}),a.jsx("li",{children:`You'll see a list of available warehouses. Common default names include "COMPUTE_WH" or "PROD_WH".`}),a.jsx("li",{children:"Select the warehouse you want to use for this connection. Make sure it has the appropriate size and auto-suspend settings for your workload."}),a.jsx("li",{children:`If you don't have a warehouse, you can create one using the "Create Warehouse" button or run: CREATE WAREHOUSE my_warehouse;`})]})]})]})})}function Hse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-auth-method-details",children:[a.jsx(Yt,{children:"Which authentication method should I choose?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Snowflake supports two authentication methods for programmatic access:"}),a.jsxs("div",{className:"space-y-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("strong",{className:"font-medium",children:"Username & Password:"}),a.jsx("p",{className:"mt-1",children:"The simplest method using your Snowflake username and password. Suitable for development and testing environments."})]}),a.jsxs("div",{children:[a.jsx("strong",{className:"font-medium",children:"Key Pair Authentication:"}),a.jsx("p",{className:"mt-1",children:"More secure method using public/private key cryptography. Recommended for production environments. You'll need to generate an RSA key pair and assign the public key to your Snowflake user."}),a.jsxs("p",{className:"mt-1",children:["Learn more about"," ",a.jsx(dn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function $se(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-username-details",children:[a.jsx(Yt,{children:"How do I find my Snowflake username?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Your Snowflake username is the login identifier for your Snowflake account."}),a.jsx("p",{className:"mb-2",children:"Here's what you need to know:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"Use the same username you use to log in to the Snowflake web interface."}),a.jsx("li",{children:"Snowflake usernames are case-insensitive and are typically in uppercase by default."}),a.jsx("li",{children:"If you're using SSO (Single Sign-On) for the web interface, you may need to create a separate user account with password authentication for programmatic access."}),a.jsx("li",{children:"You can view all users in your account by running: SHOW USERS; (requires appropriate privileges)"})]})]})]})})}function Vse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-password-details",children:[a.jsx(Yt,{children:"How do I manage my Snowflake password?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"Use the password associated with your Snowflake user account for authentication."}),a.jsx("p",{className:"mb-2",children:"Important security considerations:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"Your password must meet Snowflake's security requirements (minimum length, complexity, etc.)."}),a.jsx("li",{children:"If you've forgotten your password, a Snowflake administrator can reset it using: ALTER USER username SET PASSWORD = 'new_password';"}),a.jsxs("li",{children:["For production environments, consider using"," ",a.jsx(dn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Key-Pair authentication"})," ","instead of passwords for enhanced security."]}),a.jsx("li",{children:"Your password is encrypted and securely stored. It will never be displayed in plain text after saving."})]})]})]})})}function Bse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-keypair-details",children:[a.jsx(Yt,{children:"How do I set up key pair authentication?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To use key pair authentication, you need to generate an RSA key pair and configure your Snowflake user."}),a.jsx("p",{className:"mb-2",children:"Here's how to set it up:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Generate an RSA key pair using OpenSSL:",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt"})]}),a.jsxs("li",{children:["Extract the public key:",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub"})]}),a.jsxs("li",{children:["Assign the public key to your Snowflake user (run this in Snowflake as ACCOUNTADMIN):",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"ALTER USER your_username SET RSA_PUBLIC_KEY='MIIBIjANBg...';"})]}),a.jsx("li",{children:"Copy the private key content from rsa_key.p8 and paste it in the Private Key field above."})]}),a.jsxs("p",{className:"mt-2 text-xs",children:["For more details, see"," ",a.jsx(dn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function Gse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"snowflake-passphrase-details",children:[a.jsx(Yt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"A passphrase is an optional encryption password that protects your private key."}),a.jsx("p",{className:"mb-2",children:"Here's what you need to know:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"If you generated your private key with a passphrase (encrypted key), you must provide it here."}),a.jsx("li",{children:"If your private key is not encrypted (generated without the -nocrypt flag), leave this field empty."}),a.jsx("li",{children:"When generating an encrypted key with OpenSSL, you set the passphrase during the key generation process."}),a.jsx("li",{children:"The passphrase adds an extra layer of security by encrypting the private key file itself."}),a.jsx("li",{children:"This passphrase is only used to decrypt the private key and is never sent to Snowflake."})]})]})]})})}const qse=({form:e})=>{const t=e.watch("credentials.authMethod");return e.watch("type")!==Re.SNOWFLAKE?null:a.jsxs(a.Fragment,{children:[a.jsxs(Zr,{title:"Connection Settings",children:[a.jsx(_t,{control:e.control,name:"config.account",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter your Snowflake account identifier",children:"Account"}),a.jsx(Ct,{children:a.jsx(It,{...n,placeholder:"e.g., xy12345.us-east-1"})}),a.jsx(hn,{children:a.jsx(zse,{})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:e.control,name:"config.warehouse",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Specify the Snowflake warehouse to use for query execution",children:"Warehouse"}),a.jsx(Ct,{children:a.jsx(It,{...n,placeholder:"Enter warehouse name"})}),a.jsx(hn,{children:a.jsx(Fse,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Zr,{title:"Authentication",children:[a.jsx(_t,{control:e.control,name:"credentials.authMethod",render:({field:n})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{children:"Authentication Method"}),a.jsx(w2,{value:n.value,onValueChange:n.onChange,children:a.jsxs(E2,{children:[a.jsx(th,{value:Is.PASSWORD,children:"Username & Password"}),a.jsx(th,{value:Is.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(hn,{children:a.jsx(Hse,{})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:e.control,name:"credentials.username",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your Snowflake username",children:"Username"}),a.jsx(Ct,{children:a.jsx(It,{...n,placeholder:"Enter username"})}),a.jsx(hn,{children:a.jsx($se,{})}),a.jsx(Mt,{})]})}),t===Is.PASSWORD&&a.jsx(_t,{control:e.control,name:"credentials.password",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your Snowflake password",children:"Password"}),a.jsx(Ct,{children:a.jsx(It,{...n,type:"password",placeholder:"Enter password"})}),a.jsx(hn,{children:a.jsx(Vse,{})}),a.jsx(Mt,{})]})}),t===Is.KEY_PAIR&&a.jsxs(a.Fragment,{children:[a.jsx(_t,{control:e.control,name:"credentials.privateKey",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Paste your private key in PEM format",children:"Private Key"}),a.jsx(Ct,{children:a.jsx(Co,{...n,placeholder:`-----BEGIN PRIVATE KEY-----
|
|
794
|
-
...
|
|
795
|
-
-----END PRIVATE KEY-----`,rows:6})}),a.jsx(hn,{children:a.jsx(Bse,{})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:e.control,name:"credentials.privateKeyPassphrase",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the passphrase if your private key is encrypted",children:"Passphrase (Optional)"}),a.jsx(Ct,{children:a.jsx(It,{...n,type:"password",value:n.value??"",placeholder:"Enter passphrase if key is encrypted"})}),a.jsx(hn,{children:a.jsx(Gse,{})}),a.jsx(Mt,{})]})})]})]})]})},Kse=()=>a.jsx(a.Fragment,{children:a.jsx(vn,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(Zt,{value:"snowflake-setup",children:[a.jsx(Yt,{children:"How do I get started with Snowflake?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To use Snowflake as your storage provider, you'll need an active Snowflake account with appropriate permissions."}),a.jsx("p",{className:"mb-2",children:"Here's how to get started:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Sign up for a"," ",a.jsx(dn,{className:"underline",href:"https://signup.snowflake.com/",children:"Snowflake account"})," ","if you don't have one yet."]}),a.jsx("li",{children:"Make sure you have the necessary privileges to create and access databases, schemas, and warehouses."}),a.jsx("li",{children:"Choose your authentication method: Username & Password for quick setup, or Key-Pair authentication for production environments."}),a.jsx("li",{children:"Fill in the connection details below (account identifier and warehouse)."}),a.jsx("li",{children:"You can access tables using the full path format: database.schema.table (similar to BigQuery and Athena)."})]})]})]})})});function Zse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"bigquery-api-details",children:[a.jsx(Yt,{children:"How do I enable the BigQuery API?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(dn,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function Yse(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"athena-api-details",children:[a.jsx(Yt,{children:"How do I activate Athena API?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(dn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),a.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),a.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function Wse({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=wo({resolver:gi(DX),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,h=i("type");re.useEffect(()=>{r==null||r(u)},[u,r]);const y=async g=>{const{dirtyFields:x}=s.formState,v=sO(g);return x.credentials||delete v.credentials,t(v)};return a.jsx(Nl,{...s,children:a.jsxs(pi,{onSubmit:g=>{s.handleSubmit(y)(g)},noValidate:!0,children:[a.jsxs(Al,{children:[a.jsxs(Zr,{title:"General",children:[a.jsx(_t,{control:c,name:"title",render:({field:g})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(Ct,{children:a.jsx(It,{...g,placeholder:"Storage title"})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:c,name:"type",render:({field:g})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(Ct,{children:a.jsxs(ua,{value:g.value,onValueChange:g.onChange,disabled:!!e,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a storage type"})}),a.jsx(ha,{children:a.jsx(Py,{children:Cl.getAllTypes().map(({type:x,displayName:v,icon:C,status:S})=>a.jsx(Bn,{value:x,disabled:S===Wo.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C,{size:20}),v]})},x))})})]})}),a.jsxs(hn,{children:[h===Re.GOOGLE_BIGQUERY&&a.jsx(Zse,{}),h===Re.AWS_ATHENA&&a.jsx(Yse,{}),h===Re.SNOWFLAKE&&a.jsx(Kse,{})]}),a.jsx(Mt,{})]})})]}),h===Re.GOOGLE_BIGQUERY&&a.jsx(Ise,{form:s}),h===Re.AWS_ATHENA&&a.jsx(Use,{form:s}),h===Re.SNOWFLAKE&&a.jsx(qse,{form:s})]}),a.jsxs(Oc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!u||f,children:"Save"}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Ic(e){const[t,n]=m.useState(!1),[r,s]=m.useState(!1),i=m.useCallback(()=>{r?n(!0):e()},[r,e]),c=m.useCallback(()=>{n(!1),s(!1),e()},[e]),u=m.useCallback(h=>{s(h)},[]),f=m.useCallback(()=>{s(!1),e()},[e]);return{showUnsavedDialog:t,setShowUnsavedDialog:n,isDirty:r,handleClose:i,confirmClose:c,handleFormDirtyChange:u,handleFormSubmitSuccess:f}}function oI({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Uy(),{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:h,handleFormSubmitSuccess:y}=Ic(t),g=async v=>{if(n){const C=await s(n.id,v);C&&(r(C),y())}},x=m.useRef(!1);return m.useEffect(()=>{const v=n?"Edit":"Create";e&&!x.current?(Le({event:"data_storage_config_open",category:"DataStorage",action:v,label:n==null?void 0:n.type}),x.current=!0):!e&&x.current&&(Le({event:"data_storage_config_close",category:"DataStorage",action:v,label:n==null?void 0:n.type}),x.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:v=>{v||u()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsx(di,{children:"Configure Storage Provider"}),a.jsx(xl,{children:"Customize settings for your storage provider"})]}),a.jsx(Wse,{initialData:n??void 0,onSubmit:g,onCancel:u,onDirtyChange:h})]})}),a.jsx(Cr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const Xse=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=m.useState(!1),s=Cl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{if(!KD(e))return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(ph,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const h=(g,x)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),y=(g,x,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx(dn,{href:v,onClick:C=>{C.stopPropagation()},children:x})]});switch(e.type){case Re.GOOGLE_BIGQUERY:{const g=e.config.projectId,x=e.config.location,v=`https://console.cloud.google.com/bigquery?project=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[y("Project ID",g,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),h("Location",x)]})}case Re.AWS_ATHENA:{const g=e.config.region,x=e.config.outputBucket,v=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[h("Region",g),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Bucket",x,v)]})}case Re.SNOWFLAKE:{const g=e.config.account,x=e.config.warehouse;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[y("Account",g,"https://app.snowflake.com/"),a.jsx("span",{className:"text-muted-foreground",children:"•"}),h("Warehouse",x)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(yb,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(S2,{children:a.jsx(oI,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function Qse({initialType:e,onTypeSelect:t}){var c;const[n,r]=m.useState(e??null);m.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=u=>{r(u),t(u)},i=[{type:Be.SQL,label:"SQL",description:"SQL query"},{type:Be.TABLE,label:"Table",description:"Existing table"},{type:Be.VIEW,label:"View",description:"Existing view"},{type:Be.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Be.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return a.jsxs("div",{className:"dm-card-block",children:[a.jsx(Aa,{className:"text-foreground",children:"Definition Type"}),a.jsxs(ua,{value:n??"",onValueChange:u=>{s(u)},children:[a.jsx(fa,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(da,{placeholder:"Select definition type",children:n&&((c=i.find(u=>u.type===n))==null?void 0:c.label)})}),a.jsx(ha,{children:a.jsx(Py,{children:i.map(u=>a.jsxs(Bn,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const Jse=tn({definitionType:Vr(Be.SQL),definition:tn({sqlQuery:Dt().min(1,"SQL query is required")})}),eoe=e=>{const t=mO(e);return tn({definitionType:Vr(Be.TABLE),definition:t})},toe=e=>{const t=mO(e);return tn({definitionType:Vr(Be.VIEW),definition:t})},noe=e=>{const t=KQ(e);return tn({definitionType:Vr(Be.TABLE_PATTERN),definition:t})},roe=tn({definitionType:Vr(Be.CONNECTOR),definition:tn({connector:tn({source:tn({name:Dt().min(1,"Connector name is required"),configuration:Y1(qZ(BZ())).min(1,"At least one configuration is required"),node:Dt().min(1,"Node is required"),fields:Y1(Dt()).min(1,"At least one field is required")}),storage:tn({fullyQualifiedName:Dt().min(1,"fully qualified name is required")})})})}),aoe=(e,t)=>{if(!e)return tn({definitionType:KZ(by(Be)),definition:tn({}).optional()});switch(e){case Be.SQL:return Jse;case Be.TABLE:return eoe(t);case Be.VIEW:return toe(t);case Be.TABLE_PATTERN:return noe(t);case Be.CONNECTOR:return roe;default:return tn({})}};function soe({control:e}){return a.jsx(_t,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{className:"text-foreground",children:"SQL Query"}),a.jsx(Ct,{children:a.jsx(Uae,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(Mt,{})]})})}function ooe({control:e,storageType:t}){const n=WD(t),r=XD(t);return a.jsx(_t,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Fully Qualified Table Name"}),a.jsx(Ct,{children:a.jsx(It,{placeholder:n,value:s.value??"",onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(hn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function ioe({control:e,storageType:t}){const n=WD(t),r=XD(t);return a.jsx(_t,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Fully Qualified View Name"}),a.jsx(Ct,{children:a.jsx(It,{placeholder:n,value:s.value??"",onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(hn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function loe({control:e,storageType:t}){const n=UX(t),r=zX(t);return a.jsx(_t,{control:e,name:"definition.pattern",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Table Pattern"}),a.jsx(Ct,{children:a.jsx(It,{placeholder:n,value:s.value??"",onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(hn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}const V2=e=>{switch(e){case Be.SQL:return{sqlQuery:""};case Be.TABLE:return{fullyQualifiedName:""};case Be.VIEW:return{fullyQualifiedName:""};case Be.TABLE_PATTERN:return{pattern:""};case Be.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},coe=Cc("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 B2({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:oe(coe({variant:t}),e),...n})}function iI({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:oe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function G2({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:oe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function uoe({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return n?a.jsx(A2,{variant:"grid"}):r?a.jsxs(B2,{variant:"destructive",children:[a.jsx(hh,{className:"h-4 w-4"}),a.jsx(G2,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(ti,{children:[a.jsx(sl,{title:"Choose Connector",children:a.jsx(tre,{children:e.map(c=>a.jsx(nre,{icon:c.logoBase64?a.jsx(_c,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),i==null||i(c)}},c.name))})}),e.length===0&&a.jsx(ei,{icon:a.jsx(qf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function doe({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:h="Back",finishLabel:y="Save"}){const g=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(we,{className:"w-full",variant:"default",onClick:u,disabled:!n||s,children:y})}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[a.jsx("div",{className:"flex-1",children:r&&a.jsxs(we,{variant:"outline",onClick:c,disabled:s,children:[a.jsx(vP,{className:"h-4 w-4"}),h]})}),a.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),a.jsx("div",{className:"flex flex-1 justify-end",children:g?a.jsx(we,{variant:"default",onClick:u,disabled:!n||s,children:y}):a.jsxs(we,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(Da,{className:"h-4 w-4"})]})})]})}function oc({connector:e,size:t=24,variant:n="compact"}){return a.jsx(ei,{icon:a.jsx(_c,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function $u({label:e}){return a.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Yr,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(ri,{className:"h-4 w-4"})]})})})}const bb="**********";function foe({specification:e,configuration:t,onValueChange:n}){const{name:r,title:s}=e,i=s??r,c=r;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(It,{type:"checkbox",id:c,name:r,checked:t[r]||!1,onChange:u=>{n(r,u.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),a.jsx(Aa,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(Va,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function hoe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(It,{id:r,name:r,type:"number",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{const u=c.target.value,f=u===""?void 0:parseFloat(u);n(r,f)}})}function moe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(Co,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
796
|
-
`):Array.isArray(i)?i.join(`
|
|
797
|
-
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:u=>{const f=u.target.value.split(`
|
|
798
|
-
`).filter(h=>h.trim());n(r,f)}})}function poe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name,u=f=>{if(!f||typeof f!="string"&&typeof f!="number")return"";const h=typeof f=="string"?f:f.toString();try{const y=new Date(h);return isNaN(y.getTime())?"":y.toISOString().split("T")[0]}catch{return""}};return a.jsx(It,{id:r,name:r,type:"date",value:t[r]||u(i)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function goe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(It,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function yoe({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(Co,{id:s,name:s,value:t[s]&&typeof t[s]=="object"?JSON.stringify(t[s],null,2):typeof c=="object"?JSON.stringify(c,null,2):"",placeholder:i??`Enter ${r.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:u=>{try{const f=JSON.parse(u.target.value);n(s,f)}catch{n(s,u.target.value)}}})}function xoe({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const i=e.title??e.name,c=r&&!s;return a.jsx(It,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?bb:t[e.name]||"",...c?{readOnly:!0,disabled:!0}:{},...c?{}:{placeholder:e.placeholder??`Enter ${i.toLowerCase()}`},...c?{}:{onChange:u=>{n(e.name,u.target.value)}}})}function voe({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:i,default:c}=e,u=e.title??e.name,f=r.map(h=>({value:h,label:h}));return a.jsx($2,{options:f,value:t[s]||c||"",onValueChange:h=>{n(s,h)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function boe(){const e=m.useRef(new Lf),t=m.useCallback(async(s,i,c)=>await e.current.exchangeCredentials(s,{fieldPath:c,payload:i}),[]),n=m.useCallback(async(s,i)=>{try{return await e.current.checkOAuthStatus(s,i)}catch{return{valid:!1}}},[]),r=m.useCallback(async(s,i)=>await e.current.getOAuthSettings(s,i),[]);return{exchangeCredentials:t,checkStatus:n,getSettings:r}}let wf=null;function Soe({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=m.useState(!1),[f,h]=m.useState(!1),[y,g]=m.useState(null);m.useEffect(()=>{if(window.FB){h(!0);return}if(document.getElementById("facebook-jssdk")){const w=setInterval(()=>{window.FB&&(h(!0),clearInterval(w))},100);return()=>{clearInterval(w)}}if(!e)return;if(wf&&wf!==e){console.warn("Facebook SDK already initialized with different appId");return}wf??(wf=e),window.fbAsyncInit=function(){window.FB&&wf&&(window.FB.init({appId:wf,cookie:!0,xfbml:!0,version:"v23.0"}),h(!0))};const S=document.createElement("script");S.id="facebook-jssdk",S.src="https://connect.facebook.net/en_US/sdk.js",S.async=!0,S.defer=!0,S.crossOrigin="anonymous",document.body.appendChild(S)},[e]);const x=()=>{if(!window.FB||!f){const S=new Error("Facebook SDK not loaded or not ready");g(S.message),r==null||r(S);return}u(!0),g(null),window.FB.login(S=>{var w;if(S.status==="connected"&&S.authResponse){const{accessToken:R,expiresIn:j,userID:_}=S.authResponse;(w=window.FB)==null||w.api("/me?fields=name,email",I=>{const A={accessToken:R,expiresIn:j,userID:_,userName:I.name,userEmail:I.email};n(A),u(!1)})}else{const R=new Error("User cancelled login or did not fully authorize");g(R.message),r==null||r(R),u(!1)}},{scope:t})},v=s||c||!f,C=()=>c?"Connecting...":i||(f?"Continue with Facebook":"Loading...");return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(we,{type:"button",onClick:x,disabled:v,className:"flex items-center justify-center gap-2 rounded-md border-none bg-[#1877F2] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#166FE5] disabled:cursor-not-allowed disabled:opacity-60",children:[a.jsx("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"})}),C()]}),y&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:y})]})}function Coe({isLoading:e,status:t,settings:n,onOAuthSuccess:r}){const s=i=>{r({accessToken:i.accessToken})};return a.jsx("div",{className:"mt-2 mb-2",children:a.jsx(Soe,{appId:n==null?void 0:n.vars.AppId,scope:n==null?void 0:n.vars.Scopes,onSuccess:s,disabled:e,children:t!=null&&t.user?a.jsxs(a.Fragment,{children:["Authenticated as ",a.jsx("strong",{children:t.user.name??t.user.id})]}):"Continue with Facebook"})})}function lI({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,h]=m.useState(!1),[y,g]=m.useState(null),[x,v]=m.useState(null),[C,S]=m.useState(null),w=m.useMemo(()=>{const G=n[e.name],q=t!=null&&t.value&&G?G[t.value]:G;return q==null?void 0:q._source_credential_id},[n,e.name,t==null?void 0:t.value]),R=m.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),j=m.useMemo(()=>{const G=n[e.name];if(t!=null&&t.value&&G){const q=G[t.value];return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}return G&&typeof G=="object"&&!Array.isArray(G)?G:{}},[n,e.name,t==null?void 0:t.value]),_=m.useMemo(()=>{const G=j;return"_source_credential_id"in G?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(z=>z in G&&G[z]!==void 0&&G[z]!==""))},[j,t]),[I,A]=m.useState(_);m.useEffect(()=>{const G="_source_credential_id"in j,q=(t==null?void 0:t.items)&&Object.keys(t.items).some(z=>z in j&&j[z]!==void 0&&j[z]!=="");G&&I?A(!1):q&&!I&&A(!0)},[j,t,I]);const O=(G,q)=>{if(!(t!=null&&t.value))return;const z=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...z,[t.value]:{...typeof z[t.value]=="object"&&z[t.value]!==null?z[t.value]:{},[G]:q}})},{checkStatus:T,getSettings:D,exchangeCredentials:L}=boe(),$=async G=>{try{h(!0),S(null);const q=await L(s,G,R),z=n[e.name];t?r(e.name,{...z,[t.value]:{_source_credential_id:q.credentialId}}):r(e.name,{_source_credential_id:q.credentialId})}catch(q){const z=q instanceof Error?q.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",q),S(z)}finally{h(!1)}};m.useEffect(()=>{if(!w){g(null),h(!1);return}let G=!1;return(async()=>{try{h(!0);const z=await T(s,w);G||g(z)}catch(z){G||(console.error("Failed to validate credentials:",z),g({valid:!1}))}finally{G||h(!1)}})(),()=>{G=!0}},[w,s,T]),m.useEffect(()=>{(async()=>{try{const q=await D(s,R);v(q)}catch(q){console.error("Failed to fetch settings:",q),v(null)}})()},[s,R,D]);const K=!!(x!=null&&x.isEnabled);if((I||!K)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([G,q])=>{const z=Array.isArray(q.attributes)?q.attributes.includes("SECRET")&&j[G]!==void 0:!1,M=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Va,{htmlFor:G,required:q.required,tooltip:q.description,className:"mb-2 justify-start",children:q.title??G}),z&&u&&i&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!M)},children:M?"Cancel":"Edit"})]}),q2({specification:{...q,name:G},configuration:j,onValueChange:(H,V)=>{O(H,V)},flags:{isEditingExisting:u,isSecret:z,isSecretEditing:M},connectorName:s})]},G)}),K&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!1),h(!1)},className:"px-0",children:"Back to OAuth"})]});const Z=(()=>{switch(s){case"FacebookMarketing":return a.jsx(Coe,{isLoading:f,status:y,settings:x,onOAuthSuccess:$});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[Z,C&&a.jsx("div",{className:"text-destructive text-sm",children:C}),(t==null?void 0:t.items)&&Object.keys(t.items).length>0&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!0)},className:"px-0",children:"Manually"})]})}function q2({specification:e,configuration:t,onValueChange:n,flags:r,connectorName:s}){const{requiredType:i,options:c}=e,{isSecret:u=!1,isEditingExisting:f=!1,isSecretEditing:h=!1}=r??{};if(e.attributes&&Array.isArray(e.attributes)&&e.attributes.includes("OAUTH_FLOW"))return a.jsx(lI,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(xoe,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:h});if(c&&c.length>0)return a.jsx(voe,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case _s.BOOLEAN:return a.jsx(foe,{specification:e,configuration:t,onValueChange:n});case _s.NUMBER:return a.jsx(hoe,{specification:e,configuration:t,onValueChange:n});case _s.ARRAY:return a.jsx(moe,{specification:e,configuration:t,onValueChange:n});case _s.OBJECT:return a.jsx(yoe,{specification:e,configuration:t,onValueChange:n});case _s.DATE:return a.jsx(poe,{specification:e,configuration:t,onValueChange:n});case _s.STRING:default:return a.jsx(goe,{specification:e,configuration:t,onValueChange:n})}}function woe({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(Gi,{children:[e.requiredType!==_s.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Va,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),q2({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function Eoe({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=m.useMemo(()=>{var v,C;const x=t[e.name];if(x&&typeof x=="object"){const S=Object.keys(x);if(S.length>0)return S[0]}return((C=(v=e.oneOf)==null?void 0:v[0])==null?void 0:C.value)??""},[t,e.name,e.oneOf]),[f,h]=m.useState(u);if(m.useEffect(()=>{h(u)},[u]),m.useEffect(()=>{if(f){const x=t[e.name];x&&typeof x=="object"&&f in x||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const y=x=>{h(x)},g=(x,v,C)=>{const S=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[x]:{...typeof S[x]=="object"&&S[x]!==null?S[x]:{},[v]:C}})};return a.jsx(ere,{label:e.title??e.name,options:e.oneOf.map(x=>({value:x.value,label:x.label})),value:f,onValueChange:y,children:e.oneOf.map(x=>{const v=x.attributes&&Array.isArray(x.attributes)&&x.attributes.includes("OAUTH_FLOW");return a.jsx($ne,{value:x.value,children:v?a.jsx(lI,{specification:e,option:x,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:i,secretEditing:{[e.name]:s},isEditingExisting:r}):Object.entries(x.items).map(([C,S])=>{const w=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(S.attributes)&&Object.keys(w)[0]===x.value?S.attributes.includes("SECRET"):!1,j=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},_=typeof j[x.value]=="object"&&j[x.value]!==null?j[x.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Va,{htmlFor:C,required:S.required,tooltip:S.description,className:"mb-2 justify-start",children:C}),R&&r&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),q2({specification:{...S,name:C},configuration:_,onValueChange:(I,A)=>{g(x.value,I,A)},flags:{isEditingExisting:r,isSecret:R,isSecretEditing:s},connectorName:c})]},C)})},x.value)})},e.name)}function q_(e,t,n,r,s,i,c){return e.map(u=>{const f=Array.isArray(u.attributes)?u.attributes.includes("SECRET"):!1,h=s[u.name];return u.oneOf&&u.requiredType===_s.OBJECT?a.jsx(Eoe,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:h,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(woe,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:h,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function K_({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx(m6,{title:e,children:q_(t,n,r,s,i,c,u)}):q_(t,n,r,s,i,c,u)}function Roe({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=m.useState([]),[i,c]=m.useState(!1),[u,f]=m.useState(!1),h=m.useCallback(async()=>{c(!0);try{const x=await En.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);m.useEffect(()=>{u&&h()},[u,h]);const y=(x,v)=>{const C=v._id;if(!C){console.error("Configuration does not have _id field");return}t({dataMartId:x.id,dataMartTitle:x.title,configId:C,configuration:v}),f(!1)},g=x=>{const C=[],S=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},w=(R,j,_=0,I=!0)=>{if(R.startsWith("_")||I&&_===0&&!S(R))return;let A=null;if(j==null)A="N/A";else if(typeof j=="string")A=j;else if(typeof j=="number"||typeof j=="boolean")A=String(j);else if(Array.isArray(j))A=JSON.stringify(j);else if(typeof j=="object"){C.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([O,T])=>{w(O,T,_+1,!1)}),C.push({key:"",value:"}",indent:_});return}else A=JSON.stringify(j);C.push({key:R,value:A,indent:_})};for(const[R,j]of Object.entries(x))w(R,j);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:C.map(({key:R,value:j,indent:_},I)=>a.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&a.jsxs("span",{className:"font-medium",children:[R,":"]}),a.jsx("span",{className:"text-muted-foreground truncate",title:j,children:j})]},I))})};return a.jsx(Ka,{children:a.jsxs(_r,{open:u,onOpenChange:f,children:[a.jsx(Nr,{asChild:!0,children:a.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),a.jsx(Da,{className:oe("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",u&&"rotate-90")})]})}),a.jsx(Ar,{side:"bottom",align:"end",className:"w-72",children:i?a.jsx(Nt,{disabled:!0,children:"Loading…"}):r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[a.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:a.jsx(zU,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),a.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),a.jsx("div",{children:r.map(x=>{const C=x.definition.connector.source.configuration;return C.length===0?null:C.length===1?a.jsxs(wt,{delayDuration:300,children:[a.jsx(Et,{asChild:!0,children:a.jsxs(Nt,{onSelect:()=>{y(x,C[0])},children:[a.jsx(eg,{className:"text-foreground h-4 w-4"}),x.title]})}),a.jsx(Rt,{side:"right",className:"max-w-sm",children:g(C[0])})]},x.id):a.jsxs(jS,{children:[a.jsxs(TS,{className:"flex items-center gap-2",children:[a.jsx(eg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:x.title})]}),a.jsx(_S,{children:C.map((S,w)=>a.jsxs(wt,{delayDuration:300,children:[a.jsx(Et,{asChild:!0,children:a.jsxs(Nt,{onSelect:()=>{y(x,S)},children:["Configuration ",w+1]})}),a.jsx(Rt,{side:"right",className:"max-w-sm",children:g(S)})]},w))})]},x.id)})})]})})]})})}function Z_({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:i=!1,isEditingExisting:c=!1}){const[u,f]=m.useState({}),h=m.useRef(!1),y=m.useRef(!1),[g,x]=m.useState({});m.useEffect(()=>{if(t){y.current=!0;const O={...s??{}};t.forEach(T=>{const D=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;O[T.name]===void 0&&T.default!==void 0&&(O[T.name]=T.default),c&&D&&(O[T.name]=bb)}),f(O),h.current=!0,setTimeout(()=>{y.current=!1},0)}},[t,s,c]),m.useEffect(()=>{h.current&&s&&Object.keys(s).length>0&&(y.current=!0,f({...s}),setTimeout(()=>{y.current=!1},0))},[s]),m.useEffect(()=>{h.current&&!y.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(O,T)=>{f(D=>({...D,[O]:T}))},C=m.useCallback(O=>!(O==null||typeof O=="string"&&O.trim()===""||typeof O=="number"&&isNaN(O)||Array.isArray(O)&&O.length===0),[]),S=m.useCallback((O,T)=>{var L,$;if(typeof O!="object"||O===null)return C(O);if((L=T.attributes)!=null&&L.includes("OAUTH_FLOW")&&"_source_credential_id"in O)return!0;const D=($=T.oneOf)==null?void 0:$.filter(K=>K.value===Object.keys(O)[0]);return D?D.every(K=>{var Z;if((Z=K.attributes)!=null&&Z.includes("OAUTH_FLOW")){const G=O[K.value];if(typeof G=="object"&&G!==null){if("_source_credential_id"in G)return!0;const q=Object.entries(K.items).filter(([,z])=>z.required);if(q.length>0)return q.every(([z])=>{const M=G[z];return C(M)})}return!1}return Object.entries(K.items).every(([,G])=>K.value in O?S(O[K.value],G):!1)}):C(O[T.name])},[C]),w=m.useCallback((O,T)=>{const D=T.filter(Z=>Z.required&&Z.oneOf),L=D.length===0?!0:D.some(Z=>S(O[Z.name],Z)),K=T.filter(Z=>Z.required&&Z.name!=="Fields").every(Z=>C(O[Z.name]));return L&&K},[C,S]),R=(O,T)=>{x(D=>({...D,[O]:T})),f(T?D=>({...D,[O]:""}):D=>({...D,[O]:bb}))},j=O=>{const T={...u};Object.entries(O.configuration).forEach(([D,L])=>{["_id","_copiedFrom"].includes(D)||(T[D]=L)}),T._copiedFrom={dataMartId:O.dataMartId,dataMartTitle:O.dataMartTitle,configId:O.configId},f(T)};if(m.useEffect(()=>{if(t&&r){const O=w(u,t);r(O)}},[u,t,r,w]),i)return a.jsx(A2,{variant:"list"});if(!t||t.length===0)return a.jsxs(ti,{children:[a.jsx(oc,{connector:e}),a.jsx(ei,{icon:a.jsx(qf,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx($u,{label:"Need configuration?"})]});const _=[...t].filter(O=>{var T;return O.name!=="Fields"&&!((T=O.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((O,T)=>{const D=L=>{const $=L.default!=null&&L.default!=="";return L.required&&!$?1:L.required&&$?2:!L.required&&!$?3:4};return D(O)-D(T)}),I=_.filter(O=>{var T;return!((T=O.attributes)!=null&&T.includes("ADVANCED"))}),A=_.filter(O=>{var T;return(T=O.attributes)==null?void 0:T.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(ti,{children:[a.jsx(oc,{connector:e}),a.jsxs(sl,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),a.jsx(Roe,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),I.length>0&&a.jsx(K_,{items:I,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name}),A.length>0&&a.jsx(K_,{collapsibleTitle:"Advanced Settings",items:A,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name})]})]})})}function joe({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:i}){const c=r?`Select data for ${r}`:"Select data";return s?a.jsx(A2,{variant:"list"}):!t||t.length===0?a.jsxs(ti,{children:[a.jsx(oc,{connector:e}),a.jsx(ei,{icon:a.jsx(qf,{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."}),a.jsx($u,{label:"Missing some data?"})]}):a.jsxs(ti,{children:[a.jsx(oc,{connector:e}),a.jsxs(sl,{title:c,children:[t.map(u=>a.jsx(p6,{type:"radio",id:u.name,name:"selectedField",value:u.name,label:u.overview??u.name,checked:n===u.name,onChange:f=>{i(f)},tooltip:u.name&&a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Table name:"})," ",u.destinationName??u.name]}),u.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",u.description]}),u.documentation&&a.jsxs(Yr,{to:u.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",a.jsx(Da,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name)),a.jsx($u,{label:"Missing some data?"})]})]})}var no=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(no||{});function Y_({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const i=m.useRef(null),[c,u]=m.useState(""),[f,h]=m.useState(no.ORIGINAL),y=t==null?void 0:t.find(R=>R.name===n),g=m.useMemo(()=>(y==null?void 0:y.fields)??[],[y==null?void 0:y.fields]),x=m.useMemo(()=>(y==null?void 0:y.uniqueKeys)??[],[y==null?void 0:y.uniqueKeys]),v=m.useMemo(()=>{const R=new Map;return g.forEach((j,_)=>R.set(j.name,_)),R},[g]),C=m.useMemo(()=>{const R=g.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,I)=>{const A=x.includes(_.name),O=x.includes(I.name);if(A&&!O)return-1;if(!A&&O)return 1;if(f===no.ASC)return _.name.localeCompare(I.name);if(f===no.DESC)return I.name.localeCompare(_.name);const T=v.get(_.name)??0,D=v.get(I.name)??0;return T-D};return[...R].sort(j)},[g,c,x,f,v]),S=g.map(R=>R.name),w=r.filter(R=>S.includes(R)).length;return m.useEffect(()=>{if(x.length>0){const R=x.filter(j=>g.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{s(j,!0)})}},[n,x,g,r,s]),m.useEffect(()=>{const R=j=>{const I=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",A=document.activeElement.tagName;if(!(A==="INPUT"||A==="TEXTAREA")&&I){j.preventDefault();const O=g.map(L=>L.name),D=O.filter(L=>!r.includes(L)).length>0;O.forEach(L=>{s(L,D)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[g,r,s]),!n||!t?a.jsxs(ti,{children:[a.jsx(oc,{connector:e}),a.jsx(ei,{icon:a.jsx(qf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx($u,{label:"Need fields?"})]}):g.length?a.jsx(ti,{children:a.jsxs(a.Fragment,{children:[a.jsx(oc,{connector:e}),a.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Ec,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=i.current)==null||R.focus()}}),a.jsx("input",{ref:i,type:"text",placeholder:"Search field",value:c,onChange:R=>{u(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&a.jsx("button",{type:"button",onClick:()=>{u("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:a.jsx(Zu,{className:"h-4 w-4"})})]}),a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===no.ASC&&a.jsx(qj,{className:"text-muted-foreground h-4 w-4"}),f===no.DESC&&a.jsx(Gj,{className:"text-muted-foreground h-4 w-4"}),f===no.ORIGINAL&&a.jsx(Kj,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(Ar,{align:"end",children:[a.jsxs(Nt,{onSelect:()=>{h(no.ASC)},children:[a.jsx(qj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(Nt,{onSelect:()=>{h(no.DESC)},children:[a.jsx(Gj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(Nt,{onSelect:()=>{h(no.ORIGINAL)},children:[a.jsx(Kj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(sl,{title:`Selected ${String(w)} of ${String(S.length)} fields for "${n}" data`,children:[C.map(R=>{const j=x.includes(R.name);return a.jsx(p6,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||j,disabled:j,onChange:_=>{s(R.name,_)},label:R.name,tooltip:a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[j&&a.jsxs("p",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Unique key"})," ",a.jsx(T1,{className:"text-secondary h-3 w-3"})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:j?a.jsx(T1,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),C.length===0&&c&&a.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),a.jsx($u,{label:"Need another field?"})]})]})}):a.jsxs(ti,{children:[a.jsx(oc,{connector:e}),a.jsx(ei,{icon:a.jsx(qf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx($u,{label:"Need fields?"})]})}const cI=m.createContext(void 0),uI={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Toe(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 uI;default:return e}}class _oe extends Sl{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 ro=new _oe;var zn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(zn||{});const ol={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class Sb{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!==zn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Zo.getReportById(n.reportId),s=Jl(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:zn.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 Noe{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:zn.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 s1={getMapper(e){switch(e){case zn.REPORT_RUN:return new Sb;case zn.CONNECTOR_RUN:return new Noe;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Ef={mapFromDto(e){return s1.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 zn.REPORT_RUN:return new Sb().enhanceWithReportData(n);case zn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new Sb,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===zn.REPORT_RUN),i=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case zn.REPORT_RUN:return i.find(u=>u.id===c.id)??c;case zn.CONNECTOR_RUN:{const u=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:u}}}default:return c}})},mapToCreateRequest(e){return s1.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return s1.getMapper(e.type).mapToUpdateRequest(e)}};function Aoe({children:e}){const[t,n]=m.useReducer(Toe,uI),{dataMart:r}=xs(),{fetchAvailableConnectors:s}=Dc();if(!r)throw new Error("Trigger provider must be used within a data mart context");const i=m.useCallback(async v=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const C=await ro.getScheduledTriggers(v),S=await Ef.mapFromDtoListWithReportData(C,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:S})}catch(C){const S=C instanceof Error?C.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:S}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:S})}},[r,s]),c=m.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGERS_START"});try{const w=(await ro.getScheduledTriggers(v)).filter(j=>j.type===C),R=await Ef.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(S){const w=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:w}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:w})}},[r]),u=m.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGER_START"});try{const S=await ro.getScheduledTrigger(v,C),w=await Ef.mapFromDtoWithReportData(S,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:w})}catch(S){const w=S instanceof Error?S.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:w}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:w})}},[r]),f=m.useCallback(async(v,C,S,w,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:C,cronExpression:S,timeZone:w,isActive:R,triggerConfig:j},I=await ro.createScheduledTrigger(v,_),A=await Ef.mapFromDtoWithReportData(I,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Le({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:C}),An.success("Trigger created"),A}catch(_){const I=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:I}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:I}),_}},[r]),h=m.useCallback(async(v,C,S,w,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:S,timeZone:w,isActive:R},_=await ro.updateScheduledTrigger(v,C,j),I=await Ef.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:I}),Le({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:I.type}),An.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),y=m.useCallback(async(v,C)=>{n({type:"DELETE_TRIGGER_START"});try{await ro.deleteScheduledTrigger(v,C),n({type:"DELETE_TRIGGER_SUCCESS",payload:C}),Le({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:C}),An.success("Trigger deleted")}catch(S){const w=S instanceof Error?S.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:w}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:w}),S}},[]),g=m.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),x=m.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(cI.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:h,deleteScheduledTrigger:y,selectScheduledTrigger:g,reset:x},children:e})}function dI(){const e=m.useContext(cI);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function Doe(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:h,selectedTrigger:y,isLoading:g,error:x}=dI();return m.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:h,selectedTrigger:y,isLoading:g,error:x,getScheduledTriggers:v=>t(v),getScheduledTriggersByType:(v,C)=>n(v,C),getScheduledTrigger:(v,C)=>r(v,C),createScheduledTrigger:(v,C,S,w,R,j)=>s(v,C,S,w,R,j),updateScheduledTrigger:(v,C,S,w,R)=>i(v,C,S,w,R),deleteScheduledTrigger:(v,C)=>c(v,C),selectScheduledTrigger:u}}const Ooe=tn({type:Vr(ol.SCHEDULED_REPORT_RUN),reportId:Dt().min(1,"Report ID is required")}),Ioe=VZ(),Moe=tn({type:by(zn),cronExpression:Dt().min(1,"Cron expression is required"),timeZone:Dt().min(1,"Time zone is required"),isActive:$Z(),triggerConfig:GZ([Ooe,Ioe])});function koe({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=wo({resolver:gi(Moe),defaultValues:{type:e?e.type:n??zn.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:ol.SCHEDULED_REPORT_RUN,reportId:t??""}}});m.useEffect(()=>{t&&s.getValues("type")===zn.REPORT_RUN&&s.setValue("triggerConfig",{type:ol.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),m.useEffect(()=>{n&&(s.setValue("type",n),n===zn.REPORT_RUN?s.setValue("triggerConfig",{type:ol.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const i=u=>{s.setValue("type",u),u===zn.REPORT_RUN?s.setValue("triggerConfig",{type:ol.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async u=>{try{await r(u)}catch(f){console.error("Error submitting form:",f)}};return{form:s,handleTypeChange:i,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}const Loe=[Ae.GOOGLE_SHEETS,Ae.EMAIL,Ae.SLACK,Ae.MS_TEAMS,Ae.GOOGLE_CHAT];function Poe({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=Ja(),{dataMart:i}=xs();m.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>Loe.includes(u.dataDestination.type));return a.jsxs(ua,{value:e,onValueChange:t,disabled:n,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a report"})}),a.jsx(ha,{children:c.map(u=>{const f=sa.getInfo(u.dataDestination.type).icon;return a.jsx(Bn,{value:u.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(f,{className:"h-4 w-4",size:16}),a.jsx("span",{children:u.title})]})},u.id)})})]})}var qy="Switch",[Uoe]=wr(qy),[zoe,Foe]=Uoe(qy),fI=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:h,form:y,...g}=e,[x,v]=m.useState(null),C=mt(t,_=>v(_)),S=m.useRef(!1),w=x?y||!!x.closest("form"):!0,[R,j]=la({prop:s,defaultProp:i??!1,onChange:h,caller:qy});return a.jsxs(zoe,{scope:n,checked:R,disabled:u,children:[a.jsx(Je.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":gI(R),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:C,onClick:Oe(e.onClick,_=>{j(I=>!I),w&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),w&&a.jsx(pI,{control:x,bubbles:!S.current,name:r,value:f,checked:R,required:c,disabled:u,form:y,style:{transform:"translateX(-100%)"}})]})});fI.displayName=qy;var hI="SwitchThumb",mI=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Foe(hI,n);return a.jsx(Je.span,{"data-state":gI(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});mI.displayName=hI;var Hoe="SwitchBubbleInput",pI=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=m.useRef(null),u=mt(c,i),f=v2(n),h=hS(t);return m.useEffect(()=>{const y=c.current;if(!y)return;const g=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(g,"checked").set;if(f!==n&&v){const C=new Event("click",{bubbles:r});v.call(y,n),y.dispatchEvent(C)}},[f,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:u,style:{...s.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});pI.displayName=Hoe;function gI(e){return e?"checked":"unchecked"}var $oe=fI,Voe=mI;function K2({className:e,...t}){return a.jsx($oe,{"data-slot":"switch",className:oe("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 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 dark:data-[state=unchecked]:bg-white/16",e),...t,children:a.jsx(Voe,{"data-slot":"switch-thumb",className:oe("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 Boe(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 Cb(e,t="UTC"){const n=Boe(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:i,month:c,dayOfWeek:u}=n;if(r.startsWith("*/")&&s==="*"&&i==="*"&&c==="*"&&u==="*"){const g=Number.parseInt(r.substring(2));if(!isNaN(g))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:g,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&i==="*"&&c==="*"&&u==="*"){const g=Number.parseInt(s.substring(2));if(!isNaN(g)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:g,timezone:t}}const f=Number.parseInt(r),h=Number.parseInt(s),y=!isNaN(f)&&!isNaN(h)?`${h.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(h)&&i==="*"&&c==="*"&&u==="*")return{type:"daily",time:y,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(f)&&!isNaN(h)&&i==="*"&&c==="*"&&u!=="*"){const g=u.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(g.length>0)return{type:"weekly",time:y,weekdays:g,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(h)&&i!=="*"&&c==="*"&&u==="*"){const g=i.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(g.length>0)return{type:"monthly",time:y,weekdays:[1,2,3,4,5],monthDays:g,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 yI({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:i=3}){const[c,u]=m.useState(!1),f=g=>{const x=t.includes(g)?t.filter(v=>v!==g):[...t,g].sort((v,C)=>v-C);n(x)},h=(g,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(v=>v!==g))},y=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const g=t.map(x=>e.find(v=>v.value===x)).filter(Boolean);return g.length<=i?a.jsx("div",{className:"flex flex-wrap gap-1",children:g.map(x=>a.jsxs(jr,{variant:"secondary",className:"h-5 text-xs",children:[x.label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:v=>h(x.value,v),children:a.jsx(Zu,{className:"h-2 w-2"})})]},x.value))}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(jr,{variant:"secondary",className:"h-5 text-xs",children:[g[0].label,a.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=>h(g[0].value,x),children:a.jsx(Zu,{className:"h-2 w-2"})})]}),g.length>1&&a.jsxs(jr,{variant:"outline",className:"h-5 text-xs",children:["+",g.length-1]})]})};return a.jsxs(z2,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(F2,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[a.jsx("div",{className:"flex-1 text-left",children:y()}),a.jsx(Xb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(H2,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(G6,{className:"h-full overflow-visible",children:[a.jsx(q6,{placeholder:s,className:"h-8"}),a.jsxs(cse,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(K6,{children:"No items found."}),a.jsx(Z6,{className:"h-full overflow-visible",children:e.map(g=>a.jsxs(Y6,{value:g.value.toString(),onSelect:()=>f(g.value),className:"text-sm",children:[a.jsx(ia,{className:oe("mr-2 h-3 w-3",t.includes(g.value)?"opacity-100":"opacity-0")}),g.label]},g.value))})]})]})})]})}const xI=[{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"}],Ap=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function vI(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 i;return(i=xI.find(c=>c.value===s))==null?void 0:i.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,u)=>c-u).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 Goe(e,t,n=!0){const r=Cb(e,t);return vI(r,n)}const qoe=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),wb=[5,10,15,30],Eb=[1,2,3,4,6,8,12],Koe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Type"}),a.jsxs(ua,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:"daily",children:"Daily"}),a.jsx(Bn,{value:"weekly",children:"Weekly"}),a.jsx(Bn,{value:"monthly",children:"Monthly"}),a.jsx(Bn,{value:"interval",children:"Interval"})]})]})]}),Zoe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(It,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),W_=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Aa,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx($2,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),Yoe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(yI,{options:xI,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),Woe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(yI,{options:qoe,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),Xoe=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Type"}),a.jsxs(ua,{value:e,onValueChange:i=>{n(i)},disabled:s,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:"minutes",children:"Minutes"}),a.jsx(Bn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Every"}),a.jsxs(ua,{value:t.toString(),onValueChange:i=>{r(Number.parseInt(i)||1)},disabled:s,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsx(ha,{children:(e==="minutes"?wb:Eb).map(i=>a.jsxs(Bn,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),Qoe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Aa,{className:"text-sm",children:"Cron Expression"}),a.jsx(It,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),a.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function Rb({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:i=!0,showSaveButton:c=!1,hideEnableSwitch:u=!1}){const[f,h]=m.useState(n),[y,g]=m.useState(t??Ap()),[x,v]=m.useState(!1),C=m.useMemo(()=>hW.getTimezonesWithOffset().map(z=>({value:z.identifier,label:z.displayName,offset:z.offsetString,isDST:z.isDST})),[]),[S,w]=m.useState(()=>Cb(e,y)),[R,j]=m.useState(""),[_,I]=m.useState("");m.useEffect(()=>{h(n)},[n]),m.useEffect(()=>{const z=t??Ap();g(z)},[t]),m.useEffect(()=>{if(e){const z=Cb(e,y);w(z)}},[e,y]);const A=z=>{const[M,H]=z.time.split(":").map(Number);switch(z.type){case"daily":return`${String(H)} ${String(M)} * * *`;case"weekly":return`${String(H)} ${String(M)} * * ${z.weekdays.join(",")}`;case"monthly":return`${String(H)} ${String(M)} ${z.monthDays.join(",")} * *`;case"interval":return z.intervalType==="minutes"?`*/${String(z.intervalValue)} * * * *`:`0 */${String(z.intervalValue)} * * *`;case"custom":return z.customCron;default:return`${String(H)} ${String(M)} * * *`}},O=m.useCallback(z=>{w(M=>{if(M.intervalType===z)return console.log("Type unchanged, skipping update"),M;const V=(z==="minutes"?wb:Eb)[0];return{...M,intervalType:z,intervalValue:V}})},[]),T=m.useCallback(z=>{w(M=>(M.intervalType==="minutes"?wb:Eb).includes(z)?{...M,intervalValue:z}:M)},[]),D=m.useMemo(()=>z=>vI(z,f),[f]);m.useEffect(()=>{const z=A(S);j(z),I(D(S))},[S,f,y,D]);const L=m.useRef(""),$=m.useRef(""),K=m.useRef(!1);m.useEffect(()=>{const z=A(S);r&&(L.current!==z||$.current!==y||K.current!==f)&&(r({cron:z,timezone:y,enabled:f}),L.current=z,$.current=y,K.current=f)},[S,y,f,r]);const Z=z=>{h(z)},G=z=>{g(z),w(M=>({...M,timezone:z}))},q=["daily","weekly","monthly"].includes(S.type);return a.jsxs("div",{className:s,children:[!u&&a.jsx("div",{className:"mb-4 space-y-4 pt-0",children:a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Aa,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),a.jsx(K2,{id:"schedule-enabled",checked:f,onCheckedChange:Z})]})})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[a.jsx(Koe,{value:S.type,onChange:z=>{w(M=>({...M,type:z}))},disabled:!f}),S.type!=="custom"&&S.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Zoe,{value:S.time,onChange:z=>{w(M=>({...M,time:z}))},disabled:!f}),q&&a.jsx(W_,{value:y,onChange:G,disabled:!f,timezones:C})]}),(S.type==="interval"||S.type==="custom")&&a.jsx(W_,{value:y,onChange:G,disabled:!f,timezones:C}),S.type==="weekly"&&a.jsx(Yoe,{value:S.weekdays,onChange:z=>{w(M=>({...M,weekdays:z}))},disabled:!f}),S.type==="monthly"&&a.jsx(Woe,{value:S.monthDays,onChange:z=>{w(M=>({...M,monthDays:z}))},disabled:!f}),S.type==="interval"&&a.jsx(Xoe,{intervalType:S.intervalType,intervalValue:S.intervalValue,onTypeChange:O,onValueChange:T,disabled:!f}),S.type==="custom"&&a.jsx(Qoe,{value:S.customCron,onChange:z=>{w(M=>({...M,customCron:z}))},disabled:!f})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(FA,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!x)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(wA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),x?a.jsx(qu,{className:"text-muted-foreground h-4 w-4"}):a.jsx(Vs,{className:"text-muted-foreground h-4 w-4"})]}),x&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),a.jsx(jr,{variant:f?"default":"secondary",className:"text-xs",children:f?"Enabled":"Disabled"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),a.jsx(jr,{variant:"secondary",className:"font-mono text-xs",children:R})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),a.jsx(jr,{variant:"outline",className:"text-xs",children:y})]}),a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),a.jsx("span",{className:"flex-1 text-right text-xs",children:_})]})]}),f&&q&&y!==Ap()&&a.jsxs(B2,{className:"border-amber-200 bg-amber-50",children:[a.jsx(hh,{className:"h-4 w-4"}),a.jsx(iI,{children:"Time Zone"}),a.jsxs(G2,{children:["Schedule runs in ",y," (not your local ",Ap()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(we,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function Joe(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"trigger-type-options-description-details",children:[a.jsx(Yt,{children:"How do I choose a type?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:[a.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)."]}),a.jsxs("p",{className:"mb-2",children:[a.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 eie(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"trigger-type-change-description-details",children:[a.jsx(Yt,{children:"How do I change the trigger type?"}),a.jsx(Wt,{children:a.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 tie(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"report-change-description-details",children:[a.jsx(Yt,{children:"How do I change a report?"}),a.jsx(Wt,{children:a.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 nie(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"report-select-description-details",children:[a.jsx(Yt,{children:"How do I choose the report?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),a.jsxs("p",{children:["You can use an existing one or create a new one on the ",a.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function rie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=m.useState(!1),{form:f,handleTypeChange:h,handleSubmit:y,isDirty:g}=koe({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async w=>{u(!0);try{await r(w)}finally{u(!1)}}});m.useEffect(()=>{i==null||i(g)},[g,i]);const{control:x,watch:v}=f,S=v("type")===zn.REPORT_RUN;return a.jsx(Nl,{...f,children:a.jsxs(pi,{onSubmit:w=>void y(w),noValidate:!1,children:[a.jsxs(Al,{children:[a.jsx(_t,{control:x,name:"type",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(ua,{onValueChange:R=>{w.onChange(R),h(R)},defaultValue:w.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(Ct,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select trigger type"})})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:zn.REPORT_RUN,children:"Report Run"}),a.jsx(Bn,{value:zn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(hn,{children:e?a.jsx(eie,{}):a.jsx(Joe,{})}),a.jsx(Mt,{})]})}),S&&a.jsx(_t,{control:x,name:"triggerConfig.reportId",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(Ct,{children:a.jsx(VS,{children:a.jsx(Poe,{value:w.value??"",onChange:w.onChange,disabled:!!t||!!e})})}),a.jsx(hn,{children:e!=null&&e.triggerConfig?a.jsx(tie,{}):a.jsx(nie,{})}),a.jsx(Mt,{})]})}),a.jsx(Rb,{showPreview:!1,cron:v("cronExpression"),timezone:v("timeZone"),enabled:v("isActive"),onChange:w=>{f.setValue("cronExpression",w.cron,{shouldDirty:!0}),f.setValue("timeZone",w.timezone,{shouldDirty:!0}),f.setValue("isActive",w.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"})]}),a.jsxs(Oc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!g||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&a.jsx(we,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function aie({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=m.useMemo(()=>Goe(e,t,n),[e,t,n]);return a.jsxs("div",{children:[a.jsx("div",{children:r}),n&&a.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function sie({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=m.useState(!1),[i,c]=m.useState(!1),u=()=>{c(!1),n(e.id)};return a.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[a.jsxs(_r,{open:r,onOpenChange:s,children:[a.jsx(Nr,{asChild:!0,children:a.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:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ar,{align:"end",children:[a.jsxs(Nt,{onClick:()=>{t(e.id)},children:[a.jsx(sd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:()=>{c(!0)},children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(Cr,{open:i,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:u,variant:"destructive"})]})}function oie({connector:e}){const{connectors:t}=Dc(),n=Vee(e,t);return a.jsx(a.Fragment,{children:n})}function bI({connector:e}){return a.jsx(oie,{connector:e})}function iie(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 lie=e=>{const{connectors:t}=Dc();return m.useMemo(()=>t.find(n=>n.name===e),[t,e])},cie=re.memo(function({connector:t,children:n}){const r=lie(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=xs();m.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const u=m.useMemo(()=>r!=null&&r.logoBase64?a.jsx(_c,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=m.useCallback(()=>{s!=null&&s.storage&&vX(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),h=m.useMemo(()=>iie(i),[i]),y=m.useMemo(()=>!h.lastRunDate||!h.lastRunStatus?null:{statusType:HQ(h.lastRunStatus),statusText:VQ(h.lastRunStatus),date:h.lastRunDate},[h]),g=m.useMemo(()=>(s==null?void 0:s.storage)&&bX(s.storage),[s]),x=m.useMemo(()=>{const v=t.source.fields.length.toString();return`${t.source.node} • ${v} fields`},[t.source.node,t.source.fields.length]);return a.jsxs(_y,{children:[a.jsx(Ny,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Ay,{children:[a.jsxs(KS,{children:[a.jsx(ZS,{children:u}),a.jsxs(YS,{children:[a.jsx(WS,{children:a.jsx(bI,{connector:t})}),a.jsx(XS,{children:x})]})]}),a.jsxs(QS,{children:[a.jsxs(tl,{children:[a.jsx(nl,{children:"Last run status:"}),a.jsx(rl,{children:y?a.jsx(Mh,{type:y.statusType,variant:"ghost",children:y.statusText}):"Not run yet"})]}),a.jsxs(tl,{children:[a.jsx(nl,{children:"Last run date:"}),a.jsx(rl,{children:y?a.jsx(zs,{date:y.date}):"Never run"})]}),a.jsxs(tl,{children:[a.jsx(nl,{children:"Total runs:"}),a.jsxs(rl,{children:[h.totalRuns," runs",h.firstRunDate&&a.jsxs(a.Fragment,{children:[", since"," ",h.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),a.jsx(JS,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[g,a.jsx(ri,{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 uie(e){const t=e.triggerConfig,n=sa.getInfo(t.report.dataDestination.type).icon;return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[a.jsx(n,{className:"h-4 w-4",size:16}),t.report.title,a.jsx(zQ,{report:t.report,children:a.jsx(zr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function die(e){var s;const t=e.triggerConfig,{connector:n}=t.connector,r=(s=n.info)!=null&&s.logoBase64?a.jsx(_c,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):a.jsx(lc,{className:"h-4 w-4",size:16});return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[r,a.jsx(bI,{connector:n}),a.jsx(cie,{connector:n,children:a.jsx(zr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function fie({trigger:e}){switch(e.type){case zn.REPORT_RUN:return uie(e);case zn.CONNECTOR_RUN:return die(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function hie({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===zn.REPORT_RUN?"Report Run":"Connector Run";return a.jsx(jr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(fie,{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,i=n.getValue("isActive");return a.jsx(aie,{cronExpression:String(r),timeZone:s,isEnabled:i})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(zs,{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 a.jsx("div",{className:"text-sm",children:r?a.jsx(zs,{date:new Date(r)}):a.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 a.jsx(Mh,{type:r?er.SUCCESS:er.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>a.jsx(gd,{table:n}),cell:({row:n})=>a.jsx(sie,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function mie({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function Z2({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=dI(),{showUnsavedDialog:f,setShowUnsavedDialog:h,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=Ic(t),C=!!u,S=m.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===zn.REPORT_RUN?{type:ol.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),w=async j=>{C?await c(n,u.id,j.cronExpression,j.timeZone,j.isActive):await i(n,j.type,j.cronExpression,j.timeZone,j.isActive,j.triggerConfig),v()},R=m.useRef(!1);return m.useEffect(()=>{const j=C?"Edit":"Create",_=(u==null?void 0:u.type)??s;e&&!R.current?(Le({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:j,label:_}),R.current=!0):!e&&R.current&&(Le({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:j,label:_}),R.current=!1)},[e,C,u,s]),a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:j=>{j||y()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsxs(di,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(xl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(rie,{preSelectedReportId:r,preSelectedType:s,initialData:S,onSubmit:w,onCancel:y,onDirtyChange:x})]})}),a.jsx(Cr,{open:f,onOpenChange:h,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function pie({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,i]=m.useState(!1),c=m.useCallback(()=>{i(!1)},[]),u=m.useCallback(R=>{r(R)},[r]),f=m.useMemo(()=>hie({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:h,setSorting:y,columnVisibility:g,setColumnVisibility:x}=Ac({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=El({data:e,columns:f,getCoreRowModel:wl(),getPaginationRowModel:Ph(),onSortingChange:y,getSortedRowModel:Nc(),getFilteredRowModel:pd(),state:{sorting:h,columnVisibility:g},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),C=m.useCallback(()=>{v.previousPage()},[v]),S=m.useCallback(()=>{v.nextPage()},[v]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(jl,{className:"dm-card-table-header",children:v.getHeaderGroups().map(R=>a.jsx(Fn,{className:"dm-card-table-header-row",children:R.headers.map(j=>a.jsx(_l,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},R.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map((R,j)=>a.jsx(Fn,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:R.getVisibleCells().map((_,I)=>a.jsx(Hr,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":I+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),a.jsx(mie,{table:v,onPreviousClick:C,onNextClick:S}),a.jsx(Z2,{isOpen:s,onClose:c,dataMartId:t})]})}function gie({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=Doe(e),[i,c]=m.useState(!1);m.useEffect(()=>{s&&c(!0)},[s]);const u=y=>{const g=t.find(x=>x.id===y);g&&r(g)},f=()=>{c(!1),r(null)},h=async y=>{try{await n(e,y)}catch(g){console.error("Error deleting trigger:",g)}};return a.jsxs(a.Fragment,{children:[a.jsx(pie,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:y=>void h(y)}),a.jsx(Z2,{isOpen:i,onClose:f,dataMartId:e})]})}function Y2(){return a.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:a.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[a.jsx(Wb,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Time Triggers"}),a.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",a.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Dp(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function Mg(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function yie({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const i=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[u,f]=m.useState(""),[h,y]=m.useState(""),[g,x]=m.useState(""),[v,C]=m.useState(null),[S,w]=m.useState(null),[R,j]=m.useState(null),_=(D,L=!1)=>D.trim()?L&&D.startsWith('"')&&D.endsWith('"')?D.slice(1,-1)?null:"Quoted identifier cannot be empty":/^[A-Za-z][A-Za-z0-9_]*$/.test(D)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",I=m.useCallback((D,L,$,K,Z,G)=>{let q;if(e===Re.SNOWFLAKE&&Z){const M=Dp(Z),H=Dp(L);q=`${D}.${M}.${H}`}else q=`${D}.${L}`;const z=e===Re.SNOWFLAKE?!!(D&&Z&&L&&$===null&&G===null&&K===null):!!(D&&L&&$===null&&K===null);s({fullyQualifiedName:q,isValid:z})},[s,e]);m.useEffect(()=>{let D="",L="",$="";if(t!=null&&t.fullyQualifiedName){const M=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===Re.SNOWFLAKE&&M.length===3){const H=M[0],V=M[1],se=M[2];H&&V&&se&&(D=H,L=Mg(V),$=Mg(se))}else if(M.length>=2){const H=M[0],V=M[1];H&&V&&(D=H,$=V)}}else D=`${c}_owox`,e===Re.SNOWFLAKE&&(L="PUBLIC"),$=i;const K=_(D),Z=e===Re.SNOWFLAKE?_(L,!0):null,G=_($,e===Re.SNOWFLAKE);f(D),y(L),x($),C(K),w(Z),j(G);const q=e===Re.SNOWFLAKE&&L?`${D}.${Dp(L)}.${Dp($)}`:`${D}.${$}`,z=e===Re.SNOWFLAKE?!!(D&&L&&$&&K===null&&Z===null&&G===null):!!(D&&$&&K===null&&G===null);((t==null?void 0:t.fullyQualifiedName)!==q||t.isValid!==z)&&I(D,$,K,G,L,Z)},[t,i,c,e,I]);const A=D=>{f(D);const L=_(D);C(L),I(D,g,L,R,h,S)},O=D=>{y(D);const L=_(D,!0);w(L),I(u,g,v,R,D,L)},T=D=>{x(D);const L=_(D,e===Re.SNOWFLAKE);j(L),I(u,D,v,L,h,S)};return a.jsxs(ti,{children:[e===Re.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(ei,{icon:a.jsx(yD,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(sl,{title:"Choose where to store your data",children:[a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(It,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:D=>{A(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(It,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"table-name-error":void 0,onChange:D=>{T(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===Re.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(ei,{icon:a.jsx(xD,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(sl,{title:"Choose where to store your data",children:[a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(It,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:D=>{A(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(It,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"athena-table-name-error":void 0,onChange:D=>{T(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===Re.SNOWFLAKE&&a.jsxs(a.Fragment,{children:[a.jsx(ei,{icon:a.jsx(vD,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(sl,{title:"Choose where to store your data",children:[a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"snowflake-database-name",tooltip:"Enter database name for Snowflake where the connector data will be stored.",children:"Database name"}),a.jsx(It,{type:"text",id:"snowflake-database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"snowflake-database-name-error":void 0,onChange:D=>{A(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn't exist"}),v&&a.jsx("p",{id:"snowflake-database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"snowflake-schema-name",tooltip:"Enter schema name for Snowflake where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Schema name"}),a.jsx(It,{type:"text",id:"snowflake-schema-name",placeholder:"PUBLIC",autoComplete:"off",className:"box-border w-full",value:h,"aria-invalid":!!S,"aria-describedby":S?"snowflake-schema-name-error":void 0,onChange:D=>{O(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Schema is auto-created on first run if it doesn't exist"}),S&&a.jsx("p",{id:"snowflake-schema-name-error",className:"text-destructive text-sm",children:S})]}),a.jsxs(Gi,{children:[a.jsx(Va,{required:!0,htmlFor:"snowflake-table-name",tooltip:"Enter table name where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Table name"}),a.jsx(It,{type:"text",id:"snowflake-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"snowflake-table-name-error":void 0,onChange:D=>{T(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn't exist"}),R&&a.jsx("p",{id:"snowflake-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),a.jsx(sl,{title:"Schedule updates",children:a.jsx(Y2,{})})]})}function xie({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:i,preselectedConnector:c,onDirtyChange:u}){const[f,h]=m.useState(!1),[y,g]=m.useState(null),[x,v]=m.useState(""),[C,S]=m.useState([]),[w,R]=m.useState(1),[j,_]=m.useState({}),[I,A]=m.useState(!1),[O,T]=m.useState(new Set),[D,L]=m.useState(new Set),{connectors:$,connectorSpecification:K,connectorFields:Z,loading:G,loadingSpecification:q,loadingFields:z,error:M,fetchAvailableConnectors:H,fetchConnectorSpecification:V,fetchConnectorFields:se}=Dc();m.useEffect(()=>{u==null||u(f)},[f,u]);const[ge,P]=m.useState(null),U=m.useMemo(()=>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"}],[n,s]),F=U.length,W=m.useCallback(async Ie=>{!O.has(Ie)&&!q&&(T(B=>new Set(B).add(Ie)),await V(Ie))},[O,q,V]),X=m.useCallback(async Ie=>{D.has(Ie)||(L(B=>new Set(B).add(Ie)),await se(Ie))},[D,se]);m.useEffect(()=>{if(!c||y||$.length===0)return;const Ie=$.find(B=>B.name===c);Ie&&(g(Ie),R(i??2),W(Ie.name),!n&&s!=="fields-only"&&X(Ie.name))},[c,$,y,i,n,s,W,X]),m.useEffect(()=>{if($.length===0&&!G&&H(),r&&$.length>0&&!y){const{source:Ie,storage:B}=r;v(Ie.node),S(Ie.fields),_(Ie.configuration[0]||{}),P({fullyQualifiedName:B.fullyQualifiedName,isValid:!0});const ne=$.find(ue=>ue.name===Ie.name);ne&&(g(ne),W(ne.name),!n&&s!=="fields-only"&&X(ne.name),s==="fields-only"&&X(ne.name))}if(n&&$.length>0&&!y&&!r){const Ie=$[0];g(Ie),W(Ie.name)}},[s,r,$,n,G,H,W,X,y]);const ae=Ie=>{g(Ie),_({}),A(!1),h(!0),T(B=>{const ne=new Set(B);return ne.delete(Ie.name),ne}),W(Ie.name),X(Ie.name),Le({event:"connector_setup",category:Ie.name,action:"connector_selected",label:Ie.displayName})},J=Ie=>{v(Ie),S([]),h(!0)},ce=(Ie,B)=>{S(B?ne=>ne.includes(Ie)?ne:[...ne,Ie]:ne=>ne.filter(ue=>ue!==Ie)),h(!0)},ye=(Ie,B)=>{S(B?ne=>{const ue=Ie.filter(Ne=>!ne.includes(Ne));return[...ne,...ue]}:ne=>ne.filter(ue=>!Ie.includes(ue))),h(!0)},Se=Ie=>{P(Ie),h(!0)},Me=m.useCallback(Ie=>{_(Ie),h(!0)},[]),ke=m.useCallback(Ie=>{A(Ie)},[]);m.useEffect(()=>{K&&(K.some(B=>B.required&&B.name!=="Fields")||A(!0))},[K]),m.useEffect(()=>{var B;const Ie=((B=U[w-1])==null?void 0:B.title)??`Step ${String(w)}`;Le({event:"connector_setup",category:(y==null?void 0:y.name)??"unknown",action:"step",label:Ie})},[w,y]);const tt=()=>{w<F&&R(w+1)},at=()=>{w>1&&R(w-1)},Pt=()=>{if(n)return y!==null&&I;if(s==="fields-only")switch(w){case 1:return C.length>0;default:return!1}switch(w){case 1:return y!==null;case 2:return I;case 3:return x!=="";case 4:return C.length>0;case 5:return ge!==null&&ge.fullyQualifiedName!==""&&ge.isValid;default:return!1}},fn=()=>w>1,Dn=(Ie,B)=>{if(!Ie)return B;const ne=Ie.find(ue=>ue.name===B);return(ne==null?void 0:ne.destinationName)??B},ln=()=>{if(n&&w===1)return K&&y?a.jsx(Z_,{connector:y,connectorSpecification:K,onConfigurationChange:Me,onValidationChange:ke,initialConfiguration:j,loading:q,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(w){case 1:return y&&x&&Z?a.jsx(Y_,{connector:y,connectorFields:Z,selectedField:x,selectedFields:C,onFieldToggle:ce,onSelectAllFields:ye}):null;default:return null}switch(w){case 1:return a.jsx(uoe,{connectors:$,selectedConnector:y,loading:G,error:M,onConnectorSelect:ae,onConnectorDoubleClick:()=>{R(Ie=>Ie<F?Ie+1:Ie)}});case 2:return y&&K?a.jsx(Z_,{connector:y,connectorSpecification:K,onConfigurationChange:Me,onValidationChange:ke,initialConfiguration:j,loading:q,isEditingExisting:!1}):null;case 3:return y&&Z?a.jsx(joe,{connectorFields:Z,connector:y,selectedField:x,connectorName:y.displayName,loading:z,onFieldSelect:J}):null;case 4:return y&&x&&Z?a.jsx(Y_,{connector:y,connectorFields:Z,selectedField:x,selectedFields:C,onFieldToggle:ce,onSelectAllFields:ye}):null;case 5:return x&&Z?a.jsx(yie,{dataStorageType:t,destinationName:Dn(Z,x),connectorName:(y==null?void 0:y.displayName)??"",target:ge,onTargetChange:Se}):null;default:return null}};return a.jsxs(Xne,{children:[a.jsx(Qne,{children:ln()}),a.jsx(Jne,{variant:"horizontal",children:a.jsx(doe,{currentStep:w,totalSteps:F,canGoNext:Pt(),canGoBack:fn(),isLoading:q||z,onNext:tt,onBack:at,onFinish:()=>{n&&y?(e({source:{name:y.name,configuration:[j],node:(r==null?void 0:r.source.node)??x,fields:(r==null?void 0:r.source.fields)??C},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}),Le({event:"connector_setup",category:y.name,action:"created",label:"configuration-only"})):s==="fields-only"&&r?(e({source:{...r.source,fields:C},storage:r.storage}),Le({event:"connector_setup",category:r.source.name,action:"created",label:"fields-only"})):y&&ge&&(e({source:{name:y.name,configuration:[j],node:x,fields:C},storage:{fullyQualifiedName:ge.fullyQualifiedName}}),Le({event:"connector_setup",category:y.name,action:"created",label:"full"})),h(!1)}})})]})}const SI=20,CI=20;function wI({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 EI(e=30,t=0){wI({vertical:CI+e,horizontal:SI+t})}function rh(){wI({vertical:CI,horizontal:SI})}function RI({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:i=null,mode:c="full",initialStep:u,preselectedConnector:f}){m.useEffect(()=>(e?EI(55):rh(),()=>{rh()}),[e]);const{showUnsavedDialog:h,setShowUnsavedDialog:y,handleClose:g,confirmClose:x,handleFormDirtyChange:v,handleFormSubmitSuccess:C}=Ic(t);return a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:S=>{S||g()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsx(di,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(xl,{children:c==="fields-only"?"Select fields for your Data Mart":i!=null&&i.source.name?"Update configuration":"Follow these steps to set it up"})]}),a.jsx(xie,{onSubmit:S=>{r(S),C()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:v})]})}),a.jsx(Cr,{open:h,onOpenChange:y,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:x,variant:"destructive"})]})}const W2=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,h]=m.useState(!1),[y,g]=m.useState(1),[x,v]=m.useState();m.useEffect(()=>{c!==void 0&&h(c)},[c]);const C=()=>{v(void 0),g(1),h(!0)},S=()=>{h(!1),u==null||u()};return m.useEffect(()=>{i&&(i==="connector"?(v(void 0),g(1),h(!0)):(v(i),g(2),h(!0)))},[i]),a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{onClick:C,style:{cursor:"pointer"},children:n}),a.jsx(nd,{children:a.jsx(RI,{isOpen:f,onClose:S,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:y,preselectedConnector:x})})]})};function vie({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(W2,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:a.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:[a.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:a.jsx(Jb,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(Da,{className:"h-6 w-6"})]})})}const bie=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"Google BigQuery";case Re.AWS_ATHENA:return"AWS Athena";case Re.SNOWFLAKE:return"Snowflake";default:return e}},Au=e=>typeof e=="object"&&"connector"in e,Rf=e=>{if(!Au(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.split("."),i=s.length===2||s.length===3;return r&&i};function Sie({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=Cl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=Dc();m.useEffect(()=>{f()},[f]);const h=C=>{const S=u.find(w=>w.name===C);if(S!=null&&S.logoBase64)return()=>a.jsx(_c,{base64:S.logoBase64,size:24})},y=()=>{const C=t.connector.source.node||"No node selected";return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:C}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[a.jsx("span",{children:"Edit config"}),a.jsx(Da,{className:"h-3 w-3"})]})}),a.jsx(Rt,{children:"Edit connector configuration"})]})]})},g=(C,S,w)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",a.jsx(dn,{href:w,onClick:R=>{R.stopPropagation()},children:S})]}),x=()=>{switch(i.type){case Re.GOOGLE_BIGQUERY:{const C=i.config.projectId,S=t.connector.storage.fullyQualifiedName,w=S.split(".")[0],R=S.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${w}`,_=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${w}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Dataset",w,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,_),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(zr,{className:"h-4 w-4"})}),a.jsx(Rt,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Re.AWS_ATHENA:{const C=i.config.region,S=t.connector.storage.fullyQualifiedName,[w,R]=S.split("."),j=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",w,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,j),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(zr,{className:"h-4 w-4"})}),a.jsx(Rt,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Re.SNOWFLAKE:{const C=i.config.account,w=t.connector.storage.fullyQualifiedName.split("."),R=w[0],j=w[1],_=w[2],I=`https://${C}.snowflakecomputing.com`,A=`${I}/#/data/databases/${R}`,O=`${I}/#/data/databases/${R}/schemas/${j}`,T=`${I}/#/data/databases/${R}/schemas/${j}/table/${_}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",R,A),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",Mg(j),O),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",Mg(_),T),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(zr,{className:"h-4 w-4"})}),a.jsx(Rt,{children:"The database, schema 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"}},v=()=>s!==1;return a.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[a.jsx("div",{className:"flex-grow",children:a.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[a.jsx(W2,{dataStorageType:i.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:a.jsx(yb,{icon:h(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:y(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(yb,{title:bie(i.type),icon:c.icon,subtitle:x(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),a.jsx("div",{className:"shrink-0 px-4",children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("span",{children:a.jsx(we,{type:"button",variant:"ghost",onClick:()=>{v()&&n(e)},disabled:!v(),children:a.jsx(Qa,{className:"h-4 w-4"})})})}),!v()&&a.jsx(Rt,{children:"Remove last configuration only after adding a new one."})]})})]})}function Cie({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(W2,{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:a.jsxs(we,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(ma,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function wie({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=gs(),{setValue:u,getValues:f,trigger:h}=yd(),[y,g]=m.useState(!1),[x,v]=m.useState(!1);m.useEffect(()=>{r&&v(!0)},[r]);const C=(i==null?void 0:i.status)??Ur.DRAFT,S=async q=>{u("definition",q,{shouldDirty:!0,shouldTouch:!0}),await h("definition")&&s&&s()},w=async q=>{const z=q.source,M=q.storage;await S({connector:{source:z,storage:M}})},R=async q=>{if(i){if(i.status.code!==Ur.PUBLISHED){Tt.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:q})}},j=q=>async z=>{const H=f().definition;if(typeof H=="object"&&Au(H)){const V=[...H.connector.source.configuration];V[q]=z.source.configuration[0]||{};const se={connector:{...H.connector,source:{...H.connector.source,configuration:V}}};await S(se)}},_=async q=>{const M=f().definition;if(typeof M=="object"&&Au(M)){const H={connector:{...M.connector,source:{...M.connector.source,fields:q.source.fields}}};await S(H)}g(!1)},I=q=>{R({runType:q.runType,data:q.data})},A=q=>{const z=q.connector.source.fields.length;return a.jsxs(we,{type:"button",variant:"outline",onClick:()=>{g(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(HU,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(z),")"]})]})},[O,T]=m.useState(null),[D,L]=m.useState(!1),$=q=>{T(q),L(!0)},K=async()=>{O!==null&&(await Z(O),T(null),L(!1))},Z=async q=>{const M=f().definition;if(Au(M)&&M.connector.source.configuration.length<=1){const H=V2(Be.CONNECTOR);await S(H)}if(typeof M=="object"&&Au(M)&&M.connector.source.configuration.length>1){const H={...M.connector.source,configuration:M.connector.source.configuration.filter((se,ge)=>ge!==q)},V={connector:{...M.connector,source:H}};await S(V)}},G=async q=>{const M=f().definition;if(Au(M)){const H={...M.connector.source,configuration:[...M.connector.source.configuration,q]},V={connector:{...M.connector,source:H}};await S(V)}};return a.jsxs(a.Fragment,{children:[a.jsx(_t,{control:e,name:"definition",render:({field:q})=>a.jsxs(xt,{className:"dark:bg-white/2",children:[a.jsx(Ct,{children:a.jsx("div",{className:"space-y-3",children:!Rf(q.value)||C===Ur.DRAFT?a.jsx(vie,{storageType:t,onSetupConnector:z=>{w(z),v(!1)},preset:n,isOpen:x,onClose:()=>{v(!1)}}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cie,{storageType:t,onAddConfiguration:z=>void G(z),existingConnector:Rf(q.value)?{source:q.value.connector.source,storage:q.value.connector.storage}:void 0}),Rf(q.value)&&A(q.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:i&&i.definitionType===Be.CONNECTOR&&a.jsx(_6,{configuration:i.definition,onManualRun:I,children:a.jsxs(we,{variant:"outline",children:[a.jsx(Wg,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:Rf(q.value)&&(i!=null&&i.storage)?q.value.connector.source.configuration.map((z,M)=>{const H=q.value;return a.jsx(nd,{children:a.jsx(Sie,{configIndex:M,connectorDef:H,dataStorage:i.storage,onRemoveConfiguration:V=>{$(V)},onUpdateConfiguration:V=>j(V),dataMartStatus:typeof C=="object"?C.code:C,totalConfigurations:H.connector.source.configuration.length},M)},M)}):null})]})})}),a.jsx(Mt,{})]})}),a.jsx(nd,{children:a.jsx(RI,{isOpen:y,onClose:()=>{g(!1)},onSubmit:q=>void _(q),dataStorageType:t,existingConnector:Rf(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(Cr,{open:D,onOpenChange:L,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{K()},onCancel:()=>{T(null)},variant:"destructive"})]})}function Eie({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=yd(),[i,c]=m.useState(!1);return m.useEffect(()=>{e===Be.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),a.jsxs("div",{className:"space-y-2",children:[e===Be.SQL&&a.jsx(soe,{control:s}),e===Be.TABLE&&a.jsx(ooe,{control:s,storageType:t}),e===Be.VIEW&&a.jsx(ioe,{control:s,storageType:t}),e===Be.TABLE_PATTERN&&a.jsx(loe,{control:s,storageType:t}),e===Be.CONNECTOR&&a.jsx(wie,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function jI(){const[e]=IL(),t=e.get("preset");return m.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return dee(n)},[t])}function Rie(e,t){const[n,r]=m.useState(e);return m.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const jie=1e3,Tie=[Ya.SUCCESS,Ya.ERROR,Ya.CANCELLED];function _ie(e){const[t,n]=m.useState(!1),[r,s]=m.useState(null),i=m.useRef({triggerId:null,abortController:null}),c=m.useCallback(g=>i.current.triggerId===g,[]),u=m.useCallback(g=>{s({isValid:!1,error:g instanceof Error?g.message:"Validation failed"}),n(!1)},[]),f=m.useCallback(async()=>{const{triggerId:g,abortController:x}=i.current;if(g){x==null||x.abort(),i.current={triggerId:null,abortController:null},s(null),n(!1);try{await En.abortSqlDryRunTrigger(e,g)}catch(v){console.error("Failed to cancel trigger:",v)}}},[e]),h=m.useCallback(async(g,x)=>{for(;!x.aborted&&c(g);)try{const v=await En.getSqlDryRunTriggerStatus(e,g);if(Tie.includes(v)){const C=await En.getSqlDryRunTriggerResponse(e,g);s({isValid:C.isValid,error:C.error??void 0,bytes:C.bytes}),n(!1),i.current={triggerId:null,abortController:null};return}await new Promise(C=>setTimeout(C,jie))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),y=m.useCallback(async g=>{await f(),n(!0),s(null);try{const{triggerId:x}=await En.createSqlDryRunTrigger(e,g),v=new AbortController;i.current={triggerId:x,abortController:v},await h(x,v.signal)}catch(x){u(x)}},[e,f,h,u]);return m.useEffect(()=>()=>{const{triggerId:g,abortController:x}=i.current;x==null||x.abort(),g&&En.abortSqlDryRunTrigger(e,g).catch(()=>{})},[e]),{validateSql:y,isLoading:t,result:r,cancel:f}}const Nie=300;function Aie({sql:e,dataMartId:t,debounceDelay:n=Nie,className:r="",onValidationStateChange:s}){const i=Rie(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:h}=_ie(t);m.useEffect(()=>{if(!i){h();const g={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(g);return}c(i)},[i,c,h,s]),m.useEffect(()=>{const g={isLoading:u,isValid:(f==null?void 0:f.isValid)??null,error:(f==null?void 0:f.error)??null,bytes:(f==null?void 0:f.bytes)??null};s==null||s(g)},[u,f,s]);const y=()=>u?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(wc,{className:"h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(TP,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(lc,{className:"h-3 w-3 text-gray-600"}),a.jsx("span",{className:"text-xs text-gray-600",children:wQ(f.bytes)})]})}),a.jsx(Rt,{children:a.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):a.jsxs("div",{className:"flex h-9 items-center gap-2",children:[a.jsx(tg,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&a.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):a.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[a.jsx(lc,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return a.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:y()})}const Die={isValid:null,isLoading:!1,error:null},Oie=(e,t)=>{if(e!==Be.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},Iie=e=>V2(e);function Mie({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=gs(),c=jI();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:h}}=r,[,y]=m.useState(Die),[g,x]=m.useState(!1),v=m.useCallback(()=>{if(!e)return;const G={definitionType:e,definition:V2(e)};return u?{definitionType:e,definition:u}:G},[e,u]),C=m.useCallback(()=>{if(!e)return;const G=aoe(e,h);return gi(G)},[e,h]),S=wo({resolver:C(),defaultValues:v(),mode:"onChange"}),{handleSubmit:w,reset:R,watch:j,formState:{isDirty:_,isValid:I}}=S,A=j("definition"),O=Oie(e,A);m.useEffect(()=>{e&&R(v())},[e,R,v]),m.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const G={definitionType:c.definitionType,definition:Iie(c.definitionType)};R(G)}},[c,e,t,R,n]);const T=m.useCallback(G=>{y({isLoading:G.isLoading,isValid:G.isValid,error:G.error})},[]),D=m.useCallback(G=>{n(G)},[n]),L=m.useCallback(async G=>{if(e&&f)try{await s(f,G.definitionType,G.definition),x(!0),R(G)}catch(q){console.error("Failed to update data mart definition:",q)}},[f,e,s,R]);m.useEffect(()=>{g&&(x(!1),i==null||i())},[g,i]);const $=m.useCallback(G=>{G==null||G.preventDefault(),w(L)(G)},[w,L]),K=m.useCallback(()=>{R(v())},[R,v]),Z=()=>e?a.jsxs("form",{onSubmit:$,className:"space-y-4",children:[a.jsx(Eie,{definitionType:e,storageType:h,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:$}),e!==Be.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(we,{variant:"default",type:"submit",disabled:!I||!_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:K,disabled:!_,children:"Discard"}),e===Be.SQL&&O&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(Aie,{sql:O,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(r5,{...S,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(Qse,{initialType:e,onTypeSelect:D}),Z()]})})}function kie(e){switch(e){case Re.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Re.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};case Re.SNOWFLAKE:return{type:"snowflake-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function TI(e){return e.type==="bigquery-data-mart-schema"}function _I(e){return e.type==="athena-data-mart-schema"}function NI(e){return e.type==="snowflake-data-mart-schema"}function X_(e){return e!==null&&typeof e=="object"&&"mode"in e}function Q_(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function J_(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function Lie(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function o1(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Pie(e){const t=o1(e),[n,r]=m.useState(t),[s,i]=m.useState(!1);m.useEffect(()=>{const f=o1(e);r(f),i(!1)},[e]);const c=m.useCallback(f=>{n?TI(n)&&f.every(X_)?(r({...n,fields:f}),i(!0)):_I(n)&&f.every(Q_)?(r({...n,fields:f}),i(!0)):NI(n)&&f.every(J_)&&(r({...n,fields:f}),i(!0)):f.length>0&&(X_(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):Q_(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):J_(f[0])&&(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)))},[n]),u=m.useCallback(()=>{const f=o1(e);r(f),i(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:u,setIsDirty:i}}function Uie(e,t){const n=m.useRef(!1),r=m.useRef(!1),[s,i]=m.useState("idle");return m.useEffect(()=>{e||(n.current||r.current)&&(i(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,i("idle")},startActualizeOperation:()=>{r.current=!0,i("idle")},resetOperationStatus:()=>{i("idle")}}}function zie(e){const t=m.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]=m.useState({});return m.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function AI(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 i=e;return i.fields&&i.fields.length>0?i.fields.some(c=>AI(c,t)):!1}function DI(e,t,n=""){const r=[];return e.forEach((s,i)=>{const c=n?`${n}.${String(i)}`:String(i),u=s.name?s.name.toLowerCase().includes(t):!1,f=s.alias?s.alias.toLowerCase().includes(t):!1,h=s.description?s.description.toLowerCase().includes(t):!1;if((u||f||h)&&r.push(c),s.fields&&s.fields.length>0){const y=DI(s.fields,t,c);y.length>0&&(r.includes(c)||r.push(c),r.push(...y))}}),r}function Fie(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return AI(r,s)}function Hie(e){const[t,n]=m.useState(""),r=m.useCallback(i=>{n(i),e.setGlobalFilter(i)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}function $ie(e){const[t,n]=m.useState(new Set),[r,s]=m.useState(null),i=m.useRef(""),c=m.useMemo(()=>{const C=S=>S.some(w=>w.type===sr.RECORD||w.type===sr.STRUCT||w.fields&&C(w.fields));return C(e)},[e]),u=m.useCallback(C=>{n(S=>{const w=new Set(S);return w.has(C)?w.delete(C):w.add(C),w})},[]),f=m.useCallback(()=>{const C=[],S=(w,R="")=>{w.forEach((j,_)=>{const I=R?`${R}.${String(_)}`:String(_);(j.type===sr.RECORD||j.type===sr.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(I),S(j.fields,I))})};S(e),n(w=>C.every(j=>w.has(j))?new Set:new Set(C))},[e]),h=m.useMemo(()=>{const C=[],S=(w,R="",j=0)=>{w.forEach((_,I)=>{const A=R?`${R}.${String(I)}`:String(I),O=_.type===sr.RECORD||_.type===sr.STRUCT;C.push({..._,path:A,level:j}),O&&_.fields&&t.has(A)&&S(_.fields,A,j+1)})};return S(e),C},[e,t]),y=m.useCallback(C=>{if(C!==i.current)if(i.current=C,C){r===null&&s(new Set(t));const w=DI(e,C).filter(R=>{const j=R.split(".").map(Number);let _=e,I;for(let A=0;A<j.length;A++){if(I=_[j[A]],!I)return!1;if((I.type===sr.RECORD||I.type===sr.STRUCT)&&I.fields&&I.fields.length>0)return!0;A<j.length-1&&(_=I.fields??[])}return!1});n(R=>{const j=new Set(R);return w.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),s(null))},[e,t,r]),g=m.useCallback(C=>{const S=h[C];return S.type===sr.RECORD||S.type===sr.STRUCT},[h]),x=m.useMemo(()=>e.map(C=>({...C,fields:void 0})),[e]),v=m.useMemo(()=>{const C=[],S=(w,R="")=>{w.forEach((j,_)=>{const I=R?`${R}.${String(_)}`:String(_);(j.type===sr.RECORD||j.type===sr.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(I),S(j.fields,I))})};return S(e),C.length===0?!1:C.every(w=>t.has(w))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:u,toggleAllRecords:f,flattenedFields:h,handleSearchChange:y,isRecordType:g,topLevelFields:x,allExpanded:v}}function Vie(e,t,n,r){const s=m.useCallback((f,h)=>{if(n){const y=[...e],g=t[f].path;if(!g)y[f]={...y[f],...h};else{const x=g.split(".").map(Number);let v=y,C;for(let w=0;w<x.length-1;w++)C=v[x[w]],v=C.fields??[];const S=x[x.length-1];v[S]&&(v[S]={...v[S],...h})}n(y)}},[e,t,n]),i=m.useCallback(()=>{if(n){const f={name:"",type:sr.STRING,mode:eh.NULLABLE,isPrimaryKey:!1,status:Wa.DISCONNECTED};n([...e,f])}},[e,n]),c=m.useCallback(f=>{if(n){const h=[...e],y=t[f].path;if(!y)h.splice(f,1);else{const g=y.split(".").map(Number);let x=h,v;for(let S=0;S<g.length-1;S++)v=x[g[S]],x=v.fields??[];const C=g[g.length-1];x.splice(C,1)}n(h)}},[e,t,n]),u=m.useCallback(f=>{var h,y;if(n&&r){const g=[...e],x=t[f].path,v={name:"",type:sr.STRING,mode:eh.NULLABLE,isPrimaryKey:!1,status:Wa.DISCONNECTED};if(!x)(h=g[f]).fields??(h.fields=[]),g[f].fields.push(v);else{const C=x.split(".").map(Number);let S=g;for(let w=0;w<C.length;w++){const R=C[w];w===C.length-1?((y=S[R]).fields??(y.fields=[]),S[R].fields.push(v)):S=S[R].fields??[]}}n(g)}},[e,t,n,r]);return{updateField:s,handleAddRow:i,handleDeleteRow:c,handleAddNestedField:u}}function X2(e,t,n){return{handleDragEnd:m.useCallback(s=>{const{active:i,over:c}=s;if(!c||i.id===c.id||!t)return;if(!n){const x=Number(i.id),v=Number(c.id),C=[...e],[S]=C.splice(x,1);C.splice(v,0,S),t(C);return}const u=n.findIndex((x,v)=>(x.path??String(v))===i.id),f=n.findIndex((x,v)=>(x.path??String(v))===c.id);if(u===-1||f===-1)return;const h=n[u].path,y=n[f].path,g=[...e];if(!h&&!y){const[x]=g.splice(u,1);g.splice(f,0,x),t(g);return}if(h&&y){const x=h.split(".").map(Number),v=y.split(".").map(Number);if(x.length===v.length&&x.slice(0,-1).join(".")===v.slice(0,-1).join(".")){let C=g;for(let j=0;j<x.length-1;j++)C=C[x[j]].fields??[];const S=x[x.length-1],w=v[v.length-1],[R]=C.splice(S,1);C.splice(w,0,R),t(g)}}},[e,n,t])}}function Bie(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Ky=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Q2(e){return"nodeType"in e}function Oa(e){var t,n;return e?bd(e)?e:Q2(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function J2(e){const{Document:t}=Oa(e);return e instanceof t}function Vh(e){return bd(e)?!1:e instanceof Oa(e).HTMLElement}function OI(e){return e instanceof Oa(e).SVGElement}function Sd(e){return e?bd(e)?e.document:Q2(e)?J2(e)?e:Vh(e)||OI(e)?e.ownerDocument:document:document:document}const vo=Ky?m.useLayoutEffect:m.useEffect;function eC(e){const t=m.useRef(e);return vo(()=>{t.current=e}),m.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 Gie(){const e=m.useRef(null),t=m.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ah(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return vo(()=>{n.current!==e&&(n.current=e)},t),n}function Bh(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function kg(e){const t=eC(e),n=m.useRef(null),r=m.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function jb(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let i1={};function Gh(e,t){return m.useMemo(()=>{if(t)return t;const n=i1[e]==null?0:i1[e]+1;return i1[e]=n,e+"-"+n},[e,t])}function II(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((i,c)=>{const u=Object.entries(c);for(const[f,h]of u){const y=i[f];y!=null&&(i[f]=y+e*h)}return i},{...t})}}const Vu=II(1),Lg=II(-1);function qie(e){return"clientX"in e&&"clientY"in e}function tC(e){if(!e)return!1;const{KeyboardEvent:t}=Oa(e.target);return t&&e instanceof t}function Kie(e){if(!e)return!1;const{TouchEvent:t}=Oa(e.target);return t&&e instanceof t}function Tb(e){if(Kie(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 qie(e)?{x:e.clientX,y:e.clientY}:null}const sh=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[sh.Translate.toString(e),sh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),eN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Zie(e){return e.matches(eN)?e:e.querySelector(eN)}const Yie={display:"none"};function Wie(e){let{id:t,value:n}=e;return re.createElement("div",{id:t,style:Yie},n)}function Xie(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 re.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Qie(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const MI=m.createContext(null);function Jie(e){const t=m.useContext(MI);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ele(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:s,event:i}=r;e.forEach(c=>{var u;return(u=c[s])==null?void 0:u.call(c,i)})},[e]),t]}const tle={draggable:`
|
|
799
|
-
To pick up a draggable item, press the space bar.
|
|
800
|
-
While dragging, use the arrow keys to move the item.
|
|
801
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
802
|
-
`},nle={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 rle(e){let{announcements:t=nle,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=tle}=e;const{announce:i,announcement:c}=Qie(),u=Gh("DndLiveRegion"),[f,h]=m.useState(!1);if(m.useEffect(()=>{h(!0)},[]),Jie(m.useMemo(()=>({onDragStart(g){let{active:x}=g;i(t.onDragStart({active:x}))},onDragMove(g){let{active:x,over:v}=g;t.onDragMove&&i(t.onDragMove({active:x,over:v}))},onDragOver(g){let{active:x,over:v}=g;i(t.onDragOver({active:x,over:v}))},onDragEnd(g){let{active:x,over:v}=g;i(t.onDragEnd({active:x,over:v}))},onDragCancel(g){let{active:x,over:v}=g;i(t.onDragCancel({active:x,over:v}))}}),[i,t])),!f)return null;const y=re.createElement(re.Fragment,null,re.createElement(Wie,{id:r,value:s.draggable}),re.createElement(Xie,{id:u,announcement:c}));return n?Os.createPortal(y,n):y}var Sr;(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"})(Sr||(Sr={}));function Pg(){}function nC(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function rC(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Fs=Object.freeze({x:0,y:0});function ale(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function sle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ole(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ile(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function tN(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 aC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=tN(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const h=ale(tN(f),s);i.push({id:u,data:{droppableContainer:c,value:h}})}}return i.sort(sle)};function lle(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),i=Math.min(t.top+t.height,e.top+e.height),c=s-r,u=i-n;if(r<s&&n<i){const f=t.width*t.height,h=e.width*e.height,y=c*u,g=y/(f+h-y);return Number(g.toFixed(4))}return 0}const cle=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:c}=i,u=n.get(c);if(u){const f=lle(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(ole)};function ule(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function kI(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Fs}function dle(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((c,u)=>({...c,top:c.top+e*u.y,bottom:c.bottom+e*u.y,left:c.left+e*u.x,right:c.right+e*u.x}),{...n})}}const fle=dle(1);function hle(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 mle(e,t,n){const r=hle(t);if(!r)return e;const{scaleX:s,scaleY:i,x:c,y:u}=r,f=e.left-c-(1-s)*parseFloat(n),h=e.top-u-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),y=s?e.width/s:e.width,g=i?e.height/i:e.height;return{width:y,height:g,top:h,right:f+y,bottom:h+g,left:f}}const ple={ignoreTransform:!1};function Cd(e,t){t===void 0&&(t=ple);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:y}=Oa(e).getComputedStyle(e);h&&(n=mle(n,h,y))}const{top:r,left:s,width:i,height:c,bottom:u,right:f}=n;return{top:r,left:s,width:i,height:c,bottom:u,right:f}}function nN(e){return Cd(e,{ignoreTransform:!0})}function gle(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function yle(e,t){return t===void 0&&(t=Oa(e).getComputedStyle(e)),t.position==="fixed"}function xle(e,t){t===void 0&&(t=Oa(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function sC(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(J2(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Vh(s)||OI(s)||n.includes(s))return n;const i=Oa(e).getComputedStyle(s);return s!==e&&xle(s,i)&&n.push(s),yle(s,i)?n:r(s.parentNode)}return e?r(e):n}function LI(e){const[t]=sC(e,1);return t??null}function l1(e){return!Ky||!e?null:bd(e)?e:Q2(e)?J2(e)||e===Sd(e).scrollingElement?window:Vh(e)?e:null:null}function PI(e){return bd(e)?e.scrollX:e.scrollLeft}function UI(e){return bd(e)?e.scrollY:e.scrollTop}function _b(e){return{x:PI(e),y:UI(e)}}var Rr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Rr||(Rr={}));function zI(e){return!Ky||!e?!1:e===document.scrollingElement}function FI(e){const t={x:0,y:0},n=zI(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,i=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:c,isRight:u,maxScroll:r,minScroll:t}}const vle={x:.2,y:.2};function ble(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=vle);const{isTop:h,isBottom:y,isLeft:g,isRight:x}=FI(e),v={x:0,y:0},C={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!h&&i<=t.top+S.height?(v.y=Rr.Backward,C.y=r*Math.abs((t.top+S.height-i)/S.height)):!y&&f>=t.bottom-S.height&&(v.y=Rr.Forward,C.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!x&&u>=t.right-S.width?(v.x=Rr.Forward,C.x=r*Math.abs((t.right-S.width-u)/S.width)):!g&&c<=t.left+S.width&&(v.x=Rr.Backward,C.x=r*Math.abs((t.left+S.width-c)/S.width)),{direction:v,speed:C}}function Sle(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,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 HI(e){return e.reduce((t,n)=>Vu(t,_b(n)),Fs)}function Cle(e){return e.reduce((t,n)=>t+PI(n),0)}function wle(e){return e.reduce((t,n)=>t+UI(n),0)}function Ele(e,t){if(t===void 0&&(t=Cd),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);LI(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Rle=[["x",["left","right"],Cle],["y",["top","bottom"],wle]];class oC{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=sC(n),s=HI(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of Rle)for(const f of c)Object.defineProperty(this,f,{get:()=>{const h=u(r),y=s[i]-h;return this.rect[f]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ff{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 jle(e){const{EventTarget:t}=Oa(e);return e instanceof t?e:Sd(e)}function c1(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 fs;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fs||(fs={}));function rN(e){e.preventDefault()}function Tle(e){e.stopPropagation()}var un;(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"})(un||(un={}));const $I={start:[un.Space,un.Enter],cancel:[un.Esc],end:[un.Space,un.Enter,un.Tab]},_le=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case un.Right:return{...n,x:n.x+25};case un.Left:return{...n,x:n.x-25};case un.Down:return{...n,y:n.y+25};case un.Up:return{...n,y:n.y-25}}};class VI{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 Ff(Sd(n)),this.windowListeners=new Ff(Oa(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fs.Resize,this.handleCancel),this.windowListeners.add(fs.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fs.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ele(r),n(Fs)}handleKeyDown(t){if(tC(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=$I,coordinateGetter:c=_le,scrollBehavior:u="smooth"}=s,{code:f}=t;if(i.end.includes(f)){this.handleEnd(t);return}if(i.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:h}=r.current,y=h?{x:h.left,y:h.top}:Fs;this.referenceCoordinates||(this.referenceCoordinates=y);const g=c(t,{active:n,context:r.current,currentCoordinates:y});if(g){const x=Lg(g,y),v={x:0,y:0},{scrollableAncestors:C}=r.current;for(const S of C){const w=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:I,maxScroll:A,minScroll:O}=FI(S),T=Sle(S),D={x:Math.min(w===un.Right?T.right-T.width/2:T.right,Math.max(w===un.Right?T.left:T.left+T.width/2,g.x)),y:Math.min(w===un.Down?T.bottom-T.height/2:T.bottom,Math.max(w===un.Down?T.top:T.top+T.height/2,g.y))},L=w===un.Right&&!j||w===un.Left&&!_,$=w===un.Down&&!I||w===un.Up&&!R;if(L&&D.x!==g.x){const K=S.scrollLeft+x.x,Z=w===un.Right&&K<=A.x||w===un.Left&&K>=O.x;if(Z&&!x.y){S.scrollTo({left:K,behavior:u});return}Z?v.x=S.scrollLeft-K:v.x=w===un.Right?S.scrollLeft-A.x:S.scrollLeft-O.x,v.x&&S.scrollBy({left:-v.x,behavior:u});break}else if($&&D.y!==g.y){const K=S.scrollTop+x.y,Z=w===un.Down&&K<=A.y||w===un.Up&&K>=O.y;if(Z&&!x.x){S.scrollTo({top:K,behavior:u});return}Z?v.y=S.scrollTop-K:v.y=w===un.Down?S.scrollTop-A.y:S.scrollTop-O.y,v.y&&S.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,Vu(Lg(g,this.referenceCoordinates),v))}}}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()}}VI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=$I,onActivation:s}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const u=i.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function aN(e){return!!(e&&"distance"in e)}function sN(e){return!!(e&&"delay"in e)}class iC{constructor(t,n,r){var s;r===void 0&&(r=jle(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:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=Sd(c),this.documentListeners=new Ff(this.document),this.listeners=new Ff(r),this.windowListeners=new Ff(Oa(c)),this.initialCoordinates=(s=Tb(i))!=null?s:Fs,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(fs.Resize,this.handleCancel),this.windowListeners.add(fs.DragStart,rN),this.windowListeners.add(fs.VisibilityChange,this.handleCancel),this.windowListeners.add(fs.ContextMenu,rN),this.documentListeners.add(fs.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(sN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(aN(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(fs.Click,Tle,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fs.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:c,options:{activationConstraint:u}}=i;if(!s)return;const f=(n=Tb(t))!=null?n:Fs,h=Lg(s,f);if(!r&&u){if(aN(u)){if(u.tolerance!=null&&c1(h,u.tolerance))return this.handleCancel();if(c1(h,u.distance))return this.handleStart()}if(sN(u)&&c1(h,u.tolerance))return this.handleCancel();this.handlePending(u,h);return}t.cancelable&&t.preventDefault(),c(f)}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===un.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Nle={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qh extends iC{constructor(t){const{event:n}=t,r=Sd(n.target);super(t,Nle,r)}}qh.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 Ale={move:{name:"mousemove"},end:{name:"mouseup"}};var Nb;(function(e){e[e.RightClick=2]="RightClick"})(Nb||(Nb={}));class Dle extends iC{constructor(t){super(t,Ale,Sd(t.event.target))}}Dle.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Nb.RightClick?!1:(r==null||r({event:n}),!0)}}];const u1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ole extends iC{constructor(t){super(t,u1)}static setup(){return window.addEventListener(u1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(u1.move.name,t)};function t(){}}}Ole.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 Hf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Hf||(Hf={}));var Ug;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ug||(Ug={}));function Ile(e){let{acceleration:t,activator:n=Hf.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=Ug.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:y,delta:g,threshold:x}=e;const v=kle({delta:g,disabled:!i}),[C,S]=Gie(),w=m.useRef({x:0,y:0}),R=m.useRef({x:0,y:0}),j=m.useMemo(()=>{switch(n){case Hf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Hf.DraggableRect:return s}},[n,s,f]),_=m.useRef(null),I=m.useCallback(()=>{const O=_.current;if(!O)return;const T=w.current.x*R.current.x,D=w.current.y*R.current.y;O.scrollBy(T,D)},[]),A=m.useMemo(()=>u===Ug.TreeOrder?[...h].reverse():h,[u,h]);m.useEffect(()=>{if(!i||!h.length||!j){S();return}for(const O of A){if((r==null?void 0:r(O))===!1)continue;const T=h.indexOf(O),D=y[T];if(!D)continue;const{direction:L,speed:$}=ble(O,D,j,t,x);for(const K of["x","y"])v[K][L[K]]||($[K]=0,L[K]=0);if($.x>0||$.y>0){S(),_.current=O,C(I,c),w.current=$,R.current=L;return}}w.current={x:0,y:0},R.current={x:0,y:0},S()},[t,I,r,S,i,c,JSON.stringify(j),JSON.stringify(v),C,h,A,y,JSON.stringify(x)])}const Mle={x:{[Rr.Backward]:!1,[Rr.Forward]:!1},y:{[Rr.Backward]:!1,[Rr.Forward]:!1}};function kle(e){let{delta:t,disabled:n}=e;const r=jb(t);return Bh(s=>{if(n||!r||!s)return Mle;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Rr.Backward]:s.x[Rr.Backward]||i.x===-1,[Rr.Forward]:s.x[Rr.Forward]||i.x===1},y:{[Rr.Backward]:s.y[Rr.Backward]||i.y===-1,[Rr.Forward]:s.y[Rr.Forward]||i.y===1}}},[n,t,r])}function Lle(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Bh(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function Ple(e,t){return m.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...i]},[]),[e,t])}var oh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(oh||(oh={}));var Ab;(function(e){e.Optimized="optimized"})(Ab||(Ab={}));const oN=new Map;function Ule(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,c]=m.useState(null),{frequency:u,measure:f,strategy:h}=s,y=m.useRef(e),g=w(),x=ah(g),v=m.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[x]),C=m.useRef(null),S=Bh(R=>{if(g&&!n)return oN;if(!R||R===oN||y.current!==e||i!=null){const j=new Map;for(let _ of e){if(!_)continue;if(i&&i.length>0&&!i.includes(_.id)&&_.rect.current){j.set(_.id,_.rect.current);continue}const I=_.node.current,A=I?new oC(f(I),I):null;_.rect.current=A,A&&j.set(_.id,A)}return j}return R},[e,i,n,g,f]);return m.useEffect(()=>{y.current=e},[e]),m.useEffect(()=>{g||v()},[n,g]),m.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),m.useEffect(()=>{g||typeof u!="number"||C.current!==null||(C.current=setTimeout(()=>{v(),C.current=null},u))},[u,g,v,...r]),{droppableRects:S,measureDroppableContainers:v,measuringScheduled:i!=null};function w(){switch(h){case oh.Always:return!1;case oh.BeforeDragging:return n;default:return!n}}}function BI(e,t){return Bh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function zle(e,t){return BI(e,t)}function Fle(e){let{callback:t,disabled:n}=e;const r=eC(t),s=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return m.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Zy(e){let{callback:t,disabled:n}=e;const r=eC(t),s=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return m.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Hle(e){return new oC(Cd(e),e)}function iN(e,t,n){t===void 0&&(t=Hle);const[r,s]=m.useState(null);function i(){s(f=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=f??n)!=null?h:null}const y=t(e);return JSON.stringify(f)===JSON.stringify(y)?f:y})}const c=Fle({callback(f){if(e)for(const h of f){const{type:y,target:g}=h;if(y==="childList"&&g instanceof HTMLElement&&g.contains(e)){i();break}}}}),u=Zy({callback:i});return vo(()=>{i(),e?(u==null||u.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),c==null||c.disconnect())},[e]),r}function $le(e){const t=BI(e);return kI(e,t)}const lN=[];function Vle(e){const t=m.useRef(e),n=Bh(r=>e?r&&r!==lN&&e&&t.current&&e.parentNode===t.current.parentNode?r:sC(e):lN,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function Ble(e){const[t,n]=m.useState(null),r=m.useRef(e),s=m.useCallback(i=>{const c=l1(i.target);c&&n(u=>u?(u.set(c,_b(c)),new Map(u)):null)},[]);return m.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const h=l1(f);return h?(h.addEventListener("scroll",s,{passive:!0}),[h,_b(h)]):null}).filter(f=>f!=null);n(u.length?new Map(u):null),r.current=e}return()=>{c(e),c(i)};function c(u){u.forEach(f=>{const h=l1(f);h==null||h.removeEventListener("scroll",s)})}},[s,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Vu(i,c),Fs):HI(e):Fs,[e,t])}function cN(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==Fs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Lg(e,n.current):Fs}function Gle(e){m.useEffect(()=>{if(!Ky)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 qle(e,t){return m.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=c=>{i(c,t)},n},{}),[e,t])}function GI(e){return m.useMemo(()=>e?gle(e):null,[e])}const uN=[];function Kle(e,t){t===void 0&&(t=Cd);const[n]=e,r=GI(n?Oa(n):null),[s,i]=m.useState(uN);function c(){i(()=>e.length?e.map(f=>zI(f)?r:new oC(t(f),f)):uN)}const u=Zy({callback:c});return vo(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function Zle(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Vh(t)?t:e}function Yle(e){let{measure:t}=e;const[n,r]=m.useState(null),s=m.useCallback(h=>{for(const{target:y}of h)if(Vh(y)){r(g=>{const x=t(y);return g?{...g,width:x.width,height:x.height}:x});break}},[t]),i=Zy({callback:s}),c=m.useCallback(h=>{const y=Zle(h);i==null||i.disconnect(),y&&(i==null||i.observe(y)),r(y?t(y):null)},[t,i]),[u,f]=kg(c);return m.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const Wle=[{sensor:qh,options:{}},{sensor:VI,options:{}}],Xle={current:{}},Zp={draggable:{measure:nN},droppable:{measure:nN,strategy:oh.WhileDragging,frequency:Ab.Optimized},dragOverlay:{measure:Cd}};class $f 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 Qle={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $f,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Zp,measureDroppableContainers:Pg,windowRect:null,measuringScheduled:!1},Jle={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pg,draggableNodes:new Map,over:null,measureDroppableContainers:Pg},Yy=m.createContext(Jle),qI=m.createContext(Qle);function ece(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $f}}}function tce(e,t){switch(t.type){case Sr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Sr.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 Sr.DragEnd:case Sr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Sr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new $f(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Sr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const c=new $f(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case Sr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new $f(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function nce(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=m.useContext(Yy),i=jb(r),c=jb(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!tC(i)||document.activeElement===i.target)return;const u=s.get(c);if(!u)return;const{activatorNode:f,node:h}=u;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const y of[f.current,h.current]){if(!y)continue;const g=Zie(y);if(g){g.focus();break}}})}},[r,t,s,c,i]),null}function rce(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function ace(e){return m.useMemo(()=>({draggable:{...Zp.draggable,...e==null?void 0:e.draggable},droppable:{...Zp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Zp.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 sce(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=m.useRef(!1),{x:c,y:u}=typeof s=="boolean"?{x:s,y:s}:s;vo(()=>{if(!c&&!u||!t){i.current=!1;return}if(i.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const y=n(h),g=kI(y,r);if(c||(g.x=0),u||(g.y=0),i.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const x=LI(h);x&&x.scrollBy({top:g.y,left:g.x})}},[t,c,u,r,n])}const KI=m.createContext({...Fs,scaleX:1,scaleY:1});var Ki;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ki||(Ki={}));const lC=m.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:h,sensors:y=Wle,collisionDetection:g=cle,measuring:x,modifiers:v,...C}=t;const S=m.useReducer(tce,void 0,ece),[w,R]=S,[j,_]=ele(),[I,A]=m.useState(Ki.Uninitialized),O=I===Ki.Initialized,{draggable:{active:T,nodes:D,translate:L},droppable:{containers:$}}=w,K=T!=null?D.get(T):null,Z=m.useRef({initial:null,translated:null}),G=m.useMemo(()=>{var In;return T!=null?{id:T,data:(In=K==null?void 0:K.data)!=null?In:Xle,rect:Z}:null},[T,K]),q=m.useRef(null),[z,M]=m.useState(null),[H,V]=m.useState(null),se=ah(C,Object.values(C)),ge=Gh("DndDescribedBy",c),P=m.useMemo(()=>$.getEnabled(),[$]),U=ace(x),{droppableRects:F,measureDroppableContainers:W,measuringScheduled:X}=Ule(P,{dragging:O,dependencies:[L.x,L.y],config:U.droppable}),ae=Lle(D,T),J=m.useMemo(()=>H?Tb(H):null,[H]),ce=es(),ye=zle(ae,U.draggable.measure);sce({activeNode:T!=null?D.get(T):null,config:ce.layoutShiftCompensation,initialRect:ye,measure:U.draggable.measure});const Se=iN(ae,U.draggable.measure,ye),Me=iN(ae?ae.parentElement:null),ke=m.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),tt=$.getNodeFor((n=ke.current.over)==null?void 0:n.id),at=Yle({measure:U.dragOverlay.measure}),Pt=(r=at.nodeRef.current)!=null?r:ae,fn=O?(s=at.rect)!=null?s:Se:null,Dn=!!(at.nodeRef.current&&at.rect),ln=$le(Dn?null:Se),Ie=GI(Pt?Oa(Pt):null),B=Vle(O?tt??ae:null),ne=Kle(B),ue=rce(v,{transform:{x:L.x-ln.x,y:L.y-ln.y,scaleX:1,scaleY:1},activatorEvent:H,active:G,activeNodeRect:Se,containerNodeRect:Me,draggingNodeRect:fn,over:ke.current.over,overlayNodeRect:at.rect,scrollableAncestors:B,scrollableAncestorRects:ne,windowRect:Ie}),Ne=J?Vu(J,L):null,Ee=Ble(B),Te=cN(Ee),$e=cN(Ee,[Se]),st=Vu(ue,Te),ot=fn?fle(fn,ue):null,jn=G&&ot?g({active:G,collisionRect:ot,droppableRects:F,droppableContainers:P,pointerCoordinates:Ne}):null,mr=ile(jn,"id"),[On,Qr]=m.useState(null),Gn=Dn?ue:Vu(ue,$e),Hn=ule(Gn,(i=On==null?void 0:On.rect)!=null?i:null,Se),or=m.useRef(null),kn=m.useCallback((In,Tn)=>{let{sensor:We,options:Ft}=Tn;if(q.current==null)return;const Ht=D.get(q.current);if(!Ht)return;const qt=In.nativeEvent,Zn=new We({active:q.current,activeNode:Ht,event:qt,options:Ft,context:ke,onAbort(Xt){if(!D.get(Xt))return;const{onDragAbort:ee}=se.current,le={id:Xt};ee==null||ee(le),j({type:"onDragAbort",event:le})},onPending(Xt,Y,ee,le){if(!D.get(Xt))return;const{onDragPending:je}=se.current,He={id:Xt,constraint:Y,initialCoordinates:ee,offset:le};je==null||je(He),j({type:"onDragPending",event:He})},onStart(Xt){const Y=q.current;if(Y==null)return;const ee=D.get(Y);if(!ee)return;const{onDragStart:le}=se.current,Ce={activatorEvent:qt,active:{id:Y,data:ee.data,rect:Z}};Os.unstable_batchedUpdates(()=>{le==null||le(Ce),A(Ki.Initializing),R({type:Sr.DragStart,initialCoordinates:Xt,active:Y}),j({type:"onDragStart",event:Ce}),M(or.current),V(qt)})},onMove(Xt){R({type:Sr.DragMove,coordinates:Xt})},onEnd:nn(Sr.DragEnd),onCancel:nn(Sr.DragCancel)});or.current=Zn;function nn(Xt){return async function(){const{active:ee,collisions:le,over:Ce,scrollAdjustedTranslate:je}=ke.current;let He=null;if(ee&&je){const{cancelDrop:qe}=se.current;He={activatorEvent:qt,active:ee,collisions:le,delta:je,over:Ce},Xt===Sr.DragEnd&&typeof qe=="function"&&await Promise.resolve(qe(He))&&(Xt=Sr.DragCancel)}q.current=null,Os.unstable_batchedUpdates(()=>{R({type:Xt}),A(Ki.Uninitialized),Qr(null),M(null),V(null),or.current=null;const qe=Xt===Sr.DragEnd?"onDragEnd":"onDragCancel";if(He){const Fe=se.current[qe];Fe==null||Fe(He),j({type:qe,event:He})}})}}},[D]),Eo=m.useCallback((In,Tn)=>(We,Ft)=>{const Ht=We.nativeEvent,qt=D.get(Ft);if(q.current!==null||!qt||Ht.dndKit||Ht.defaultPrevented)return;const Zn={active:qt};In(We,Tn.options,Zn)===!0&&(Ht.dndKit={capturedBy:Tn.sensor},q.current=Ft,kn(We,Tn))},[D,kn]),pa=Ple(y,Eo);Gle(y),vo(()=>{Se&&I===Ki.Initializing&&A(Ki.Initialized)},[Se,I]),m.useEffect(()=>{const{onDragMove:In}=se.current,{active:Tn,activatorEvent:We,collisions:Ft,over:Ht}=ke.current;if(!Tn||!We)return;const qt={active:Tn,activatorEvent:We,collisions:Ft,delta:{x:st.x,y:st.y},over:Ht};Os.unstable_batchedUpdates(()=>{In==null||In(qt),j({type:"onDragMove",event:qt})})},[st.x,st.y]),m.useEffect(()=>{const{active:In,activatorEvent:Tn,collisions:We,droppableContainers:Ft,scrollAdjustedTranslate:Ht}=ke.current;if(!In||q.current==null||!Tn||!Ht)return;const{onDragOver:qt}=se.current,Zn=Ft.get(mr),nn=Zn&&Zn.rect.current?{id:Zn.id,rect:Zn.rect.current,data:Zn.data,disabled:Zn.disabled}:null,Xt={active:In,activatorEvent:Tn,collisions:We,delta:{x:Ht.x,y:Ht.y},over:nn};Os.unstable_batchedUpdates(()=>{Qr(nn),qt==null||qt(Xt),j({type:"onDragOver",event:Xt})})},[mr]),vo(()=>{ke.current={activatorEvent:H,active:G,activeNode:ae,collisionRect:ot,collisions:jn,droppableRects:F,draggableNodes:D,draggingNode:Pt,draggingNodeRect:fn,droppableContainers:$,over:On,scrollableAncestors:B,scrollAdjustedTranslate:st},Z.current={initial:fn,translated:ot}},[G,ae,jn,ot,D,Pt,fn,F,$,On,B,st]),Ile({...ce,delta:L,draggingRect:ot,pointerCoordinates:Ne,scrollableAncestors:B,scrollableAncestorRects:ne});const Dr=m.useMemo(()=>({active:G,activeNode:ae,activeNodeRect:Se,activatorEvent:H,collisions:jn,containerNodeRect:Me,dragOverlay:at,draggableNodes:D,droppableContainers:$,droppableRects:F,over:On,measureDroppableContainers:W,scrollableAncestors:B,scrollableAncestorRects:ne,measuringConfiguration:U,measuringScheduled:X,windowRect:Ie}),[G,ae,Se,H,jn,Me,at,D,$,F,On,W,B,ne,U,X,Ie]),vs=m.useMemo(()=>({activatorEvent:H,activators:pa,active:G,activeNodeRect:Se,ariaDescribedById:{draggable:ge},dispatch:R,draggableNodes:D,over:On,measureDroppableContainers:W}),[H,pa,G,Se,R,ge,D,On,W]);return re.createElement(MI.Provider,{value:_},re.createElement(Yy.Provider,{value:vs},re.createElement(qI.Provider,{value:Dr},re.createElement(KI.Provider,{value:Hn},h)),re.createElement(nce,{disabled:(u==null?void 0:u.restoreFocus)===!1})),re.createElement(rle,{...u,hiddenTextDescribedById:ge}));function es(){const In=(z==null?void 0:z.autoScrollEnabled)===!1,Tn=typeof f=="object"?f.enabled===!1:f===!1,We=O&&!In&&!Tn;return typeof f=="object"?{...f,enabled:We}:{enabled:We}}}),oce=m.createContext(null),dN="button",ice="Draggable";function lce(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Gh(ice),{activators:c,activatorEvent:u,active:f,activeNodeRect:h,ariaDescribedById:y,draggableNodes:g,over:x}=m.useContext(Yy),{role:v=dN,roleDescription:C="draggable",tabIndex:S=0}=s??{},w=(f==null?void 0:f.id)===t,R=m.useContext(w?KI:oce),[j,_]=kg(),[I,A]=kg(),O=qle(c,t),T=ah(n);vo(()=>(g.set(t,{id:t,key:i,node:j,activatorNode:I,data:T}),()=>{const L=g.get(t);L&&L.key===i&&g.delete(t)}),[g,t]);const D=m.useMemo(()=>({role:v,tabIndex:S,"aria-disabled":r,"aria-pressed":w&&v===dN?!0:void 0,"aria-roledescription":C,"aria-describedby":y.draggable}),[r,v,S,w,C,y.draggable]);return{active:f,activatorEvent:u,activeNodeRect:h,attributes:D,isDragging:w,listeners:r?void 0:O,node:j,over:x,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function cce(){return m.useContext(qI)}const uce="Droppable",dce={timeout:25};function fce(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Gh(uce),{active:c,dispatch:u,over:f,measureDroppableContainers:h}=m.useContext(Yy),y=m.useRef({disabled:n}),g=m.useRef(!1),x=m.useRef(null),v=m.useRef(null),{disabled:C,updateMeasurementsFor:S,timeout:w}={...dce,...s},R=ah(S??r),j=m.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{h(Array.isArray(R.current)?R.current:[R.current]),v.current=null},w)},[w]),_=Zy({callback:j,disabled:C||!c}),I=m.useCallback((D,L)=>{_&&(L&&(_.unobserve(L),g.current=!1),D&&_.observe(D))},[_]),[A,O]=kg(I),T=ah(t);return m.useEffect(()=>{!_||!A.current||(_.disconnect(),g.current=!1,_.observe(A.current))},[A,_]),m.useEffect(()=>(u({type:Sr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:x,data:T}}),()=>u({type:Sr.UnregisterDroppable,key:i,id:r})),[r]),m.useEffect(()=>{n!==y.current.disabled&&(u({type:Sr.SetDroppableDisabled,id:r,key:i,disabled:n}),y.current.disabled=n)},[r,i,n,u]),{active:c,rect:x,isOver:(f==null?void 0:f.id)===r,node:A,over:f,setNodeRef:O}}function ZI(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function hce(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function Op(e){return e!==null&&e>=0}function mce(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 pce(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const YI=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=ZI(t,r,n),c=t[s],u=i[s];return!u||!c?null:{x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height}},Ip={scaleX:1,scaleY:1},cC=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:c}=e;const u=(t=i[n])!=null?t:r;if(!u)return null;if(s===n){const h=i[c];return h?{x:0,y:n<c?h.top+h.height-(u.top+u.height):h.top-u.top,...Ip}:null}const f=gce(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...Ip}:s<n&&s>=c?{x:0,y:u.height+f,...Ip}:{x:0,y:0,...Ip}};function gce(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return r?n<t?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const WI="Sortable",XI=re.createContext({activeIndex:-1,containerId:WI,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:YI,disabled:{draggable:!1,droppable:!1}});function uC(e){let{children:t,id:n,items:r,strategy:s=YI,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:h,measureDroppableContainers:y}=cce(),g=Gh(WI,n),x=u.rect!==null,v=m.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),C=c!=null,S=c?v.indexOf(c.id):-1,w=h?v.indexOf(h.id):-1,R=m.useRef(v),j=!mce(v,R.current),_=w!==-1&&S===-1||j,I=pce(i);vo(()=>{j&&C&&y(v)},[j,v,C,y]),m.useEffect(()=>{R.current=v},[v]);const A=m.useMemo(()=>({activeIndex:S,containerId:g,disabled:I,disableTransforms:_,items:v,overIndex:w,useDragOverlay:x,sortedRects:hce(v,f),strategy:s}),[S,g,I.draggable,I.droppable,_,v,w,f,x,s]);return re.createElement(XI.Provider,{value:A},t)}const yce=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return ZI(n,r,s).indexOf(t)},xce=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:c,previousItems:u,previousContainerId:f,transition:h}=e;return!h||!r||u!==i&&s===c?!1:n?!0:c!==s&&t===f},vce={duration:200,easing:"ease"},QI="transform",bce=sh.Transition.toString({property:QI,duration:0,easing:"linear"}),Sce={roleDescription:"sortable"};function Cce(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=m.useState(null),u=m.useRef(n);return vo(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const h=Cd(r.current,{ignoreTransform:!0}),y={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(y.x||y.y)&&c(y)}}n!==u.current&&(u.current=n)},[t,n,r,s]),m.useEffect(()=>{i&&c(null)},[i]),i}function wce(e){let{animateLayoutChanges:t=xce,attributes:n,disabled:r,data:s,getNewIndex:i=yce,id:c,strategy:u,resizeObserverConfig:f,transition:h=vce}=e;const{items:y,containerId:g,activeIndex:x,disabled:v,disableTransforms:C,sortedRects:S,overIndex:w,useDragOverlay:R,strategy:j}=m.useContext(XI),_=Ece(r,v),I=y.indexOf(c),A=m.useMemo(()=>({sortable:{containerId:g,index:I,items:y},...s}),[g,s,I,y]),O=m.useMemo(()=>y.slice(y.indexOf(c)),[y,c]),{rect:T,node:D,isOver:L,setNodeRef:$}=fce({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:K,activatorEvent:Z,activeNodeRect:G,attributes:q,setNodeRef:z,listeners:M,isDragging:H,over:V,setActivatorNodeRef:se,transform:ge}=lce({id:c,data:A,attributes:{...Sce,...n},disabled:_.draggable}),P=Bie($,z),U=!!K,F=U&&!C&&Op(x)&&Op(w),W=!R&&H,X=W&&F?ge:null,J=F?X??(u??j)({rects:S,activeNodeRect:G,activeIndex:x,overIndex:w,index:I}):null,ce=Op(x)&&Op(w)?i({id:c,items:y,activeIndex:x,overIndex:w}):I,ye=K==null?void 0:K.id,Se=m.useRef({activeId:ye,items:y,newIndex:ce,containerId:g}),Me=y!==Se.current.items,ke=t({active:K,containerId:g,isDragging:H,isSorting:U,id:c,index:I,items:y,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:h,wasDragging:Se.current.activeId!=null}),tt=Cce({disabled:!ke,index:I,node:D,rect:T});return m.useEffect(()=>{U&&Se.current.newIndex!==ce&&(Se.current.newIndex=ce),g!==Se.current.containerId&&(Se.current.containerId=g),y!==Se.current.items&&(Se.current.items=y)},[U,ce,g,y]),m.useEffect(()=>{if(ye===Se.current.activeId)return;if(ye&&!Se.current.activeId){Se.current.activeId=ye;return}const Pt=setTimeout(()=>{Se.current.activeId=ye},50);return()=>clearTimeout(Pt)},[ye]),{active:K,activeIndex:x,attributes:q,data:A,rect:T,index:I,newIndex:ce,items:y,isOver:L,isSorting:U,isDragging:H,listeners:M,node:D,overIndex:w,over:V,setNodeRef:P,setActivatorNodeRef:se,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:tt??J,transition:at()};function at(){if(tt||Me&&Se.current.newIndex===I)return bce;if(!(W&&!tC(Z)||!h)&&(U||ke))return sh.Transition.toString({...h,property:QI})}}function Ece(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}}un.Down,un.Right,un.Up,un.Left;function Bu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:i,saveButtonText:c="Save",cancelButtonText:u="Discard"}){const[f,h]=m.useState(!1),[y,g]=m.useState(e),x=m.useRef(null),v=j=>{g(j.target.value)},C=()=>{n&&y!==e&&n(y.trim()),h(!1)},S=()=>{g(e),h(!1)},w=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),C()):j.key==="Escape"&&(j.preventDefault(),S())},R=j=>{h(j),j?(g(e),setTimeout(()=>{x.current&&x.current.focus()},0)):S()};return a.jsxs(z2,{open:f,onOpenChange:R,children:[a.jsx(F2,{asChild:!0,children:a.jsx("div",{className:oe("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",i),children:e||t})}),a.jsxs(H2,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(Co,{ref:x,value:y,onChange:v,onKeyDown:w,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),a.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(we,{size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Rce({isAllExpanded:e,onToggle:t}){return a.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?a.jsx(wP,{className:"h-4 w-4"}):a.jsx(Xb,{className:"h-4 w-4"})})}function jce({isExpanded:e,onToggle:t,ariaLabel:n}){return a.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?a.jsx(Vs,{className:"h-4 w-4"}):a.jsx(Da,{className:"h-4 w-4"})})}function Tce({className:e="",...t}){return a.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:a.jsx(vA,{className:"h-4 w-4 text-gray-400"})})}function dC({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=wce({id:e}),f={transform:sh.Transform.toString(i),transition:c,opacity:u?.75:1},h=m.Children.toArray(t),y=[a.jsx(Hr,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:a.jsx(Tce,{...n,...r})},"drag-handle-cell"),...h.slice(1)];return a.jsx(Fn,{ref:s,style:f,className:"group",children:y})}function JI({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,i]=m.useState(!1),c=()=>{t&&t(e.index),i(!1)},u=r&&n&&r(e.index),f=!!t,h=u&&f;return a.jsxs("div",{className:"px-3 text-right",children:[a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.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:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ar,{align:"end",children:[u&&a.jsxs(Nt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),h&&a.jsx(Na,{}),f&&a.jsxs(Nt,{onClick:()=>{i(!0)},children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(Cr,{open:s,onOpenChange:i,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function _ce({mode:e,onModeChange:t}){const n=Object.values(eh),r=s=>{t&&t(s)};return a.jsxs(ua,{value:e,onValueChange:r,children:[a.jsx(fa,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(da,{placeholder:"Select field mode"})}),a.jsx(ha,{className:"max-h-[300px]",children:n.map(s=>a.jsx(Bn,{value:s,children:s},s))})]})}var Wy="Checkbox",[Nce]=wr(Wy),[Ace,fC]=Nce(Wy);function Dce(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:h,value:y="on",internal_do_not_use_render:g}=e,[x,v]=la({prop:n,defaultProp:s??!1,onChange:f,caller:Wy}),[C,S]=m.useState(null),[w,R]=m.useState(null),j=m.useRef(!1),_=C?!!c||!!C.closest("form"):!0,I={checked:x,disabled:i,setChecked:v,control:C,setControl:S,name:u,form:c,value:y,hasConsumerStoppedPropagationRef:j,required:h,defaultChecked:ul(s)?!1:s,isFormControl:_,bubbleInput:w,setBubbleInput:R};return a.jsx(Ace,{scope:t,...I,children:Oce(g)?g(I):r})}var eM="CheckboxTrigger",tM=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:h,setControl:y,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:C}=fC(eM,e),S=mt(s,y),w=m.useRef(f);return m.useEffect(()=>{const R=i==null?void 0:i.form;if(R){const j=()=>g(w.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[i,g]),a.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":ul(f)?"mixed":f,"aria-required":h,"data-state":iM(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:S,onKeyDown:Oe(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Oe(n,R=>{g(j=>ul(j)?!0:!j),C&&v&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});tM.displayName=eM;var nM=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:h,form:y,...g}=e;return a.jsx(Dce,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:h,name:r,form:y,value:f,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(tM,{...g,ref:t,__scopeCheckbox:n}),x&&a.jsx(oM,{__scopeCheckbox:n})]})})});nM.displayName=Wy;var rM="CheckboxIndicator",aM=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=fC(rM,n);return a.jsx($r,{present:r||ul(i.checked)||i.checked===!0,children:a.jsx(Je.span,{"data-state":iM(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});aM.displayName=rM;var sM="CheckboxBubbleInput",oM=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:h,value:y,form:g,bubbleInput:x,setBubbleInput:v}=fC(sM,e),C=mt(n,v),S=v2(i),w=hS(r);m.useEffect(()=>{const j=x;if(!j)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!s.current;if(S!==i&&A){const T=new Event("click",{bubbles:O});j.indeterminate=ul(i),A.call(j,ul(i)?!1:i),j.dispatchEvent(T)}},[x,S,i,s]);const R=m.useRef(ul(i)?!1:i);return a.jsx(Je.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:u,disabled:f,name:h,value:y,form:g,...t,tabIndex:-1,ref:C,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});oM.displayName=sM;function Oce(e){return typeof e=="function"}function ul(e){return e==="indeterminate"}function iM(e){return ul(e)?"indeterminate":e?"checked":"unchecked"}function Ice({className:e,...t}){return a.jsx(nM,{"data-slot":"checkbox",className:oe("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:a.jsx(aM,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(ia,{className:"size-3.5"})})})}function lM({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(Ice,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const fN={[Wa.CONNECTED]:{icon:mh,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[Wa.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:ph,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[Wa.DISCONNECTED]:{icon:LU,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function cM({status:e}){if(!(e in fN))return null;const t=fN[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(n,{className:oe("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),a.jsxs(Rt,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs font-medium",children:s}),a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:i})]})]})})}function hC({type:e,storageType:t,onTypeChange:n}){const r=t===Re.GOOGLE_BIGQUERY?Object.values(sr):t===Re.AWS_ATHENA?Object.values(c2):Object.values(u2),s=i=>{n&&(t===Re.GOOGLE_BIGQUERY||Re.AWS_ATHENA,n(i))};return a.jsxs(ua,{value:e,onValueChange:s,children:[a.jsx(fa,{className:"cursor-pointer",size:"sm",children:a.jsx(da,{placeholder:"Select field type"})}),a.jsx(ha,{className:"max-h-[300px]",children:r.map(i=>a.jsx(Bn,{value:i,children:i},i))})]})}function Mce({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ar,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(Nt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ia,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function kce({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:i,"aria-label":c}){const[u,f]=m.useState(n),h=m.useRef(!0);m.useEffect(()=>{(n===""||h.current)&&(f(n),h.current=!1)},[n]);const y=m.useCallback(g=>{const x=g.target.value;f(x);const v=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(v)}},[r,s]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Ec,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(It,{id:e,placeholder:t,value:u,onChange:y,className:i??"dm-card-toolbar-search-input","aria-label":c??t})]})}function Lce({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s,disabled:i=!1}){return a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsx(kce,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),a.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&a.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([c,u])=>u===0?null:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(cM,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:u})]},c))}),a.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:i,"aria-label":"Add new field",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const Pce={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function hN(e,t={}){const n=Pce[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 Uce({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:i,dragContextProps:c,rowComponent:u=Fn,getRowId:f}){const{isSchemaActualizationLoading:h}=gs(),y=t,g=i,x=u,{columnVisibility:v,setColumnVisibility:C}=zie(y),S=El({data:e,columns:y,getCoreRowModel:wl(),getFilteredRowModel:pd(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:C,enableGlobalFilter:!0,globalFilterFn:Fie,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:w,onChange:R,searchValue:j}=Hie(S),_=m.useRef("");m.useEffect(()=>{s&&j!==_.current&&(_.current=j,s(j))},[j,s]);const I=m.useMemo(()=>{const T={[Wa.CONNECTED]:0,[Wa.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[Wa.DISCONNECTED]:0};return(r??e).forEach(L=>{L.status in T&&T[L.status]++}),T},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx(Lce,{table:S,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:w,onFilterChange:R,statusCounts:I,disabled:h}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(Rl,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(jl,{className:"dm-card-table-header",children:S.getHeaderGroups().map(T=>a.jsx(Fn,{className:"dm-card-table-header-row",children:T.headers.map(D=>a.jsx(_l,{className:"bg-secondary dark:bg-background",style:hN(D.column.id,{width:D.getSize()!==0?D.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:D.isPlaceholder?null:typeof D.column.columnDef.header=="function"?D.column.columnDef.header(D.getContext()):D.column.columnDef.header},D.id))},T.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:S.getRowModel().rows.length?a.jsx(g,{...c,children:S.getRowModel().rows.map(T=>a.jsx(x,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(D=>a.jsx(Hr,{className:"bg-background dark:bg-muted",style:hN(D.column.id,{width:D.column.getSize()!==0?D.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:D.column.columnDef.cell&&typeof D.column.columnDef.cell=="function"?D.column.columnDef.cell(D.getContext()):null},D.id))},T.id))}):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:y.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.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,disabled:h,"aria-label":"Add new field",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function mC({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:h,primaryKeyColumnCell:y,aliasColumnCell:g,descriptionColumnCell:x,actionsColumnCell:v,dragContext:C,dragContextProps:S,rowComponent:w,getRowId:R}){const j=m.useCallback((T,D)=>{if(t){const L=[...e];L[T]={...L[T],...D},t(L)}},[e,t]),_=m.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),I=m.useCallback(T=>{if(t){const D=[...e];D.splice(T,1),t(D)}},[e,t]),A=m.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(cM,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default",children:"Name"}),a.jsx(Rt,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>h?h({row:T,updateField:j}):a.jsx(Bu,{value:Lie(T.getValue("name")),onValueChange:D=>{j(T.index,{name:D})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default",children:"PK"}),a.jsx(Rt,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:T})=>y?y({row:T,updateField:j}):a.jsx(lM,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:D=>{j(T.index,{isPrimaryKey:D})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default",children:"Alias"}),a.jsx(Rt,{children:"Alternative name for the field"})]}),size:80,cell:({row:T})=>g?g({row:T,updateField:j}):a.jsx(Bu,{value:T.getValue("alias"),onValueChange:D=>{j(T.index,{alias:D})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default",children:"Description"}),a.jsx(Rt,{children:"Detailed information about the field"})]}),cell:({row:T})=>x?x({row:T,updateField:j}):a.jsx(Bu,{value:T.getValue("description"),onValueChange:D=>{j(T.index,{description:D})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>a.jsx(Mce,{table:T}),cell:({row:T,table:D})=>v?v({row:T,table:D}):a.jsx(JI,{row:T,onDeleteRow:t?I:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,I,t,f,h,y,g,x,v]),O=m.useMemo(()=>{const D={accessorKey:"type",header:()=>a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(Rt,{children:"Data type of the field"})]}),size:80,cell:$=>s({row:$.row,updateField:j}),enableHiding:!1},L=[...A];if(L.splice(3,0,D),i.length>0){const $=[...i];$.sort((K,Z)=>{const G=K.columnIndex??1/0,q=Z.columnIndex??1/0;return G-q}),$.forEach(K=>{if(K.columnIndex!==void 0){const Z=Math.min(Math.max(0,K.columnIndex),L.length);L.splice(Z,0,K)}else L.splice(L.length-1,0,K)})}return L},[A,s,j,i]);return a.jsx(Uce,{fields:e,columns:O,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:C,dragContextProps:S,rowComponent:w,getRowId:R})}function zce({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:h,allExpanded:y}=$ie(e),{updateField:g,handleDeleteRow:x,handleAddNestedField:v,handleAddRow:C}=Vie(e,c,t,K=>K),S=m.useCallback(()=>({name:"",type:sr.STRING,mode:eh.NULLABLE,isPrimaryKey:!1,status:Wa.DISCONNECTED}),[]),w=m.useCallback(({row:K})=>a.jsx(hC,{type:K.getValue("type"),storageType:Re.GOOGLE_BIGQUERY,onTypeChange:Z=>{g(K.index,{type:Z})}}),[g]),R=m.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(Rt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
803
|
-
NULLABLE - field can be NULL
|
|
804
|
-
REQUIRED - field cant be NULL
|
|
805
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:K})=>a.jsx(_ce,{mode:K.getValue("mode"),onModeChange:Z=>{g(K.index,{mode:Z})}}),columnIndex:4}],[g]),j=m.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(Rce,{isAllExpanded:y,onToggle:i}),a.jsxs(wt,{children:[a.jsx(Et,{className:"cursor-default",children:"Name"}),a.jsx(Rt,{children:"Field name in the output schema"})]})]}),[r,y,i]),_=m.useCallback(({row:K})=>{const Z=c[K.index],q=(Z.type===sr.RECORD||Z.type===sr.STRUCT)&&Z.fields&&Z.fields.length>0,z=Z.path??"",M=Z.level??0,H=n.has(z);return a.jsxs("div",{className:"flex items-center",children:[M>0&&a.jsx("div",{style:{width:`${String(M*16-(q?4:0))}px`},className:"flex-shrink-0"}),q?a.jsx(jce,{isExpanded:H,onToggle:()=>{s(z)},ariaLabel:H?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(Bu,{value:K.getValue("name"),onValueChange:V=>{g(K.index,{name:V})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,g]),I=m.useCallback(({row:K})=>{const Z=c[K.index],G=Z.type===sr.RECORD||Z.type===sr.STRUCT;return(Z.level??0)===0&&!G?a.jsx(lM,{isPrimaryKey:K.getValue("isPrimaryKey"),onPrimaryKeyChange:z=>{g(K.index,{isPrimaryKey:z})}}):a.jsx("div",{})},[c,g]),A=m.useCallback(({row:K})=>a.jsx(Bu,{value:K.getValue("description"),onValueChange:Z=>{g(K.index,{description:Z})},minRows:5,placeholder:"-"}),[g]),O=m.useCallback(({row:K})=>a.jsx(Bu,{value:K.getValue("alias"),onValueChange:Z=>{g(K.index,{alias:Z})},placeholder:"-"}),[g]),T=m.useCallback(({row:K})=>a.jsx(JI,{row:K,onDeleteRow:t?x:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,x,v,f]),{handleDragEnd:D}=X2(e,t,c),L=m.useCallback(K=>{const Z=c[K.index];return Z.path??String(c.indexOf(Z))},[c]),$=rC(nC(qh,{activationConstraint:{distance:5}}));return a.jsx(lC,{sensors:$,collisionDetection:aC,onDragEnd:D,children:a.jsx(mC,{fields:c,onFieldsChange:t,onAddRow:C,createNewField:S,renderTypeCell:w,additionalColumns:R,fieldsForStatusCount:h,onSearchChange:u,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:I,aliasColumnCell:O,descriptionColumnCell:A,actionsColumnCell:T,dragContext:uC,dragContextProps:{items:c.map(K=>K.path??String(c.indexOf(K))),strategy:cC},rowComponent:dC,getRowId:L})})}function Fce({fields:e,onFieldsChange:t}){const n=m.useCallback(()=>({name:"",type:c2.STRING,isPrimaryKey:!1,status:Wa.DISCONNECTED}),[]),r=m.useCallback(({row:c,updateField:u})=>a.jsx(hC,{type:c.getValue("type"),storageType:Re.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=X2(e,t),i=rC(nC(qh,{activationConstraint:{distance:5}}));return a.jsx(lC,{sensors:i,collisionDetection:aC,onDragEnd:s,children:a.jsx(mC,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:uC,dragContextProps:{items:e.map((c,u)=>u),strategy:cC},rowComponent:dC})})}function Hce({fields:e,onFieldsChange:t}){const n=m.useCallback(()=>({name:"",type:u2.VARCHAR,isPrimaryKey:!1,status:Wa.DISCONNECTED}),[]),r=m.useCallback(({row:c,updateField:u})=>a.jsx(hC,{type:c.getValue("type"),storageType:Re.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=X2(e,t),i=rC(nC(qh,{activationConstraint:{distance:5}}));return a.jsx(lC,{sensors:i,collisionDetection:aC,onDragEnd:s,children:a.jsx(mC,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:uC,dragContextProps:{items:e.map((c,u)=>u),strategy:cC},rowComponent:dC})})}function $ce({schema:e,storageType:t,onFieldsChange:n}){const r=m.useMemo(()=>{if(!e){const s=kie(t);return n(s.fields),s}return e},[e,t,n]);return TI(r)?a.jsx(zce,{fields:r.fields,onFieldsChange:n}):_I(r)?a.jsx(Fce,{fields:r.fields,onFieldsChange:n}):NI(r)?a.jsx(Hce,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function Vce({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=gs(),{id:u="",schema:f}=t??{},{schema:h,isDirty:y,updateSchema:g,resetSchema:x}=Pie(f),{operationStatus:v,startSaveOperation:C}=Uie(r,s);m.useEffect(()=>{v==="success"&&x()},[v,x]);const S=m.useCallback(I=>{g(I)},[g]),w=m.useCallback(()=>{u&&h&&(C(),n(u,h).then(()=>{i==null||i()}))},[u,h,C,n,i]),R=m.useCallback(()=>{i==null||i()},[i]),j=m.useCallback(()=>{x()},[x]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx($ce,{schema:h,storageType:t.storage.type,onFieldsChange:S}),a.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[a.jsxs("div",{className:"flex space-x-4",children:[a.jsx(we,{variant:"default",onClick:w,disabled:!y||_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:j,disabled:!y||_,children:"Discard"})]}),a.jsx(we,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function Bce(){const e=Zg(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(JO,{children:a.jsx(_re,{id:t})})}):a.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):a.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function Gce({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:oe("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function qce({className:e,...t}){return a.jsx("div",{"data-slot":"card-header",className:oe("@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 Kce({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:oe("leading-none font-semibold",e),...t})}function Zce({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:oe("text-muted-foreground text-sm",e),...t})}function Yce({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:oe("px-6",e),...t})}function Wce({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:oe("flex items-center px-6 [.border-t]:pt-6",e),...t})}const pC=m.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function ho({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=m.useContext(pC);return a.jsxs("div",{className:"flex items-center gap-2 self-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:a.jsx(e,{size:18})}),a.jsx(Kce,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(Zce,{className:oe("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.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:[a.jsx(zr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),a.jsx("span",{className:"sr-only",children:t})]})}),a.jsx(Rt,{children:a.jsx("p",{children:t})})]})})]})}ho.displayName="CollapsibleCardHeaderTitle";function Kh({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:oe("flex items-center gap-2 self-center",t),onClick:n,children:e})}Kh.displayName="CollapsibleCardHeaderActions";function mo({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=m.useContext(pC);let s,i;return m.Children.forEach(e,c=>{if(m.isValidElement(c))switch(c.type){case ho:s=c;break;case Kh:i=c;break}}),a.jsxs(qce,{className:oe("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,a.jsxs("div",{className:"flex items-center gap-2",children:[i,t&&a.jsx("div",{className:oe("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:a.jsx("div",{className:oe("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(Vs,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}mo.displayName="CollapsibleCardHeader";function po({children:e}){return a.jsx(Yce,{className:"px-4 pt-1",children:e})}po.displayName="CollapsibleCardContent";function ni({left:e,right:t}){return a.jsxs(Wce,{className:"flex items-center gap-2 px-4 py-4",children:[a.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&a.jsx("div",{className:"flex items-center",children:t})]})}ni.displayName="CollapsibleCardFooter";const mN="collapsed-card-";function dl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?io.get(`${mN}${c}`,"boolean")??s:s,[f,h]=m.useState(u);m.useEffect(()=>{c&&io.set(`${mN}${c}`,f)},[f,c]);const y=()=>{const S=!f;h(S),i==null||i(S)};let g,x,v;m.Children.forEach(e,S=>{if(m.isValidElement(S))switch(S.type){case mo:g=S;break;case po:x=S;break;case ni:v=S;break}});const C={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 a.jsx(pC.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:y},children:a.jsxs(Gce,{className:oe(C[n],t),children:[g,a.jsx("div",{className:oe("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[x,v]})})]})})}function Xce(){const{dataMart:e,updateDataMartStorage:t}=xs(),n=(e==null?void 0:e.definitionType)??null,[r,s]=m.useState(n);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs(dl,{collapsible:!0,name:"data-storage",children:[a.jsx(mo,{children:a.jsx(ho,{icon:lc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(po,{children:(e==null?void 0:e.storage)&&a.jsx(Xse,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(ni,{})]}),a.jsxs(dl,{collapsible:!0,name:"input-source",children:[a.jsx(mo,{children:a.jsx(ho,{icon:Qb,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(po,{children:e&&a.jsx(Mie,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(ni,{})]}),a.jsxs(dl,{collapsible:!0,name:"output-schema",children:[a.jsx(mo,{children:a.jsx(ho,{icon:OP,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(po,{children:e&&a.jsx(Vce,{definitionType:r})}),a.jsx(ni,{})]})]})}function Qce({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=m.useState(!1),[i,c]=m.useState(!1),[u,f]=m.useState(!1),{deleteReport:h,fetchReportsByDataMartId:y,runReport:g}=Ja(),x=`actions-menu-${e.original.id}`,v=m.useCallback(async()=>{try{await h(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[h,y,t,e.original.id,e.original.dataMart.id]),C=m.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=m.useCallback(async()=>{try{s(!0),await g(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[g,e.original.id]),w=m.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(_r,{open:i,onOpenChange:c,children:[a.jsx(Nr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Ar,{id:x,align:"end",role:"menu",children:[a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem",children:[a.jsx(sd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),Dy(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(Na,{}),a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Wg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(Nt,{asChild:!0,children:a.jsxs("a",{href:$S(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(YP,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Cr,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}const Jce={[Mn.SUCCESS]:{icon:mh,color:"text-green-500",label:"Success"},[Mn.ERROR]:{icon:tg,color:"text-red-500",label:"Fail"},[Mn.RUNNING]:{icon:wc,color:"text-primary animate-spin",label:"In progress"},[Mn.CANCELLED]:{icon:tg,color:"text-gray-500",label:"Cancelled"}};function uM({status:e,error:t}){if(!e)return null;const n=Jce[e],{icon:r,color:s,label:i}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,u=()=>e===Mn.ERROR&&t?`${i}: ${t}`:i;return a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(r,{className:oe("h-5 w-5",s),role:"img","aria-label":u(),"aria-describedby":c,tabIndex:0})}),a.jsxs(Rt,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs",children:i}),e===Mn.ERROR&&t&&a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}var il=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(il||{});const eue={[il.TITLE]:"Title",[il.LAST_RUN_DATE]:"Last Run Date",[il.LAST_RUN_STATUS]:"Last Run Status"},tue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:il.TITLE,header:({column:n})=>a.jsx(br,{column:n,children:eue[il.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:il.LAST_RUN_DATE,header:({column:n})=>a.jsx(br,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(zs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:il.LAST_RUN_STATUS,header:({column:n})=>a.jsx(br,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(uM,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(gd,{table:n}),cell:({row:n})=>a.jsx(Qce,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function nue({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=Ja(),s=m.useMemo(()=>n.filter(x=>x.dataDestination.type===Ae.GOOGLE_SHEETS&&x.dataDestination.id===e.id),[n,e.id]);m.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=m.useMemo(()=>tue({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:h}=Ac({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),y=El({data:s,columns:i,getCoreRowModel:wl(),onSortingChange:u,getSortedRowModel:Nc(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:h}),g=`google-sheets-reports-table-${e.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{id:g,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(jl,{className:"dm-card-table-header",children:y.getHeaderGroups().map(x=>a.jsx(Fn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(_l,{style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.column.getSize())}%`},scope:"col",children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((x,v)=>a.jsx(Fn,{onClick:()=>{const C=n.find(S=>S.id===x.original.id);C&&t(C)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((C,S)=>a.jsx(Hr,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},role:"cell","aria-colindex":S+1,children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},x.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:i.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function rue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=m.useState(!1),[i,c]=m.useState(!1),[u,f]=m.useState(!1),{deleteReport:h,fetchReportsByDataMartId:y,runReport:g}=Ja(),x=`actions-menu-${e.original.id}`,v=m.useCallback(async()=>{try{await h(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[h,y,t,e.original.id,e.original.dataMart.id]),C=m.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=m.useCallback(async()=>{try{s(!0),await g(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[g,e.original.id]),w=m.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(_r,{open:i,onOpenChange:c,children:[a.jsx(Nr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Ar,{id:x,align:"end",role:"menu",children:[a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem",children:[a.jsx(sd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Wg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Cr,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}function d1({column:e,children:t,label:n}){const r=e.getIsSorted(),s=m.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),i=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",u=n??(typeof t=="string"?t:"Column");return a.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(qu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Vs,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(qu,{className:"text-muted-foreground h-4 w-4"})})]})]})}var ll=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ll||{});const dM={[ll.TITLE]:"Title",[ll.LAST_RUN_DATE]:"Last Run Date",[ll.LAST_RUN_STATUS]:"Last Run Status"};function aue({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ar,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=dM[t.id]||t.id;return a.jsx(Nt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ia,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const sue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ll.TITLE,header:({column:n})=>a.jsx(d1,{column:n,children:dM[ll.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ll.LAST_RUN_DATE,header:({column:n})=>a.jsx(d1,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(zs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ll.LAST_RUN_STATUS,header:({column:n})=>a.jsx(d1,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(uM,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(aue,{table:n}),cell:({row:n})=>a.jsx(rue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function oue({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=Ja(),i=m.useMemo(()=>r.filter(v=>v.dataDestination.type===e&&v.dataDestination.id===t.id),[r,t.id,e]);m.useEffect(()=>{s({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[s]);const c=m.useMemo(()=>sue({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:h,setColumnVisibility:y}=Ac({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),g=El({data:i,columns:c,getCoreRowModel:wl(),onSortingChange:f,getSortedRowModel:Nc(),state:{sorting:u,columnVisibility:h},onColumnVisibilityChange:y}),x=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{id:x,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(jl,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>a.jsx(Fn,{className:"dm-card-table-header-row",children:v.headers.map(C=>a.jsx(_l,{style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},scope:"col",children:C.isPlaceholder?null:typeof C.column.columnDef.header=="function"?C.column.columnDef.header(C.getContext()):C.column.columnDef.header},C.id))},v.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,C)=>a.jsx(Fn,{onClick:()=>{const S=r.find(w=>w.id===v.original.id);S&&n(S)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":C+1,children:v.getVisibleCells().map((S,w)=>a.jsx(Hr,{className:`px-6 whitespace-normal ${S.column.id==="actions"?"actions-cell":""}`,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},role:"cell","aria-colindex":w+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},v.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:c.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function iue({children:e,className:t,...n}){return a.jsx("div",{className:oe("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 lue({children:e,className:t,...n}){return a.jsx("div",{className:oe("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function cue({children:e,className:t,...n}){return a.jsx("div",{className:oe("text-md font-medium",t),...n,children:e})}function uue({children:e,className:t,...n}){return a.jsx("div",{className:oe("text-muted-foreground text-sm",t),...n,children:e})}function due({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:i,tooltipTextSwitchDisabled:c}){const u=t?c??"Disabled":e?s:i;return a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?a.jsx(wc,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(K2,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(Rt,{children:u})]})}function fue({icon:e,className:t,...n}){return a.jsx("div",{className:oe("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:a.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??a.jsx(Da,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function hue(e){const{dataMart:t}=gs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=Ja(),[c,u]=m.useState(!1),f=m.useMemo(()=>n.find(v=>v.dataDestination.type===Ae.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),h=m.useMemo(()=>(t==null?void 0:t.status.code)===Ur.PUBLISHED,[t==null?void 0:t.status.code]),y=m.useMemo(()=>!!f,[f]),g=m.useMemo(()=>y?"Available in Looker Studio":"Not available in Looker Studio",[y]),x=m.useCallback(async v=>{if(!(!t||!h)){u(!0);try{if(v){const C={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:Tr.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(C),await i(t.id)}else f&&(await s(f.id),await i(t.id))}catch(C){console.error("Failed to toggle Looker Studio report:",C)}finally{u(!1)}}},[t,h,e,f,r,s,i]);return{existingReport:f,isLoading:c,isEnabled:h,isChecked:y,dynamicTitle:g,handleSwitchChange:x}}function mue({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=hue(e),h=m.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(iue,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?h:void 0,...n,children:[a.jsx(due,{checked:c,disabled:!i,loading:s,onCheckedChange:y=>void f(y),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),a.jsxs(lue,{children:[a.jsx(cue,{children:u}),a.jsx(uue,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===Mn.SUCCESS&&"successfully ",a.jsx(zs,{date:new Date(r.lastRunDate)}),r.lastRunStatus===Mn.ERROR&&" but failed with error",r.lastRunError&&a.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&&a.jsx(fue,{})]})}function pue(){const{scope:e}=hi();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(Yb,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Yr,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(Da,{className:"h-4 w-4"})]})})]})})}function gue(){const[e,t]=m.useState(!1),[n,r]=m.useState(Rn.CREATE),[s,i]=m.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Rn.CREATE),i(null),t(!0),Le({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:h=>{r(Rn.EDIT),i(h),t(!0),Le({event:"report_open",category:"Report",action:"EditReport",label:h.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),Le({event:"report_close",category:"Report",action:n===Rn.EDIT?"Edit":"Create",label:"ReportForm"})}}}const yue=[Ae.GOOGLE_SHEETS,Ae.EMAIL,Ae.SLACK,Ae.MS_TEAMS,Ae.GOOGLE_CHAT];function xue({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=pQ(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:h}=gue();return r?a.jsxs(a.Fragment,{children:[a.jsxs(dl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(mo,{children:[a.jsx(ho,{icon:n.icon,children:e.title}),a.jsx(Kh,{children:yue.includes(e.type)&&a.jsx(vue,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(po,{children:a.jsx(pde,{destination:e,onEditReport:f})}),a.jsx(ni,{})]}),a.jsx(mde,{destination:e,isOpen:s,onClose:h,mode:i,initialReport:c})]}):null}function vue({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Ur.DRAFT;return a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("span",{children:a.jsxs(we,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(ma,{className:"h-4 w-4"}),"Add Report"]})})}),n&&a.jsx(Rt,{children:a.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function bue({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){m.useEffect(()=>{{const s=setTimeout(()=>{const i=document.getElementById(e);if(i){const c=i;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 Sue=tn({title:Dt().min(1,"Title is required"),documentUrl:Dt().refine(JD,"Enter a valid Google Sheets URL"),dataDestinationId:Dt().min(1,"Destination is required")});function Cue({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=m.useState(null),[f,h]=m.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=Ja();m.useEffect(()=>{f&&x&&(u(x),h(!1))},[x,f]);const C=wo({resolver:gi(Sue),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Dy(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(i==null?void 0:i.id)??""},mode:"onTouched"}),{register:S,handleSubmit:w,formState:R,reset:j}=C,{errors:_,isDirty:I}=R,A=m.useCallback(async O=>{try{u(null),v(),h(!0);const{spreadsheetId:T,sheetId:D}=qX(O.documentUrl);if(!T){u("Invalid Google Sheets URL");return}let L;if(t===Rn.CREATE)L=await g({title:O.title,dataMartId:n,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Tr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:D}});else{if(!e){u("Initial report is required for edit mode");return}L=await y(e.id,{title:O.title,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Tr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:D}})}if(!L||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(L))}catch($){console.error("onAfterSubmit failed",$)}s==null||s()}catch(T){console.error("Error submitting form:",T),u("An error occurred while submitting the form")}},[t,e,n,g,y,r,s,v,x]);return{form:C,register:S,handleSubmit:w,errors:_,isDirty:I,reset:j,formError:c,isSubmitting:f,setFormError:u,getValues:C.getValues,onSubmit:A}}function wue(e){return e.type===ol.SCHEDULED_REPORT_RUN}function Eue(e,t){if(e.length!==t.length)return!1;const n=i=>`${i.id??"new"}|${i.cron}|${i.timezone}|${i.enabled?"1":"0"}`,r=[...e].sort((i,c)=>n(i).localeCompare(n(c))),s=[...t].sort((i,c)=>n(i).localeCompare(n(c)));for(let i=0;i<r.length;i++){const c=r[i],u=s[i];if(c.id!==u.id||c.cron!==u.cron||c.timezone!==u.timezone||c.enabled!==u.enabled)return!1}return!0}const pN=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,gN="0 9 * * *";function Rue(e){return{id:e.id,cron:e.cronExpression,timezone:e.timeZone,enabled:e.isActive,lastRun:e.lastRunTimestamp??null,nextRun:e.nextRunTimestamp??null}}async function yN(e,t){return(await ro.getScheduledTriggers(e)).filter(s=>s.type===zn.REPORT_RUN&&wue(s.triggerConfig)&&s.triggerConfig.reportId===t).map(Rue)}const gC=m.forwardRef(({dataMartId:e,reportId:t,onDirtyChange:n},r)=>{const[s,i]=m.useState([]),[c,u]=m.useState([]),f=m.useRef(!1),[h,y]=m.useState(null);m.useEffect(()=>{let S=!1;async function w(){if(!e||!t){u([]),i([]),f.current=!0,n==null||n(!1);return}try{const R=await yN(e,t);S||(u(R),i(R),f.current=!0,n==null||n(!1))}catch{S||(u([]),i([]),f.current=!0,n==null||n(!1))}}return w(),()=>{S=!0}},[e,t,n]),m.useEffect(()=>{f.current&&(n==null||n(!Eue(s,c)))},[s,c,n]),m.useImperativeHandle(r,()=>({persist:async S=>{const w=c.filter(A=>A.id!==null),R=s.filter(A=>A.id!==null),j=new Map(w.map(A=>[A.id,A])),_=new Map(R.map(A=>[A.id,A]));for(const[A]of j.entries())_.get(A)||await ro.deleteScheduledTrigger(e,A);for(const[A,O]of _.entries()){const T=j.get(A);T&&(T.cron!==O.cron||T.timezone!==O.timezone||T.enabled!==O.enabled)&&await ro.updateScheduledTrigger(e,A,{cronExpression:O.cron,timeZone:O.timezone,isActive:O.enabled})}const I=s.filter(A=>!A.id);for(const A of I)await ro.createScheduledTrigger(e,{type:zn.REPORT_RUN,cronExpression:A.cron,timeZone:A.timezone,isActive:A.enabled,triggerConfig:{type:ol.SCHEDULED_REPORT_RUN,reportId:S}});try{const A=await yN(e,S);u(A),i(A),n==null||n(!1)}catch{u(s.map(A=>({...A}))),n==null||n(!1)}}}),[e,s,c,n]);const g=()=>{i(S=>[...S,{id:null,cron:gN,timezone:pN(),enabled:!0}])},x=S=>{i(w=>w.filter((R,j)=>j!==S))},v=(S,w)=>{i(R=>R.map((j,_)=>_===S?{...j,...w}:j))},C=s.length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[C?s.map((S,w)=>a.jsxs("div",{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",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Aa,{htmlFor:`trigger-enabled-${String(w)}`,className:"text-sm font-normal",children:S.enabled?"Enabled":"Disabled"}),a.jsx(K2,{id:`trigger-enabled-${String(w)}`,checked:S.enabled,onCheckedChange:R=>{v(w,{enabled:R})}})]}),a.jsx("div",{children:a.jsx(we,{variant:"ghost",size:"sm",type:"button","aria-label":"Delete trigger",onClick:()=>{y(w)},children:a.jsx(Qa,{className:"h-4 w-4","aria-hidden":"true"})})})]}),a.jsx(Rb,{cron:S.cron,timezone:S.timezone,enabled:S.enabled,onChange:v.bind(null,w),showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),(S.lastRun??S.nextRun)&&a.jsxs("div",{className:"text-muted-foreground mt-3 grid gap-1 text-xs sm:grid-cols-2",children:[S.lastRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Last run: "}),a.jsx(zs,{date:new Date(S.lastRun)})]}),S.nextRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Next run: "}),a.jsx(zs,{date:new Date(S.nextRun)})]})]}),h===w&&a.jsx(PO,{open:h===w,onOpenChange:R=>{R||y(null)},children:a.jsxs(UO,{children:[a.jsxs(zO,{children:[a.jsx(HO,{children:"Delete trigger?"}),a.jsx($O,{children:"This action will remove this schedule from the report."})]}),a.jsxs(FO,{children:[a.jsx(BO,{onClick:()=>{y(null)},children:"Cancel"}),a.jsx(VO,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{x(w),y(null)},children:"Delete"})]})]})})]},`${S.id??"new"}:${String(w)}`)):a.jsxs("div",{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",children:[a.jsx(Rb,{cron:gN,timezone:pN(),enabled:!1,showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),a.jsx("div",{className:"gp-2 mt-3 flex items-center justify-between text-sm",children:a.jsx(we,{variant:"outline",type:"button",onClick:g,size:"sm",children:"+ Add trigger"})})]}),C&&a.jsx("div",{children:a.jsx(we,{variant:"outline",type:"button",onClick:g,children:"+ Add trigger"})})]})});gC.displayName="ReportSchedulesInlineList";function jue(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"service-account-details",children:[a.jsx(Yt,{children:"How do I get a correct document link?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open your Google Sheets document and select the specific ",a.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),a.jsxs("li",{children:["Share the document with the service account email and grant it ",a.jsx("strong",{children:"Editor"})," ","access."]}),a.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",a.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),a.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function f1(e){return"serviceAccount"in e}function fM({value:e,children:t,doNotTruncateContent:n}){const[r,s]=m.useState(!1),i=async()=>{e&&(await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3))};return a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c=>c.key==="Enter"&&i(),className:oe("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:[a.jsx("span",{className:n?"w-[95%]":"truncate",children:t||e||"No data"}),r?a.jsx(ia,{className:"h-4 w-4 text-green-500"}):a.jsx(Ku,{className:"h-4 w-4"})]})}),a.jsx(Rt,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const Tue=Cc("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function _ue({className:e,orientation:t,...n}){return a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:oe(Tue({orientation:t}),e),...n})}const hM=({mode:e,isSubmitting:t,isDirty:n,triggersDirty:r,onRunAndSave:s,onCancel:i})=>{const c=t||!(n||r),u=e===Rn.CREATE?"Create & Run report":n||r?"Save & Run report":"Run report";return a.jsxs(Oc,{children:[a.jsxs(_ue,{className:"w-full",children:[a.jsx(we,{variant:"default",type:"submit",disabled:c,className:"flex-1",children:e===Rn.CREATE?"Create new report":"Save changes to report"}),a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"default",type:"button",disabled:c,"aria-label":"More actions",children:a.jsx(Vs,{className:"size-4","aria-hidden":"true"})})}),a.jsx(Ar,{align:"start",children:a.jsx(Nt,{onClick:s,disabled:t,children:u})})]})]}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,disabled:t,children:"Cancel"})]})},Nue=m.forwardRef(({initialReport:e,mode:t=Rn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",h="google-sheets-title-input",y="google-sheets-document-url-input",g="google-sheets-data-destination-select",{dataMart:x}=gs(),{scope:v}=hi(),{dataDestinations:C,fetchDataDestinations:S,loading:w}=Lh(),[R,j]=m.useState([]);m.useEffect(()=>{x&&S()},[x,S]),m.useEffect(()=>{if(C.length>0){const M=C.filter(H=>H.type===Ae.GOOGLE_SHEETS);j(M)}},[C]),bue({elementId:h,isOpen:!0,delay:150});const _=m.useRef(null),I=m.useRef(!1),[A,O]=m.useState(!1),{runReport:T}=Ja(),{isDirty:D,reset:L,form:$,isSubmitting:K,formError:Z,onSubmit:G}=Cue({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onAfterSubmit:async M=>{var H;try{await((H=_.current)==null?void 0:H.persist(M.id))}catch(V){console.error("Failed to persist schedule for report",V)}if(I.current)try{await T(M.id)}catch(V){throw console.error("Failed to run report",V),V}finally{I.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});m.useEffect(()=>{r&&r(Z)},[Z,r]),m.useEffect(()=>{if(t===Rn.EDIT&&e&&Dy(e.destinationConfig))L({title:e.title,documentUrl:$S(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Rn.CREATE){const M=(c==null?void 0:c.id)??"";L({title:"",documentUrl:"",dataDestinationId:M})}},[e,t,L,c]),m.useEffect(()=>{n==null||n(D||A)},[D,A,n]);const q=$.watch("documentUrl"),z=q&&JD(q.trim());return a.jsx(Nl,{...$,children:a.jsxs(pi,{id:f,ref:u,noValidate:!0,onSubmit:M=>void $.handleSubmit(G)(M),children:[a.jsxs(Al,{children:[a.jsxs(Zr,{title:"General",children:[a.jsx(_t,{control:$.control,name:"title",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(Ct,{children:a.jsx(It,{id:h,placeholder:"Enter a report title",...M})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:$.control,name:"dataDestinationId",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(ua,{onValueChange:M.onChange,value:M.value,disabled:w||R.length===0,children:[a.jsx(Ct,{children:a.jsx(fa,{id:g,className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{className:"truncate",placeholder:"Select a destination",children:M.value&&R.length>0&&(()=>{const H=R.find(V=>V.id===M.value);if(H){const se=sa.getInfo(H.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(se,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:H.title})})]})}return null})()})})}),a.jsx(ha,{children:R.map(H=>{const se=sa.getInfo(H.type).icon;return a.jsx(Bn,{value:H.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(se,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:H.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(f1(H.credentials)&&F0(H.credentials.serviceAccount))??"No email found"})]})]})},H.id)})})]}),R.length===0&&!w&&a.jsxs(B2,{className:"mt-2",children:[a.jsx(hh,{className:"h-4 w-4"}),a.jsx(iI,{children:"No destinations available"}),a.jsxs(G2,{children:["You need to create a Destination before you can create a report."," ",a.jsx(Yr,{to:v("/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"})]})]}),M.value&&R.length>0&&(()=>{const H=R.find(V=>V.id===M.value);return H?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Service Account Email"}),a.jsx(fM,{value:f1(H.credentials)?F0(H.credentials.serviceAccount)??"No email found":"",children:f1(H.credentials)?F0(H.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(Mt,{})]})}),a.jsx(_t,{control:$.control,name:"documentUrl",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(Ct,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(It,{id:y,placeholder:"Document URL",className:"flex-1",...M}),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${z?"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:()=>{z&&window.open(q.trim(),"_blank","noopener,noreferrer")},disabled:!z,"aria-label":z?"Open document in new tab":"Document link is not valid",children:a.jsx(ri,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(Rt,{side:"top",align:"center",role:"tooltip",children:z?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(hn,{children:a.jsx(jue,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Zr,{title:"Automate Report Runs",children:x!=null&&x.id?a.jsx(gC,{ref:_,dataMartId:x.id,reportId:t===Rn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:O}):a.jsx(Y2,{})})]}),a.jsx(hM,{mode:t,isSubmitting:K,isDirty:D,triggersDirty:A,onRunAndSave:()=>{I.current=!0,$.handleSubmit(G)()},onCancel:i})]})})});function Aue({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:h,handleFormSubmitSuccess:y}=Ic(t);return a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsx(di,{children:r===Rn.CREATE?"Create new report":"Edit report"}),a.jsx(xl,{children:r===Rn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(kh,{children:a.jsx(Nue,{initialReport:n,mode:r,onDirtyChange:h,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(Cr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const Due=tn({cacheLifetime:HZ().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Oue({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=m.useState(null),{createReport:c,updateReport:u}=Ja(),f=wo({resolver:gi(Due),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&hO(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async y=>{try{i(null);const{cacheLifetime:g}=y,x={type:Tr.LOOKER_STUDIO_CONFIG,cacheLifetime:g};e?await u(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(g){console.error("Error submitting form:",g),i("Failed to save report. Please try again.")}},formError:s,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function Iue(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"cache-lifetime-details",children:[a.jsx(Yt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(Wt,{children:a.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 Mue=[{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"}],kue=m.forwardRef(({initialReport:e,mode:t=Rn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:h}=gs(),{isDirty:y,reset:g,form:x,isSubmitting:v,formError:C,onSubmit:S}=Oue({initialReport:e,dataMartId:(h==null?void 0:h.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return m.useEffect(()=>{r&&r(C)},[C,r]),m.useEffect(()=>{t===Rn.EDIT&&e&&hO(e.destinationConfig)?g({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Rn.CREATE&&g({cacheLifetime:300})},[e,t,g]),m.useEffect(()=>{n==null||n(y)},[y,n]),a.jsx(Nl,{...x,children:a.jsxs(pi,{id:f,ref:u,noValidate:!0,onSubmit:w=>void x.handleSubmit(S)(w),children:[a.jsx(Al,{children:a.jsx(Zr,{title:"Cache Configuration",children:a.jsx(_t,{control:x.control,name:"cacheLifetime",render:({field:w})=>{var R;return a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),a.jsxs(ua,{onValueChange:j=>{w.onChange(parseInt(j,10))},value:((R=w.value)==null?void 0:R.toString())??"300",defaultValue:"300",children:[a.jsx(Ct,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select cache time"})})}),a.jsx(ha,{children:Mue.map(j=>a.jsx(Bn,{value:j.value.toString(),children:j.label},j.value))})]}),a.jsx(Mt,{}),a.jsx(hn,{children:a.jsx(Iue,{})})]})}})})}),a.jsxs(Oc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===Rn.CREATE?"Create":"Save changes",disabled:!y||v,children:v?t===Rn.CREATE?"Creating...":"Saving...":t===Rn.CREATE?"Create":"Save changes"}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Lue({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:h,handleFormSubmitSuccess:y}=Ic(t);return a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsx(di,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(xl,{children:r===Rn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(kh,{children:a.jsx(kue,{initialReport:n,mode:r,onDirtyChange:h,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(Cr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const xN=({destination:e})=>{const n=sa.getInfo(e.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(n,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:e.title})})]})};function Pue(e){return"to"in e}const Uue=({destination:e})=>{if(!e)return null;const t=e.credentials,n=Pue(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Recipients of this report"}),a.jsx(fM,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var ac=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(ac||{});const zue=tn({title:Dt().min(1,"Title is required"),dataDestinationId:Dt().min(1,"Destination is required"),reportCondition:by(ac),subject:Dt().min(1,"Subject is required"),messageTemplate:Dt().min(1,"Message body is required")});function Fue({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=m.useState(null),[f,h]=m.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=Ja();m.useEffect(()=>{f&&x&&(u(x),h(!1))},[x,f]);const C=wo({resolver:gi(zue),defaultValues:{title:(e==null?void 0:e.title)??"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(i==null?void 0:i.id)??"",reportCondition:e!=null&&e.destinationConfig&&$0(e.destinationConfig)?e.destinationConfig.reportCondition:ac.ALWAYS,subject:e!=null&&e.destinationConfig&&$0(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&$0(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:S,formState:w,reset:R}=C,{isDirty:j,errors:_}=w,I=m.useCallback(async A=>{try{u(null),v(),h(!0);let O;const T={type:Tr.EMAIL_CONFIG,reportCondition:A.reportCondition,subject:A.subject,messageTemplate:A.messageTemplate};if(t===Rn.CREATE)O=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:T});else{if(!e){u("Initial report is required for edit mode");return}O=await y(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:T})}if(!O||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(O))}catch(D){console.error("onAfterSubmit failed",D)}s==null||s()}catch(O){console.error("Error submitting form:",O),u("An error occurred while submitting the form")}},[t,e,n,g,y,r,s,v,x]);return{form:C,handleSubmit:S,errors:_,isDirty:j,reset:R,formError:c,isSubmitting:f,setFormError:u,onSubmit:I}}function Hue({value:e,onChange:t,onBlur:n,height:r=240,theme:s="light",options:i,className:c,placeholder:u="Start writing your message…"}){const f=h=>{n&&h.onDidBlurEditorText(n)};return a.jsx(L2,{language:"markdown",height:r,value:e,onChange:h=>{t(h??"")},onMount:f,theme:s,options:{wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",folding:!1,scrollBeyondLastLine:!1,automaticLayout:!0,placeholder:u,...i},className:c})}const $ue=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pr,{className:"h-6 w-3/4"}),a.jsx(Pr,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pr,{className:"h-4 w-full"}),a.jsx(Pr,{className:"h-4 w-5/6"}),a.jsx(Pr,{className:"h-4 w-4/5"}),a.jsx(Pr,{className:"h-4 w-3/4"})]})]});function mM({html:e,loading:t=!1,error:n=null,height:r=240,className:s,emptyState:i=a.jsx("div",{className:"text-muted-foreground text-sm",children:"Nothing to preview"})}){const{resolvedTheme:c}=md(),[u,f]=m.useState({bg:"#fff",fg:"#000"});return m.useEffect(()=>{if(typeof window>"u")return;let h;const y=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{const g=getComputedStyle(document.documentElement),x=g.getPropertyValue("--background").trim()||"#fff",v=g.getPropertyValue("--foreground").trim()||"#000";f({bg:x,fg:v})})});return()=>{cancelAnimationFrame(y),cancelAnimationFrame(h)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx($ue,{}),!t&&n&&a.jsxs("div",{className:"text-destructive text-sm",children:["Error: ",n]}),!t&&!n&&!e&&i,!t&&!n&&!!e&&a.jsx("iframe",{title:"Markdown preview",sandbox:"allow-popups allow-popups-to-escape-sandbox",srcDoc:`<!doctype html>
|
|
806
|
-
<html lang='en' style="background:${u.bg};color:${u.fg}">
|
|
807
|
-
<head>
|
|
808
|
-
<meta charset='utf-8'/>
|
|
809
|
-
<base target='_blank'>
|
|
810
|
-
</head>
|
|
811
|
-
<body>${e}</body>
|
|
812
|
-
</html>`,className:"h-full w-full border-0"})]})}function Vue({value:e,onChange:t}){return a.jsx(w2,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(E2,{children:[a.jsx(th,{value:"markdown",children:"Markdown"}),a.jsx(th,{value:"preview",children:"Preview"})]})})}function Bue({markdown:e,enabled:t=!0,debounceMs:n=300,toHtml:r}){const[s,i]=m.useState(""),[c,u]=m.useState(!1),[f,h]=m.useState(null),y=m.useRef(null);return m.useEffect(()=>{var C;if(!t)return;const g=e;if(!g.trim()){i(""),h(null),u(!1);return}const x=new AbortController;(C=y.current)==null||C.abort(),y.current=x,u(!0),h(null);const v=setTimeout(()=>{r(g,x.signal).then(S=>{i(S)}).catch(S=>{if(x.signal.aborted)return;const w=S instanceof Error?S.message:"Failed to load preview";h(w)}).finally(()=>{x.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),x.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function Gue(e,t){return ja.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function pM(e){const t=m.useCallback(Gue,[]);return Bue({...e,toHtml:t})}function que(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"message-details",children:[a.jsx(Yt,{children:"How can I format my message?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"You can format your message using Markdown — a simple text formatting syntax that lets you add structure and style without using complex editors."}),a.jsxs("p",{className:"mb-2",children:["For example:",a.jsx("br",{}),"**bold text** → ",a.jsx("b",{children:"bold text"}),a.jsx("br",{}),"*italic text* → ",a.jsx("i",{children:"italic text"}),a.jsx("br",{}),"- list item → • list item"]}),a.jsxs("p",{children:["Use the Preview tab to see how your message will look after formatting.",a.jsx("br",{}),"If you’re new to Markdown, learn more from this"," ",a.jsx(dn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function Kue(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"sending-condition-details",children:[a.jsx(Yt,{children:"What are Data Mart Run results?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"A Data Mart Run result is the outcome of processing your Data Mart — for example, running an SQL query that retrieves data for your report."}),a.jsx("p",{children:"Before sending a report, OWOX automatically runs the Data Mart and checks its result. Depending on your settings, the report can be sent always, only if the result is not empty, or only if it’s empty."})]})]})})}function Zue(){return a.jsxs(Zt,{value:"sheets-api-details",children:[a.jsx(Yt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(dn,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})}function Yue(){return a.jsxs(Zt,{value:"looker-studio-details",children:[a.jsx(Yt,{children:"How do I connect to Looker Studio?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",a.jsx(dn,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),a.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),a.jsx(dn,{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"})]})]})}function Wue(){return a.jsxs(Zt,{value:"odata-details",children:[a.jsx(Yt,{children:"How do I use OData?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]})}function Xue(){return a.jsxs(Zt,{value:"email-details",children:[a.jsx(Yt,{children:"How do I start sending Email?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports by email, first configure the ",a.jsx("strong",{children:"Email"})," destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Email block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected addresses as formatted text."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(dn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/email/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-email",children:"OWOX documentation"}),"."]})]})]})}function Que(){return a.jsxs(Zt,{value:"slack-details",children:[a.jsx(Yt,{children:"How do I start sending to Slack?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Slack, first configure the ",a.jsx("strong",{children:"Slack"})," destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Slack block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(dn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/slack/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-slack",children:"OWOX documentation"}),"."]})]})]})}function Jue(){return a.jsxs(Zt,{value:"msteams-details",children:[a.jsx(Yt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Microsoft Teams, first configure the ",a.jsx("strong",{children:"Microsoft Teams"})," ","destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Microsoft Teams block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(dn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/microsoft-teams/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-microsoft-teams",children:"OWOX documentation"}),"."]})]})]})}function ede(){return a.jsxs(Zt,{value:"googlechat-details",children:[a.jsx(Yt,{children:"How do I start sending to Google Chat?"}),a.jsxs(Wt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Google Chat, first configure the ",a.jsx("strong",{children:"Google Chat"})," ","destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Google Chat block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the connected space as chat messages."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(dn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/google-chat/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-google-chat",children:"OWOX documentation"}),"."]})]})]})}const tde={[Ae.GOOGLE_SHEETS]:Zue,[Ae.LOOKER_STUDIO]:Yue,[Ae.ODATA]:Wue,[Ae.EMAIL]:Xue,[Ae.SLACK]:Que,[Ae.MS_TEAMS]:Jue,[Ae.GOOGLE_CHAT]:ede};function nde({destinationType:e}){const t=tde[e];return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function rde({form:e,isEditMode:t,allowedDestinationTypes:n}){const{flags:r}=_h();return a.jsx(_t,{control:e.control,name:"type",render:({field:s})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(ua,{onValueChange:s.onChange,defaultValue:s.value,disabled:!!t,children:[a.jsx(Ct,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a destination type"})})}),a.jsx(ha,{children:a.jsx(Py,{children:sa.getAllTypes().filter(({type:i})=>n&&n.length>0?n.includes(i):!0).map(({type:i,displayName:c,icon:u,status:f})=>{const h=f===js.COMING_SOON,y=f===js.CLOUD_ONLY&&RQ(r);return a.jsx(a.Fragment,{children:y?a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{children:a.jsx(Bn,{value:i,disabled:!0,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,a.jsx(jr,{variant:"secondary",children:"Cloud & Enterprise"})]})},i)})}),a.jsxs(Rt,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(Yr,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/owox-cloud-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["Cloud edition",a.jsx(ri,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(Yr,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/self-managed-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["an Enterprise plan",a.jsx(ri,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Bn,{value:i,disabled:h,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,h&&a.jsx(jr,{variant:"outline",children:f})]})},i)})})})})]}),s.value&&a.jsx(hn,{children:a.jsx(nde,{destinationType:s.value})}),a.jsx(Mt,{})]})})}const gM="credentials.to",ade=/[,;\n]/,sde=", ",yM="Enter emails separated by comma, semicolon or newline",ode="Emails list";function vN(e){const t=new Set,n=[];for(const r of e.split(ade)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function h1(e){return e.join(sde)}function bN(e,t){e.setValue(gM,t,{shouldDirty:!0,shouldTouch:!0})}function ide({field:e,form:t}){const n=Array.isArray(e.value)?h1(e.value):"",[r,s]=m.useState(n),[i,c]=m.useState(!1),u=Array.isArray(e.value)?h1(e.value):"";m.useEffect(()=>{i||s(u)},[u,i]);const f=g=>{const x=g.target.value;s(x),bN(t,vN(x))},h=()=>{c(!0)},y=g=>{c(!1),e.onBlur();const x=vN(g.target.value);bN(t,x),s(h1(x))};return a.jsx(Co,{name:e.name,ref:e.ref,onFocus:h,onBlur:y,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:yM})}function Mp({form:e,emailsFieldTitle:t=ode}){return a.jsx(_t,{control:e.control,name:gM,render:({field:n})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(yt,{tooltip:yM,children:t})}),a.jsx(Ct,{children:a.jsx(ide,{field:n,form:e})}),a.jsx(Mt,{})]})})}function lde(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"service-account-details",children:[a.jsx(Yt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Wt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(dn,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function cde({form:e}){const[t,n]=m.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?oO(i):null;return a.jsx(_t,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(Ct,{children:!t&&c?a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(dn,{href:c.url,children:c.email})}),a.jsx(Rt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Co,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(hn,{children:a.jsx(lde,{})}),a.jsx(Mt,{})]})})}function yC(e){return"destinationSecretKey"in e}function ude(){return a.jsx(vn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Zt,{value:"json-config-details",children:[a.jsx(Yt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(Wt,{children:[a.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),a.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[a.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),a.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 dde({form:e}){const t=e.getValues("credentials"),n=m.useMemo(()=>t&&yC(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=m.useMemo(()=>GS(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(_t,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(xt,{children:[a.jsx(yt,{children:"JSON Config"}),a.jsx(Ct,{children:a.jsx(bD,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(Mt,{}),a.jsx(hn,{children:a.jsx(ude,{})})]})})})}function fde({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r,isEditMode:s,allowedDestinationTypes:i}){const c=wo({resolver:gi(cQ),defaultValues:e??{title:"New Destination",type:Ae.GOOGLE_SHEETS},mode:"onTouched"}),u=c.watch("type");m.useEffect(()=>{r==null||r(c.formState.isDirty)},[c.formState.isDirty,r]);const f=async h=>{const{dirtyFields:y}=c.formState,g=sO(h);return y.credentials||delete g.credentials,t(g)};return a.jsx(Nl,{...c,children:a.jsxs(pi,{onSubmit:h=>{c.handleSubmit(f)(h)},children:[a.jsxs(Al,{children:[a.jsx(_t,{control:c.control,name:"title",render:({field:h})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(Ct,{children:a.jsx(It,{placeholder:"Enter title",...h})}),a.jsx(Mt,{})]})}),a.jsx(rde,{form:c,isEditMode:s,allowedDestinationTypes:i}),u===Ae.GOOGLE_SHEETS&&a.jsx(cde,{form:c}),u===Ae.LOOKER_STUDIO&&a.jsx(dde,{form:c}),u===Ae.EMAIL&&a.jsx(Mp,{form:c,emailsFieldTitle:"Enter user emails list"}),u===Ae.SLACK&&a.jsx(Mp,{form:c,emailsFieldTitle:"Enter Slack channel emails list"}),u===Ae.MS_TEAMS&&a.jsx(Mp,{form:c,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),u===Ae.GOOGLE_CHAT&&a.jsx(Mp,{form:c,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(Oc,{children:[a.jsxs(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!c.formState.isDirty||c.formState.isSubmitting,children:[c.formState.isSubmitting&&a.jsx(wc,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function xM({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r,initialFormData:s,allowedDestinationTypes:i}){const{updateDataDestination:c,createDataDestination:u}=Lh(),{showUnsavedDialog:f,setShowUnsavedDialog:h,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=Ic(t),C=async w=>{const R=nO.getMapper(w.type);if(n){const j=R.mapToUpdateRequest(w),_=await c(n.id,j);_&&r(_)}else{const j=R.mapToCreateRequest(w),_=await u(j);_&&r(_)}v()},S=m.useRef(!1);return m.useEffect(()=>{const w=n?"Edit":"Create";e&&!S.current?(Le({event:"data_destination_config_open",category:"DataDestination",action:w,label:n==null?void 0:n.type}),S.current=!0):!e&&S.current&&(Le({event:"data_destination_config_close",category:"DataDestination",action:w,label:n==null?void 0:n.type}),S.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:w=>{w||y()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsx(di,{children:"Configure destination"}),a.jsx(xl,{children:"Customize settings for your destination"})]}),a.jsx(fde,{initialData:n??s??null,onSubmit:C,onCancel:y,onDirtyChange:x,isEditMode:!!n,allowedDestinationTypes:i})]})}),a.jsx(Cr,{open:f,onOpenChange:h,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const hde=[Ae.EMAIL,Ae.SLACK,Ae.GOOGLE_CHAT,Ae.MS_TEAMS],vM=m.forwardRef(({initialReport:e,mode:t=Rn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c,prefill:u,allowedDestinationTypes:f},h)=>{const y="email-report-edit-form",{dataMart:g}=xs(),x=m.useRef(null),v=m.useRef(!1),[C,S]=m.useState(!1),{runReport:w}=Ja(),{dataDestinations:R,fetchDataDestinations:j,loading:_}=Lh(),[I,A]=m.useState([]),[O,T]=m.useState(!1);m.useEffect(()=>{g&&j()},[g,j]),m.useEffect(()=>{if(R.length>0){const X=f??(c!=null&&c.type?[c.type]:hde),ae=R.filter(J=>X.includes(J.type));A(ae)}},[R,c==null?void 0:c.type,f]);const{isDirty:D,reset:L,form:$,isSubmitting:K,formError:Z,onSubmit:G}=Fue({initialReport:e,mode:t,dataMartId:(g==null?void 0:g.id)??"",onAfterSubmit:async X=>{var ae;try{await((ae=x.current)==null?void 0:ae.persist(X.id))}catch(J){console.error("Failed to persist schedule for report",J)}if(v.current)try{await w(X.id)}catch(J){throw console.error("Failed to run report",J),J}finally{v.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});m.useEffect(()=>{r&&r(Z)},[Z,r]),m.useEffect(()=>{if(!(t===Rn.EDIT&&e)){if(t===Rn.CREATE){const X=(c==null?void 0:c.id)??"";L({title:(u==null?void 0:u.title)??"",dataDestinationId:X,reportCondition:ac.ALWAYS,subject:(u==null?void 0:u.subject)??"",messageTemplate:(u==null?void 0:u.messageTemplate)??""})}}},[e,t,L,c,u==null?void 0:u.title,u==null?void 0:u.subject,u==null?void 0:u.messageTemplate]),m.useEffect(()=>{n==null||n(D||C)},[D,C,n]);const q=m.useMemo(()=>[{value:ac.ALWAYS,label:"Send always"},{value:ac.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:ac.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),{resolvedTheme:z}=md(),M=z==="dark"?"vs-dark":"light",[H,V]=m.useState("markdown"),se=$.watch("messageTemplate"),{html:ge,loading:P,error:U}=pM({markdown:se,enabled:H==="preview"}),F=$.watch("dataDestinationId"),W=m.useMemo(()=>F&&I.length>0?I.find(X=>X.id===F)??null:null,[F,I]);return a.jsxs(a.Fragment,{children:[a.jsx(Nl,{...$,children:a.jsxs(pi,{id:y,ref:h,noValidate:!0,onSubmit:X=>{$.handleSubmit(G)(X)},children:[a.jsxs(Al,{children:[a.jsxs(Zr,{title:"General",children:[a.jsx(_t,{control:$.control,name:"title",render:({field:X})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(Ct,{children:a.jsx(It,{placeholder:"Enter a report title",...X})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:$.control,name:"dataDestinationId",render:({field:X})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"})}),a.jsxs(ua,{onValueChange:ae=>{if(ae==="__create_new__"){T(!0);return}X.onChange(ae)},value:X.value,disabled:_,children:[a.jsx(Ct,{children:a.jsx(fa,{className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{className:"truncate",placeholder:"Select a destination",children:W&&a.jsx(xN,{destination:W})})})}),a.jsxs(ha,{children:[I.map(ae=>a.jsx(Bn,{value:ae.id,children:a.jsx(xN,{destination:ae})},ae.id)),I.length>0&&a.jsx(V5,{}),!c&&a.jsx(Bn,{value:"__create_new__",children:"+ Create new"})]})]}),a.jsx(Uue,{destination:W}),a.jsx(Mt,{})]})})]}),a.jsxs(Zr,{title:"Template",children:[a.jsx(_t,{control:$.control,name:"subject",render:({field:X})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(Ct,{children:a.jsx(It,{placeholder:"Enter a message title",...X})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:$.control,name:"messageTemplate",render:({field:X})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(yt,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(Vue,{value:H,onChange:V})]}),a.jsx(Ct,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:H==="markdown"?a.jsx(Hue,{value:X.value??"",onChange:ae=>{X.onChange(ae)},onBlur:X.onBlur,height:240,theme:M}):a.jsx(mM,{html:ge,loading:P,error:U,height:240})})}),a.jsx(hn,{children:a.jsx(que,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Zr,{title:"Sending conditions",children:a.jsx(_t,{control:$.control,name:"reportCondition",render:({field:X})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),a.jsxs(ua,{onValueChange:X.onChange,value:X.value,children:[a.jsx(Ct,{children:a.jsx(fa,{className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{})})}),a.jsx(ha,{children:q.map(ae=>a.jsx(Bn,{value:ae.value,children:ae.label},ae.value))})]}),a.jsx(hn,{children:a.jsx(Kue,{})}),a.jsx(Mt,{})]})})}),a.jsx(Zr,{title:"Automate Report Runs",children:g!=null&&g.id?a.jsx(gC,{ref:x,dataMartId:g.id,reportId:t===Rn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:S}):a.jsx(Y2,{})})]}),a.jsx(hM,{mode:t,isSubmitting:K,isDirty:D,triggersDirty:C,onRunAndSave:()=>{v.current=!0,$.handleSubmit(G)()},onCancel:i})]})}),a.jsx(xM,{isOpen:O,onClose:()=>{T(!1)},dataDestination:null,initialFormData:{title:"New Destination",type:(f==null?void 0:f[0])??Ae.EMAIL},allowedDestinationTypes:f,onSaveSuccess:X=>{j().then(()=>{$.setValue("dataDestinationId",X.id,{shouldDirty:!0,shouldTouch:!0}),T(!1)})}})]})});vM.displayName="EmailReportEditForm";function bM({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c}){const{projectId:u,id:f}=Zg(),{pathname:h}=$s(),{showUnsavedDialog:y,setShowUnsavedDialog:g,handleClose:x,confirmClose:v,handleFormDirtyChange:C,handleFormSubmitSuccess:S}=Ic(t),w=m.useCallback(()=>{const R=u&&f?`/ui/${u}/data-marts/${f}/reports`:"/";h.includes("/reports")||i_("Report has been created",{closeButton:!0,description:a.jsxs(a.Fragment,{children:["You can view it in"," ",a.jsx(Yr,{to:R,className:"underline underline-offset-4",onClick:()=>i_.dismiss(),children:"Destinations"})," ","page"]}),duration:1/0}),S()},[S,u,f,h]);return m.useEffect(()=>(e?EI(90):rh(),()=>{rh()}),[e]),a.jsxs(a.Fragment,{children:[a.jsx(li,{open:e,onOpenChange:R=>{R||x()},children:a.jsxs(ci,{children:[a.jsxs(ui,{children:[a.jsx(di,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(xl,{children:r===Rn.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(kh,{children:a.jsx(vM,{initialReport:n,mode:r,onDirtyChange:C,onSubmit:w,onCancel:x,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c})})]})}),a.jsx(Cr,{open:y,onOpenChange:g,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}function mde({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Ae.GOOGLE_SHEETS:return a.jsx(Aue,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ae.LOOKER_STUDIO:return a.jsx(Lue,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ae.EMAIL:case Ae.SLACK:case Ae.GOOGLE_CHAT:case Ae.MS_TEAMS:return a.jsx(bM,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function pde({destination:e,onEditReport:t}){switch(e.type){case Ae.GOOGLE_SHEETS:return a.jsx(nue,{destination:e,onEditReport:t});case Ae.EMAIL:case Ae.SLACK:case Ae.GOOGLE_CHAT:case Ae.MS_TEAMS:return a.jsx(oue,{destinationType:e.type,destination:e,onEditReport:t});case Ae.LOOKER_STUDIO:return a.jsx(mue,{destination:e,onEditReport:t});default:return null}}function SM(){return a.jsx("div",{className:"flex flex-col gap-4",children:a.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>a.jsx("div",{className:"border-border rounded-lg border p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Pr,{className:"h-4 w-4 rounded-full"}),a.jsx(Pr,{className:"h-4 w-40"}),a.jsx(Pr,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Pr,{className:"h-6 w-16 rounded-full"}),a.jsx(Pr,{className:"h-4 w-4"})]})]})},t))})})}function xC({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=m.useRef(r);s.current=r;const i=m.useRef(null);m.useEffect(()=>{var f;if(!e)return;(f=i.current)==null||f.abort(),i.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const h=new AbortController;s.current(h.signal)}};c();const u=window.setInterval(c,t);return()=>{var h;window.clearInterval(u),(h=i.current)==null||h.abort()}},[e,t,n])}function gde({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=gs(),{fetchReportsByDataMartId:r}=Ja(),s=n==null?void 0:n.id;m.useEffect(()=>{s&&r(s)},[s,r]),xC({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function yde(){const{dataMart:e}=gs(),{dataDestinations:t,isLoading:n}=gQ();return gde({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(SM,{}):t.length===0?a.jsx(pue,{}):t.map(r=>a.jsx(xue,{destination:r,dataMartStatus:e.status},r.id))}):null}function xde(){return a.jsx(kh,{children:a.jsx(VS,{children:a.jsx(yde,{})})})}function SN(){return a.jsxs(dl,{children:[a.jsx(mo,{children:a.jsx(ho,{icon:dP,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(po,{children:a.jsx(Are,{})}),a.jsx(ni,{})]})}function vde(){const{dataMart:e}=xs(),[t,n]=m.useState(!1),r=m.useCallback(()=>{n(!0)},[]),s=m.useCallback(()=>{n(!1)},[]);return a.jsxs(dl,{children:[a.jsxs(mo,{children:[a.jsx(ho,{icon:Wb,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(Kh,{children:a.jsxs(we,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(po,{children:a.jsx(nd,{children:a.jsx(Aoe,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(gie,{dataMartId:e.id}),a.jsx(Z2,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(ni,{})]})}const bde={list:[],listLoadingStatus:bt.IDLE,activeInsight:null,activeInsightLoadingStatus:bt.IDLE,executionStatus:bt.IDLE,executionTriggerId:null,error:null};var ht=(e=>(e.FETCH_INSIGHTS_START="FETCH_INSIGHTS_START",e.FETCH_INSIGHTS_SUCCESS="FETCH_INSIGHTS_SUCCESS",e.FETCH_INSIGHTS_ERROR="FETCH_INSIGHTS_ERROR",e.GET_INSIGHT_START="GET_INSIGHT_START",e.GET_INSIGHT_SUCCESS="GET_INSIGHT_SUCCESS",e.GET_INSIGHT_ERROR="GET_INSIGHT_ERROR",e.CREATE_INSIGHT_START="CREATE_INSIGHT_START",e.CREATE_INSIGHT_SUCCESS="CREATE_INSIGHT_SUCCESS",e.CREATE_INSIGHT_ERROR="CREATE_INSIGHT_ERROR",e.UPDATE_INSIGHT_START="UPDATE_INSIGHT_START",e.UPDATE_INSIGHT_SUCCESS="UPDATE_INSIGHT_SUCCESS",e.UPDATE_INSIGHT_ERROR="UPDATE_INSIGHT_ERROR",e.DELETE_INSIGHT_START="DELETE_INSIGHT_START",e.DELETE_INSIGHT_SUCCESS="DELETE_INSIGHT_SUCCESS",e.DELETE_INSIGHT_ERROR="DELETE_INSIGHT_ERROR",e.RUN_INSIGHT_START="RUN_INSIGHT_START",e.RUN_INSIGHT_START_ERROR="RUN_INSIGHT_START_ERROR",e.RUN_INSIGHT_STARTED="RUN_INSIGHT_STARTED",e.RUN_INSIGHT_SUCCESS="RUN_INSIGHT_SUCCESS",e.RUN_INSIGHT_ERROR="RUN_INSIGHT_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(ht||{});class Sde extends Sl{constructor(){super("/data-marts")}async getInsights(t){return this.get(`/${t}/insights`)}async getInsightById(t,n){return await this.get(`/${t}/insights/${n}`)}async createInsight(t,n){return this.post(`/${t}/insights`,n)}async updateInsight(t,n,r){return this.put(`/${t}/insights/${n}`,r)}async updateInsightTitle(t,n,r){return this.put(`/${t}/insights/${n}/title`,r)}async deleteInsight(t,n){return this.delete(`/${t}/insights/${n}`)}async startInsightExecution(t,n){return this.post(`/${t}/insights/${n}/run-triggers`,{})}async checkInsightExecutionStatus(t,n,r,s){return this.get(`/${t}/insights/${r}/run-triggers/${n}/status`,null,s)}async getInsightRunTriggers(t,n,r){return this.get(`/${t}/insights/${n}/run-triggers/`,null,r)}}const Ko=new Sde,Of=e=>({id:e.id,title:e.title,template:e.template??null,output:e.output??null,outputUpdatedAt:e.outputUpdatedAt?new Date(e.outputUpdatedAt):null,lastRun:e.lastManualDataMartRun?{status:e.lastManualDataMartRun.status,id:e.lastManualDataMartRun.id}:null,createdById:e.createdById,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}),Cde=e=>e.data.map(Of),wde=e=>({title:e.title,template:e.template??null}),Ede=e=>({title:e.title,template:e.template??null}),CM=m.createContext(void 0);function wM(){const e=m.useContext(CM);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function vC(){const{state:e,dispatch:t}=wM(),{dataMart:n}=xs();if(!n)throw new Error("useInsights must be used within a DataMart context");const r=m.useCallback(async()=>{t({type:ht.FETCH_INSIGHTS_START});try{const v=await Ko.getInsights(n.id),C=Cde(v);t({type:ht.FETCH_INSIGHTS_SUCCESS,payload:C})}catch(v){throw t({type:ht.FETCH_INSIGHTS_ERROR,payload:on(v)}),v}},[n.id,t]),s=m.useCallback(async v=>{t({type:ht.GET_INSIGHT_START});try{const C=await Ko.getInsightById(n.id,v),S=Of(C);return t({type:ht.GET_INSIGHT_SUCCESS,payload:S}),S}catch(C){throw t({type:ht.GET_INSIGHT_ERROR,payload:on(C)}),C}},[n.id,t]),i=m.useCallback(async v=>{t({type:ht.CREATE_INSIGHT_START});try{const C=wde(v),S=await Ko.createInsight(n.id,C),w=Of(S);return t({type:ht.CREATE_INSIGHT_SUCCESS,payload:w}),Le({event:"insight_created",category:"Insights",action:"Create",label:w.id}),Tt.success("Insight created"),w}catch(C){return t({type:ht.CREATE_INSIGHT_ERROR,payload:on(C)}),null}},[n.id,t]),c=m.useCallback(async(v,C)=>{t({type:ht.UPDATE_INSIGHT_START});try{const S=Ede(C),w=await Ko.updateInsight(n.id,v,S),R=Of(w);return t({type:ht.UPDATE_INSIGHT_SUCCESS,payload:R}),Le({event:"insight_updated",category:"Insights",action:"Update",label:R.id}),Tt.success("Insight updated"),R}catch(S){return t({type:ht.UPDATE_INSIGHT_ERROR,payload:on(S)}),null}},[n.id,t]),u=m.useCallback(async v=>{t({type:ht.DELETE_INSIGHT_START});try{await Ko.deleteInsight(n.id,v),t({type:ht.DELETE_INSIGHT_SUCCESS,payload:v}),Le({event:"insight_deleted",category:"Insights",action:"Delete",label:v}),Tt.success("Insight deleted")}catch(C){throw t({type:ht.DELETE_INSIGHT_ERROR,payload:on(C)}),C}},[n.id,t]),f=m.useCallback(async(v,C)=>{t({type:ht.UPDATE_INSIGHT_START});try{const S=await Ko.updateInsightTitle(n.id,v,{title:C}),w=Of(S),R=e.list.find(_=>_.id===v)??e.activeInsight,j=R?{...w,template:R.template}:w;return t({type:ht.UPDATE_INSIGHT_SUCCESS,payload:j}),Le({event:"insight_title_updated",category:"Insights",action:"Update title",label:j.id}),Tt.success("Title updated"),j}catch(S){return t({type:ht.UPDATE_INSIGHT_ERROR,payload:on(S)}),null}},[n.id,t,e.activeInsight,e.list]),h=m.useCallback(async v=>{t({type:ht.RUN_INSIGHT_START});try{const C=await Ko.startInsightExecution(n.id,v);t({type:ht.RUN_INSIGHT_STARTED,payload:{triggerId:C.triggerId}})}catch(C){t({type:ht.RUN_INSIGHT_ERROR,payload:on(C)})}},[t,n.id]),y=m.useCallback(()=>{t({type:ht.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[t]),g=m.useCallback(v=>{t({type:ht.RUN_INSIGHT_STARTED,payload:{triggerId:v}})},[t]),x=m.useCallback(async()=>{const v=e.activeInsight;if(!(!v||!n.id)&&!e.executionTriggerId&&!(!v.lastRun||GQ(v.lastRun.status)))try{const S=(await Ko.getInsightRunTriggers(n.id,v.id,{skipLoadingIndicator:!0})).data.sort((w,R)=>new Date(R.modifiedAt).getTime()-new Date(w.modifiedAt).getTime()).find(w=>!qQ(w.status));S!=null&&S.id&&(t({type:ht.RUN_INSIGHT_START}),t({type:ht.RUN_INSIGHT_STARTED,payload:{triggerId:S.id}}))}catch(C){t({type:ht.RUN_INSIGHT_ERROR,payload:on(C)})}},[e.activeInsight,e.executionTriggerId,n.id,t]);return{insights:e.list,activeInsight:e.activeInsight,listLoading:e.listLoadingStatus===bt.LOADING,insightLoading:e.activeInsightLoadingStatus===bt.LOADING,isRunning:e.executionStatus===bt.LOADING,triggerId:e.executionTriggerId,error:e.error,fetchInsights:r,getInsight:s,createInsight:i,updateInsight:c,updateInsightTitle:f,deleteInsight:u,runInsight:h,setTriggerId:g,resetTriggerId:y,ensureActiveRunPolling:x}}function Rde(){const{state:e}=wM(),t=m.useMemo(()=>e.list,[e.list]),n=m.useMemo(()=>e.listLoadingStatus===bt.LOADING,[e.listLoadingStatus]),r=m.useMemo(()=>e.listLoadingStatus===bt.LOADED||e.listLoadingStatus===bt.ERROR,[e.listLoadingStatus]),s=m.useMemo(()=>e.error,[e.error]),i=m.useMemo(()=>t.length>0,[t.length]);return{insights:t,isLoading:n,isLoaded:r,error:s,hasInsights:i}}function jde(e,t){var n,r;switch(t.type){case ht.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:bt.LOADING,error:null};case ht.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:bt.LOADING,error:null};case ht.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:bt.LOADING,error:null};case ht.UPDATE_INSIGHT_START:return{...e,error:null};case ht.DELETE_INSIGHT_START:return{...e,listLoadingStatus:bt.LOADING,error:null};case ht.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:bt.LOADED,error:null};case ht.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:bt.LOADED,error:null};case ht.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:bt.LOADED,activeInsightLoadingStatus:bt.LOADED,error:null};case ht.UPDATE_INSIGHT_SUCCESS:return{...e,list:e.list.map(s=>s.id===t.payload.id?t.payload:s),activeInsight:((n=e.activeInsight)==null?void 0:n.id)===t.payload.id?t.payload:e.activeInsight,listLoadingStatus:bt.LOADED,error:null};case ht.DELETE_INSIGHT_SUCCESS:return{...e,list:e.list.filter(s=>s.id!==t.payload),activeInsight:((r=e.activeInsight)==null?void 0:r.id)===t.payload?null:e.activeInsight,listLoadingStatus:bt.LOADED,error:null};case ht.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:bt.ERROR,error:t.payload};case ht.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:bt.ERROR,error:t.payload};case ht.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:bt.ERROR,activeInsightLoadingStatus:bt.ERROR,error:t.payload};case ht.UPDATE_INSIGHT_ERROR:case ht.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:bt.ERROR,error:t.payload};case ht.RUN_INSIGHT_START:return{...e,executionStatus:bt.LOADING,error:null};case ht.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case ht.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:bt.LOADED,executionTriggerId:null,error:null};case ht.CLEAR_ERROR:return{...e,error:null};default:return e}}function EM({children:e,initialState:t}){const[n,r]=m.useReducer(jde,t??bde);return a.jsx(CM.Provider,{value:{state:n,dispatch:r},children:e})}function Tde(){return a.jsx(EM,{children:a.jsx(Gb,{})})}function _de({status:e}){switch(e){case qn.RUNNING:return a.jsx(jr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case qn.SUCCESS:return a.jsx(jr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case qn.FAILED:return a.jsx(jr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case qn.CANCELLED:return a.jsx(jr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case qn.INTERRUPTED:return a.jsx(jr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case qn.PENDING:return a.jsx(jr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return a.jsx(jr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var oa=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(oa||{}),Ts=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(Ts||{});const CN=(e,t,n=!1)=>{var c,u,f,h;const r=e.split(`
|
|
813
|
-
`).filter(y=>y.trim()!=="");if(r.length>=3){const y=r[0],g=r[1],x=r.slice(2).join(`
|
|
814
|
-
`);if(y.includes("T")&&y.includes("Z")){const v=m1(x);return{id:`log-${t.toString()}`,timestamp:vu(y),level:n?oa.ERROR:oa.INFO,message:v.message,metadata:{at:(c=v.metadata)!=null&&c.at?vu(v.metadata.at):vu(y),type:((u=v.metadata)==null?void 0:u.type)??(g!=="unknown"?g:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const y=m1(s[3]);return{id:`log-${t.toString()}`,timestamp:vu(s[1]),level:n?oa.ERROR:s[2],message:y.message,metadata:(f=y.metadata)!=null&&f.at?{...y.metadata,at:vu(y.metadata.at)}:y.metadata}}const i=m1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?oa.ERROR:oa.INFO,message:i.message,metadata:(h=i.metadata)!=null&&h.at?{...i.metadata,at:vu(i.metadata.at)}:i.metadata}},m1=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 i=s[0],c=r[i];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}},RM=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},Nde=(e,t)=>{var i,c;let n="",r="";switch(e.type){case Lr.CONNECTOR:n=t??"",r="connector";break;case Lr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Lr.GOOGLE_SHEETS_EXPORT:case Lr.EMAIL:case Lr.SLACK:case Lr.MS_TEAMS:case Lr.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case Lr.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[EQ(`${e.triggerType} ${r} run`.trim()),n]},Ade=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)},Dde=e=>{const t=e.startedAt??e.createdAt;return Ey(t.toISOString())},Ode=e=>{const t=wN(e.startedAt),n=wN(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=CQ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},wN=e=>e?Ey(e.toISOString()):"N/A";function Ide({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:i,dataMartId:c}){const u=y=>{y.stopPropagation()},f=async y=>{if(y.stopPropagation(),c)try{await i(c,s.id),An.success("Data mart run cancelled successfully")}catch(g){An.error(g instanceof Error?g.message:"Failed to cancel data mart run")}},h=y=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${y?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return a.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ts.STRUCTURED)},className:`${h(e===Ts.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ts.RAW)},className:`${h(e===Ts.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ts.CONFIGURATION)},className:`${h(e===Ts.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==Ts.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(Ec,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.jsx(It,{type:"text",placeholder:"Search logs...",value:n,onChange:y=>{r(y.target.value)},onClick:u,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"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[s.status===qn.RUNNING&&a.jsxs(we,{variant:"destructive",size:"sm",onClick:y=>void f(y),children:[a.jsx(Zu,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(we,{variant:"outline",size:"sm",onClick:y=>{y.stopPropagation(),Ade(s)},className:"flex items-center gap-2",children:[a.jsx(PP,{className:"h-4 w-4"}),"JSON"]})]})]})}function Mde(e){switch(e){case oa.INFO:return a.jsx(zr,{className:"h-3 w-3 text-blue-500"});case oa.WARNING:return a.jsx(ph,{className:"h-3 w-3 text-yellow-500"});case oa.ERROR:return a.jsx(tg,{className:"h-3 w-3 text-red-500"});case oa.SYSTEM:return a.jsx(hh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(zr,{className:"text-muted-foreground h-3 w-3"})}}function kde(e){switch(e){case oa.INFO:return"text-blue-600 dark:text-blue-400";case oa.WARNING:return"text-yellow-600 dark:text-yellow-400";case oa.ERROR:return"text-red-600 dark:text-red-400";case oa.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Lde(e){return e===UD.SCHEDULED?a.jsx(Wb,{size:18}):a.jsx(EA,{size:18})}function Pde({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?a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"text-muted-foreground p-8 text-center text-sm",children:"No logs found"})}):a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>a.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[a.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),a.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[Mde(r.level),a.jsx("span",{className:`text-xs font-medium ${kde(r.level)}`,children:RM(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===oa.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
815
|
-
`)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var zg=(e=>(e.ERROR="error",e.DEFAULT="default",e))(zg||{});function Fg({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:i=!1}){const c=n==="error",u=r===t,f="flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors cursor-pointer",h=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return a.jsx("button",{onClick:y=>{s(e,t),y.stopPropagation()},className:`${f} ${h}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(ia,{className:"h-3 w-3"}):a.jsx(Ku,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(ia,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ku,{className:"h-3 w-3"}),"Copy"]})})}function Xy(){const[e,t]=m.useState(null),n=async(s,i)=>{if(!s)return!1;try{return await navigator.clipboard.writeText(s),t(i),setTimeout(()=>{t(null)},2e3),!0}catch(c){return console.error("Failed to copy text: ",c),!1}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,i)=>{n(s,i)}}}function Ude({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=Xy(),s=i=>{i.stopPropagation()};return a.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[a.jsx(hh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx(Fg,{text:t.join(`
|
|
816
|
-
`),section:"errors",variant:zg.ERROR,copiedSection:n,onCopy:r})]}),a.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((i,c)=>a.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:i},c))})]}),e.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[a.jsx(zr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx(Fg,{text:e.join(`
|
|
817
|
-
`),section:"logs",variant:zg.DEFAULT,copiedSection:n,onCopy:r})]}),a.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((i,c)=>a.jsx("div",{className:"mb-1 leading-relaxed",children:i},c))})]})]})}function zde({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=Xy(),i=c=>{c.stopPropagation()};return a.jsx("div",{className:"border-border rounded-lg border",onClick:i,children:e!=null?a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),a.jsx(Fg,{text:JSON.stringify(e,null,2),section:"configuration",variant:zg.DEFAULT,copiedSection:r,onCopy:s})]}),a.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)}),t&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),a.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(t,null,2)})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Insight definition:"}),a.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(n,null,2)})]})]}):a.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const to=18;function Fde({type:e,base64Icon:t}){switch(e){case Lr.CONNECTOR:return t?a.jsx(_c,{base64:t,size:to}):a.jsx(lc,{className:"text-muted-foreground",size:to});case Lr.GOOGLE_SHEETS_EXPORT:{const n=sa.getInfo(Ae.GOOGLE_SHEETS).icon;return a.jsx(n,{size:to})}case Lr.LOOKER_STUDIO:{const n=sa.getInfo(Ae.LOOKER_STUDIO).icon;return a.jsx(n,{size:to})}case Lr.EMAIL:{const n=sa.getInfo(Ae.EMAIL).icon;return a.jsx(n,{size:to})}case Lr.SLACK:{const n=sa.getInfo(Ae.SLACK).icon;return a.jsx(n,{size:to})}case Lr.MS_TEAMS:{const n=sa.getInfo(Ae.MS_TEAMS).icon;return a.jsx(n,{size:to})}case Lr.GOOGLE_CHAT:{const n=sa.getInfo(Ae.GOOGLE_CHAT).icon;return a.jsx(n,{size:to})}case Lr.INSIGHT:return a.jsx(el,{className:"text-brand-blue-500",size:to});default:return a.jsx(lc,{className:"text-muted-foreground",size:to})}}function Hde({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:h}){const{copiedSection:y,handleCopy:g}=Xy(),x=m.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const j=e.logs.map((A,O)=>CN(A,O)),_=e.errors.map((A,O)=>CN(A,e.logs.length+O,!0));return[...j,..._].filter(A=>{const O=RM(A);return i===""||A.message.toLowerCase().includes(i.toLowerCase())||O.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=m.useCallback(()=>r===Ts.STRUCTURED?a.jsx(Pde,{logs:x}):r===Ts.RAW?a.jsx(Ude,{logs:e.logs,errors:e.errors}):a.jsx(zde,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,x,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),C=Dde(e),S=Ode(e),[w,R]=Nde(e,h==null?void 0:h.displayName);return a.jsxs("div",{className:"dm-card-block",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{children:a.jsx(Fde,{type:e.type,base64Icon:h==null?void 0:h.logoBase64})}),a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{className:"text-foreground align-center mr-12 flex items-center font-mono text-sm font-medium",children:C})}),a.jsx(Rt,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{children:["Started At: ",S.startedAt]}),a.jsxs("div",{children:["Finished At: ",S.finishedAt]}),S.duration&&a.jsxs("div",{children:["Duration: ",S.duration]})]})})]}),a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[Lde(e.triggerType),a.jsxs("span",{className:"inline-flex items-center",children:[w,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(KO,{userProjection:e.createdByUser})]}),R&&a.jsxs(a.Fragment,{children:[" • ",R]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_de,{status:e.status}),a.jsx(Da,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&a.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),a.jsx(Fg,{text:e.id,section:"run-id",onCopy:g,copiedSection:y,iconOnly:!0})]}),a.jsx(Ide,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function $de(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:i=[],isLoading:c}=gs(),[u,f]=m.useState(!1),[h,y]=m.useState(!0),[g,x]=m.useState(0),[v,C]=m.useState(null),[S,w]=m.useState(Ts.STRUCTURED),[R,j]=m.useState(""),_=m.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);x(T.length),y(T.length===20)},[t==null?void 0:t.id,n,20]),I=m.useCallback(async()=>{if(!(t!=null&&t.id)||u)return;f(!0);const T=await r(t.id,g,20);x(D=>D+T.length),y(T.length===20),f(!1)},[t==null?void 0:t.id,r,g,u,20]);m.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=m.useMemo(()=>(t==null?void 0:t.definitionType)===Be.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),O=T=>{C(v===T?null:T)};return c?a.jsx(SM,{}):a.jsx("div",{className:"flex flex-col gap-4 pb-4",children:i.length===0?a.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):a.jsxs("div",{className:"space-y-2",children:[i.map(T=>a.jsx(Hde,{run:T,isExpanded:v===T.id,onToggle:O,logViewType:S,setLogViewType:w,searchTerm:R,setSearchTerm:j,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},T.id)),h&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(Hu,{variant:"outline",size:"sm",onClick:()=>void I(),disabled:u,className:"flex items-center gap-2",children:u?a.jsxs(a.Fragment,{children:[a.jsx(KU,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Vde=5e3,Bde=20;function Gde(){const{dataMart:e,getDataMartRuns:t}=xs();return xC({enabled:!!(e!=null&&e.id),intervalMs:Vde,onTick:()=>{e!=null&&e.id&&t(e.id,Bde,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(dl,{collapsible:!1,name:"run-history",children:[a.jsx(mo,{children:a.jsx(ho,{icon:hU,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(po,{children:a.jsx($de,{})})]})})}function qde(){const e=jI(),{navigate:t}=hi(),n=r=>{const s=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(s)};return a.jsx("div",{className:"flex h-full w-full items-center justify-center",children:a.jsx("div",{className:"m-auto w-lg",children:a.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:[a.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),a.jsx(S2,{children:a.jsx(JO,{children:a.jsx(kne,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function jM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=Uy();m.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(a2,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(s2,{children:[a.jsxs(o2,{children:[a.jsx(i2,{children:"Storage Details"}),a.jsx(l2,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(hX,{dataStorage:s,isLoading:i})})]})})}const Kde=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=m.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(_r,{open:s,onOpenChange:i,children:[a.jsx(Nr,{asChild:!0,children:a.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:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ar,{align:"end",children:[a.jsxs(Nt,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(xA,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(Nt,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(sd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},Zde=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(br,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return a.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(br,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=Cl.getInfo(s);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),i]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(br,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return a.jsx("div",{className:"text-muted-foreground",children:i})}},{id:"actions",size:80,header:({table:r})=>a.jsx(gd,{table:r}),cell:({row:r})=>a.jsx(Kde,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Yde({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(gA,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Storage"]})]})}function Wde({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Ac({columns:e,storageKeyPrefix:"data-storage-list"}),[f,h]=m.useState([]),[y,g]=m.useState({}),[x,v]=m.useState(!1),[C]=m.useState(null),S=El({data:t,columns:[...e],getCoreRowModel:wl(),getPaginationRowModel:Ph(),onSortingChange:i,getSortedRowModel:Nc(),onColumnFiltersChange:h,getFilteredRowModel:pd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),w=(j,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(j)};return t.length?a.jsxs("div",{children:[C&&a.jsx(jM,{isOpen:x,onClose:()=>{v(!1)},id:C.id}),a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Ec,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(R=S.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=S.getColumn("title"))==null?void 0:_.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ma,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(jl,{className:"dm-card-table-header",children:S.getHeaderGroups().map(j=>a.jsx(Fn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(_l,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.getSize())}%`},children:_.isPlaceholder?null:td(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:S.getRowModel().rows.length?S.getRowModel().rows.map(j=>a.jsx(Fn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const I=j.original.id;w(I,_)},children:j.getVisibleCells().map(_=>a.jsx(Hr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${_.column.id==="actions"?"actions-cell":""} ${_.column.id==="createdAt"?"whitespace-nowrap":""}`,style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:td(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{S.previousPage()},disabled:!S.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{S.nextPage()},disabled:!S.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(Yde,{onOpenTypeDialog:r})})}const Xde=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=m.useState(e),[s,i]=m.useState(!1),{dataStorages:c,currentDataStorage:u,clearCurrentDataStorage:f,fetchDataStorages:h,getDataStorageById:y,deleteDataStorage:g,createDataStorage:x}=Uy();m.useEffect(()=>{h()},[h]),m.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[C,S]=m.useState(!1),[w,R]=m.useState(!1),[j,_]=m.useState(null),[I,A]=m.useState(!1),[O,T]=m.useState(null),D=async V=>{i(!0);try{const se=await x(V);v(),se!=null&&se.id&&(await y(se.id),S(!0),i(!1))}catch(se){console.error("Failed to create storage:",se)}},L=V=>{T(V),A(!0)},$=()=>{A(!1),T(null)},K=async V=>{await y(V),S(!0)},Z=V=>{_(V),R(!0)},G=async()=>{if(j)try{await g(j),await h()}catch(V){console.error("Failed to delete storage:",V)}finally{R(!1),_(null)}},q=async()=>{try{S(!1),await h()}catch(V){console.error("Failed to save storage:",V)}},z=()=>{S(!1),f()},M=c.map(V=>({id:V.id,title:V.title,type:V.type,createdAt:V.createdAt,modifiedAt:V.modifiedAt})),H=Zde({onViewDetails:L,onEdit:K,onDelete:Z});return a.jsxs("div",{children:[a.jsx(Wde,{columns:H,data:M,onEdit:K,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(jM,{isOpen:I,onClose:$,id:O??""}),a.jsx(X5,{isOpen:n,onClose:v,onSelect:D,isCreatingDataStorage:s}),a.jsx(oI,{isOpen:C,onClose:z,dataStorage:u,onSaveSuccess:()=>void q()}),a.jsx(Cr,{open:w,onOpenChange:R,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{G()},onCancel:()=>{_(null)},variant:"destructive"})]})},Qde=()=>{const[e,t]=m.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(S2,{children:a.jsx(Xde,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Jde({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(Yb,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),a.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."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Destination"]})]})}function efe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var C;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Ac({columns:e,storageKeyPrefix:"data-destination-list"}),[f,h]=m.useState([]),[y,g]=m.useState({}),x=El({data:t,columns:[...e],getCoreRowModel:wl(),getPaginationRowModel:Ph(),onSortingChange:i,getSortedRowModel:Nc(),onColumnFiltersChange:h,getFilteredRowModel:pd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),v=(S,w)=>{w.target instanceof HTMLElement&&(w.target.closest('[role="checkbox"]')||w.target.closest(".actions-cell")||w.target.closest('[role="menuitem"]'))||n==null||n(S)};return t.length?a.jsx("div",{children:a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Ec,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(C=x.getColumn("title"))==null?void 0:C.getFilterValue(),onChange:S=>{var w;return(w=x.getColumn("title"))==null?void 0:w.setFilterValue(S.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ma,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(jl,{className:"dm-card-table-header",children:x.getHeaderGroups().map(S=>a.jsx(Fn,{className:"dm-card-table-header-row",children:S.headers.map(w=>a.jsx(_l,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.getSize())}%`},children:w.isPlaceholder?null:td(w.column.columnDef.header,w.getContext())},w.id))},S.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(S=>a.jsx(Fn,{"data-state":S.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:w=>{const R=S.original.id;v(R,w)},children:S.getVisibleCells().map(w=>a.jsx(Hr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${w.column.id==="actions"?"actions-cell":""} ${w.column.id==="createdAt"?"whitespace-nowrap":""}`,style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.column.getSize())}%`},children:td(w.column.columnDef.cell,w.getContext())},w.id))},S.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(Jde,{onOpenTypeDialog:r})})}const tfe=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=m.useState(!1),f=()=>{if(n&&yC(n)){const g=GS(n);navigator.clipboard.writeText(g),Tt.success("JSON Config copied to clipboard")}},h=t===Ae.LOOKER_STUDIO,y=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(_r,{open:c,onOpenChange:u,children:[a.jsx(Nr,{asChild:!0,children:a.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:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ar,{align:"end",children:[a.jsxs(Nt,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(sd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),h&&y&&a.jsxs(a.Fragment,{children:[a.jsx(Na,{}),a.jsxs(Nt,{onClick:f,children:[a.jsx(Ku,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(Nt,{onClick:()=>{i==null||i(e)},children:[a.jsx(T1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(Na,{}),a.jsxs(Nt,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},nfe=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(br,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(br,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=sa.getInfo(s);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),i]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(br,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return a.jsx("div",{className:"text-muted-foreground",children:i})}},{id:"actions",size:80,header:({table:r})=>a.jsx(gd,{table:r}),cell:({row:r})=>a.jsx(tfe,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}],rfe=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f}=Lh(),h=m.useCallback(()=>{s(),g(!0),t==null||t()},[s,t]),[y,g]=m.useState(!1),[x,v]=m.useState(!1),[C,S]=m.useState(!1),[w,R]=m.useState(null),[j,_]=m.useState(null);m.useEffect(()=>{i()},[i]),m.useEffect(()=>{e&&h()},[e,h]);const I=async G=>{await c(G),g(!0)},A=G=>{R(G),v(!0)},O=G=>{_(G),S(!0)},T=async()=>{if(j)try{const G=await f(j);if(yC(G.credentials)){Tt.success("New JSON Config copied to clipboard");const q=GS(G.credentials);navigator.clipboard.writeText(q)}await i()}catch(G){console.error("Failed to rotate secret key:",G)}finally{S(!1),_(null)}},D=async()=>{if(w)try{await u(w),await i()}catch(G){console.error("Failed to delete destination:",G)}finally{v(!1),R(null)}},L=async()=>{try{g(!1),await i()}catch(G){console.error("Failed to save destination:",G)}},$=()=>{g(!1),s()},K=n.map(G=>({id:G.id,title:G.title,type:G.type,createdAt:G.createdAt,modifiedAt:G.modifiedAt,credentials:G.credentials})),Z=nfe({onEdit:I,onDelete:A,onRotateSecretKey:O});return a.jsxs("div",{children:[a.jsx(efe,{columns:Z,data:K,onEdit:I,onDelete:A,onRotateSecretKey:O,onOpenTypeDialog:h}),a.jsx(xM,{isOpen:y,onClose:$,dataDestination:r,onSaveSuccess:()=>void L()}),a.jsx(Cr,{open:x,onOpenChange:v,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{D()},onCancel:()=>{R(null)},variant:"destructive"}),a.jsx(Cr,{open:C,onOpenChange:S,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{S(!1)},variant:"destructive",children:a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),a.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[a.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),a.jsx("li",{children:"Go to your Looker Studio Connector"}),a.jsx("li",{children:"Update the configuration with the new JSON Config"}),a.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),a.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},afe=()=>{const[e,t]=m.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(kh,{children:a.jsx(rfe,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Db({className:e,...t}){return a.jsx("div",{"data-slot":"empty",className:oe("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function Ob({className:e,...t}){return a.jsx("div",{"data-slot":"empty-header",className:oe("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const sfe=Cc("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-muted-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6 [&_svg]:stroke-[1.5]"}},defaultVariants:{variant:"default"}});function Ib({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:oe(sfe({variant:t,className:e})),...n})}function Mb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-title",className:oe("text-muted-foreground text-lg font-medium tracking-tight",e),...t})}function kb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-description",className:oe("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function ofe({className:e,...t}){return a.jsx("div",{"data-slot":"empty-content",className:oe("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}const ife=()=>{const e=Sc(),{createInsight:t,insightLoading:n}=vC(),r=()=>{(async()=>{const s=await t({title:"Untitled insight"});s&&e(s.id)})()};return a.jsxs(Db,{children:[a.jsxs(Ob,{children:[a.jsx(Ib,{variant:"icon",children:a.jsx(el,{})}),a.jsx(Mb,{children:"Create your first Insight"}),a.jsx(kb,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(ofe,{children:a.jsxs(we,{variant:"outline",onClick:r,disabled:n,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Insight"]})})]})};function lfe({id:e,onDelete:t}){const[n,r]=m.useState(!1);return a.jsx("div",{className:"text-right",onClick:s=>{s.stopPropagation()},children:a.jsxs(_r,{open:n,onOpenChange:r,children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${n?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Bs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ar,{align:"end",children:a.jsxs(Nt,{className:"text-destructive",onClick:()=>t==null?void 0:t(e),children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})}const cfe=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(br,{column:t,children:"Title"}),cell:({row:t})=>{const n=t.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:n})},meta:{title:"Title"}},{accessorKey:"lastRun",size:50,sortDescFirst:!0,header:({column:t})=>a.jsx(br,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:rO(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(gd,{table:t}),cell:({row:t})=>a.jsx(lfe,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function ufe({items:e,onRowClick:t,onDelete:n}){const r=m.useMemo(()=>cfe({onDelete:n}),[n]),{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Ac({columns:r,storageKeyPrefix:"data-mart-insights",defaultSortingColumn:"lastRun"}),f=El({data:e,columns:r,getCoreRowModel:wl(),getPaginationRowModel:Ph(),onSortingChange:i,getSortedRowModel:Nc(),getFilteredRowModel:pd(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),h=m.useCallback(()=>{f.previousPage()},[f]),y=m.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Rl,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(jl,{className:"dm-card-table-header",children:f.getHeaderGroups().map(x=>a.jsx(Fn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(_l,{scope:"col",style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.getSize())}%`},children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(Tl,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((x,v)=>a.jsx(Fn,{onClick:()=>{t(x.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((C,S)=>a.jsx(Hr,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":S+1,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},x.id)):a.jsx(Fn,{children:a.jsx(Hr,{colSpan:r.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No insights found."})})})})]})}),a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:h,disabled:!f.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:y,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function dfe(){const e=Sc(),{fetchInsights:t,deleteInsight:n,createInsight:r,insightLoading:s}=vC(),{insights:i,isLoading:c,error:u,hasInsights:f}=Rde(),[h,y]=m.useState(null);m.useEffect(()=>{t()},[t]);const g=C=>{e(C)},x=()=>{(async()=>{const C=await r({title:"Untitled insight"});C&&e(C.id)})()},v=()=>{(async()=>{if(h)try{await n(h)}finally{y(null)}})()};return a.jsxs(dl,{children:[a.jsxs(mo,{children:[a.jsx(ho,{tooltip:"Manage and review your insights",icon:el,children:"Insights"}),f&&a.jsx(Kh,{children:a.jsxs(we,{variant:"outline","aria-label":"Add new insight",disabled:s,onClick:x,children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})]}),a.jsxs(po,{children:[c&&!f?a.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading insights…"}):u?a.jsx("div",{className:"text-destructive p-4 text-sm",children:"Failed to load insights"}):f?a.jsx(ufe,{items:i.map(C=>({id:C.id,title:C.title,lastRun:C.outputUpdatedAt})),onRowClick:g,onDelete:C=>{y(C)}}):a.jsx(ife,{}),a.jsx(Cr,{open:!!h,onOpenChange:C=>{C||y(null)},title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:v})]}),a.jsx(ni,{})]})}function ffe(){return a.jsx(EM,{children:a.jsx(dfe,{})})}const Qy=m.createContext(null);Qy.displayName="PanelGroupContext";const Jn={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},bC=10,ic=m.useLayoutEffect,EN=Vg.useId,hfe=typeof EN=="function"?EN:()=>null;let mfe=0;function SC(e=null){const t=hfe(),n=m.useRef(e||t||null);return n.current===null&&(n.current=""+mfe++),e??n.current}function TM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:h,onExpand:y,onResize:g,order:x,style:v,tagName:C="div",...S}){const w=m.useContext(Qy);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:R,expandPanel:j,getPanelSize:_,getPanelStyle:I,groupId:A,isPanelCollapsed:O,reevaluatePanelConstraints:T,registerPanel:D,resizePanel:L,unregisterPanel:$}=w,K=SC(c),Z=m.useRef({callbacks:{onCollapse:h,onExpand:y,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:K,idIsFromProps:c!==void 0,order:x});m.useRef({didLogMissingDefaultSizeWarning:!1}),ic(()=>{const{callbacks:q,constraints:z}=Z.current,M={...z};Z.current.id=K,Z.current.idIsFromProps=c!==void 0,Z.current.order=x,q.onCollapse=h,q.onExpand=y,q.onResize=g,z.collapsedSize=n,z.collapsible=r,z.defaultSize=s,z.maxSize=u,z.minSize=f,(M.collapsedSize!==z.collapsedSize||M.collapsible!==z.collapsible||M.maxSize!==z.maxSize||M.minSize!==z.minSize)&&T(Z.current,M)}),ic(()=>{const q=Z.current;return D(q),()=>{$(q)}},[x,K,D,$]),m.useImperativeHandle(i,()=>({collapse:()=>{R(Z.current)},expand:q=>{j(Z.current,q)},getId(){return K},getSize(){return _(Z.current)},isCollapsed(){return O(Z.current)},isExpanded(){return!O(Z.current)},resize:q=>{L(Z.current,q)}}),[R,j,_,O,K,L]);const G=I(Z.current,s);return m.createElement(C,{...S,children:e,className:t,id:K,style:{...G,...v},[Jn.groupId]:A,[Jn.panel]:"",[Jn.panelCollapsible]:r||void 0,[Jn.panelId]:K,[Jn.panelSize]:parseFloat(""+G.flexGrow).toFixed(1)})}const _M=m.forwardRef((e,t)=>m.createElement(TM,{...e,forwardedRef:t}));TM.displayName="Panel";_M.displayName="forwardRef(Panel)";let Lb=null,Yp=-1,Xi=null;function pfe(e,t,n){const r=(t&IM)!==0,s=(t&MM)!==0,i=(t&kM)!==0,c=(t&LM)!==0;if(t){if(r)return i?"se-resize":c?"ne-resize":"e-resize";if(s)return i?"sw-resize":c?"nw-resize":"w-resize";if(i)return"s-resize";if(c)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function gfe(){Xi!==null&&(document.head.removeChild(Xi),Lb=null,Xi=null,Yp=-1)}function p1(e,t,n){var r,s;const i=pfe(e,t);if(Lb!==i){if(Lb=i,Xi===null&&(Xi=document.createElement("style"),document.head.appendChild(Xi)),Yp>=0){var c;(c=Xi.sheet)===null||c===void 0||c.removeRule(Yp)}Yp=(r=(s=Xi.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function NM(e){return e.type==="keydown"}function AM(e){return e.type.startsWith("pointer")}function DM(e){return e.type.startsWith("mouse")}function Jy(e){if(AM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(DM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function yfe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function xfe(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function vfe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:TN(e),b:TN(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ot(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:jN(RN(n.a)),b:jN(RN(n.b))};if(s.a===s.b){const i=r.childNodes,c={a:n.a.at(-1),b:n.b.at(-1)};let u=i.length;for(;u--;){const f=i[u];if(f===c.a)return 1;if(f===c.b)return-1}}return Math.sign(s.a-s.b)}const bfe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Sfe(e){var t;const n=getComputedStyle((t=OM(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function Cfe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Sfe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||bfe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function RN(e){let t=e.length;for(;t--;){const n=e[t];if(Ot(n,"Missing node"),Cfe(n))return n}return null}function jN(e){return e&&Number(getComputedStyle(e).zIndex)||0}function TN(e){const t=[];for(;e;)t.push(e),e=OM(e);return t}function OM(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const IM=1,MM=2,kM=4,LM=8,wfe=yfe()==="coarse";let ks=[],Gu=!1,Qi=new Map,ex=new Map;const ih=new Set;function Efe(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=Qi.get(c))!==null&&i!==void 0?i:0;return Qi.set(c,f+1),ih.add(u),Hg(),function(){var y;ex.delete(e),ih.delete(u);const g=(y=Qi.get(c))!==null&&y!==void 0?y:1;if(Qi.set(c,g-1),Hg(),g===1&&Qi.delete(c),ks.includes(u)){const x=ks.indexOf(u);x>=0&&ks.splice(x,1),tx(),s("up",!0,null)}}}function Rfe(e){const{target:t}=e,{x:n,y:r}=Jy(e);Gu=!0,CC({target:t,x:n,y:r}),Hg(),ks.length>0&&($g("down",e),tx(),e.preventDefault(),PM(t)||e.stopImmediatePropagation())}function g1(e){const{x:t,y:n}=Jy(e);if(Gu&&e.type!=="pointerleave"&&e.buttons===0&&(Gu=!1,$g("up",e)),!Gu){const{target:r}=e;CC({target:r,x:t,y:n})}$g("move",e),tx(),ks.length>0&&e.preventDefault()}function y1(e){const{target:t}=e,{x:n,y:r}=Jy(e);ex.clear(),Gu=!1,ks.length>0&&(e.preventDefault(),PM(t)||e.stopImmediatePropagation()),$g("up",e),CC({target:t,x:n,y:r}),tx(),Hg()}function PM(e){let t=e;for(;t;){if(t.hasAttribute(Jn.resizeHandle))return!0;t=t.parentElement}return!1}function CC({target:e,x:t,y:n}){ks.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ih.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:h,right:y,top:g}=u,x=wfe?c.coarse:c.fine;if(t>=h-x&&t<=y+x&&n>=g-x&&n<=f+x){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&vfe(r,i)>0){let C=r,S=!1;for(;C&&!C.contains(i);){if(xfe(C.getBoundingClientRect(),u)){S=!0;break}C=C.parentElement}if(S)return}ks.push(s)}})}function x1(e,t){ex.set(e,t)}function tx(){let e=!1,t=!1;ks.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;ex.forEach(r=>{n|=r}),e&&t?p1("intersection",n):e?p1("horizontal",n):t?p1("vertical",n):gfe()}let v1;function Hg(){var e;(e=v1)===null||e===void 0||e.abort(),v1=new AbortController;const t={capture:!0,signal:v1.signal};ih.size&&(Gu?(ks.length>0&&Qi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",y1,t),s.addEventListener("pointerleave",g1,t),s.addEventListener("pointermove",g1,t))}),Qi.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",y1,t),s.addEventListener("pointercancel",y1,t)})):Qi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",Rfe,t),s.addEventListener("pointermove",g1,t))}))}function $g(e,t){ih.forEach(n=>{const{setResizeHandlerState:r}=n,s=ks.includes(n);r(e,s,t)})}function jfe(){const[e,t]=m.useState(0);return m.useCallback(()=>t(n=>n+1),[])}function Ot(e,t){if(!e)throw console.error(t),Error(t)}function vc(e,t,n=bC){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Xo(e,t,n=bC){return vc(e,t,n)===0}function Fa(e,t,n){return vc(e,t,n)===0}function Tfe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],i=t[r];if(!Fa(s,i,n))return!1}return!0}function Mu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Ot(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:c=100,minSize:u=0}=r;if(vc(n,u)<0)if(i){const f=(s+u)/2;vc(n,f)<0?n=s:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(bC)),n}function If({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Fa(e,0))return t;const c=[...t],[u,f]=r;Ot(u!=null,"Invalid first pivot index"),Ot(f!=null,"Invalid second pivot index");let h=0;if(i==="keyboard"){{const g=e<0?f:u,x=n[g];Ot(x,`Panel constraints not found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:S=0}=x;if(C){const w=t[g];if(Ot(w!=null,`Previous layout not found for panel index ${g}`),Fa(w,v)){const R=S-w;vc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}{const g=e<0?u:f,x=n[g];Ot(x,`No panel constraints found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:S=0}=x;if(C){const w=t[g];if(Ot(w!=null,`Previous layout not found for panel index ${g}`),Fa(w,S)){const R=w-v;vc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}}{const g=e<0?1:-1;let x=e<0?f:u,v=0;for(;;){const S=t[x];Ot(S!=null,`Previous layout not found for panel index ${x}`);const R=Mu({panelConstraints:n,panelIndex:x,size:100})-S;if(v+=R,x+=g,x<0||x>=n.length)break}const C=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-C:C}{let x=e<0?u:f;for(;x>=0&&x<n.length;){const v=Math.abs(e)-Math.abs(h),C=t[x];Ot(C!=null,`Previous layout not found for panel index ${x}`);const S=C-v,w=Mu({panelConstraints:n,panelIndex:x,size:S});if(!Fa(C,w)&&(h+=C-w,c[x]=w,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(Tfe(s,c))return s;{const g=e<0?f:u,x=t[g];Ot(x!=null,`Previous layout not found for panel index ${g}`);const v=x+h,C=Mu({panelConstraints:n,panelIndex:g,size:v});if(c[g]=C,!Fa(C,v)){let S=v-C,R=e<0?f:u;for(;R>=0&&R<n.length;){const j=c[R];Ot(j!=null,`Previous layout not found for panel index ${R}`);const _=j+S,I=Mu({panelConstraints:n,panelIndex:R,size:_});if(Fa(j,I)||(S-=I-j,c[R]=I),Fa(S,0))break;e>0?R--:R++}}}const y=c.reduce((g,x)=>x+g,0);return Fa(y,100)?c:s}function _fe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,c=0;const u=n[0];Ot(u!=null,"No pivot index found"),t.forEach((g,x)=>{const{constraints:v}=g,{maxSize:C=100,minSize:S=0}=v;x===u?(r=S,s=C):(i+=S,c+=C)});const f=Math.min(s,100-i),h=Math.max(r,100-c),y=e[u];return{valueMax:f,valueMin:h,valueNow:y}}function lh(e,t=document){return Array.from(t.querySelectorAll(`[${Jn.resizeHandleId}][data-panel-group-id="${e}"]`))}function UM(e,t,n=document){const s=lh(e,n).findIndex(i=>i.getAttribute(Jn.resizeHandleId)===t);return s??null}function zM(e,t,n){const r=UM(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Nfe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function FM(e,t=document){if(Nfe(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function nx(e,t=document){const n=t.querySelector(`[${Jn.resizeHandleId}="${e}"]`);return n||null}function Afe(e,t,n,r=document){var s,i,c,u;const f=nx(t,r),h=lh(e,r),y=f?h.indexOf(f):-1,g=(s=(i=n[y])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,x=(c=(u=n[y+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[g,x]}function Dfe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){m.useRef({didWarnAboutMissingResizeHandle:!1}),ic(()=>{if(!i)return;const u=lh(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:h,valueMin:y,valueNow:g}=_fe({layout:r,panelsArray:s,pivotIndices:[f,f+1]}),x=u[f];if(x!=null){const v=s[f];Ot(v,`No panel data found for index "${f}"`),x.setAttribute("aria-controls",v.id),x.setAttribute("aria-valuemax",""+Math.round(h)),x.setAttribute("aria-valuemin",""+Math.round(y)),x.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{u.forEach((f,h)=>{f.removeAttribute("aria-controls"),f.removeAttribute("aria-valuemax"),f.removeAttribute("aria-valuemin"),f.removeAttribute("aria-valuenow")})}},[n,r,s,i]),m.useEffect(()=>{if(!i)return;const u=t.current;Ot(u,"Eager values not found");const{panelDataArray:f}=u,h=FM(n,i);Ot(h!=null,`No group found for id "${n}"`);const y=lh(n,i);Ot(y,`No resize handles found for group id "${n}"`);const g=y.map(x=>{const v=x.getAttribute(Jn.resizeHandleId);Ot(v,"Resize handle element has no handle id attribute");const[C,S]=Afe(n,v,f,i);if(C==null||S==null)return()=>{};const w=R=>{if(!R.defaultPrevented)switch(R.key){case"Enter":{R.preventDefault();const j=f.findIndex(_=>_.id===C);if(j>=0){const _=f[j];Ot(_,`No panel data found for index ${j}`);const I=r[j],{collapsedSize:A=0,collapsible:O,minSize:T=0}=_.constraints;if(I!=null&&O){const D=If({delta:Fa(I,A)?T-A:A-I,initialLayout:r,panelConstraints:f.map(L=>L.constraints),pivotIndices:zM(n,v,i),prevLayout:r,trigger:"keyboard"});r!==D&&c(D)}}break}}};return x.addEventListener("keydown",w),()=>{x.removeEventListener("keydown",w)}});return()=>{g.forEach(x=>x())}},[i,e,t,n,r,s,c])}function _N(e,t){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 HM(e,t){const n=e==="horizontal",{x:r,y:s}=Jy(t);return n?r:s}function Ofe(e,t,n,r,s){const i=n==="horizontal",c=nx(t,s);Ot(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(Jn.groupId);Ot(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const h=HM(n,e),y=FM(u,s);Ot(y,`No group element found for id "${u}"`);const g=y.getBoundingClientRect(),x=i?g.width:g.height;return(h-f)/x*100}function Ife(e,t,n,r,s,i){if(NM(e)){const c=n==="horizontal";let u=0;e.shiftKey?u=100:s!=null?u=s:u=10;let f=0;switch(e.key){case"ArrowDown":f=c?0:u;break;case"ArrowLeft":f=c?-u:0;break;case"ArrowRight":f=c?u:0;break;case"ArrowUp":f=c?0:-u;break;case"End":f=100;break;case"Home":f=-100;break}return f}else return r==null?0:Ofe(e,t,n,r,i)}function Mfe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,s=100;for(let i=0;i<e.length;i++){const c=n[i];Ot(c,`Panel constraints not found for index ${i}`);const{defaultSize:u}=c;u!=null&&(r++,t[i]=u,s-=u)}for(let i=0;i<e.length;i++){const c=n[i];Ot(c,`Panel constraints not found for index ${i}`);const{defaultSize:u}=c;if(u!=null)continue;const f=e.length-r,h=s/f;r++,t[i]=h,s-=h}return t}function wu(e,t,n){t.forEach((r,s)=>{const i=e[s];Ot(i,`Panel data not found for index ${s}`);const{callbacks:c,constraints:u,id:f}=i,{collapsedSize:h=0,collapsible:y}=u,g=n[f];if(g==null||r!==g){n[f]=r;const{onCollapse:x,onExpand:v,onResize:C}=c;C&&C(r,g),y&&(x||v)&&(v&&(g==null||Xo(g,h))&&!Xo(r,h)&&v(),x&&(g==null||!Xo(g,h))&&Xo(r,h)&&x())}})}function kp(e,t){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 kfe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:s,precision:i=3}){const c=n[s];let u;return c==null?u=e!=null?e.toFixed(i):"1":r.length===1?u="1":u=c.toFixed(i),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Lfe(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function NN(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function $M(e){return`react-resizable-panels:${e}`}function VM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=t;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function BM(e,t){try{const n=$M(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function Pfe(e,t,n){var r,s;const i=(r=BM(e,n))!==null&&r!==void 0?r:{},c=VM(t);return(s=i[c])!==null&&s!==void 0?s:null}function Ufe(e,t,n,r,s){var i;const c=$M(e),u=VM(t),f=(i=BM(e,s))!==null&&i!==void 0?i:{};f[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(c,JSON.stringify(f))}catch(h){console.error(h)}}function AN({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,c)=>i+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Fa(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=100/r*c;n[i]=u}let s=0;for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=Mu({panelConstraints:t,panelIndex:i,size:c});c!=u&&(s+=c-u,n[i]=u)}if(!Fa(s,0))for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=c+s,f=Mu({panelConstraints:t,panelIndex:i,size:u});if(c!==f&&(s-=f-c,n[i]=f,Fa(s,0)))break}return n}const zfe=100,Mf={getItem:e=>(NN(Mf),Mf.getItem(e)),setItem:(e,t)=>{NN(Mf),Mf.setItem(e,t)}},DN={};function GM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Mf,style:h,tagName:y="div",...g}){const x=SC(i),v=m.useRef(null),[C,S]=m.useState(null),[w,R]=m.useState([]),j=jfe(),_=m.useRef({}),I=m.useRef(new Map),A=m.useRef(0),O=m.useRef({autoSaveId:e,direction:r,dragState:C,id:x,keyboardResizeBy:u,onLayout:c,storage:f}),T=m.useRef({layout:w,panelDataArray:[],panelDataArrayChanged:!1});m.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),m.useImperativeHandle(s,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:F}=T.current;return F},setLayout:F=>{const{onLayout:W}=O.current,{layout:X,panelDataArray:ae}=T.current,J=AN({layout:F,panelConstraints:ae.map(ce=>ce.constraints)});_N(X,J)||(R(J),T.current.layout=J,W&&W(J),wu(ae,J,_.current))}}),[]),ic(()=>{O.current.autoSaveId=e,O.current.direction=r,O.current.dragState=C,O.current.id=x,O.current.onLayout=c,O.current.storage=f}),Dfe({committedValuesRef:O,eagerValuesRef:T,groupId:x,layout:w,panelDataArray:T.current.panelDataArray,setLayout:R,panelGroupElement:v.current}),m.useEffect(()=>{const{panelDataArray:F}=T.current;if(e){if(w.length===0||w.length!==F.length)return;let W=DN[e];W==null&&(W=Lfe(Ufe,zfe),DN[e]=W);const X=[...F],ae=new Map(I.current);W(e,X,ae,w,f)}},[e,w,f]),m.useEffect(()=>{});const D=m.useCallback(F=>{const{onLayout:W}=O.current,{layout:X,panelDataArray:ae}=T.current;if(F.constraints.collapsible){const J=ae.map(Me=>Me.constraints),{collapsedSize:ce=0,panelSize:ye,pivotIndices:Se}=Xl(ae,F,X);if(Ot(ye!=null,`Panel size not found for panel "${F.id}"`),!Xo(ye,ce)){I.current.set(F.id,ye);const ke=Du(ae,F)===ae.length-1?ye-ce:ce-ye,tt=If({delta:ke,initialLayout:X,panelConstraints:J,pivotIndices:Se,prevLayout:X,trigger:"imperative-api"});kp(X,tt)||(R(tt),T.current.layout=tt,W&&W(tt),wu(ae,tt,_.current))}}},[]),L=m.useCallback((F,W)=>{const{onLayout:X}=O.current,{layout:ae,panelDataArray:J}=T.current;if(F.constraints.collapsible){const ce=J.map(at=>at.constraints),{collapsedSize:ye=0,panelSize:Se=0,minSize:Me=0,pivotIndices:ke}=Xl(J,F,ae),tt=W??Me;if(Xo(Se,ye)){const at=I.current.get(F.id),Pt=at!=null&&at>=tt?at:tt,Dn=Du(J,F)===J.length-1?Se-Pt:Pt-Se,ln=If({delta:Dn,initialLayout:ae,panelConstraints:ce,pivotIndices:ke,prevLayout:ae,trigger:"imperative-api"});kp(ae,ln)||(R(ln),T.current.layout=ln,X&&X(ln),wu(J,ln,_.current))}}},[]),$=m.useCallback(F=>{const{layout:W,panelDataArray:X}=T.current,{panelSize:ae}=Xl(X,F,W);return Ot(ae!=null,`Panel size not found for panel "${F.id}"`),ae},[]),K=m.useCallback((F,W)=>{const{panelDataArray:X}=T.current,ae=Du(X,F);return kfe({defaultSize:W,dragState:C,layout:w,panelData:X,panelIndex:ae})},[C,w]),Z=m.useCallback(F=>{const{layout:W,panelDataArray:X}=T.current,{collapsedSize:ae=0,collapsible:J,panelSize:ce}=Xl(X,F,W);return Ot(ce!=null,`Panel size not found for panel "${F.id}"`),J===!0&&Xo(ce,ae)},[]),G=m.useCallback(F=>{const{layout:W,panelDataArray:X}=T.current,{collapsedSize:ae=0,collapsible:J,panelSize:ce}=Xl(X,F,W);return Ot(ce!=null,`Panel size not found for panel "${F.id}"`),!J||vc(ce,ae)>0},[]),q=m.useCallback(F=>{const{panelDataArray:W}=T.current;W.push(F),W.sort((X,ae)=>{const J=X.order,ce=ae.order;return J==null&&ce==null?0:J==null?-1:ce==null?1:J-ce}),T.current.panelDataArrayChanged=!0,j()},[j]);ic(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:F,onLayout:W,storage:X}=O.current,{layout:ae,panelDataArray:J}=T.current;let ce=null;if(F){const Se=Pfe(F,J,X);Se&&(I.current=new Map(Object.entries(Se.expandToSizes)),ce=Se.layout)}ce==null&&(ce=Mfe({panelDataArray:J}));const ye=AN({layout:ce,panelConstraints:J.map(Se=>Se.constraints)});_N(ae,ye)||(R(ye),T.current.layout=ye,W&&W(ye),wu(J,ye,_.current))}}),ic(()=>{const F=T.current;return()=>{F.layout=[]}},[]);const z=m.useCallback(F=>{let W=!1;const X=v.current;return X&&window.getComputedStyle(X,null).getPropertyValue("direction")==="rtl"&&(W=!0),function(J){J.preventDefault();const ce=v.current;if(!ce)return()=>null;const{direction:ye,dragState:Se,id:Me,keyboardResizeBy:ke,onLayout:tt}=O.current,{layout:at,panelDataArray:Pt}=T.current,{initialLayout:fn}=Se??{},Dn=zM(Me,F,ce);let ln=Ife(J,F,ye,Se,ke,ce);const Ie=ye==="horizontal";Ie&&W&&(ln=-ln);const B=Pt.map(Ne=>Ne.constraints),ne=If({delta:ln,initialLayout:fn??at,panelConstraints:B,pivotIndices:Dn,prevLayout:at,trigger:NM(J)?"keyboard":"mouse-or-touch"}),ue=!kp(at,ne);(AM(J)||DM(J))&&A.current!=ln&&(A.current=ln,!ue&&ln!==0?Ie?x1(F,ln<0?IM:MM):x1(F,ln<0?kM:LM):x1(F,0)),ue&&(R(ne),T.current.layout=ne,tt&&tt(ne),wu(Pt,ne,_.current))}},[]),M=m.useCallback((F,W)=>{const{onLayout:X}=O.current,{layout:ae,panelDataArray:J}=T.current,ce=J.map(at=>at.constraints),{panelSize:ye,pivotIndices:Se}=Xl(J,F,ae);Ot(ye!=null,`Panel size not found for panel "${F.id}"`);const ke=Du(J,F)===J.length-1?ye-W:W-ye,tt=If({delta:ke,initialLayout:ae,panelConstraints:ce,pivotIndices:Se,prevLayout:ae,trigger:"imperative-api"});kp(ae,tt)||(R(tt),T.current.layout=tt,X&&X(tt),wu(J,tt,_.current))},[]),H=m.useCallback((F,W)=>{const{layout:X,panelDataArray:ae}=T.current,{collapsedSize:J=0,collapsible:ce}=W,{collapsedSize:ye=0,collapsible:Se,maxSize:Me=100,minSize:ke=0}=F.constraints,{panelSize:tt}=Xl(ae,F,X);tt!=null&&(ce&&Se&&Xo(tt,J)?Xo(J,ye)||M(F,ye):tt<ke?M(F,ke):tt>Me&&M(F,Me))},[M]),V=m.useCallback((F,W)=>{const{direction:X}=O.current,{layout:ae}=T.current;if(!v.current)return;const J=nx(F,v.current);Ot(J,`Drag handle element not found for id "${F}"`);const ce=HM(X,W);S({dragHandleId:F,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:ce,initialLayout:ae})},[]),se=m.useCallback(()=>{S(null)},[]),ge=m.useCallback(F=>{const{panelDataArray:W}=T.current,X=Du(W,F);X>=0&&(W.splice(X,1),delete _.current[F.id],T.current.panelDataArrayChanged=!0,j())},[j]),P=m.useMemo(()=>({collapsePanel:D,direction:r,dragState:C,expandPanel:L,getPanelSize:$,getPanelStyle:K,groupId:x,isPanelCollapsed:Z,isPanelExpanded:G,reevaluatePanelConstraints:H,registerPanel:q,registerResizeHandle:z,resizePanel:M,startDragging:V,stopDragging:se,unregisterPanel:ge,panelGroupElement:v.current}),[D,C,r,L,$,K,x,Z,G,H,q,z,M,V,se,ge]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return m.createElement(Qy.Provider,{value:P},m.createElement(y,{...g,children:t,className:n,id:i,ref:v,style:{...U,...h},[Jn.group]:"",[Jn.groupDirection]:r,[Jn.groupId]:x}))}const qM=m.forwardRef((e,t)=>m.createElement(GM,{...e,forwardedRef:t}));GM.displayName="PanelGroup";qM.displayName="forwardRef(PanelGroup)";function Du(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xl(e,t,n){const r=Du(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],c=n[r];return{...t.constraints,panelSize:c,pivotIndices:i}}function Ffe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){m.useEffect(()=>{if(e||n==null||r==null)return;const s=nx(t,r);if(s==null)return;const i=c=>{if(!c.defaultPrevented)switch(c.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{c.preventDefault(),n(c);break}case"F6":{c.preventDefault();const u=s.getAttribute(Jn.groupId);Ot(u,`No group element found for id "${u}"`);const f=lh(u,r),h=UM(u,t,r);Ot(h!==null,`No resize element found for id "${t}"`);const y=c.shiftKey?h>0?h-1:f.length-1:h+1<f.length?h+1:0;f[y].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function KM({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:h,onPointerUp:y,style:g={},tabIndex:x=0,tagName:v="div",...C}){var S,w;const R=m.useRef(null),j=m.useRef({onClick:c,onDragging:u,onPointerDown:h,onPointerUp:y});m.useEffect(()=>{j.current.onClick=c,j.current.onDragging=u,j.current.onPointerDown=h,j.current.onPointerUp=y});const _=m.useContext(Qy);if(_===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:I,groupId:A,registerResizeHandle:O,startDragging:T,stopDragging:D,panelGroupElement:L}=_,$=SC(s),[K,Z]=m.useState("inactive"),[G,q]=m.useState(!1),[z,M]=m.useState(null),H=m.useRef({state:K});ic(()=>{H.current.state=K}),m.useEffect(()=>{if(n)M(null);else{const P=O($);M(()=>P)}},[n,$,O]);const V=(S=r==null?void 0:r.coarse)!==null&&S!==void 0?S:15,se=(w=r==null?void 0:r.fine)!==null&&w!==void 0?w:5;m.useEffect(()=>{if(n||z==null)return;const P=R.current;Ot(P,"Element ref not attached");let U=!1;return Efe($,P,I,{coarse:V,fine:se},(W,X,ae)=>{if(!X){Z("inactive");return}switch(W){case"down":{Z("drag"),U=!1,Ot(ae,'Expected event to be defined for "down" action'),T($,ae);const{onDragging:J,onPointerDown:ce}=j.current;J==null||J(!0),ce==null||ce();break}case"move":{const{state:J}=H.current;U=!0,J!=="drag"&&Z("hover"),Ot(ae,'Expected event to be defined for "move" action'),z(ae);break}case"up":{Z("hover"),D();const{onClick:J,onDragging:ce,onPointerUp:ye}=j.current;ce==null||ce(!1),ye==null||ye(),U||J==null||J();break}}})},[V,I,n,se,O,$,z,T,D]),Ffe({disabled:n,handleId:$,resizeHandler:z,panelGroupElement:L});const ge={touchAction:"none",userSelect:"none"};return m.createElement(v,{...C,children:e,className:t,id:s,onBlur:()=>{q(!1),i==null||i()},onFocus:()=>{q(!0),f==null||f()},ref:R,role:"separator",style:{...ge,...g},tabIndex:x,[Jn.groupDirection]:I,[Jn.groupId]:A,[Jn.resizeHandle]:"",[Jn.resizeHandleActive]:K==="drag"?"pointer":G?"keyboard":void 0,[Jn.resizeHandleEnabled]:!n,[Jn.resizeHandleId]:$,[Jn.resizeHandleState]:K})}KM.displayName="PanelResizeHandle";function Hfe({className:e,...t}){return a.jsx(qM,{"data-slot":"resizable-panel-group",className:oe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function ON({...e}){return a.jsx(_M,{"data-slot":"resizable-panel",...e})}function $fe({withHandle:e,className:t,...n}){return a.jsx(KM,{"data-slot":"resizable-handle",className:oe("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&a.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:a.jsx(vA,{className:"size-2.5"})})})}function Vfe({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=m.useMemo(()=>{const x=io.get(e);if(x!==null){const v=Number(x);if(!Number.isNaN(v))return b1(v,.1,.9)}return b1(r,.1,.9)},[e,r]),u=Math.round(c*100),f=100-u,y=Math.min(45,Math.max(5,Math.round(s/1200*100)));function g(x){const v=x[0],C=b1(v/100,.1,.9);io.set(e,C)}return a.jsxs(Hfe,{direction:"horizontal",onLayout:g,className:oe("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(ON,{defaultSize:u,minSize:y,className:"overflow-auto",children:t}),a.jsx($fe,{withHandle:!0}),a.jsx(ON,{defaultSize:f,minSize:y,className:"overflow-auto",children:n})]})}function b1(e,t,n){return Math.max(t,Math.min(n,e))}const Bfe=[{label:"prompt",insertText:`{{#prompt}}
|
|
818
|
-
$0
|
|
819
|
-
{{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],IN=new Set;function Gfe(e,t){IN.has(t)||(e.languages.registerCompletionItemProvider(t,{triggerCharacters:["/"],provideCompletionItems:(n,r)=>{const s=r.lineNumber,i=r.column,c=n.getValueInRange({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:i}),u=c.lastIndexOf("/");if(u!==-1){const f=c.substring(u+1),h={startLineNumber:s,endLineNumber:s,startColumn:u+2,endColumn:i},y=[];return Bfe.forEach(g=>{g.label.startsWith(f)&&y.push({label:g.label,insertText:g.insertText,documentation:{value:g.documentation,isTrusted:!0},detail:g.documentation,kind:e.languages.CompletionItemKind.Field,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:h,additionalTextEdits:[{range:{startLineNumber:s,endLineNumber:s,startColumn:u+1,endColumn:u+2},text:""}]})}),{suggestions:y}}return{suggestions:[]}}}),IN.add(t))}const qfe=(e,t)=>{Gfe(t,"markdown")};function MN({value:e,onChange:t,height:n="60vh",className:r,readOnly:s}){const{resolvedTheme:i}=md();return a.jsx("div",{className:r,children:a.jsx(L2,{height:n,language:"markdown",theme:i==="dark"?"vs-dark":"light",className:"overflow-hidden rounded-tl-md",value:e,onChange:c=>{t(c??"")},onMount:qfe,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",overviewRulerBorder:!1,automaticLayout:!0,overviewRulerLanes:0,placeholder:"Press '/' for commands",readOnly:!!s}})})}function Kfe({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Zfe({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:oe("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function kN({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:oe("inline-flex items-center gap-1.5",e),...t})}function Yfe({asChild:e,className:t,...n}){const r=e?fh:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:oe("hover:text-foreground transition-colors",t),...n})}function Wfe({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:oe("[&>svg]:size-3.5",t),...n,children:e??a.jsx(Da,{})})}function Xfe({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=m.useCallback(async c=>{if(!(!e||!t))try{const u=await Ko.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[Ya.SUCCESS,Ya.ERROR,Ya.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);xC({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const Qfe=tn({title:Dt().min(1,"Title cannot be empty"),template:Dt().optional()}),Jfe=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:h,dirtyFields:y}}=wo({resolver:gi(Qfe),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),g=s("title"),x=s("template"),v=!!y.template;m.useEffect(()=>{c({title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""})},[e==null?void 0:e.id,e==null?void 0:e.title,e==null?void 0:e.template,c]);const C=m.useCallback(async w=>{if(!e)return;const R=w.trim();f("title",R,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,R),u("title",{defaultValue:R})},[e,u,f,n]),S=m.useCallback(async w=>{if(!e)return;const R={title:w.title.trim(),template:w.template&&w.template.trim().length>0?w.template:null},j=await t(e.id,R);j&&c({title:j.title,template:j.template??""})},[e,c,t]);return{register:r,handleSubmit:i,setValue:f,isTemplateDirty:v,isSubmitting:h,titleValue:g,templateValue:x,handleTitleUpdate:C,onSubmit:S}},S1=[{icon:el,text:"Initializing intelligence..."},{icon:gA,text:"Connecting to data sources..."},{icon:MU,text:"Mapping data relationships..."},{icon:JP,text:"Exploring dataset structure..."},{icon:tz,text:"Scanning available fields..."},{icon:lz,text:"Analyzing data patterns..."},{icon:YU,text:"Selecting optimal insight path..."},{icon:jA,text:"Preparing aggregated tables..."},{icon:yU,text:"Building visual model..."},{icon:GP,text:"Finalizing insight output..."},{icon:mz,text:"Validating field consistency..."},{icon:JU,text:"Checking for missing values..."},{icon:XP,text:"Detecting anomalies in data..."},{icon:vU,text:"Cross-referencing data sources..."},{icon:uz,text:"Verifying aggregation results..."},{icon:dU,text:"Ensuring data relationships are correct..."},{icon:cP,text:"Refining visual model parameters..."},{icon:oU,text:"Confirming data integrity..."},{icon:KP,text:"Preparing final output for insights..."},{icon:nU,text:"Performing final quality checks..."}],ehe=()=>{const[e,t]=m.useState(0);m.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%S1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=S1[e].icon;return a.jsx("div",{className:"bg-muted h-full w-full rounded-tr-md rounded-br-md dark:bg-transparent",children:a.jsxs("div",{className:"flex h-full w-full animate-pulse flex-col items-center justify-center gap-4 p-4 text-center select-none",children:[a.jsx("div",{className:"text-muted-foreground animate-fade-slide-in-out",children:a.jsx(n,{className:"h-8 w-8",strokeWidth:1})},`${String(e)}-icon`),a.jsx("h3",{className:"text-muted-foreground animate-fade-slide-in-out text-sm",children:S1[e].text},`${String(e)}-text`)]})})};function the(){const e=Sc(),{insightId:t}=Zg(),n=m.useMemo(()=>"insight_details_split",[]),[r,s]=m.useState(!1),{dataMart:i}=xs(),{activeInsight:c,insightLoading:u,isRunning:f,triggerId:h,updateInsight:y,updateInsightTitle:g,getInsight:x,runInsight:v,deleteInsight:C,resetTriggerId:S,ensureActiveRunPolling:w}=vC(),{handleSubmit:R,setValue:j,isTemplateDirty:_,isSubmitting:I,titleValue:A,templateValue:O,handleTitleUpdate:T,onSubmit:D}=Jfe(c,y,g),L=pM({markdown:(c==null?void 0:c.output)??"",enabled:!!(c!=null&&c.output),debounceMs:0}),[$,K]=m.useState(!1),[Z,G]=m.useState(!1),{copyToClipboard:q}=Xy(),z=m.useCallback(async()=>{const ge=(c==null?void 0:c.output)??"";if(!ge)return;await q(ge,"insight-output")?Tt.success("Markdown copied to clipboard"):Tt.error("Failed to copy to clipboard")},[c==null?void 0:c.output,q]);m.useEffect(()=>{const ge=P=>{(P.metaKey||P.ctrlKey)&&P.shiftKey&&(P.key==="M"||P.key==="m")&&(P.preventDefault(),K(F=>!F))};return window.addEventListener("keydown",ge),()=>{window.removeEventListener("keydown",ge)}},[]);const M=m.useCallback(async()=>{c&&(await C(c.id),e(".."))},[c,C,e]),H=!u&&!(c!=null&&c.output);m.useEffect(()=>{t&&x(t)},[t,x]),m.useEffect(()=>{c!=null&&c.id&&w()},[c==null?void 0:c.id,w]),Xfe({triggerId:h,dataMartId:(i==null?void 0:i.id)??"",insightId:(c==null?void 0:c.id)??"",onRunFinished:m.useCallback(()=>{S(),c!=null&&c.id&&x(c.id)},[c==null?void 0:c.id,x,S]),onError:m.useCallback(()=>{S()},[S])});const V=m.useCallback(async()=>{if(!(c!=null&&c.id)){console.error("Insight ID is not available");return}try{await v(c.id)}catch(ge){throw console.error("Failed to run insight"),ge}},[c==null?void 0:c.id,v]),se=m.useCallback(()=>R(async ge=>{if(await D(ge),!(c!=null&&c.id)){console.error("Insight ID is not available");return}try{await v(c.id)}catch(P){throw console.error("Failed to run insight"),P}})(),[R,c==null?void 0:c.id,D,v]);return u?a.jsx("div",{className:"text-muted-foreground flex flex-col gap-2 text-sm",children:"Loading..."}):!c||!i?a.jsxs(Db,{children:[a.jsx(Ob,{children:a.jsx(Ib,{variant:"icon",children:a.jsx(el,{})})}),a.jsx(Mb,{children:"Insight not found"}),a.jsx(kb,{children:"The insight you're looking for doesn't exist or couldn't be loaded"})]}):a.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Kfe,{children:a.jsxs(Zfe,{children:[a.jsx(kN,{children:a.jsx(Yfe,{asChild:!0,children:a.jsx(Yr,{to:"..",children:"Insights"})})}),a.jsx(Wfe,{}),a.jsx(kN,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(Q5,{title:A||"Untitled insight",onUpdate:T,className:"font-medium",errorMessage:"Title cannot be empty",minWidth:"200px"})})})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(we,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(yA,{className:"h-4 w-4"})})}),a.jsx(Ar,{align:"end",children:a.jsxs(Nt,{onClick:()=>{s(!0)},className:"text-destructive",children:[a.jsx(Qa,{className:"h-4 w-4 text-red-600"})," ",a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})]}),a.jsx("div",{className:"bg-background flex-1 rounded-md border",children:a.jsx(Vfe,{storageKey:n,initialRatio:.5,left:a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:a.jsx(MN,{value:O??"",onChange:ge=>{j("template",ge,{shouldDirty:!0})},height:"calc(100vh - 275px)",placeholder:"Type / to view available commands...",readOnly:f})}),a.jsxs("div",{className:"flex items-center justify-between gap-4 border-t px-4 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(we,{variant:"default",size:"default",disabled:I||f,onClick:()=>void(_?se():V()),children:f?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(wc,{className:"h-3 w-3 animate-spin"})," Running…"]}):_?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(el,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(el,{})," Run Insight"]})}),a.jsxs(wt,{delayDuration:1500,children:[a.jsx(Et,{asChild:!0,children:a.jsxs(we,{variant:"outline",size:"default",onClick:()=>{G(!0)},className:"gap-2",children:[a.jsx(az,{className:"text-muted-foreground h-4 w-4"}),"Send & Schedule ..."]})}),a.jsx(Rt,{side:"top",children:a.jsx("p",{children:"You can schedule this insight to run at a specific time or send it to a recipient"})})]})]}),c.outputUpdatedAt&&a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(zs,{date:c.outputUpdatedAt})})}),a.jsx(Rt,{side:"top",children:a.jsxs("p",{children:["Last run: ",rO(c.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:f?a.jsx(ehe,{}):H?a.jsx(Db,{className:"h-full",children:a.jsxs(Ob,{children:[a.jsx(Ib,{variant:"icon",children:a.jsx(el,{})}),a.jsx(Mb,{children:"Even data needs a little spark"}),a.jsx(kb,{children:"Write prompt to uncover the story behind your data!"})]})}):a.jsx("div",{className:"flex h-full min-h-0 flex-col gap-2",children:a.jsx("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:$?a.jsx(MN,{value:c.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0}):L.error?a.jsx("div",{className:"text-destructive",children:L.error}):a.jsxs(a.Fragment,{children:[a.jsx(mM,{html:L.html,loading:L.loading,error:L.error,height:"100%"}),!!c.output&&!L.loading&&!L.error&&a.jsx("div",{className:"absolute top-2 right-2 z-10",children:a.jsx(Ka,{children:a.jsxs(wt,{children:[a.jsx(Et,{asChild:!0,children:a.jsx(we,{variant:"outline",size:"icon",className:"h-8 w-8","aria-label":"Copy markdown to clipboard",onClick:()=>void z(),children:a.jsx(Ku,{className:"h-4 w-4"})})}),a.jsx(Rt,{side:"left",children:a.jsx("p",{children:"Copy markdown to clipboard"})})]})})})]})})})})})}),a.jsx(Cr,{open:r,onOpenChange:s,title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{M()}}),a.jsx(VS,{children:a.jsx(bM,{isOpen:Z,onClose:()=>{G(!1)},mode:Rn.CREATE,preSelectedDestination:null,prefill:{title:c.title||A||"New report",subject:`Insight: ${c.title||A||""}`.trim(),messageTemplate:O??""},allowedDestinationTypes:[Ae.EMAIL,Ae.SLACK,Ae.MS_TEAMS,Ae.GOOGLE_CHAT]})})]})}const nhe=[{path:"overview",element:a.jsx(SN,{})},{path:"data-setup",element:a.jsx(Xce,{})},{path:"insights",element:a.jsx(Tde,{}),children:[{index:!0,element:a.jsx(ffe,{})},{path:":insightId",element:a.jsx(the,{})}]},{path:"reports",element:a.jsx(xde,{})},{path:"triggers",element:a.jsx(vde,{})},{path:"run-history",element:a.jsx(Gde,{})},{index:!0,element:a.jsx(SN,{})}];function rhe({to:e="/data-marts"}){const{user:t,status:n}=fi();if(n===Kr.LOADING)return a.jsx(Uu,{fullScreen:!0,message:"Loading..."});if(n===Kr.UNAUTHENTICATED||!t)return a.jsx(Uu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=fg(t.projectId,e);return a.jsx(nL,{to:r,replace:!0})}return a.jsx(Uu,{fullScreen:!0,message:"Project not found"})}const ahe=[{index:!0,path:"/",element:a.jsx(rhe,{})},{path:"/ui/:projectId",element:a.jsx(ZW,{}),children:[{path:"about",element:a.jsx(YW,{})},{index:!0,element:a.jsx(y_,{})},{path:"data-marts",element:a.jsx(y_,{})},{path:"data-marts/create",element:a.jsx(qde,{})},{path:"data-marts/:id",element:a.jsx(Bce,{}),children:nhe},{path:"data-storages",element:a.jsx(Qde,{})},{path:"data-destinations",element:a.jsx(afe,{})},{path:"*",element:a.jsx(d_,{})}]},{path:"*",element:a.jsx(d_,{})}],ZM="gtm-script",YM="gtm-noscript",she="GOOGLE_TAG_MANAGER_CONTAINER_ID";function ohe(){return!!document.getElementById(ZM)}function ihe(e){const t=document.createElement("script");return t.id=ZM,t.innerHTML=`
|
|
820
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
821
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
822
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
823
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
824
|
-
})(window,document,'script','dataLayer','${e}');
|
|
825
|
-
`,t}function lhe(e){const t=document.createElement("noscript");return t.id=YM,t.innerHTML=`
|
|
826
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
827
|
-
height="0"
|
|
828
|
-
width="0"
|
|
829
|
-
style="display:none;visibility:hidden">
|
|
830
|
-
</iframe>
|
|
831
|
-
`,t}function che(e){if(ohe())return;const t=ihe(e);document.head.prepend(t)}function uhe(e){if(document.getElementById(YM))return;const t=lhe(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function dhe(e){try{che(e),uhe(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function fhe(e){return(e[she]??"").trim()}function hhe(){const{flags:e,callState:t}=_h();return m.useEffect(()=>{if(t!==bt.LOADED||!e)return;const n=fhe(e);n&&dhe(n)},[e,t]),null}const mhe="INTERCOM_APP_ID",WM="intercom-widget-script";function phe(){return!!document.getElementById(WM)}function ghe(e,t){if(phe()){t();return}const n=document.createElement("script");n.id=WM,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function yhe(){try{return(await ja.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function xhe(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 vhe(e,t){if(!t)return;const n=xhe(e,t),r=await yhe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function bhe(){const{flags:e,callState:t}=_h(),{user:n}=fi(),r=m.useRef(!1);return m.useEffect(()=>{if(r.current||t!==bt.LOADED||!e)return;const s=e[mhe],i=(typeof s=="string"?s:"").trim();i&&ghe(i,()=>{vhe(i,n).then(()=>{r.current=!0,rh()})})},[e,t,n]),null}function She({initialState:e,reducer:t,children:n}){const[r,s]=m.useReducer(t,e),i=m.useMemo(()=>s,[s]);return a.jsx(z3.Provider,{value:r,children:a.jsx(F3.Provider,{value:i,children:n})})}function Che(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const i=e[s],c=t[s],u=i(c,n);u!==c&&(r[s]=u)}),r}}const LN={id:null,title:null},XM="project/SET_PROJECT",whe="project/CLEAR_PROJECT";function Ehe(e){return{type:XM,payload:e}}function Rhe(e=LN,t){switch(t.type){case XM:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case whe:return{...LN};default:return e}}class jhe extends Sl{getFlags(){return this.get("/flags")}}const The=new jhe(""),QM={LICENSED_APP_EDITION:"COMMUNITY",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"},_he={data:{...QM},callState:bt.IDLE},JM="settings/LOAD_FLAGS",e8="settings/LOAD_FLAGS_SUCCESS",t8="settings/LOAD_FLAGS_ERROR";function Nhe(){return{type:JM}}function Ahe(e){return{type:e8,payload:e}}function Dhe(e){return{type:t8,payload:e}}function Ohe(e=_he,t){switch(t.type){case JM:return{...e,callState:bt.LOADING,error:void 0};case e8:return{...e,callState:bt.LOADED,data:{...QM,...t.payload}};case t8:return{...e,callState:bt.ERROR,error:t.payload};default:return e}}async function Ihe(e){try{e(Nhe());const t=await The.getFlags();e(Ahe(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Dhe(n))}}const n8="app/SET_READY";function Mhe(e={ready:!1},t){switch(t.type){case n8:return{...e,ready:!!t.payload};default:return e}}const khe=Che({project:Rhe,flags:Ohe,app:Mhe});function Lhe({children:e}){return a.jsx(She,{reducer:khe,initialState:{project:{id:null,title:null},flags:{data:null,callState:bt.IDLE},app:{ready:!1}},children:e})}function Phe({children:e}){const t=JG(),{user:n,status:r}=fi(),s=ug(f=>f.flags),i=s.callState,c=ug(f=>f.app.ready);m.useEffect(()=>{r===Kr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Ehe({id:n.projectId,title:n.projectTitle??null})),i===bt.IDLE&&Ihe(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,i,t]),m.useEffect(()=>{const f=r===Kr.AUTHENTICATED&&!!(n!=null&&n.projectId)&&i===bt.LOADED;t({type:n8,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=m.useMemo(()=>a.jsx(Uu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):i===bt.ERROR?a.jsx(Uu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):u}function Uhe(){const e=TL(ahe);return a.jsx(GK,{children:a.jsx(Lhe,{children:a.jsxs(Phe,{children:[a.jsx(hhe,{}),a.jsx(bhe,{}),a.jsx(zL,{router:e})]})})})}const r8=document.getElementById("root");if(!r8)throw new Error("Root element not found");C9.createRoot(r8).render(a.jsx(m.StrictMode,{children:a.jsx(Uhe,{})}));
|