@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
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
var m9=Object.defineProperty;var p9=(e,t,n)=>t in e?m9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var eo=(e,t,n)=>p9(e,typeof t!="symbol"?t+"":t,n);function g9(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 HN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f0={exports:{}},ff={};/**
|
|
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 lj;function y9(){if(lj)return ff;lj=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 ff.Fragment=t,ff.jsx=n,ff.jsxs=n,ff}var cj;function x9(){return cj||(cj=1,f0.exports=y9()),f0.exports}var a=x9(),h0={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 uj;function v9(){if(uj)return gt;uj=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"),m=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,E={};function R(P,U,z){this.props=P,this.context=U,this.refs=E,this.updater=z||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,z){this.props=P,this.context=U,this.refs=E,this.updater=z||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 k(P,U,z){var X=z.ref;return{$$typeof:e,type:P,key:U,ref:X!==void 0?X:null,props:z}}function B(P,U){return k(P.type,U,P.props)}function G(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function Y(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(z){return U[z]})}var V=/\/+/g;function Z(P,U){return typeof P=="object"&&P!==null&&P.key!=null?Y(""+P.key):U.toString(36)}function F(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,z,X,W){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,z,X,W)}}if(J)return W=W(P),J=X===""?"."+Z(P,0):X,A(W)?(z="",J!=null&&(z=J.replace(V,"$&/")+"/"),M(W,U,z,"",function(Ce){return Ce})):W!=null&&(G(W)&&(W=B(W,z+(W.key==null||P&&P.key===W.key?"":(""+W.key).replace(V,"$&/")+"/")+J)),U.push(W)),1;J=0;var le=X===""?".":X+":";if(A(P))for(var ye=0;ye<P.length;ye++)X=P[ye],ae=le+Z(X,ye),J+=M(X,U,z,ae,W);else if(ye=v(P),typeof ye=="function")for(P=ye.call(P),ye=0;!(X=P.next()).done;)X=X.value,ae=le+Z(X,ye++),J+=M(X,U,z,ae,W);else if(ae==="object"){if(typeof P.then=="function")return M(F(P),U,z,X,W);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 $(P,U,z){if(P==null)return P;var X=[],W=0;return M(P,X,"","",function(ae){return U.call(z,ae,W++)}),X}function H(P){if(P._status===-1){var U=P._result;U=U(),U.then(function(z){(P._status===0||P._status===-1)&&(P._status=1,P._result=z)},function(z){(P._status===0||P._status===-1)&&(P._status=2,P._result=z)}),P._status===-1&&(P._status=0,P._result=U)}if(P._status===1)return P._result.default;throw P._result}var oe=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:$,forEach:function(P,U,z){$(P,function(){U.apply(this,arguments)},z)},count:function(P){var U=0;return $(P,function(){U++}),U},toArray:function(P){return $(P,function(U){return U})||[]},only:function(P){if(!G(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,z){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var X=S({},P.props),W=P.key;if(U!=null)for(ae in U.key!==void 0&&(W=""+U.key),U)!D.call(U,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&U.ref===void 0||(X[ae]=U[ae]);var ae=arguments.length-2;if(ae===1)X.children=z;else if(1<ae){for(var J=Array(ae),le=0;le<ae;le++)J[le]=arguments[le+2];X.children=J}return k(P.type,W,X)},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,z){var X,W={},ae=null;if(U!=null)for(X in U.key!==void 0&&(ae=""+U.key),U)D.call(U,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(W[X]=U[X]);var J=arguments.length-2;if(J===1)W.children=z;else if(1<J){for(var le=Array(J),ye=0;ye<J;ye++)le[ye]=arguments[ye+2];W.children=le}if(P&&P.defaultProps)for(X in J=P.defaultProps,J)W[X]===void 0&&(W[X]=J[X]);return k(P,ae,W)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:u,render:P}},gt.isValidElement=G,gt.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:H}},gt.memo=function(P,U){return{$$typeof:m,type:P,compare:U===void 0?null:U}},gt.startTransition=function(P){var U=T.T,z={};T.T=z;try{var X=P(),W=T.S;W!==null&&W(z,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(O,oe)}catch(ae){oe(ae)}finally{U!==null&&z.types!==null&&(U.types=z.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,z){return T.H.useActionState(P,U,z)},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,z){return T.H.useImperativeHandle(P,U,z)},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,z){return T.H.useReducer(P,U,z)},gt.useRef=function(P){return T.H.useRef(P)},gt.useState=function(P){return T.H.useState(P)},gt.useSyncExternalStore=function(P,U,z){return T.H.useSyncExternalStore(P,U,z)},gt.useTransition=function(){return T.H.useTransition()},gt.version="19.2.1",gt}var dj;function zb(){return dj||(dj=1,h0.exports=v9()),h0.exports}var h=zb();const re=HN(h),uh=g9({__proto__:null,default:re},[h]);var m0={exports:{}},hf={},p0={exports:{}},g0={};/**
|
|
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 fj;function b9(){return fj||(fj=1,(function(e){function t(M,$){var H=M.length;M.push($);e:for(;0<H;){var oe=H-1>>>1,ge=M[oe];if(0<s(ge,$))M[oe]=$,M[H]=ge,H=oe;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var $=M[0],H=M.pop();if(H!==$){M[0]=H;e:for(var oe=0,ge=M.length,P=ge>>>1;oe<P;){var U=2*(oe+1)-1,z=M[U],X=U+1,W=M[X];if(0>s(z,H))X<ge&&0>s(W,z)?(M[oe]=W,M[X]=H,oe=X):(M[oe]=z,M[U]=H,oe=U);else if(X<ge&&0>s(W,H))M[oe]=W,M[X]=H,oe=X;else break e}}return $}function s(M,$){var H=M.sortIndex-$.sortIndex;return H!==0?H:M.id-$.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=[],m=[],y=1,g=null,x=3,v=!1,C=!1,S=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function I(M){for(var $=n(m);$!==null;){if($.callback===null)r(m);else if($.startTime<=M)r(m),$.sortIndex=$.expirationTime,t(f,$);else break;$=n(m)}}function A(M){if(S=!1,I(M),!C)if(n(f)!==null)C=!0,O||(O=!0,Y());else{var $=n(m);$!==null&&F(A,$.startTime-M)}}var O=!1,T=-1,D=5,k=-1;function B(){return E?!0:!(e.unstable_now()-k<D)}function G(){if(E=!1,O){var M=e.unstable_now();k=M;var $=!0;try{e:{C=!1,S&&(S=!1,j(T),T=-1),v=!0;var H=x;try{t:{for(I(M),g=n(f);g!==null&&!(g.expirationTime>M&&B());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,x=g.priorityLevel;var ge=oe(g.expirationTime<=M);if(M=e.unstable_now(),typeof ge=="function"){g.callback=ge,I(M),$=!0;break t}g===n(f)&&r(f),I(M)}else r(f);g=n(f)}if(g!==null)$=!0;else{var P=n(m);P!==null&&F(A,P.startTime-M),$=!1}}break e}finally{g=null,x=H,v=!1}$=void 0}}finally{$?Y():O=!1}}}var Y;if(typeof _=="function")Y=function(){_(G)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Z=V.port2;V.port1.onmessage=G,Y=function(){Z.postMessage(null)}}else Y=function(){R(G,0)};function F(M,$){T=R(function(){M(e.unstable_now())},$)}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 $=3;break;default:$=x}var H=x;x=$;try{return M()}finally{x=H}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(M,$){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var H=x;x=M;try{return $()}finally{x=H}},e.unstable_scheduleCallback=function(M,$,H){var oe=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?oe+H:oe):H=oe,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=H+ge,M={id:y++,callback:$,priorityLevel:M,startTime:H,expirationTime:ge,sortIndex:-1},H>oe?(M.sortIndex=H,t(m,M),n(f)===null&&M===n(m)&&(S?(j(T),T=-1):S=!0,F(A,H-oe))):(M.sortIndex=ge,t(f,M),C||v||(C=!0,O||(O=!0,Y()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var $=x;return function(){var H=x;x=$;try{return M.apply(this,arguments)}finally{x=H}}}})(g0)),g0}var hj;function S9(){return hj||(hj=1,p0.exports=b9()),p0.exports}var y0={exports:{}},Gr={};/**
|
|
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 mj;function C9(){if(mj)return Gr;mj=1;var e=zb();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(f,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:f,containerInfo:m,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,m){if(f==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Gr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Gr.createPortal=function(f,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return i(f,m,null,y)},Gr.flushSync=function(f){var m=c.T,y=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=y,r.d.f()}},Gr.preconnect=function(f,m){typeof f=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(f,m))},Gr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Gr.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var y=m.as,g=u(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):y==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Gr.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=u(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(f)},Gr.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=u(y,m.crossOrigin);r.d.L(f,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Gr.preloadModule=function(f,m){if(typeof f=="string")if(m){var y=u(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},Gr.requestFormReset=function(f){r.d.r(f)},Gr.unstable_batchedUpdates=function(f,m){return f(m)},Gr.useFormState=function(f,m,y){return c.H.useFormState(f,m,y)},Gr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Gr.version="19.2.1",Gr}var pj;function $N(){if(pj)return y0.exports;pj=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(),y0.exports=C9(),y0.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 gj;function E9(){if(gj)return hf;gj=1;var e=S9(),t=zb(),n=$N();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 m(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 w=b.alternate;if(w===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===d)return f(b),o;if(w===p)return f(b),l;w=w.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=w;else{for(var N=!1,L=b.child;L;){if(L===d){N=!0,d=b,p=w;break}if(L===p){N=!0,p=b,d=w;break}L=L.sibling}if(!N){for(L=w.child;L;){if(L===d){N=!0,d=w,p=b;break}if(L===p){N=!0,p=w,d=b;break}L=L.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"),E=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"),k=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Y(o){return o===null||typeof o!="object"?null:(o=G&&o[G]||o["@@iterator"],typeof o=="function"?o:null)}var V=Symbol.for("react.client.reference");function Z(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===V?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case A:return"Suspense";case O:return"SuspenseList";case k: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:Z(o.type)||"Memo";case D:l=o._payload,o=o._init;try{return Z(o(l))}catch{}}return null}var F=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},oe=[],ge=-1;function P(o){return{current:o}}function U(o){0>ge||(o.current=oe[ge],oe[ge]=null,ge--)}function z(o,l){ge++,oe[ge]=o.current,o.current=l}var X=P(null),W=P(null),ae=P(null),J=P(null);function le(o,l){switch(z(ae,l),z(W,o),z(X,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?DR(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=DR(l),o=OR(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(X),z(X,o)}function ye(){U(X),U(W),U(ae)}function Ce(o){o.memoizedState!==null&&z(J,o);var l=X.current,d=OR(l,o.type);l!==d&&(z(W,o),z(X,d))}function Ve(o){W.current===o&&(U(X),U(W)),J.current===o&&(U(J),lf._currentValue=H)}var De,et;function rt(o){if(De===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);De=l&&l[1]||"",et=-1<d.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+De+o+et}var dn=!1;function zt(o,l){if(!o||dn)return"";dn=!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 w=p.DetermineComponentFrameRoot(),N=w[0],L=w[1];if(N&&L){var Q=N.split(`
|
|
44
|
+
`),de=L.split(`
|
|
45
|
+
`);for(b=p=0;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;for(;b<de.length&&!de[b].includes("DetermineComponentFrameRoot");)b++;if(p===Q.length||b===de.length)for(p=Q.length-1,b=de.length-1;1<=p&&0<=b&&Q[p]!==de[b];)b--;for(;1<=p&&0<=b;p--,b--)if(Q[p]!==de[b]){if(p!==1||b!==1)do if(p--,b--,0>b||Q[p]!==de[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{dn=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?rt(d):""}function On(o,l){switch(o.tag){case 26:case 27:case 5:return rt(o.type);case 16:return rt("Lazy");case 13:return o.child!==l&&l!==null?rt("Suspense Fallback"):rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return zt(o.type,!1);case 11:return zt(o.type.render,!1);case 1:return zt(o.type,!0);case 31:return rt("Activity");default:return""}}function yn(o){try{var l="",d=null;do l+=On(o,d),d=o,o=o.return;while(o);return l}catch(p){return`
|
|
47
|
+
Error generating stack: `+p.message+`
|
|
48
|
+
`+p.stack}}var Me=Object.prototype.hasOwnProperty,q=e.unstable_scheduleCallback,ne=e.unstable_cancelCallback,ce=e.unstable_shouldYield,Oe=e.unstable_requestPaint,we=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,mt=e.unstable_UserBlockingPriority,st=e.unstable_NormalPriority,Wt=e.unstable_LowPriority,sr=e.unstable_IdlePriority,$n=e.log,Dr=e.unstable_setDisableYieldValue,Jr=null,fn=null;function or(o){if(typeof $n=="function"&&Dr(o),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(Jr,o)}catch{}}var kn=Math.clz32?Math.clz32:ea,Ys=Math.log,Aa=Math.LN2;function ea(o){return o>>>=0,o===0?32:31-(Ys(o)/Aa|0)|0}var Da=256,Cs=262144,En=4194304;function In(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 Ye(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var b=0,w=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var L=p&134217727;return L!==0?(p=L&~w,p!==0?b=In(p):(N&=L,N!==0?b=In(N):d||(d=L&~o,d!==0&&(b=In(d))))):(L=p&~w,L!==0?b=In(L):N!==0?b=In(N):d||(d=p&~o,d!==0&&(b=In(d)))),b===0?0:l!==0&&l!==b&&(l&w)===0&&(w=b&-b,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:b}function Bt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Xt(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 Gt(){var o=En;return En<<=1,(En&62914560)===0&&(En=4194304),o}function Vn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Jt(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Qt(o,l,d,p,b,w){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 L=o.entanglements,Q=o.expirationTimes,de=o.hiddenUpdates;for(d=N&~d;0<d;){var xe=31-kn(d),be=1<<xe;L[xe]=0,Q[xe]=-1;var he=de[xe];if(he!==null)for(de[xe]=null,xe=0;xe<he.length;xe++){var pe=he[xe];pe!==null&&(pe.lane&=-536870913)}d&=~be}p!==0&&Cr(o,p,0),w!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=w&~(N&~l))}function Cr(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 K(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 ee(o,l){var d=l&-l;return d=(d&42)!==0?1:fe(d),(d&(o.suspendedLanes|l))!==0?0:d}function fe(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 Se(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function _e(){var o=$.p;return o!==0?o:(o=window.event,o===void 0?32:tj(o.type))}function Ge(o,l){var d=$.p;try{return $.p=o,l()}finally{$.p=d}}var Fe=Math.random().toString(36).slice(2),ke="__reactFiber$"+Fe,ze="__reactProps$"+Fe,Xe="__reactContainer$"+Fe,at="__reactEvents$"+Fe,tt="__reactListeners$"+Fe,pt="__reactHandles$"+Fe,hn="__reactResources$"+Fe,Ln="__reactMarker$"+Fe;function Zn(o){delete o[ke],delete o[ze],delete o[at],delete o[tt],delete o[pt]}function an(o){var l=o[ke];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Xe]||d[ke]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=zR(o);o!==null;){if(d=o[ke])return d;o=zR(o)}return l}o=d,d=o.parentNode}return null}function sn(o){if(o=o[ke]||o[Xe]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function Oa(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function ns(o){var l=o[hn];return l||(l=o[hn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Nn(o){o[Ln]=!0}var Ia=new Set,Mc={};function Ma(o,l){ma(o,l),ma(o+"Capture",l)}function ma(o,l){for(Mc[o]=l,o=0;o<l.length;o++)Ia.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]*$"),Il={},Ft={};function Er(o){return Me.call(Ft,o)?!0:Me.call(Il,o)?!1:kc.test(o)?Ft[o]=!0:(Il[o]=!0,!1)}function Es(o,l,d){if(Er(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 rs(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 on(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 Or(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ed(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ax(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,w=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(N){d=""+N,w.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 sx(o){if(!o._valueTracker){var l=Ed(o)?"checked":"value";o._valueTracker=ax(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=Ed(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function Xh(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 l8=/[\n"\\]/g;function as(o){return o.replace(l8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ox(o,l,d,p,b,w,N,L){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=""+Or(l)):o.value!==""+Or(l)&&(o.value=""+Or(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?ix(o,N,Or(l)):d!=null?ix(o,N,Or(d)):p!=null&&o.removeAttribute("value"),b==null&&w!=null&&(o.defaultChecked=!!w),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?o.name=""+Or(L):o.removeAttribute("name")}function RC(o,l,d,p,b,w,N,L){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),l!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||l!=null)){sx(o);return}d=d!=null?""+Or(d):"",l=l!=null?""+Or(l):d,L||l===o.value||(o.value=l),o.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=L?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),sx(o)}function ix(o,l,d){l==="number"&&Xh(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=""+Or(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 jC(o,l,d){if(l!=null&&(l=""+Or(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+Or(d):""}function TC(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(F(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=Or(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),sx(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 c8=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 _C(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||c8.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function NC(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&&_C(o,b,p)}else for(var w in l)l.hasOwnProperty(w)&&_C(o,w,l[w])}function lx(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 u8=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"]]),d8=/^[\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 Qh(o){return d8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function jo(){}var cx=null;function ux(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 AC(o){var l=sn(o);if(l&&(o=l.stateNode)){var d=o[ze]||null;e:switch(o=l.stateNode,l.type){case"input":if(ox(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="'+as(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var b=p[ze]||null;if(!b)throw Error(r(90));ox(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":jC(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Lc(o,!!d.multiple,l,!1)}}}var dx=!1;function DC(o,l,d){if(dx)return o(l,d);dx=!0;try{var p=o(l);return p}finally{if(dx=!1,(Uc!==null||zc!==null)&&(zm(),Uc&&(l=Uc,o=zc,zc=Uc=null,AC(l),o)))for(l=0;l<o.length;l++)AC(o[l])}}function wd(o,l){var d=o.stateNode;if(d===null)return null;var p=d[ze]||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 To=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fx=!1;if(To)try{var Rd={};Object.defineProperty(Rd,"passive",{get:function(){fx=!0}}),window.addEventListener("test",Rd,Rd),window.removeEventListener("test",Rd,Rd)}catch{fx=!1}var xi=null,hx=null,Jh=null;function OC(){if(Jh)return Jh;var o,l=hx,d=l.length,p,b="value"in xi?xi.value:xi.textContent,w=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[w-p];p++);return Jh=b.slice(o,1<p?1-p:void 0)}function em(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 tm(){return!0}function IC(){return!1}function pa(o){function l(d,p,b,w,N){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var L in o)o.hasOwnProperty(L)&&(d=o[L],this[L]=d?d(w):w[L]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?tm:IC,this.isPropagationStopped=IC,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=tm)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=tm)},persist:function(){},isPersistent:tm}),l}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nm=pa(Ml),jd=g({},Ml,{view:0,detail:0}),f8=pa(jd),mx,px,Td,rm=g({},jd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yx,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!==Td&&(Td&&o.type==="mousemove"?(mx=o.screenX-Td.screenX,px=o.screenY-Td.screenY):px=mx=0,Td=o),mx)},movementY:function(o){return"movementY"in o?o.movementY:px}}),MC=pa(rm),h8=g({},rm,{dataTransfer:0}),m8=pa(h8),p8=g({},jd,{relatedTarget:0}),gx=pa(p8),g8=g({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),y8=pa(g8),x8=g({},Ml,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),v8=pa(x8),b8=g({},Ml,{data:0}),kC=pa(b8),S8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C8={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"},E8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w8(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=E8[o])?!!l[o]:!1}function yx(){return w8}var R8=g({},jd,{key:function(o){if(o.key){var l=S8[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=em(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?C8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yx,charCode:function(o){return o.type==="keypress"?em(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?em(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),j8=pa(R8),T8=g({},rm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),LC=pa(T8),_8=g({},jd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yx}),N8=pa(_8),A8=g({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),D8=pa(A8),O8=g({},rm,{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}),I8=pa(O8),M8=g({},Ml,{newState:0,oldState:0}),k8=pa(M8),L8=[9,13,27,32],xx=To&&"CompositionEvent"in window,_d=null;To&&"documentMode"in document&&(_d=document.documentMode);var P8=To&&"TextEvent"in window&&!_d,PC=To&&(!xx||_d&&8<_d&&11>=_d),UC=" ",zC=!1;function FC(o,l){switch(o){case"keyup":return L8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Fc=!1;function U8(o,l){switch(o){case"compositionend":return HC(l);case"keypress":return l.which!==32?null:(zC=!0,UC);case"textInput":return o=l.data,o===UC&&zC?null:o;default:return null}}function z8(o,l){if(Fc)return o==="compositionend"||!xx&&FC(o,l)?(o=OC(),Jh=hx=xi=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 PC&&l.locale!=="ko"?null:l.data;default:return null}}var F8={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 $C(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!F8[o.type]:l==="textarea"}function VC(o,l,d,p){Uc?zc?zc.push(p):zc=[p]:Uc=p,l=qm(l,"onChange"),0<l.length&&(d=new nm("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var Nd=null,Ad=null;function H8(o){RR(o,0)}function am(o){var l=Oa(o);if(wC(l))return o}function BC(o,l){if(o==="change")return l}var GC=!1;if(To){var vx;if(To){var bx="oninput"in document;if(!bx){var qC=document.createElement("div");qC.setAttribute("oninput","return;"),bx=typeof qC.oninput=="function"}vx=bx}else vx=!1;GC=vx&&(!document.documentMode||9<document.documentMode)}function KC(){Nd&&(Nd.detachEvent("onpropertychange",ZC),Ad=Nd=null)}function ZC(o){if(o.propertyName==="value"&&am(Ad)){var l=[];VC(l,Ad,o,ux(o)),DC(H8,l)}}function $8(o,l,d){o==="focusin"?(KC(),Nd=l,Ad=d,Nd.attachEvent("onpropertychange",ZC)):o==="focusout"&&KC()}function V8(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return am(Ad)}function B8(o,l){if(o==="click")return am(l)}function G8(o,l){if(o==="input"||o==="change")return am(l)}function q8(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ka=typeof Object.is=="function"?Object.is:q8;function Dd(o,l){if(ka(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(!Me.call(l,b)||!ka(o[b],l[b]))return!1}return!0}function YC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function WC(o,l){var d=YC(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=YC(d)}}function XC(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?XC(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function QC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Xh(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=Xh(o.document)}return l}function Sx(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 K8=To&&"documentMode"in document&&11>=document.documentMode,Hc=null,Cx=null,Od=null,Ex=!1;function JC(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Ex||Hc==null||Hc!==Xh(p)||(p=Hc,"selectionStart"in p&&Sx(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}),Od&&Dd(Od,p)||(Od=p,p=qm(Cx,"onSelect"),0<p.length&&(l=new nm("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")},wx={},eE={};To&&(eE=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(wx[o])return wx[o];if(!$c[o])return o;var l=$c[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in eE)return wx[o]=l[d];return o}var tE=Ll("animationend"),nE=Ll("animationiteration"),rE=Ll("animationstart"),Z8=Ll("transitionrun"),Y8=Ll("transitionstart"),W8=Ll("transitioncancel"),aE=Ll("transitionend"),sE=new Map,Rx="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(" ");Rx.push("scrollEnd");function ws(o,l){sE.set(o,l),Ma(l,[o])}var sm=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)},ss=[],Vc=0,jx=0;function om(){for(var o=Vc,l=jx=Vc=0;l<o;){var d=ss[l];ss[l++]=null;var p=ss[l];ss[l++]=null;var b=ss[l];ss[l++]=null;var w=ss[l];if(ss[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}w!==0&&oE(d,b,w)}}function im(o,l,d,p){ss[Vc++]=o,ss[Vc++]=l,ss[Vc++]=d,ss[Vc++]=p,jx|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Tx(o,l,d,p){return im(o,l,d,p),lm(o)}function Pl(o,l){return im(o,null,null,l),lm(o)}function oE(o,l,d){o.lanes|=d;var p=o.alternate;p!==null&&(p.lanes|=d);for(var b=!1,w=o.return;w!==null;)w.childLanes|=d,p=w.alternate,p!==null&&(p.childLanes|=d),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(b=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,b&&l!==null&&(b=31-kn(d),o=w.hiddenUpdates,p=o[b],p===null?o[b]=[l]:p.push(l),l.lane=d|536870912),w):null}function lm(o){if(50<ef)throw ef=0,Lv=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 X8(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 La(o,l,d,p){return new X8(o,l,d,p)}function _x(o){return o=o.prototype,!(!o||!o.isReactComponent)}function _o(o,l){var d=o.alternate;return d===null?(d=La(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 iE(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 cm(o,l,d,p,b,w){var N=0;if(p=o,typeof o=="function")_x(o)&&(N=1);else if(typeof o=="string")N=n9(o,d,X.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case k:return o=La(31,d,l,b),o.elementType=k,o.lanes=w,o;case S:return Ul(d.children,b,w,l);case E:N=8,b|=24;break;case R:return o=La(12,d,l,b|2),o.elementType=R,o.lanes=w,o;case A:return o=La(13,d,l,b),o.elementType=A,o.lanes=w,o;case O:return o=La(19,d,l,b),o.elementType=O,o.lanes=w,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=La(N,d,l,b),l.elementType=o,l.type=p,l.lanes=w,l}function Ul(o,l,d,p){return o=La(7,o,p,l),o.lanes=d,o}function Nx(o,l,d){return o=La(6,o,null,l),o.lanes=d,o}function lE(o){var l=La(18,null,null,0);return l.stateNode=o,l}function Ax(o,l,d){return l=La(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var cE=new WeakMap;function os(o,l){if(typeof o=="object"&&o!==null){var d=cE.get(o);return d!==void 0?d:(l={value:o,source:l,stack:yn(l)},cE.set(o,l),l)}return{value:o,source:l,stack:yn(l)}}var Gc=[],qc=0,um=null,Id=0,is=[],ls=0,vi=null,Ws=1,Xs="";function No(o,l){Gc[qc++]=Id,Gc[qc++]=um,um=o,Id=l}function uE(o,l,d){is[ls++]=Ws,is[ls++]=Xs,is[ls++]=vi,vi=o;var p=Ws;o=Xs;var b=32-kn(p)-1;p&=~(1<<b),d+=1;var w=32-kn(l)+b;if(30<w){var N=b-b%5;w=(p&(1<<N)-1).toString(32),p>>=N,b-=N,Ws=1<<32-kn(l)+b|d<<b|p,Xs=w+o}else Ws=1<<w|d<<b|p,Xs=o}function Dx(o){o.return!==null&&(No(o,1),uE(o,1,0))}function Ox(o){for(;o===um;)um=Gc[--qc],Gc[qc]=null,Id=Gc[--qc],Gc[qc]=null;for(;o===vi;)vi=is[--ls],is[ls]=null,Xs=is[--ls],is[ls]=null,Ws=is[--ls],is[ls]=null}function dE(o,l){is[ls++]=Ws,is[ls++]=Xs,is[ls++]=vi,Ws=l.id,Xs=l.overflow,vi=o}var Ir=null,Pn=null,qt=!1,bi=null,cs=!1,Ix=Error(r(519));function Si(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Md(os(l,o)),Ix}function fE(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[ke]=o,l[ze]=p,d){case"dialog":Ut("cancel",l),Ut("close",l);break;case"iframe":case"object":case"embed":Ut("load",l);break;case"video":case"audio":for(d=0;d<nf.length;d++)Ut(nf[d],l);break;case"source":Ut("error",l);break;case"img":case"image":case"link":Ut("error",l),Ut("load",l);break;case"details":Ut("toggle",l);break;case"input":Ut("invalid",l),RC(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ut("invalid",l);break;case"textarea":Ut("invalid",l),TC(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||NR(l.textContent,d)?(p.popover!=null&&(Ut("beforetoggle",l),Ut("toggle",l)),p.onScroll!=null&&Ut("scroll",l),p.onScrollEnd!=null&&Ut("scrollend",l),p.onClick!=null&&(l.onclick=jo),l=!0):l=!1,l||Si(o,!0)}function hE(o){for(Ir=o.return;Ir;)switch(Ir.tag){case 5:case 31:case 13:cs=!1;return;case 27:case 3:cs=!0;return;default:Ir=Ir.return}}function Kc(o){if(o!==Ir)return!1;if(!qt)return hE(o),qt=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||Xv(o.type,o.memoizedProps)),d=!d),d&&Pn&&Si(o),hE(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=UR(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=UR(o)}else l===27?(l=Pn,ki(o.type)?(o=n0,n0=null,Pn=o):Pn=l):Pn=Ir?ds(o.stateNode.nextSibling):null;return!0}function zl(){Pn=Ir=null,qt=!1}function Mx(){var o=bi;return o!==null&&(va===null?va=o:va.push.apply(va,o),bi=null),o}function Md(o){bi===null?bi=[o]:bi.push(o)}var kx=P(null),Fl=null,Ao=null;function Ci(o,l,d){z(kx,l._currentValue),l._currentValue=d}function Do(o){o._currentValue=kx.current,U(kx)}function Lx(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 Px(o,l,d,p){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var w=b.dependencies;if(w!==null){var N=b.child;w=w.firstContext;e:for(;w!==null;){var L=w;w=b;for(var Q=0;Q<l.length;Q++)if(L.context===l[Q]){w.lanes|=d,L=w.alternate,L!==null&&(L.lanes|=d),Lx(w.return,d,o),p||(N=null);break e}w=L.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(r(341));N.lanes|=d,w=N.alternate,w!==null&&(w.lanes|=d),Lx(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,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!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 L=b.type;ka(b.pendingProps.value,N.value)||(o!==null?o.push(L):o=[L])}}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(lf):o=[lf])}b=b.return}o!==null&&Px(l,o,d,p),l.flags|=262144}function dm(o){for(o=o.firstContext;o!==null;){if(!ka(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Hl(o){Fl=o,Ao=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Mr(o){return mE(Fl,o)}function fm(o,l){return Fl===null&&Hl(o),mE(o,l)}function mE(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Ao===null){if(o===null)throw Error(r(308));Ao=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Ao=Ao.next=l;return d}var Q8=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()})}},J8=e.unstable_scheduleCallback,ek=e.unstable_NormalPriority,ir={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ux(){return{controller:new Q8,data:new Map,refCount:0}}function kd(o){o.refCount--,o.refCount===0&&J8(ek,function(){o.controller.abort()})}var Ld=null,zx=0,Yc=0,Wc=null;function tk(o,l){if(Ld===null){var d=Ld=[];zx=0,Yc=$v(),Wc={status:"pending",value:void 0,then:function(p){d.push(p)}}}return zx++,l.then(pE,pE),l}function pE(){if(--zx===0&&Ld!==null){Wc!==null&&(Wc.status="fulfilled");var o=Ld;Ld=null,Yc=0,Wc=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function nk(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 gE=M.S;M.S=function(o,l){Jw=we(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&tk(o,l),gE!==null&&gE(o,l)};var $l=P(null);function Fx(){var o=$l.current;return o!==null?o:An.pooledCache}function hm(o,l){l===null?z($l,$l.current):z($l,l.pool)}function yE(){var o=Fx();return o===null?null:{parent:ir._currentValue,pool:o}}var Xc=Error(r(460)),Hx=Error(r(474)),mm=Error(r(542)),pm={then:function(){}};function xE(o){return o=o.status,o==="fulfilled"||o==="rejected"}function vE(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(jo,jo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,SE(o),o;default:if(typeof l.status=="string")l.then(jo,jo);else{if(o=An,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,SE(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 bE(){if(Bl===null)throw Error(r(459));var o=Bl;return Bl=null,o}function SE(o){if(o===Xc||o===mm)throw Error(r(483))}var Qc=null,Pd=0;function gm(o){var l=Pd;return Pd+=1,Qc===null&&(Qc=[]),vE(Qc,o,l)}function Ud(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function ym(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 CE(o){function l(ie,te){if(o){var ue=ie.deletions;ue===null?(ie.deletions=[te],ie.flags|=16):ue.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=_o(ie,te),ie.index=0,ie.sibling=null,ie}function w(ie,te,ue){return ie.index=ue,o?(ue=ie.alternate,ue!==null?(ue=ue.index,ue<te?(ie.flags|=67108866,te):ue):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function N(ie){return o&&ie.alternate===null&&(ie.flags|=67108866),ie}function L(ie,te,ue,ve){return te===null||te.tag!==6?(te=Nx(ue,ie.mode,ve),te.return=ie,te):(te=b(te,ue),te.return=ie,te)}function Q(ie,te,ue,ve){var nt=ue.type;return nt===S?xe(ie,te,ue.props.children,ve,ue.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===D&&Vl(nt)===te.type)?(te=b(te,ue.props),Ud(te,ue),te.return=ie,te):(te=cm(ue.type,ue.key,ue.props,null,ie.mode,ve),Ud(te,ue),te.return=ie,te)}function de(ie,te,ue,ve){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=Ax(ue,ie.mode,ve),te.return=ie,te):(te=b(te,ue.children||[]),te.return=ie,te)}function xe(ie,te,ue,ve,nt){return te===null||te.tag!==7?(te=Ul(ue,ie.mode,ve,nt),te.return=ie,te):(te=b(te,ue),te.return=ie,te)}function be(ie,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Nx(""+te,ie.mode,ue),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return ue=cm(te.type,te.key,te.props,null,ie.mode,ue),Ud(ue,te),ue.return=ie,ue;case C:return te=Ax(te,ie.mode,ue),te.return=ie,te;case D:return te=Vl(te),be(ie,te,ue)}if(F(te)||Y(te))return te=Ul(te,ie.mode,ue,null),te.return=ie,te;if(typeof te.then=="function")return be(ie,gm(te),ue);if(te.$$typeof===_)return be(ie,fm(ie,te),ue);ym(ie,te)}return null}function he(ie,te,ue,ve){var nt=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return nt!==null?null:L(ie,te,""+ue,ve);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===nt?Q(ie,te,ue,ve):null;case C:return ue.key===nt?de(ie,te,ue,ve):null;case D:return ue=Vl(ue),he(ie,te,ue,ve)}if(F(ue)||Y(ue))return nt!==null?null:xe(ie,te,ue,ve,null);if(typeof ue.then=="function")return he(ie,te,gm(ue),ve);if(ue.$$typeof===_)return he(ie,te,fm(ie,ue),ve);ym(ie,ue)}return null}function pe(ie,te,ue,ve,nt){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ie=ie.get(ue)||null,L(te,ie,""+ve,nt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return ie=ie.get(ve.key===null?ue:ve.key)||null,Q(te,ie,ve,nt);case C:return ie=ie.get(ve.key===null?ue:ve.key)||null,de(te,ie,ve,nt);case D:return ve=Vl(ve),pe(ie,te,ue,ve,nt)}if(F(ve)||Y(ve))return ie=ie.get(ue)||null,xe(te,ie,ve,nt,null);if(typeof ve.then=="function")return pe(ie,te,ue,gm(ve),nt);if(ve.$$typeof===_)return pe(ie,te,ue,fm(te,ve),nt);ym(te,ve)}return null}function qe(ie,te,ue,ve){for(var nt=null,ln=null,We=te,jt=te=0,$t=null;We!==null&&jt<ue.length;jt++){We.index>jt?($t=We,We=null):$t=We.sibling;var cn=he(ie,We,ue[jt],ve);if(cn===null){We===null&&(We=$t);break}o&&We&&cn.alternate===null&&l(ie,We),te=w(cn,te,jt),ln===null?nt=cn:ln.sibling=cn,ln=cn,We=$t}if(jt===ue.length)return d(ie,We),qt&&No(ie,jt),nt;if(We===null){for(;jt<ue.length;jt++)We=be(ie,ue[jt],ve),We!==null&&(te=w(We,te,jt),ln===null?nt=We:ln.sibling=We,ln=We);return qt&&No(ie,jt),nt}for(We=p(We);jt<ue.length;jt++)$t=pe(We,ie,jt,ue[jt],ve),$t!==null&&(o&&$t.alternate!==null&&We.delete($t.key===null?jt:$t.key),te=w($t,te,jt),ln===null?nt=$t:ln.sibling=$t,ln=$t);return o&&We.forEach(function(Fi){return l(ie,Fi)}),qt&&No(ie,jt),nt}function ot(ie,te,ue,ve){if(ue==null)throw Error(r(151));for(var nt=null,ln=null,We=te,jt=te=0,$t=null,cn=ue.next();We!==null&&!cn.done;jt++,cn=ue.next()){We.index>jt?($t=We,We=null):$t=We.sibling;var Fi=he(ie,We,cn.value,ve);if(Fi===null){We===null&&(We=$t);break}o&&We&&Fi.alternate===null&&l(ie,We),te=w(Fi,te,jt),ln===null?nt=Fi:ln.sibling=Fi,ln=Fi,We=$t}if(cn.done)return d(ie,We),qt&&No(ie,jt),nt;if(We===null){for(;!cn.done;jt++,cn=ue.next())cn=be(ie,cn.value,ve),cn!==null&&(te=w(cn,te,jt),ln===null?nt=cn:ln.sibling=cn,ln=cn);return qt&&No(ie,jt),nt}for(We=p(We);!cn.done;jt++,cn=ue.next())cn=pe(We,ie,jt,cn.value,ve),cn!==null&&(o&&cn.alternate!==null&&We.delete(cn.key===null?jt:cn.key),te=w(cn,te,jt),ln===null?nt=cn:ln.sibling=cn,ln=cn);return o&&We.forEach(function(h9){return l(ie,h9)}),qt&&No(ie,jt),nt}function jn(ie,te,ue,ve){if(typeof ue=="object"&&ue!==null&&ue.type===S&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var nt=ue.key;te!==null;){if(te.key===nt){if(nt=ue.type,nt===S){if(te.tag===7){d(ie,te.sibling),ve=b(te,ue.props.children),ve.return=ie,ie=ve;break e}}else if(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===D&&Vl(nt)===te.type){d(ie,te.sibling),ve=b(te,ue.props),Ud(ve,ue),ve.return=ie,ie=ve;break e}d(ie,te);break}else l(ie,te);te=te.sibling}ue.type===S?(ve=Ul(ue.props.children,ie.mode,ve,ue.key),ve.return=ie,ie=ve):(ve=cm(ue.type,ue.key,ue.props,null,ie.mode,ve),Ud(ve,ue),ve.return=ie,ie=ve)}return N(ie);case C:e:{for(nt=ue.key;te!==null;){if(te.key===nt)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(ie,te.sibling),ve=b(te,ue.children||[]),ve.return=ie,ie=ve;break e}else{d(ie,te);break}else l(ie,te);te=te.sibling}ve=Ax(ue,ie.mode,ve),ve.return=ie,ie=ve}return N(ie);case D:return ue=Vl(ue),jn(ie,te,ue,ve)}if(F(ue))return qe(ie,te,ue,ve);if(Y(ue)){if(nt=Y(ue),typeof nt!="function")throw Error(r(150));return ue=nt.call(ue),ot(ie,te,ue,ve)}if(typeof ue.then=="function")return jn(ie,te,gm(ue),ve);if(ue.$$typeof===_)return jn(ie,te,fm(ie,ue),ve);ym(ie,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(ie,te.sibling),ve=b(te,ue),ve.return=ie,ie=ve):(d(ie,te),ve=Nx(ue,ie.mode,ve),ve.return=ie,ie=ve),N(ie)):d(ie,te)}return function(ie,te,ue,ve){try{Pd=0;var nt=jn(ie,te,ue,ve);return Qc=null,nt}catch(We){if(We===Xc||We===mm)throw We;var ln=La(29,We,null,ie.mode);return ln.lanes=ve,ln.return=ie,ln}finally{}}}var Gl=CE(!0),EE=CE(!1),Ei=!1;function $x(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vx(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 wi(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ri(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(mn&2)!==0){var b=p.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),p.pending=l,l=lm(o),oE(o,null,d),l}return im(o,p,l,d),lm(o)}function zd(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,K(o,d)}}function Bx(o,l){var d=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var N={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?b=w=N:w=w.next=N,d=d.next}while(d!==null);w===null?b=w=l:w=w.next=l}else b=w=l;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:w,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 Gx=!1;function Fd(){if(Gx){var o=Wc;if(o!==null)throw o}}function Hd(o,l,d,p){Gx=!1;var b=o.updateQueue;Ei=!1;var w=b.firstBaseUpdate,N=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var Q=L,de=Q.next;Q.next=null,N===null?w=de:N.next=de,N=Q;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,L=xe.lastBaseUpdate,L!==N&&(L===null?xe.firstBaseUpdate=de:L.next=de,xe.lastBaseUpdate=Q))}if(w!==null){var be=b.baseState;N=0,xe=de=Q=null,L=w;do{var he=L.lane&-536870913,pe=he!==L.lane;if(pe?(Ht&he)===he:(p&he)===he){he!==0&&he===Yc&&(Gx=!0),xe!==null&&(xe=xe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var qe=o,ot=L;he=l;var jn=d;switch(ot.tag){case 1:if(qe=ot.payload,typeof qe=="function"){be=qe.call(jn,be,he);break e}be=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=ot.payload,he=typeof qe=="function"?qe.call(jn,be,he):qe,he==null)break e;be=g({},be,he);break e;case 2:Ei=!0}}he=L.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:L.tag,payload:L.payload,callback:L.callback,next:null},xe===null?(de=xe=pe,Q=be):xe=xe.next=pe,N|=he;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;pe=L,L=pe.next,pe.next=null,b.lastBaseUpdate=pe,b.shared.pending=null}}while(!0);xe===null&&(Q=be),b.baseState=Q,b.firstBaseUpdate=de,b.lastBaseUpdate=xe,w===null&&(b.shared.lanes=0),Ai|=N,o.lanes=N,o.memoizedState=be}}function wE(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function RE(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)wE(d[o],l)}var Jc=P(null),xm=P(0);function jE(o,l){o=Fo,z(xm,o),z(Jc,l),Fo=o|l.baseLanes}function qx(){z(xm,Fo),z(Jc,Jc.current)}function Kx(){Fo=xm.current,U(Jc),U(xm)}var Pa=P(null),us=null;function ji(o){var l=o.alternate;z(nr,nr.current&1),z(Pa,o),us===null&&(l===null||Jc.current!==null||l.memoizedState!==null)&&(us=o)}function Zx(o){z(nr,nr.current),z(Pa,o),us===null&&(us=o)}function TE(o){o.tag===22?(z(nr,nr.current),z(Pa,o),us===null&&(us=o)):Ti()}function Ti(){z(nr,nr.current),z(Pa,Pa.current)}function Ua(o){U(Pa),us===o&&(us=null),U(nr)}var nr=P(0);function vm(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||e0(d)||t0(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 Oo=0,vt=null,wn=null,lr=null,bm=!1,eu=!1,ql=!1,Sm=0,$d=0,tu=null,rk=0;function Yn(){throw Error(r(321))}function Yx(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!ka(o[d],l[d]))return!1;return!0}function Wx(o,l,d,p,b,w){return Oo=w,vt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=o===null||o.memoizedState===null?uw:dv,ql=!1,w=d(p,b),ql=!1,eu&&(w=NE(l,d,p,b)),_E(o),w}function _E(o){M.H=Gd;var l=wn!==null&&wn.next!==null;if(Oo=0,lr=wn=vt=null,bm=!1,$d=0,tu=null,l)throw Error(r(300));o===null||cr||(o=o.dependencies,o!==null&&dm(o)&&(cr=!0))}function NE(o,l,d,p){vt=o;var b=0;do{if(eu&&(tu=null),$d=0,eu=!1,25<=b)throw Error(r(301));if(b+=1,lr=wn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=dw,w=l(d,p)}while(eu);return w}function ak(){var o=M.H,l=o.useState()[0];return l=typeof l.then=="function"?Vd(l):l,o=o.useState()[0],(wn!==null?wn.memoizedState:null)!==o&&(vt.flags|=1024),l}function Xx(){var o=Sm!==0;return Sm=0,o}function Qx(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function Jx(o){if(bm){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}bm=!1}Oo=0,lr=wn=vt=null,eu=!1,$d=Sm=0,tu=null}function ta(){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 rr(){if(wn===null){var o=vt.alternate;o=o!==null?o.memoizedState:null}else o=wn.next;var l=lr===null?vt.memoizedState:lr.next;if(l!==null)lr=l,wn=o;else{if(o===null)throw vt.alternate===null?Error(r(467)):Error(r(310));wn=o,o={memoizedState:wn.memoizedState,baseState:wn.baseState,baseQueue:wn.baseQueue,queue:wn.queue,next:null},lr===null?vt.memoizedState=lr=o:lr=lr.next=o}return lr}function Cm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vd(o){var l=$d;return $d+=1,tu===null&&(tu=[]),o=vE(tu,o,l),l=vt,(lr===null?l.memoizedState:lr.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?uw:dv),o}function Em(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Vd(o);if(o.$$typeof===_)return Mr(o)}throw Error(r(438,String(o)))}function ev(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=Cm(),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]=B;return l.index++,d}function Io(o,l){return typeof l=="function"?l(o):l}function wm(o){var l=rr();return tv(l,wn,o)}function tv(o,l,d){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=o.baseQueue,w=p.pending;if(w!==null){if(b!==null){var N=b.next;b.next=w.next,w.next=N}l.baseQueue=b=w,p.pending=null}if(w=o.baseState,b===null)o.memoizedState=w;else{l=b.next;var L=N=null,Q=null,de=l,xe=!1;do{var be=de.lane&-536870913;if(be!==de.lane?(Ht&be)===be:(Oo&be)===be){var he=de.revertLane;if(he===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),be===Yc&&(xe=!0);else if((Oo&he)===he){de=de.next,he===Yc&&(xe=!0);continue}else be={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Q===null?(L=Q=be,N=w):Q=Q.next=be,vt.lanes|=he,Ai|=he;be=de.action,ql&&d(w,be),w=de.hasEagerState?de.eagerState:d(w,be)}else he={lane:be,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Q===null?(L=Q=he,N=w):Q=Q.next=he,vt.lanes|=be,Ai|=be;de=de.next}while(de!==null&&de!==l);if(Q===null?N=w:Q.next=L,!ka(w,o.memoizedState)&&(cr=!0,xe&&(d=Wc,d!==null)))throw d;o.memoizedState=w,o.baseState=N,o.baseQueue=Q,p.lastRenderedState=w}return b===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function nv(o){var l=rr(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var p=d.dispatch,b=d.pending,w=l.memoizedState;if(b!==null){d.pending=null;var N=b=b.next;do w=o(w,N.action),N=N.next;while(N!==b);ka(w,l.memoizedState)||(cr=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,p]}function AE(o,l,d){var p=vt,b=rr(),w=qt;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var N=!ka((wn||b).memoizedState,d);if(N&&(b.memoizedState=d,cr=!0),b=b.queue,sv(IE.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},OE.bind(null,p,b,d,l),null),An===null)throw Error(r(349));w||(Oo&127)!==0||DE(p,l,d)}return d}function DE(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=vt.updateQueue,l===null?(l=Cm(),vt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function OE(o,l,d,p){l.value=d,l.getSnapshot=p,ME(l)&&kE(o)}function IE(o,l,d){return d(function(){ME(l)&&kE(o)})}function ME(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!ka(o,d)}catch{return!0}}function kE(o){var l=Pl(o,2);l!==null&&ba(l,o,2)}function rv(o){var l=ta();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:Io,lastRenderedState:o},l}function LE(o,l,d,p){return o.baseState=d,tv(o,wn,typeof p=="function"?p:Io)}function sk(o,l,d,p,b){if(Tm(o))throw Error(r(485));if(o=l.action,o!==null){var w={payload:b,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};M.T!==null?d(!0):w.isTransition=!1,p(w),d=l.pending,d===null?(w.next=l.pending=w,PE(l,w)):(w.next=d.next,l.pending=d.next=w)}}function PE(o,l){var d=l.action,p=l.payload,b=o.state;if(l.isTransition){var w=M.T,N={};M.T=N;try{var L=d(b,p),Q=M.S;Q!==null&&Q(N,L),UE(o,l,L)}catch(de){av(o,l,de)}finally{w!==null&&N.types!==null&&(w.types=N.types),M.T=w}}else try{w=d(b,p),UE(o,l,w)}catch(de){av(o,l,de)}}function UE(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){zE(o,l,p)},function(p){return av(o,l,p)}):zE(o,l,d)}function zE(o,l,d){l.status="fulfilled",l.value=d,FE(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,PE(o,d)))}function av(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,FE(l),l=l.next;while(l!==p)}o.action=null}function FE(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function HE(o,l){return l}function $E(o,l){if(qt){var d=An.formState;if(d!==null){e:{var p=vt;if(qt){if(Pn){t:{for(var b=Pn,w=cs;b.nodeType!==8;){if(!w){b=null;break t}if(b=ds(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Pn=ds(b.nextSibling),p=b.data==="F!";break e}}Si(p)}p=!1}p&&(l=d[0])}}return d=ta(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:HE,lastRenderedState:l},d.queue=p,d=iw.bind(null,vt,p),p.dispatch=d,p=rv(!1),w=uv.bind(null,vt,!1,p.queue),p=ta(),b={state:l,dispatch:null,action:o,pending:null},p.queue=b,d=sk.bind(null,vt,b,w,d),b.dispatch=d,p.memoizedState=o,[l,d,!1]}function VE(o){var l=rr();return BE(l,wn,o)}function BE(o,l,d){if(l=tv(o,l,HE)[0],o=wm(Io)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Vd(l)}catch(N){throw N===Xc?mm:N}else p=l;l=rr();var b=l.queue,w=b.dispatch;return d!==l.memoizedState&&(vt.flags|=2048,nu(9,{destroy:void 0},ok.bind(null,b,d),null)),[p,w,o]}function ok(o,l){o.action=l}function GE(o){var l=rr(),d=wn;if(d!==null)return BE(l,d,o);rr(),l=l.memoizedState,d=rr();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=Cm(),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 qE(){return rr().memoizedState}function Rm(o,l,d,p){var b=ta();vt.flags|=o,b.memoizedState=nu(1|l,{destroy:void 0},d,p===void 0?null:p)}function jm(o,l,d,p){var b=rr();p=p===void 0?null:p;var w=b.memoizedState.inst;wn!==null&&p!==null&&Yx(p,wn.memoizedState.deps)?b.memoizedState=nu(l,w,d,p):(vt.flags|=o,b.memoizedState=nu(1|l,w,d,p))}function KE(o,l){Rm(8390656,8,o,l)}function sv(o,l){jm(2048,8,o,l)}function ik(o){vt.flags|=4;var l=vt.updateQueue;if(l===null)l=Cm(),vt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function ZE(o){var l=rr().memoizedState;return ik({ref:l,nextImpl:o}),function(){if((mn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function YE(o,l){return jm(4,2,o,l)}function WE(o,l){return jm(4,4,o,l)}function XE(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 QE(o,l,d){d=d!=null?d.concat([o]):null,jm(4,4,XE.bind(null,l,o),d)}function ov(){}function JE(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&Yx(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function ew(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&Yx(l,p[1]))return p[0];if(p=o(),ql){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p}function iv(o,l,d){return d===void 0||(Oo&1073741824)!==0&&(Ht&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=tR(),vt.lanes|=o,Ai|=o,d)}function tw(o,l,d,p){return ka(d,l)?d:Jc.current!==null?(o=iv(o,d,p),ka(o,l)||(cr=!0),o):(Oo&42)===0||(Oo&1073741824)!==0&&(Ht&261930)===0?(cr=!0,o.memoizedState=d):(o=tR(),vt.lanes|=o,Ai|=o,l)}function nw(o,l,d,p,b){var w=$.p;$.p=w!==0&&8>w?w:8;var N=M.T,L={};M.T=L,uv(o,!1,l,d);try{var Q=b(),de=M.S;if(de!==null&&de(L,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var xe=nk(Q,p);Bd(o,l,xe,Ha(o))}else Bd(o,l,p,Ha(o))}catch(be){Bd(o,l,{then:function(){},status:"rejected",reason:be},Ha())}finally{$.p=w,N!==null&&L.types!==null&&(N.types=L.types),M.T=N}}function lk(){}function lv(o,l,d,p){if(o.tag!==5)throw Error(r(476));var b=rw(o).queue;nw(o,b,l,H,d===null?lk:function(){return aw(o),d(p)})}function rw(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:H},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function aw(o){var l=rw(o);l.next===null&&(l=o.alternate.memoizedState),Bd(o,l.next.queue,{},Ha())}function cv(){return Mr(lf)}function sw(){return rr().memoizedState}function ow(){return rr().memoizedState}function ck(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=Ha();o=wi(d);var p=Ri(l,o,d);p!==null&&(ba(p,l,d),zd(p,l,d)),l={cache:Ux()},o.payload=l;return}l=l.return}}function uk(o,l,d){var p=Ha();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Tm(o)?lw(l,d):(d=Tx(o,l,d,p),d!==null&&(ba(d,o,p),cw(d,l,p)))}function iw(o,l,d){var p=Ha();Bd(o,l,d,p)}function Bd(o,l,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Tm(o))lw(l,b);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var N=l.lastRenderedState,L=w(N,d);if(b.hasEagerState=!0,b.eagerState=L,ka(L,N))return im(o,l,b,0),An===null&&om(),!1}catch{}finally{}if(d=Tx(o,l,b,p),d!==null)return ba(d,o,p),cw(d,l,p),!0}return!1}function uv(o,l,d,p){if(p={lane:2,revertLane:$v(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Tm(o)){if(l)throw Error(r(479))}else l=Tx(o,d,p,2),l!==null&&ba(l,o,2)}function Tm(o){var l=o.alternate;return o===vt||l!==null&&l===vt}function lw(o,l){eu=bm=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function cw(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,K(o,d)}}var Gd={readContext:Mr,use:Em,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useLayoutEffect:Yn,useInsertionEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useSyncExternalStore:Yn,useId:Yn,useHostTransitionStatus:Yn,useFormState:Yn,useActionState:Yn,useOptimistic:Yn,useMemoCache:Yn,useCacheRefresh:Yn};Gd.useEffectEvent=Yn;var uw={readContext:Mr,use:Em,useCallback:function(o,l){return ta().memoizedState=[o,l===void 0?null:l],o},useContext:Mr,useEffect:KE,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,Rm(4194308,4,XE.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Rm(4194308,4,o,l)},useInsertionEffect:function(o,l){Rm(4,2,o,l)},useMemo:function(o,l){var d=ta();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=ta();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=uk.bind(null,vt,o),[p.memoizedState,o]},useRef:function(o){var l=ta();return o={current:o},l.memoizedState=o},useState:function(o){o=rv(o);var l=o.queue,d=iw.bind(null,vt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:ov,useDeferredValue:function(o,l){var d=ta();return iv(d,o,l)},useTransition:function(){var o=rv(!1);return o=nw.bind(null,vt,o.queue,!0,!1),ta().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=vt,b=ta();if(qt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),An===null)throw Error(r(349));(Ht&127)!==0||DE(p,l,d)}b.memoizedState=d;var w={value:d,getSnapshot:l};return b.queue=w,KE(IE.bind(null,p,w,o),[o]),p.flags|=2048,nu(9,{destroy:void 0},OE.bind(null,p,w,d,l),null),d},useId:function(){var o=ta(),l=An.identifierPrefix;if(qt){var d=Xs,p=Ws;d=(p&~(1<<32-kn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=Sm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=rk++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:cv,useFormState:$E,useActionState:$E,useOptimistic:function(o){var l=ta();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=uv.bind(null,vt,!0,d),d.dispatch=l,[o,l]},useMemoCache:ev,useCacheRefresh:function(){return ta().memoizedState=ck.bind(null,vt)},useEffectEvent:function(o){var l=ta(),d={impl:o};return l.memoizedState=d,function(){if((mn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},dv={readContext:Mr,use:Em,useCallback:JE,useContext:Mr,useEffect:sv,useImperativeHandle:QE,useInsertionEffect:YE,useLayoutEffect:WE,useMemo:ew,useReducer:wm,useRef:qE,useState:function(){return wm(Io)},useDebugValue:ov,useDeferredValue:function(o,l){var d=rr();return tw(d,wn.memoizedState,o,l)},useTransition:function(){var o=wm(Io)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Vd(o),l]},useSyncExternalStore:AE,useId:sw,useHostTransitionStatus:cv,useFormState:VE,useActionState:VE,useOptimistic:function(o,l){var d=rr();return LE(d,wn,o,l)},useMemoCache:ev,useCacheRefresh:ow};dv.useEffectEvent=ZE;var dw={readContext:Mr,use:Em,useCallback:JE,useContext:Mr,useEffect:sv,useImperativeHandle:QE,useInsertionEffect:YE,useLayoutEffect:WE,useMemo:ew,useReducer:nv,useRef:qE,useState:function(){return nv(Io)},useDebugValue:ov,useDeferredValue:function(o,l){var d=rr();return wn===null?iv(d,o,l):tw(d,wn.memoizedState,o,l)},useTransition:function(){var o=nv(Io)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Vd(o),l]},useSyncExternalStore:AE,useId:sw,useHostTransitionStatus:cv,useFormState:GE,useActionState:GE,useOptimistic:function(o,l){var d=rr();return wn!==null?LE(d,wn,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:ev,useCacheRefresh:ow};dw.useEffectEvent=ZE;function fv(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 hv={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=Ha(),b=wi(p);b.payload=l,d!=null&&(b.callback=d),l=Ri(o,b,p),l!==null&&(ba(l,o,p),zd(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=Ha(),b=wi(p);b.tag=1,b.payload=l,d!=null&&(b.callback=d),l=Ri(o,b,p),l!==null&&(ba(l,o,p),zd(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Ha(),p=wi(d);p.tag=2,l!=null&&(p.callback=l),l=Ri(o,p,d),l!==null&&(ba(l,o,d),zd(l,o,d))}};function fw(o,l,d,p,b,w,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,w,N):l.prototype&&l.prototype.isPureReactComponent?!Dd(d,p)||!Dd(b,w):!0}function hw(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&&hv.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 mw(o){sm(o)}function pw(o){console.error(o)}function gw(o){sm(o)}function _m(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function yw(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 mv(o,l,d){return d=wi(d),d.tag=3,d.payload={element:null},d.callback=function(){_m(o,l)},d}function xw(o){return o=wi(o),o.tag=3,o}function vw(o,l,d,p){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var w=p.value;o.payload=function(){return b(w)},o.callback=function(){yw(l,d,p)}}var N=d.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){yw(l,d,p),typeof b!="function"&&(Di===null?Di=new Set([this]):Di.add(this));var L=p.stack;this.componentDidCatch(p.value,{componentStack:L!==null?L:""})})}function dk(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=Pa.current,d!==null){switch(d.tag){case 31:case 13:return us===null?Fm():d.alternate===null&&Wn===0&&(Wn=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===pm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),zv(o,p,b)),!1;case 22:return d.flags|=65536,p===pm?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)),zv(o,p,b)),!1}throw Error(r(435,d.tag))}return zv(o,p,b),Fm(),!1}if(qt)return l=Pa.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,p!==Ix&&(o=Error(r(422),{cause:p}),Md(os(o,d)))):(p!==Ix&&(l=Error(r(423),{cause:p}),Md(os(l,d))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,p=os(p,d),b=mv(o.stateNode,p,b),Bx(o,b),Wn!==4&&(Wn=2)),!1;var w=Error(r(520),{cause:p});if(w=os(w,d),Jd===null?Jd=[w]:Jd.push(w),Wn!==4&&(Wn=2),l===null)return!0;p=os(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=b&-b,d.lanes|=o,o=mv(d.stateNode,p,o),Bx(d,o),!1;case 1:if(l=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Di===null||!Di.has(w))))return d.flags|=65536,b&=-b,d.lanes|=b,b=xw(b),vw(b,o,d,p),Bx(d,b),!1}d=d.return}while(d!==null);return!1}var pv=Error(r(461)),cr=!1;function kr(o,l,d,p){l.child=o===null?EE(l,null,d,p):Gl(l,o.child,d,p)}function bw(o,l,d,p,b){d=d.render;var w=l.ref;if("ref"in p){var N={};for(var L in p)L!=="ref"&&(N[L]=p[L])}else N=p;return Hl(l),p=Wx(o,l,d,N,w,b),L=Xx(),o!==null&&!cr?(Qx(o,l,b),Mo(o,l,b)):(qt&&L&&Dx(l),l.flags|=1,kr(o,l,p,b),l.child)}function Sw(o,l,d,p,b){if(o===null){var w=d.type;return typeof w=="function"&&!_x(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,Cw(o,l,w,p,b)):(o=cm(d.type,null,p,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(w=o.child,!Ev(o,b)){var N=w.memoizedProps;if(d=d.compare,d=d!==null?d:Dd,d(N,p)&&o.ref===l.ref)return Mo(o,l,b)}return l.flags|=1,o=_o(w,p),o.ref=l.ref,o.return=l,l.child=o}function Cw(o,l,d,p,b){if(o!==null){var w=o.memoizedProps;if(Dd(w,p)&&o.ref===l.ref)if(cr=!1,l.pendingProps=p=w,Ev(o,b))(o.flags&131072)!==0&&(cr=!0);else return l.lanes=o.lanes,Mo(o,l,b)}return gv(o,l,d,p,b)}function Ew(o,l,d,p){var b=p.children,w=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(w=w!==null?w.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&~w}else p=0,l.child=null;return ww(o,l,w,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&hm(l,w!==null?w.cachePool:null),w!==null?jE(l,w):qx(),TE(l);else return p=l.lanes=536870912,ww(o,l,w!==null?w.baseLanes|d:d,d,p)}else w!==null?(hm(l,w.cachePool),jE(l,w),Ti(),l.memoizedState=null):(o!==null&&hm(l,null),qx(),Ti());return kr(o,l,b,d),l.child}function qd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function ww(o,l,d,p,b){var w=Fx();return w=w===null?null:{parent:ir._currentValue,pool:w},l.memoizedState={baseLanes:d,cachePool:w},o!==null&&hm(l,null),qx(),TE(l),o!==null&&Zc(o,l,p,!0),l.childLanes=b,null}function Nm(o,l){return l=Dm({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function Rw(o,l,d){return Gl(l,o.child,null,d),o=Nm(l,l.pendingProps),o.flags|=2,Ua(l),l.memoizedState=null,o}function fk(o,l,d){var p=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(qt){if(p.mode==="hidden")return o=Nm(l,p),l.lanes=536870912,qd(null,o);if(Zx(l),(o=Pn)?(o=PR(o,cs),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:vi!==null?{id:Ws,overflow:Xs}:null,retryLane:536870912,hydrationErrors:null},d=lE(o),d.return=l,l.child=d,Ir=l,Pn=null)):o=null,o===null)throw Si(l);return l.lanes=536870912,null}return Nm(l,p)}var w=o.memoizedState;if(w!==null){var N=w.dehydrated;if(Zx(l),b)if(l.flags&256)l.flags&=-257,l=Rw(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=An,p!==null&&(N=ee(p,d),N!==0&&N!==w.retryLane))throw w.retryLane=N,Pl(o,N),ba(p,o,N),pv;Fm(),l=Rw(o,l,d)}else o=w.treeContext,Pn=ds(N.nextSibling),Ir=l,qt=!0,bi=null,cs=!1,o!==null&&dE(l,o),l=Nm(l,p),l.flags|=4096;return l}return o=_o(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Am(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 gv(o,l,d,p,b){return Hl(l),d=Wx(o,l,d,p,void 0,b),p=Xx(),o!==null&&!cr?(Qx(o,l,b),Mo(o,l,b)):(qt&&p&&Dx(l),l.flags|=1,kr(o,l,d,b),l.child)}function jw(o,l,d,p,b,w){return Hl(l),l.updateQueue=null,d=NE(l,p,d,b),_E(o),p=Xx(),o!==null&&!cr?(Qx(o,l,w),Mo(o,l,w)):(qt&&p&&Dx(l),l.flags|=1,kr(o,l,d,w),l.child)}function Tw(o,l,d,p,b){if(Hl(l),l.stateNode===null){var w=Bc,N=d.contextType;typeof N=="object"&&N!==null&&(w=Mr(N)),w=new d(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=hv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},$x(l),N=d.contextType,w.context=typeof N=="object"&&N!==null?Mr(N):Bc,w.state=l.memoizedState,N=d.getDerivedStateFromProps,typeof N=="function"&&(fv(l,d,N,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&hv.enqueueReplaceState(w,w.state,null),Hd(l,p,w,b),Fd(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){w=l.stateNode;var L=l.memoizedProps,Q=Kl(d,L);w.props=Q;var de=w.context,xe=d.contextType;N=Bc,typeof xe=="object"&&xe!==null&&(N=Mr(xe));var be=d.getDerivedStateFromProps;xe=typeof be=="function"||typeof w.getSnapshotBeforeUpdate=="function",L=l.pendingProps!==L,xe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(L||de!==N)&&hw(l,w,p,N),Ei=!1;var he=l.memoizedState;w.state=he,Hd(l,p,w,b),Fd(),de=l.memoizedState,L||he!==de||Ei?(typeof be=="function"&&(fv(l,d,be,p),de=l.memoizedState),(Q=Ei||fw(l,d,Q,p,he,de,N))?(xe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=de),w.props=p,w.state=de,w.context=N,p=Q):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,Vx(o,l),N=l.memoizedProps,xe=Kl(d,N),w.props=xe,be=l.pendingProps,he=w.context,de=d.contextType,Q=Bc,typeof de=="object"&&de!==null&&(Q=Mr(de)),L=d.getDerivedStateFromProps,(de=typeof L=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==be||he!==Q)&&hw(l,w,p,Q),Ei=!1,he=l.memoizedState,w.state=he,Hd(l,p,w,b),Fd();var pe=l.memoizedState;N!==be||he!==pe||Ei||o!==null&&o.dependencies!==null&&dm(o.dependencies)?(typeof L=="function"&&(fv(l,d,L,p),pe=l.memoizedState),(xe=Ei||fw(l,d,xe,p,he,pe,Q)||o!==null&&o.dependencies!==null&&dm(o.dependencies))?(de||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,pe,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,pe,Q)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=pe),w.props=p,w.state=pe,w.context=Q,p=xe):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),p=!1)}return w=p,Am(o,l),p=(l.flags&128)!==0,w||p?(w=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,o!==null&&p?(l.child=Gl(l,o.child,null,b),l.child=Gl(l,null,d,b)):kr(o,l,d,b),l.memoizedState=w.state,o=l.child):o=Mo(o,l,b),o}function _w(o,l,d,p){return zl(),l.flags|=256,kr(o,l,d,p),l.child}var yv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xv(o){return{baseLanes:o,cachePool:yE()}}function vv(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=Fa),o}function Nw(o,l,d){var p=l.pendingProps,b=!1,w=(l.flags&128)!==0,N;if((N=w)||(N=o!==null&&o.memoizedState===null?!1:(nr.current&2)!==0),N&&(b=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if(qt){if(b?ji(l):Ti(),(o=Pn)?(o=PR(o,cs),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:vi!==null?{id:Ws,overflow:Xs}:null,retryLane:536870912,hydrationErrors:null},d=lE(o),d.return=l,l.child=d,Ir=l,Pn=null)):o=null,o===null)throw Si(l);return t0(o)?l.lanes=32:l.lanes=536870912,null}var L=p.children;return p=p.fallback,b?(Ti(),b=l.mode,L=Dm({mode:"hidden",children:L},b),p=Ul(p,b,d,null),L.return=l,p.return=l,L.sibling=p,l.child=L,p=l.child,p.memoizedState=xv(d),p.childLanes=vv(o,N,d),l.memoizedState=yv,qd(null,p)):(ji(l),bv(l,L))}var Q=o.memoizedState;if(Q!==null&&(L=Q.dehydrated,L!==null)){if(w)l.flags&256?(ji(l),l.flags&=-257,l=Sv(o,l,d)):l.memoizedState!==null?(Ti(),l.child=o.child,l.flags|=128,l=null):(Ti(),L=p.fallback,b=l.mode,p=Dm({mode:"visible",children:p.children},b),L=Ul(L,b,d,null),L.flags|=2,p.return=l,L.return=l,p.sibling=L,l.child=p,Gl(l,o.child,null,d),p=l.child,p.memoizedState=xv(d),p.childLanes=vv(o,N,d),l.memoizedState=yv,l=qd(null,p));else if(ji(l),t0(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var de=N.dgst;N=de,p=Error(r(419)),p.stack="",p.digest=N,Md({value:p,source:null,stack:null}),l=Sv(o,l,d)}else if(cr||Zc(o,l,d,!1),N=(d&o.childLanes)!==0,cr||N){if(N=An,N!==null&&(p=ee(N,d),p!==0&&p!==Q.retryLane))throw Q.retryLane=p,Pl(o,p),ba(N,o,p),pv;e0(L)||Fm(),l=Sv(o,l,d)}else e0(L)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,Pn=ds(L.nextSibling),Ir=l,qt=!0,bi=null,cs=!1,o!==null&&dE(l,o),l=bv(l,p.children),l.flags|=4096);return l}return b?(Ti(),L=p.fallback,b=l.mode,Q=o.child,de=Q.sibling,p=_o(Q,{mode:"hidden",children:p.children}),p.subtreeFlags=Q.subtreeFlags&65011712,de!==null?L=_o(de,L):(L=Ul(L,b,d,null),L.flags|=2),L.return=l,p.return=l,p.sibling=L,l.child=p,qd(null,p),p=l.child,L=o.child.memoizedState,L===null?L=xv(d):(b=L.cachePool,b!==null?(Q=ir._currentValue,b=b.parent!==Q?{parent:Q,pool:Q}:b):b=yE(),L={baseLanes:L.baseLanes|d,cachePool:b}),p.memoizedState=L,p.childLanes=vv(o,N,d),l.memoizedState=yv,qd(o.child,p)):(ji(l),d=o.child,o=d.sibling,d=_o(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 bv(o,l){return l=Dm({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Dm(o,l){return o=La(22,o,null,l),o.lanes=0,o}function Sv(o,l,d){return Gl(l,o.child,null,d),o=bv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function Aw(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),Lx(o.return,l,d)}function Cv(o,l,d,p,b,w){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:w}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=d,N.tailMode=b,N.treeForkCount=w)}function Dw(o,l,d){var p=l.pendingProps,b=p.revealOrder,w=p.tail;p=p.children;var N=nr.current,L=(N&2)!==0;if(L?(N=N&1|2,l.flags|=128):N&=1,z(nr,N),kr(o,l,p,d),p=qt?Id:0,!L&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Aw(o,d,l);else if(o.tag===19)Aw(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&&vm(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),Cv(l,!1,b,d,w,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&&vm(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}Cv(l,!0,d,null,w,p);break;case"together":Cv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function Mo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Ai|=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=_o(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=_o(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function Ev(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&dm(o)))}function hk(o,l,d){switch(l.tag){case 3:le(l,l.stateNode.containerInfo),Ci(l,ir,o.memoizedState.cache),zl();break;case 27:case 5:Ce(l);break;case 4:le(l,l.stateNode.containerInfo);break;case 10:Ci(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Zx(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(ji(l),l.flags|=128,null):(d&l.child.childLanes)!==0?Nw(o,l,d):(ji(l),o=Mo(o,l,d),o!==null?o.sibling:null);ji(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 Dw(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),z(nr,nr.current),p)break;return null;case 22:return l.lanes=0,Ew(o,l,d,l.pendingProps);case 24:Ci(l,ir,o.memoizedState.cache)}return Mo(o,l,d)}function Ow(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)cr=!0;else{if(!Ev(o,d)&&(l.flags&128)===0)return cr=!1,hk(o,l,d);cr=(o.flags&131072)!==0}else cr=!1,qt&&(l.flags&1048576)!==0&&uE(l,Id,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")_x(o)?(p=Kl(o,p),l.tag=1,l=Tw(null,l,o,p,d)):(l.tag=0,l=gv(null,l,o,p,d));else{if(o!=null){var b=o.$$typeof;if(b===I){l.tag=11,l=bw(null,l,o,p,d);break e}else if(b===T){l.tag=14,l=Sw(null,l,o,p,d);break e}}throw l=Z(o)||o,Error(r(306,l,""))}}return l;case 0:return gv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,b=Kl(p,l.pendingProps),Tw(o,l,p,b,d);case 3:e:{if(le(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;b=w.element,Vx(o,l),Hd(l,p,null,d);var N=l.memoizedState;if(p=N.cache,Ci(l,ir,p),p!==w.cache&&Px(l,[ir],d,!0),Fd(),p=N.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=_w(o,l,p,d);break e}else if(p!==b){b=os(Error(r(424)),l),Md(b),l=_w(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(Pn=ds(o.firstChild),Ir=l,qt=!0,bi=null,cs=!0,d=EE(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(zl(),p===b){l=Mo(o,l,d);break e}kr(o,l,p,d)}l=l.child}return l;case 26:return Am(o,l),o===null?(d=VR(l.type,null,l.pendingProps,null))?l.memoizedState=d:qt||(d=l.type,o=l.pendingProps,p=Km(ae.current).createElement(d),p[ke]=l,p[ze]=o,Lr(p,d,o),Nn(p),l.stateNode=p):l.memoizedState=VR(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Ce(l),o===null&&qt&&(p=l.stateNode=FR(l.type,l.pendingProps,ae.current),Ir=l,cs=!0,b=Pn,ki(l.type)?(n0=b,Pn=ds(p.firstChild)):Pn=b),kr(o,l,l.pendingProps.children,d),Am(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&qt&&((b=p=Pn)&&(p=Vk(p,l.type,l.pendingProps,cs),p!==null?(l.stateNode=p,Ir=l,Pn=ds(p.firstChild),cs=!1,b=!0):b=!1),b||Si(l)),Ce(l),b=l.type,w=l.pendingProps,N=o!==null?o.memoizedProps:null,p=w.children,Xv(b,w)?p=null:N!==null&&Xv(b,N)&&(l.flags|=32),l.memoizedState!==null&&(b=Wx(o,l,ak,null,null,d),lf._currentValue=b),Am(o,l),kr(o,l,p,d),l.child;case 6:return o===null&&qt&&((o=d=Pn)&&(d=Bk(d,l.pendingProps,cs),d!==null?(l.stateNode=d,Ir=l,Pn=null,o=!0):o=!1),o||Si(l)),null;case 13:return Nw(o,l,d);case 4:return le(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=Gl(l,null,p,d):kr(o,l,p,d),l.child;case 11:return bw(o,l,l.type,l.pendingProps,d);case 7:return kr(o,l,l.pendingProps,d),l.child;case 8:return kr(o,l,l.pendingProps.children,d),l.child;case 12:return kr(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,Ci(l,l.type,p.value),kr(o,l,p.children,d),l.child;case 9:return b=l.type._context,p=l.pendingProps.children,Hl(l),b=Mr(b),p=p(b),l.flags|=1,kr(o,l,p,d),l.child;case 14:return Sw(o,l,l.type,l.pendingProps,d);case 15:return Cw(o,l,l.type,l.pendingProps,d);case 19:return Dw(o,l,d);case 31:return fk(o,l,d);case 22:return Ew(o,l,d,l.pendingProps);case 24:return Hl(l),p=Mr(ir),o===null?(b=Fx(),b===null&&(b=An,w=Ux(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=d),b=w),l.memoizedState={parent:p,cache:b},$x(l),Ci(l,ir,b)):((o.lanes&d)!==0&&(Vx(o,l),Hd(l,null,null,d),Fd()),b=o.memoizedState,w=l.memoizedState,b.parent!==p?(b={parent:p,cache:p},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),Ci(l,ir,p)):(p=w.cache,Ci(l,ir,p),p!==b.cache&&Px(l,[ir],d,!0))),kr(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function ko(o){o.flags|=4}function wv(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(sR())o.flags|=8192;else throw Bl=pm,Hx}else o.flags&=-16777217}function Iw(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!ZR(l))if(sR())o.flags|=8192;else throw Bl=pm,Hx}function Om(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Gt():536870912,o.lanes|=l,ou|=l)}function Kd(o,l){if(!qt)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 Un(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 mk(o,l,d){var p=l.pendingProps;switch(Ox(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Un(l),null;case 1:return Un(l),null;case 3:return d=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Do(ir),ye(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Kc(l)?ko(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Mx())),Un(l),null;case 26:var b=l.type,w=l.memoizedState;return o===null?(ko(l),w!==null?(Un(l),Iw(l,w)):(Un(l),wv(l,b,null,p,d))):w?w!==o.memoizedState?(ko(l),Un(l),Iw(l,w)):(Un(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&ko(l),Un(l),wv(l,b,o,p,d)),null;case 27:if(Ve(l),d=ae.current,b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&ko(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}o=X.current,Kc(l)?fE(l):(o=FR(b,p,d),l.stateNode=o,ko(l))}return Un(l),null;case 5:if(Ve(l),b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&ko(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}if(w=X.current,Kc(l))fE(l);else{var N=Km(ae.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?N.createElement(b,{is:p.is}):N.createElement(b)}}w[ke]=l,w[ze]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)w.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=w;e:switch(Lr(w,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&&ko(l)}}return Un(l),wv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&ko(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=Ir,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}o[ke]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||NR(o.nodeValue,d)),o||Si(l,!0)}else o=Km(o).createTextNode(p),o[ke]=l,l.stateNode=o}return Un(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[ke]=l}else zl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),o=!1}else d=Mx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(Ua(l),l):(Ua(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Un(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[ke]=l}else zl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),b=!1}else b=Mx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(Ua(l),l):(Ua(l),null)}return Ua(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),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==b&&(p.flags|=2048)),d!==o&&d&&(l.child.flags|=8192),Om(l,l.updateQueue),Un(l),null);case 4:return ye(),o===null&&qv(l.stateNode.containerInfo),Un(l),null;case 10:return Do(l.type),Un(l),null;case 19:if(U(nr),p=l.memoizedState,p===null)return Un(l),null;if(b=(l.flags&128)!==0,w=p.rendering,w===null)if(b)Kd(p,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(w=vm(o),w!==null){for(l.flags|=128,Kd(p,!1),o=w.updateQueue,l.updateQueue=o,Om(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)iE(d,o),d=d.sibling;return z(nr,nr.current&1|2),qt&&No(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&we()>Pm&&(l.flags|=128,b=!0,Kd(p,!1),l.lanes=4194304)}else{if(!b)if(o=vm(w),o!==null){if(l.flags|=128,b=!0,o=o.updateQueue,l.updateQueue=o,Om(l,o),Kd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!qt)return Un(l),null}else 2*we()-p.renderingStartTime>Pm&&d!==536870912&&(l.flags|=128,b=!0,Kd(p,!1),l.lanes=4194304);p.isBackwards?(w.sibling=l.child,l.child=w):(o=p.last,o!==null?o.sibling=w:l.child=w,p.last=w)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=we(),o.sibling=null,d=nr.current,z(nr,b?d&1|2:d&1),qt&&No(l,p.treeForkCount),o):(Un(l),null);case 22:case 23:return Ua(l),Kx(),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&&(Un(l),l.subtreeFlags&6&&(l.flags|=8192)):Un(l),d=l.updateQueue,d!==null&&Om(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),Do(ir),Un(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function pk(o,l){switch(Ox(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Do(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 Ve(l),null;case 31:if(l.memoizedState!==null){if(Ua(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(Ua(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(nr),null;case 4:return ye(),null;case 10:return Do(l.type),null;case 22:case 23:return Ua(l),Kx(),o!==null&&U($l),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Do(ir),null;case 25:return null;default:return null}}function Mw(o,l){switch(Ox(l),l.tag){case 3:Do(ir),ye();break;case 26:case 27:case 5:Ve(l);break;case 4:ye();break;case 31:l.memoizedState!==null&&Ua(l);break;case 13:Ua(l);break;case 19:U(nr);break;case 10:Do(l.type);break;case 22:case 23:Ua(l),Kx(),o!==null&&U($l);break;case 24:Do(ir)}}function Zd(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 w=d.create,N=d.inst;p=w(),N.destroy=p}d=d.next}while(d!==b)}}catch(L){bn(l,l.return,L)}}function _i(o,l,d){try{var p=l.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var w=b.next;p=w;do{if((p.tag&o)===o){var N=p.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,b=l;var Q=d,de=L;try{de()}catch(xe){bn(b,Q,xe)}}}p=p.next}while(p!==w)}}catch(xe){bn(l,l.return,xe)}}function kw(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{RE(l,d)}catch(p){bn(o,o.return,p)}}}function Lw(o,l,d){d.props=Kl(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){bn(o,l,p)}}function Yd(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){bn(o,l,b)}}function Qs(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){bn(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){bn(o,l,b)}else d.current=null}function Pw(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){bn(o,o.return,b)}}function Rv(o,l,d){try{var p=o.stateNode;Pk(p,o.type,d,l),p[ze]=l}catch(b){bn(o,o.return,b)}}function Uw(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ki(o.type)||o.tag===4}function jv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Uw(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&&ki(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 Tv(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=jo));else if(p!==4&&(p===27&&ki(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(Tv(o,l,d),o=o.sibling;o!==null;)Tv(o,l,d),o=o.sibling}function Im(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&&ki(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Im(o,l,d),o=o.sibling;o!==null;)Im(o,l,d),o=o.sibling}function zw(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);Lr(l,p,d),l[ke]=o,l[ze]=d}catch(w){bn(o,o.return,w)}}var Lo=!1,ur=!1,_v=!1,Fw=typeof WeakSet=="function"?WeakSet:Set,wr=null;function gk(o,l){if(o=o.containerInfo,Yv=ep,o=QC(o),Sx(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,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var N=0,L=-1,Q=-1,de=0,xe=0,be=o,he=null;t:for(;;){for(var pe;be!==d||b!==0&&be.nodeType!==3||(L=N+b),be!==w||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&&++de===b&&(L=N),he===w&&++xe===p&&(Q=N),(pe=be.nextSibling)!==null)break;be=he,he=be.parentNode}be=pe}d=L===-1||Q===-1?null:{start:L,end:Q}}else d=null}d=d||{start:0,end:0}}else d=null;for(Wv={focusedElem:o,selectionRange:d},ep=!1,wr=l;wr!==null;)if(l=wr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,wr=o;else for(;wr!==null;){switch(l=wr,w=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&&w!==null){o=void 0,d=l,b=w.memoizedProps,w=w.memoizedState,p=d.stateNode;try{var qe=Kl(d.type,b);o=p.getSnapshotBeforeUpdate(qe,w),p.__reactInternalSnapshotBeforeUpdate=o}catch(ot){bn(d,d.return,ot)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)Jv(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Jv(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,wr=o;break}wr=l.return}}function Hw(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Uo(o,d),p&4&&Zd(5,d);break;case 1:if(Uo(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(N){bn(d,d.return,N)}else{var b=Kl(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(b,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){bn(d,d.return,N)}}p&64&&kw(d),p&512&&Yd(d,d.return);break;case 3:if(Uo(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{RE(o,l)}catch(N){bn(d,d.return,N)}}break;case 27:l===null&&p&4&&zw(d);case 26:case 5:Uo(o,d),l===null&&p&4&&Pw(d),p&512&&Yd(d,d.return);break;case 12:Uo(o,d);break;case 31:Uo(o,d),p&4&&Bw(o,d);break;case 13:Uo(o,d),p&4&&Gw(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=Rk.bind(null,d),Gk(o,d))));break;case 22:if(p=d.memoizedState!==null||Lo,!p){l=l!==null&&l.memoizedState!==null||ur,b=Lo;var w=ur;Lo=p,(ur=l)&&!w?zo(o,d,(d.subtreeFlags&8772)!==0):Uo(o,d),Lo=b,ur=w}break;case 30:break;default:Uo(o,d)}}function $w(o){var l=o.alternate;l!==null&&(o.alternate=null,$w(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Zn(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 Bn=null,ga=!1;function Po(o,l,d){for(d=d.child;d!==null;)Vw(o,l,d),d=d.sibling}function Vw(o,l,d){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(Jr,d)}catch{}switch(d.tag){case 26:ur||Qs(d,l),Po(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ur||Qs(d,l);var p=Bn,b=ga;ki(d.type)&&(Bn=d.stateNode,ga=!1),Po(o,l,d),af(d.stateNode),Bn=p,ga=b;break;case 5:ur||Qs(d,l);case 6:if(p=Bn,b=ga,Bn=null,Po(o,l,d),Bn=p,ga=b,Bn!==null)if(ga)try{(Bn.nodeType===9?Bn.body:Bn.nodeName==="HTML"?Bn.ownerDocument.body:Bn).removeChild(d.stateNode)}catch(w){bn(d,l,w)}else try{Bn.removeChild(d.stateNode)}catch(w){bn(d,l,w)}break;case 18:Bn!==null&&(ga?(o=Bn,kR(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),mu(o)):kR(Bn,d.stateNode));break;case 4:p=Bn,b=ga,Bn=d.stateNode.containerInfo,ga=!0,Po(o,l,d),Bn=p,ga=b;break;case 0:case 11:case 14:case 15:_i(2,d,l),ur||_i(4,d,l),Po(o,l,d);break;case 1:ur||(Qs(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&Lw(d,l,p)),Po(o,l,d);break;case 21:Po(o,l,d);break;case 22:ur=(p=ur)||d.memoizedState!==null,Po(o,l,d),ur=p;break;default:Po(o,l,d)}}function Bw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{mu(o)}catch(d){bn(l,l.return,d)}}}function Gw(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){bn(l,l.return,d)}}function yk(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new Fw),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new Fw),l;default:throw Error(r(435,o.tag))}}function Mm(o,l){var d=yk(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var b=jk.bind(null,o,p);p.then(b,b)}})}function ya(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],w=o,N=l,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(ki(L.type)){Bn=L.stateNode,ga=!1;break e}break;case 5:Bn=L.stateNode,ga=!1;break e;case 3:case 4:Bn=L.stateNode.containerInfo,ga=!0;break e}L=L.return}if(Bn===null)throw Error(r(160));Vw(w,N,b),Bn=null,ga=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)qw(l,o),l=l.sibling}var Rs=null;function qw(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:ya(l,o),xa(o),p&4&&(_i(3,o,o.return),Zd(3,o),_i(5,o,o.return));break;case 1:ya(l,o),xa(o),p&512&&(ur||d===null||Qs(d,d.return)),p&64&&Lo&&(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=Rs;if(ya(l,o),xa(o),p&512&&(ur||d===null||Qs(d,d.return)),p&4){var w=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":w=b.getElementsByTagName("title")[0],(!w||w[Ln]||w[ke]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(p),b.head.insertBefore(w,b.querySelector("head > title"))),Lr(w,p,d),w[ke]=o,Nn(w),p=w;break e;case"link":var N=qR("link","href",b).get(p+(d.href||""));if(N){for(var L=0;L<N.length;L++)if(w=N[L],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){N.splice(L,1);break t}}w=b.createElement(p),Lr(w,p,d),b.head.appendChild(w);break;case"meta":if(N=qR("meta","content",b).get(p+(d.content||""))){for(L=0;L<N.length;L++)if(w=N[L],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){N.splice(L,1);break t}}w=b.createElement(p),Lr(w,p,d),b.head.appendChild(w);break;default:throw Error(r(468,p))}w[ke]=o,Nn(w),p=w}o.stateNode=p}else KR(b,o.type,o.stateNode);else o.stateNode=GR(b,p,o.memoizedProps);else w!==p?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,p===null?KR(b,o.type,o.stateNode):GR(b,p,o.memoizedProps)):p===null&&o.stateNode!==null&&Rv(o,o.memoizedProps,d.memoizedProps)}break;case 27:ya(l,o),xa(o),p&512&&(ur||d===null||Qs(d,d.return)),d!==null&&p&4&&Rv(o,o.memoizedProps,d.memoizedProps);break;case 5:if(ya(l,o),xa(o),p&512&&(ur||d===null||Qs(d,d.return)),o.flags&32){b=o.stateNode;try{Pc(b,"")}catch(qe){bn(o,o.return,qe)}}p&4&&o.stateNode!=null&&(b=o.memoizedProps,Rv(o,b,d!==null?d.memoizedProps:b)),p&1024&&(_v=!0);break;case 6:if(ya(l,o),xa(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(qe){bn(o,o.return,qe)}}break;case 3:if(Wm=null,b=Rs,Rs=Zm(l.containerInfo),ya(l,o),Rs=b,xa(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{mu(l.containerInfo)}catch(qe){bn(o,o.return,qe)}_v&&(_v=!1,Kw(o));break;case 4:p=Rs,Rs=Zm(o.stateNode.containerInfo),ya(l,o),xa(o),Rs=p;break;case 12:ya(l,o),xa(o);break;case 31:ya(l,o),xa(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Mm(o,p)));break;case 13:ya(l,o),xa(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Lm=we()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Mm(o,p)));break;case 22:b=o.memoizedState!==null;var Q=d!==null&&d.memoizedState!==null,de=Lo,xe=ur;if(Lo=de||b,ur=xe||Q,ya(l,o),ur=xe,Lo=de,xa(o),p&8192)e:for(l=o.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(d===null||Q||Lo||ur||Zl(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){Q=d=l;try{if(w=Q.stateNode,b)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=Q.stateNode;var be=Q.memoizedProps.style,he=be!=null&&be.hasOwnProperty("display")?be.display:null;L.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(qe){bn(Q,Q.return,qe)}}}else if(l.tag===6){if(d===null){Q=l;try{Q.stateNode.nodeValue=b?"":Q.memoizedProps}catch(qe){bn(Q,Q.return,qe)}}}else if(l.tag===18){if(d===null){Q=l;try{var pe=Q.stateNode;b?LR(pe,!0):LR(Q.stateNode,!1)}catch(qe){bn(Q,Q.return,qe)}}}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,Mm(o,d))));break;case 19:ya(l,o),xa(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Mm(o,p)));break;case 30:break;case 21:break;default:ya(l,o),xa(o)}}function xa(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if(Uw(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,w=jv(o);Im(o,w,b);break;case 5:var N=d.stateNode;d.flags&32&&(Pc(N,""),d.flags&=-33);var L=jv(o);Im(o,L,N);break;case 3:case 4:var Q=d.stateNode.containerInfo,de=jv(o);Tv(o,de,Q);break;default:throw Error(r(161))}}catch(xe){bn(o,o.return,xe)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Kw(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;Kw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Uo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Hw(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:_i(4,l,l.return),Zl(l);break;case 1:Qs(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&Lw(l,l.return,d),Zl(l);break;case 27:af(l.stateNode);case 26:case 5:Qs(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 zo(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,b=o,w=l,N=w.flags;switch(w.tag){case 0:case 11:case 15:zo(b,w,d),Zd(4,w);break;case 1:if(zo(b,w,d),p=w,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(de){bn(p,p.return,de)}if(p=w,b=p.updateQueue,b!==null){var L=p.stateNode;try{var Q=b.shared.hiddenCallbacks;if(Q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Q.length;b++)wE(Q[b],L)}catch(de){bn(p,p.return,de)}}d&&N&64&&kw(w),Yd(w,w.return);break;case 27:zw(w);case 26:case 5:zo(b,w,d),d&&p===null&&N&4&&Pw(w),Yd(w,w.return);break;case 12:zo(b,w,d);break;case 31:zo(b,w,d),d&&N&4&&Bw(b,w);break;case 13:zo(b,w,d),d&&N&4&&Gw(b,w);break;case 22:w.memoizedState===null&&zo(b,w,d),Yd(w,w.return);break;case 30:break;default:zo(b,w,d)}l=l.sibling}}function Nv(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&&kd(d))}function Av(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&kd(o))}function js(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Zw(o,l,d,p),l=l.sibling}function Zw(o,l,d,p){var b=l.flags;switch(l.tag){case 0:case 11:case 15:js(o,l,d,p),b&2048&&Zd(9,l);break;case 1:js(o,l,d,p);break;case 3:js(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&&kd(o)));break;case 12:if(b&2048){js(o,l,d,p),o=l.stateNode;try{var w=l.memoizedProps,N=w.id,L=w.onPostCommit;typeof L=="function"&&L(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){bn(l,l.return,Q)}}else js(o,l,d,p);break;case 31:js(o,l,d,p);break;case 13:js(o,l,d,p);break;case 23:break;case 22:w=l.stateNode,N=l.alternate,l.memoizedState!==null?w._visibility&2?js(o,l,d,p):Wd(o,l):w._visibility&2?js(o,l,d,p):(w._visibility|=2,ru(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),b&2048&&Nv(N,l);break;case 24:js(o,l,d,p),b&2048&&Av(l.alternate,l);break;default:js(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 w=o,N=l,L=d,Q=p,de=N.flags;switch(N.tag){case 0:case 11:case 15:ru(w,N,L,Q,b),Zd(8,N);break;case 23:break;case 22:var xe=N.stateNode;N.memoizedState!==null?xe._visibility&2?ru(w,N,L,Q,b):Wd(w,N):(xe._visibility|=2,ru(w,N,L,Q,b)),b&&de&2048&&Nv(N.alternate,N);break;case 24:ru(w,N,L,Q,b),b&&de&2048&&Av(N.alternate,N);break;default:ru(w,N,L,Q,b)}l=l.sibling}}function Wd(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:Wd(d,p),b&2048&&Nv(p.alternate,p);break;case 24:Wd(d,p),b&2048&&Av(p.alternate,p);break;default:Wd(d,p)}l=l.sibling}}var Xd=8192;function au(o,l,d){if(o.subtreeFlags&Xd)for(o=o.child;o!==null;)Yw(o,l,d),o=o.sibling}function Yw(o,l,d){switch(o.tag){case 26:au(o,l,d),o.flags&Xd&&o.memoizedState!==null&&r9(d,Rs,o.memoizedState,o.memoizedProps);break;case 5:au(o,l,d);break;case 3:case 4:var p=Rs;Rs=Zm(o.stateNode.containerInfo),au(o,l,d),Rs=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Xd,Xd=16777216,au(o,l,d),Xd=p):au(o,l,d));break;default:au(o,l,d)}}function Ww(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 Qd(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];wr=p,Qw(p,o)}Ww(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Xw(o),o=o.sibling}function Xw(o){switch(o.tag){case 0:case 11:case 15:Qd(o),o.flags&2048&&_i(9,o,o.return);break;case 3:Qd(o);break;case 12:Qd(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,km(o)):Qd(o);break;default:Qd(o)}}function km(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];wr=p,Qw(p,o)}Ww(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:_i(8,l,l.return),km(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,km(l));break;default:km(l)}o=o.sibling}}function Qw(o,l){for(;wr!==null;){var d=wr;switch(d.tag){case 0:case 11:case 15:_i(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:kd(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,wr=p;else e:for(d=o;wr!==null;){p=wr;var b=p.sibling,w=p.return;if($w(p),p===d){wr=null;break e}if(b!==null){b.return=w,wr=b;break e}wr=w}}}var xk={getCacheForType:function(o){var l=Mr(ir),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return Mr(ir).controller.signal}},vk=typeof WeakMap=="function"?WeakMap:Map,mn=0,An=null,Pt=null,Ht=0,vn=0,za=null,Ni=!1,su=!1,Dv=!1,Fo=0,Wn=0,Ai=0,Yl=0,Ov=0,Fa=0,ou=0,Jd=null,va=null,Iv=!1,Lm=0,Jw=0,Pm=1/0,Um=null,Di=null,mr=0,Oi=null,iu=null,Ho=0,Mv=0,kv=null,eR=null,ef=0,Lv=null;function Ha(){return(mn&2)!==0&&Ht!==0?Ht&-Ht:M.T!==null?$v():_e()}function tR(){if(Fa===0)if((Ht&536870912)===0||qt){var o=Cs;Cs<<=1,(Cs&3932160)===0&&(Cs=262144),Fa=o}else Fa=536870912;return o=Pa.current,o!==null&&(o.flags|=32),Fa}function ba(o,l,d){(o===An&&(vn===2||vn===9)||o.cancelPendingCommit!==null)&&(lu(o,0),Ii(o,Ht,Fa,!1)),Jt(o,d),((mn&2)===0||o!==An)&&(o===An&&((mn&2)===0&&(Yl|=d),Wn===4&&Ii(o,Ht,Fa,!1)),Js(o))}function nR(o,l,d){if((mn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||Bt(o,l),b=p?Ck(o,l):Uv(o,l,!0),w=p;do{if(b===0){su&&!p&&Ii(o,l,0,!1);break}else{if(d=o.current.alternate,w&&!bk(d)){b=Uv(o,l,!1),w=!1;continue}if(b===2){if(w=l,o.errorRecoveryDisabledLanes&w)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var L=o;b=Jd;var Q=L.current.memoizedState.isDehydrated;if(Q&&(lu(L,N).flags|=256),N=Uv(L,N,!1),N!==2){if(Dv&&!Q){L.errorRecoveryDisabledLanes|=w,Yl|=w,b=4;break e}w=va,va=b,w!==null&&(va===null?va=w:va.push.apply(va,w))}b=N}if(w=!1,b!==2)continue}}if(b===1){lu(o,0),Ii(o,l,0,!0);break}e:{switch(p=o,w=b,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ii(p,l,Fa,!Ni);break e;case 2:va=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=Lm+300-we(),10<b)){if(Ii(p,l,Fa,!Ni),Ye(p,0,!0)!==0)break e;Ho=l,p.timeoutHandle=IR(rR.bind(null,p,d,va,Um,Iv,l,Fa,Yl,ou,Ni,w,"Throttled",-0,0),b);break e}rR(p,d,va,Um,Iv,l,Fa,Yl,ou,Ni,w,null,-0,0)}}break}while(!0);Js(o)}function rR(o,l,d,p,b,w,N,L,Q,de,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:jo},Yw(l,w,be);var qe=(w&62914560)===w?Lm-we():(w&4194048)===w?Jw-we():0;if(qe=a9(be,qe),qe!==null){Ho=w,o.cancelPendingCommit=qe(dR.bind(null,o,l,w,d,p,b,N,L,Q,xe,be,null,he,pe)),Ii(o,w,N,!de);return}}dR(o,l,w,d,p,b,N,L,Q)}function bk(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],w=b.getSnapshot;b=b.value;try{if(!ka(w(),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 Ii(o,l,d,p){l&=~Ov,l&=~Yl,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var b=l;0<b;){var w=31-kn(b),N=1<<w;p[w]=-1,b&=~N}d!==0&&Cr(o,d,l)}function zm(){return(mn&6)===0?(tf(0),!1):!0}function Pv(){if(Pt!==null){if(vn===0)var o=Pt.return;else o=Pt,Ao=Fl=null,Jx(o),Qc=null,Pd=0,o=Pt;for(;o!==null;)Mw(o.alternate,o),o=o.return;Pt=null}}function lu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,Fk(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Ho=0,Pv(),An=o,Pt=d=_o(o.current,null),Ht=l,vn=0,za=null,Ni=!1,su=Bt(o,l),Dv=!1,ou=Fa=Ov=Yl=Ai=Wn=0,va=Jd=null,Iv=!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),w=1<<b;l|=o[b],p&=~w}return Fo=l,om(),d}function aR(o,l){vt=null,M.H=Gd,l===Xc||l===mm?(l=bE(),vn=3):l===Hx?(l=bE(),vn=4):vn=l===pv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,za=l,Pt===null&&(Wn=1,_m(o,os(l,o.current)))}function sR(){var o=Pa.current;return o===null?!0:(Ht&4194048)===Ht?us===null:(Ht&62914560)===Ht||(Ht&536870912)!==0?o===us:!1}function oR(){var o=M.H;return M.H=Gd,o===null?Gd:o}function iR(){var o=M.A;return M.A=xk,o}function Fm(){Wn=4,Ni||(Ht&4194048)!==Ht&&Pa.current!==null||(su=!0),(Ai&134217727)===0&&(Yl&134217727)===0||An===null||Ii(An,Ht,Fa,!1)}function Uv(o,l,d){var p=mn;mn|=2;var b=oR(),w=iR();(An!==o||Ht!==l)&&(Um=null,lu(o,l)),l=!1;var N=Wn;e:do try{if(vn!==0&&Pt!==null){var L=Pt,Q=za;switch(vn){case 8:Pv(),N=6;break e;case 3:case 2:case 9:case 6:Pa.current===null&&(l=!0);var de=vn;if(vn=0,za=null,cu(o,L,Q,de),d&&su){N=0;break e}break;default:de=vn,vn=0,za=null,cu(o,L,Q,de)}}Sk(),N=Wn;break}catch(xe){aR(o,xe)}while(!0);return l&&o.shellSuspendCounter++,Ao=Fl=null,mn=p,M.H=b,M.A=w,Pt===null&&(An=null,Ht=0,om()),N}function Sk(){for(;Pt!==null;)lR(Pt)}function Ck(o,l){var d=mn;mn|=2;var p=oR(),b=iR();An!==o||Ht!==l?(Um=null,Pm=we()+500,lu(o,l)):su=Bt(o,l);e:do try{if(vn!==0&&Pt!==null){l=Pt;var w=za;t:switch(vn){case 1:vn=0,za=null,cu(o,l,w,1);break;case 2:case 9:if(xE(w)){vn=0,za=null,cR(l);break}l=function(){vn!==2&&vn!==9||An!==o||(vn=7),Js(o)},w.then(l,l);break e;case 3:vn=7;break e;case 4:vn=5;break e;case 7:xE(w)?(vn=0,za=null,cR(l)):(vn=0,za=null,cu(o,l,w,7));break;case 5:var N=null;switch(Pt.tag){case 26:N=Pt.memoizedState;case 5:case 27:var L=Pt;if(N?ZR(N):L.stateNode.complete){vn=0,za=null;var Q=L.sibling;if(Q!==null)Pt=Q;else{var de=L.return;de!==null?(Pt=de,Hm(de)):Pt=null}break t}}vn=0,za=null,cu(o,l,w,5);break;case 6:vn=0,za=null,cu(o,l,w,6);break;case 8:Pv(),Wn=6;break e;default:throw Error(r(462))}}Ek();break}catch(xe){aR(o,xe)}while(!0);return Ao=Fl=null,M.H=p,M.A=b,mn=d,Pt!==null?0:(An=null,Ht=0,om(),Wn)}function Ek(){for(;Pt!==null&&!ce();)lR(Pt)}function lR(o){var l=Ow(o.alternate,o,Fo);o.memoizedProps=o.pendingProps,l===null?Hm(o):Pt=l}function cR(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=jw(d,l,l.pendingProps,l.type,void 0,Ht);break;case 11:l=jw(d,l,l.pendingProps,l.type.render,l.ref,Ht);break;case 5:Jx(l);default:Mw(d,l),l=Pt=iE(l,Fo),l=Ow(d,l,Fo)}o.memoizedProps=o.pendingProps,l===null?Hm(o):Pt=l}function cu(o,l,d,p){Ao=Fl=null,Jx(l),Qc=null,Pd=0;var b=l.return;try{if(dk(o,b,l,d,Ht)){Wn=1,_m(o,os(d,o.current)),Pt=null;return}}catch(w){if(b!==null)throw Pt=b,w;Wn=1,_m(o,os(d,o.current)),Pt=null;return}l.flags&32768?(qt||p===1?o=!0:su||(Ht&536870912)!==0?o=!1:(Ni=o=!0,(p===2||p===9||p===3||p===6)&&(p=Pa.current,p!==null&&p.tag===13&&(p.flags|=16384))),uR(l,o)):Hm(l)}function Hm(o){var l=o;do{if((l.flags&32768)!==0){uR(l,Ni);return}o=l.return;var d=mk(l.alternate,l,Fo);if(d!==null){Pt=d;return}if(l=l.sibling,l!==null){Pt=l;return}Pt=l=o}while(l!==null);Wn===0&&(Wn=5)}function uR(o,l){do{var d=pk(o.alternate,o);if(d!==null){d.flags&=32767,Pt=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Pt=o;return}Pt=o=d}while(o!==null);Wn=6,Pt=null}function dR(o,l,d,p,b,w,N,L,Q){o.cancelPendingCommit=null;do $m();while(mr!==0);if((mn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=jx,Qt(o,d,w,N,L,Q),o===An&&(Pt=An=null,Ht=0),iu=l,Oi=o,Ho=d,Mv=w,kv=b,eR=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,Tk(st,function(){return gR(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=M.T,M.T=null,b=$.p,$.p=2,N=mn,mn|=4;try{gk(o,l,d)}finally{mn=N,$.p=b,M.T=p}}mr=1,fR(),hR(),mR()}}function fR(){if(mr===1){mr=0;var o=Oi,l=iu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var p=$.p;$.p=2;var b=mn;mn|=4;try{qw(l,o);var w=Wv,N=QC(o.containerInfo),L=w.focusedElem,Q=w.selectionRange;if(N!==L&&L&&L.ownerDocument&&XC(L.ownerDocument.documentElement,L)){if(Q!==null&&Sx(L)){var de=Q.start,xe=Q.end;if(xe===void 0&&(xe=de),"selectionStart"in L)L.selectionStart=de,L.selectionEnd=Math.min(xe,L.value.length);else{var be=L.ownerDocument||document,he=be&&be.defaultView||window;if(he.getSelection){var pe=he.getSelection(),qe=L.textContent.length,ot=Math.min(Q.start,qe),jn=Q.end===void 0?ot:Math.min(Q.end,qe);!pe.extend&&ot>jn&&(N=jn,jn=ot,ot=N);var ie=WC(L,ot),te=WC(L,jn);if(ie&&te&&(pe.rangeCount!==1||pe.anchorNode!==ie.node||pe.anchorOffset!==ie.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var ue=be.createRange();ue.setStart(ie.node,ie.offset),pe.removeAllRanges(),ot>jn?(pe.addRange(ue),pe.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),pe.addRange(ue))}}}}for(be=[],pe=L;pe=pe.parentNode;)pe.nodeType===1&&be.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<be.length;L++){var ve=be[L];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}ep=!!Yv,Wv=Yv=null}finally{mn=b,$.p=p,M.T=d}}o.current=l,mr=2}}function hR(){if(mr===2){mr=0;var o=Oi,l=iu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var p=$.p;$.p=2;var b=mn;mn|=4;try{Hw(o,l.alternate,l)}finally{mn=b,$.p=p,M.T=d}}mr=3}}function mR(){if(mr===4||mr===3){mr=0,Oe();var o=Oi,l=iu,d=Ho,p=eR;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?mr=5:(mr=0,iu=Oi=null,pR(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(Di=null),Se(d),l=l.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(Jr,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=M.T,b=$.p,$.p=2,M.T=null;try{for(var w=o.onRecoverableError,N=0;N<p.length;N++){var L=p[N];w(L.value,{componentStack:L.stack})}}finally{M.T=l,$.p=b}}(Ho&3)!==0&&$m(),Js(o),b=o.pendingLanes,(d&261930)!==0&&(b&42)!==0?o===Lv?ef++:(ef=0,Lv=o):ef=0,tf(0)}}function pR(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,kd(l)))}function $m(){return fR(),hR(),mR(),gR()}function gR(){if(mr!==5)return!1;var o=Oi,l=Mv;Mv=0;var d=Se(Ho),p=M.T,b=$.p;try{$.p=32>d?32:d,M.T=null,d=kv,kv=null;var w=Oi,N=Ho;if(mr=0,iu=Oi=null,Ho=0,(mn&6)!==0)throw Error(r(331));var L=mn;if(mn|=4,Xw(w.current),Zw(w,w.current,N,d),mn=L,tf(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(Jr,w)}catch{}return!0}finally{$.p=b,M.T=p,pR(o,l)}}function yR(o,l,d){l=os(d,l),l=mv(o.stateNode,l,2),o=Ri(o,l,2),o!==null&&(Jt(o,2),Js(o))}function bn(o,l,d){if(o.tag===3)yR(o,o,d);else for(;l!==null;){if(l.tag===3){yR(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Di===null||!Di.has(p))){o=os(d,o),d=xw(2),p=Ri(l,d,2),p!==null&&(vw(d,p,l,o),Jt(p,2),Js(p));break}}l=l.return}}function zv(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new vk;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)||(Dv=!0,b.add(d),o=wk.bind(null,o,l,d),l.then(o,o))}function wk(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,An===o&&(Ht&d)===d&&(Wn===4||Wn===3&&(Ht&62914560)===Ht&&300>we()-Lm?(mn&2)===0&&lu(o,0):Ov|=d,ou===Ht&&(ou=0)),Js(o)}function xR(o,l){l===0&&(l=Gt()),o=Pl(o,l),o!==null&&(Jt(o,l),Js(o))}function Rk(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),xR(o,d)}function jk(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),xR(o,d)}function Tk(o,l){return q(o,l)}var Vm=null,uu=null,Fv=!1,Bm=!1,Hv=!1,Mi=0;function Js(o){o!==uu&&o.next===null&&(uu===null?Vm=uu=o:uu=uu.next=o),Bm=!0,Fv||(Fv=!0,Nk())}function tf(o,l){if(!Hv&&Bm){Hv=!0;do for(var d=!1,p=Vm;p!==null;){if(o!==0){var b=p.pendingLanes;if(b===0)var w=0;else{var N=p.suspendedLanes,L=p.pingedLanes;w=(1<<31-kn(42|o)+1)-1,w&=b&~(N&~L),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,CR(p,w))}else w=Ht,w=Ye(p,p===An?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||Bt(p,w)||(d=!0,CR(p,w));p=p.next}while(d);Hv=!1}}function _k(){vR()}function vR(){Bm=Fv=!1;var o=0;Mi!==0&&zk()&&(o=Mi);for(var l=we(),d=null,p=Vm;p!==null;){var b=p.next,w=bR(p,l);w===0?(p.next=null,d===null?Vm=b:d.next=b,b===null&&(uu=d)):(d=p,(o!==0||(w&3)!==0)&&(Bm=!0)),p=b}mr!==0&&mr!==5||tf(o),Mi!==0&&(Mi=0)}function bR(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,b=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var N=31-kn(w),L=1<<N,Q=b[N];Q===-1?((L&d)===0||(L&p)!==0)&&(b[N]=Xt(L,l)):Q<=l&&(o.expiredLanes|=L),w&=~L}if(l=An,d=Ht,d=Ye(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(vn===2||vn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ne(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Bt(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&ne(p),Se(d)){case 2:case 8:d=mt;break;case 32:d=st;break;case 268435456:d=sr;break;default:d=st}return p=SR.bind(null,o),d=q(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&ne(p),o.callbackPriority=2,o.callbackNode=null,2}function SR(o,l){if(mr!==0&&mr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if($m()&&o.callbackNode!==d)return null;var p=Ht;return p=Ye(o,o===An?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(nR(o,p,l),bR(o,we()),o.callbackNode!=null&&o.callbackNode===d?SR.bind(null,o):null)}function CR(o,l){if($m())return null;nR(o,l,!0)}function Nk(){Hk(function(){(mn&6)!==0?q(He,_k):vR()})}function $v(){if(Mi===0){var o=Yc;o===0&&(o=Da,Da<<=1,(Da&261888)===0&&(Da=256)),Mi=o}return Mi}function ER(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Qh(""+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 Ak(o,l,d,p,b){if(l==="submit"&&d&&d.stateNode===b){var w=ER((b[ze]||null).action),N=p.submitter;N&&(l=(l=N[ze]||null)?ER(l.formAction):N.getAttribute("formAction"),l!==null&&(w=l,N=null));var L=new nm("action","action",null,p,b);o.push({event:L,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Mi!==0){var Q=N?wR(b,N):new FormData(b);lv(d,{pending:!0,data:Q,method:b.method,action:w},null,Q)}}else typeof w=="function"&&(L.preventDefault(),Q=N?wR(b,N):new FormData(b),lv(d,{pending:!0,data:Q,method:b.method,action:w},w,Q))},currentTarget:b}]})}}for(var Vv=0;Vv<Rx.length;Vv++){var Bv=Rx[Vv],Dk=Bv.toLowerCase(),Ok=Bv[0].toUpperCase()+Bv.slice(1);ws(Dk,"on"+Ok)}ws(tE,"onAnimationEnd"),ws(nE,"onAnimationIteration"),ws(rE,"onAnimationStart"),ws("dblclick","onDoubleClick"),ws("focusin","onFocus"),ws("focusout","onBlur"),ws(Z8,"onTransitionRun"),ws(Y8,"onTransitionStart"),ws(W8,"onTransitionCancel"),ws(aE,"onTransitionEnd"),ma("onMouseEnter",["mouseout","mouseover"]),ma("onMouseLeave",["mouseout","mouseover"]),ma("onPointerEnter",["pointerout","pointerover"]),ma("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nf="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(" "),Ik=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nf));function RR(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 w=void 0;if(l)for(var N=p.length-1;0<=N;N--){var L=p[N],Q=L.instance,de=L.currentTarget;if(L=L.listener,Q!==w&&b.isPropagationStopped())break e;w=L,b.currentTarget=de;try{w(b)}catch(xe){sm(xe)}b.currentTarget=null,w=Q}else for(N=0;N<p.length;N++){if(L=p[N],Q=L.instance,de=L.currentTarget,L=L.listener,Q!==w&&b.isPropagationStopped())break e;w=L,b.currentTarget=de;try{w(b)}catch(xe){sm(xe)}b.currentTarget=null,w=Q}}}}function Ut(o,l){var d=l[at];d===void 0&&(d=l[at]=new Set);var p=o+"__bubble";d.has(p)||(jR(l,o,2,!1),d.add(p))}function Gv(o,l,d){var p=0;l&&(p|=4),jR(d,o,p,l)}var Gm="_reactListening"+Math.random().toString(36).slice(2);function qv(o){if(!o[Gm]){o[Gm]=!0,Ia.forEach(function(d){d!=="selectionchange"&&(Ik.has(d)||Gv(d,!1,o),Gv(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Gm]||(l[Gm]=!0,Gv("selectionchange",!1,l))}}function jR(o,l,d,p){switch(tj(l)){case 2:var b=i9;break;case 8:b=l9;break;default:b=i0}d=b.bind(null,l,d,o),b=void 0,!fx||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 Kv(o,l,d,p,b){var w=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 L=p.stateNode.containerInfo;if(L===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(;L!==null;){if(N=an(L),N===null)return;if(Q=N.tag,Q===5||Q===6||Q===26||Q===27){p=w=N;continue e}L=L.parentNode}}p=p.return}DC(function(){var de=w,xe=ux(d),be=[];e:{var he=sE.get(o);if(he!==void 0){var pe=nm,qe=o;switch(o){case"keypress":if(em(d)===0)break e;case"keydown":case"keyup":pe=j8;break;case"focusin":qe="focus",pe=gx;break;case"focusout":qe="blur",pe=gx;break;case"beforeblur":case"afterblur":pe=gx;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=MC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=m8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=N8;break;case tE:case nE:case rE:pe=y8;break;case aE:pe=D8;break;case"scroll":case"scrollend":pe=f8;break;case"wheel":pe=I8;break;case"copy":case"cut":case"paste":pe=v8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=LC;break;case"toggle":case"beforetoggle":pe=k8}var ot=(l&4)!==0,jn=!ot&&(o==="scroll"||o==="scrollend"),ie=ot?he!==null?he+"Capture":null:he;ot=[];for(var te=de,ue;te!==null;){var ve=te;if(ue=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ue===null||ie===null||(ve=wd(te,ie),ve!=null&&ot.push(rf(te,ve,ue))),jn)break;te=te.return}0<ot.length&&(he=new pe(he,qe,null,d,xe),be.push({event:he,listeners:ot}))}}if((l&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",pe=o==="mouseout"||o==="pointerout",he&&d!==cx&&(qe=d.relatedTarget||d.fromElement)&&(an(qe)||qe[Xe]))break e;if((pe||he)&&(he=xe.window===xe?xe:(he=xe.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(qe=d.relatedTarget||d.toElement,pe=de,qe=qe?an(qe):null,qe!==null&&(jn=i(qe),ot=qe.tag,qe!==jn||ot!==5&&ot!==27&&ot!==6)&&(qe=null)):(pe=null,qe=de),pe!==qe)){if(ot=MC,ve="onMouseLeave",ie="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(ot=LC,ve="onPointerLeave",ie="onPointerEnter",te="pointer"),jn=pe==null?he:Oa(pe),ue=qe==null?he:Oa(qe),he=new ot(ve,te+"leave",pe,d,xe),he.target=jn,he.relatedTarget=ue,ve=null,an(xe)===de&&(ot=new ot(ie,te+"enter",qe,d,xe),ot.target=ue,ot.relatedTarget=jn,ve=ot),jn=ve,pe&&qe)t:{for(ot=Mk,ie=pe,te=qe,ue=0,ve=ie;ve;ve=ot(ve))ue++;ve=0;for(var nt=te;nt;nt=ot(nt))ve++;for(;0<ue-ve;)ie=ot(ie),ue--;for(;0<ve-ue;)te=ot(te),ve--;for(;ue--;){if(ie===te||te!==null&&ie===te.alternate){ot=ie;break t}ie=ot(ie),te=ot(te)}ot=null}else ot=null;pe!==null&&TR(be,he,pe,ot,!1),qe!==null&&jn!==null&&TR(be,jn,qe,ot,!0)}}e:{if(he=de?Oa(de):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var ln=BC;else if($C(he))if(GC)ln=G8;else{ln=V8;var We=$8}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&lx(de.elementType)&&(ln=BC):ln=B8;if(ln&&(ln=ln(o,de))){VC(be,ln,d,xe);break e}We&&We(o,he,de),o==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&ix(he,"number",he.value)}switch(We=de?Oa(de):window,o){case"focusin":($C(We)||We.contentEditable==="true")&&(Hc=We,Cx=de,Od=null);break;case"focusout":Od=Cx=Hc=null;break;case"mousedown":Ex=!0;break;case"contextmenu":case"mouseup":case"dragend":Ex=!1,JC(be,d,xe);break;case"selectionchange":if(K8)break;case"keydown":case"keyup":JC(be,d,xe)}var jt;if(xx)e:{switch(o){case"compositionstart":var $t="onCompositionStart";break e;case"compositionend":$t="onCompositionEnd";break e;case"compositionupdate":$t="onCompositionUpdate";break e}$t=void 0}else Fc?FC(o,d)&&($t="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&($t="onCompositionStart");$t&&(PC&&d.locale!=="ko"&&(Fc||$t!=="onCompositionStart"?$t==="onCompositionEnd"&&Fc&&(jt=OC()):(xi=xe,hx="value"in xi?xi.value:xi.textContent,Fc=!0)),We=qm(de,$t),0<We.length&&($t=new kC($t,o,null,d,xe),be.push({event:$t,listeners:We}),jt?$t.data=jt:(jt=HC(d),jt!==null&&($t.data=jt)))),(jt=P8?U8(o,d):z8(o,d))&&($t=qm(de,"onBeforeInput"),0<$t.length&&(We=new kC("onBeforeInput","beforeinput",null,d,xe),be.push({event:We,listeners:$t}),We.data=jt)),Ak(be,o,de,d,xe)}RR(be,l)})}function rf(o,l,d){return{instance:o,listener:l,currentTarget:d}}function qm(o,l){for(var d=l+"Capture",p=[];o!==null;){var b=o,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=wd(o,d),b!=null&&p.unshift(rf(o,b,w)),b=wd(o,l),b!=null&&p.push(rf(o,b,w))),o.tag===3)return p;o=o.return}return[]}function Mk(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function TR(o,l,d,p,b){for(var w=l._reactName,N=[];d!==null&&d!==p;){var L=d,Q=L.alternate,de=L.stateNode;if(L=L.tag,Q!==null&&Q===p)break;L!==5&&L!==26&&L!==27||de===null||(Q=de,b?(de=wd(d,w),de!=null&&N.unshift(rf(d,de,Q))):b||(de=wd(d,w),de!=null&&N.push(rf(d,de,Q)))),d=d.return}N.length!==0&&o.push({event:l,listeners:N})}var kk=/\r\n?/g,Lk=/\u0000|\uFFFD/g;function _R(o){return(typeof o=="string"?o:""+o).replace(kk,`
|
|
49
|
+
`).replace(Lk,"")}function NR(o,l){return l=_R(l),_R(o)===l}function Rn(o,l,d,p,b,w){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":rs(o,"class",p);break;case"tabIndex":rs(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":rs(o,d,p);break;case"style":NC(o,p,w);break;case"data":if(l!=="object"){rs(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=Qh(""+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 w=="function"&&(d==="formAction"?(l!=="input"&&Rn(o,l,"name",b.name,b,null),Rn(o,l,"formEncType",b.formEncType,b,null),Rn(o,l,"formMethod",b.formMethod,b,null),Rn(o,l,"formTarget",b.formTarget,b,null)):(Rn(o,l,"encType",b.encType,b,null),Rn(o,l,"method",b.method,b,null),Rn(o,l,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Qh(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=jo);break;case"onScroll":p!=null&&Ut("scroll",o);break;case"onScrollEnd":p!=null&&Ut("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=Qh(""+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":Ut("beforetoggle",o),Ut("toggle",o),Es(o,"popover",p);break;case"xlinkActuate":on(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":on(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":on(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":on(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":on(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":on(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":on(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":on(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":on(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Es(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=u8.get(d)||d,Es(o,d,p))}}function Zv(o,l,d,p,b,w){switch(d){case"style":NC(o,p,w);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&&Ut("scroll",o);break;case"onScrollEnd":p!=null&&Ut("scrollend",o);break;case"onClick":p!=null&&(o.onclick=jo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mc.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),l=d.slice(2,b?d.length-7:void 0),w=o[ze]||null,w=w!=null?w[d]:null,typeof w=="function"&&o.removeEventListener(l,w,b),typeof p=="function")){typeof w!="function"&&w!==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,""):Es(o,d,p)}}}function Lr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ut("error",o),Ut("load",o);var p=!1,b=!1,w;for(w in d)if(d.hasOwnProperty(w)){var N=d[w];if(N!=null)switch(w){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,w,N,d,null)}}b&&Rn(o,l,"srcSet",d.srcSet,d,null),p&&Rn(o,l,"src",d.src,d,null);return;case"input":Ut("invalid",o);var L=w=N=b=null,Q=null,de=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":de=xe;break;case"value":w=xe;break;case"defaultValue":L=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,l));break;default:Rn(o,l,p,xe,d,null)}}RC(o,w,L,Q,de,N,b,!1);return;case"select":Ut("invalid",o),p=N=w=null;for(b in d)if(d.hasOwnProperty(b)&&(L=d[b],L!=null))switch(b){case"value":w=L;break;case"defaultValue":N=L;break;case"multiple":p=L;default:Rn(o,l,b,L,d,null)}l=w,d=N,o.multiple=!!p,l!=null?Lc(o,!!p,l,!1):d!=null&&Lc(o,!!p,d,!0);return;case"textarea":Ut("invalid",o),w=b=p=null;for(N in d)if(d.hasOwnProperty(N)&&(L=d[N],L!=null))switch(N){case"value":p=L;break;case"defaultValue":b=L;break;case"children":w=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Rn(o,l,N,L,d,null)}TC(o,p,b,w);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:Rn(o,l,Q,p,d,null)}return;case"dialog":Ut("beforetoggle",o),Ut("toggle",o),Ut("cancel",o),Ut("close",o);break;case"iframe":case"object":Ut("load",o);break;case"video":case"audio":for(p=0;p<nf.length;p++)Ut(nf[p],o);break;case"image":Ut("error",o),Ut("load",o);break;case"details":Ut("toggle",o);break;case"embed":case"source":case"link":Ut("error",o),Ut("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(de in d)if(d.hasOwnProperty(de)&&(p=d[de],p!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,de,p,d,null)}return;default:if(lx(l)){for(xe in d)d.hasOwnProperty(xe)&&(p=d[xe],p!==void 0&&Zv(o,l,xe,p,d,void 0));return}}for(L in d)d.hasOwnProperty(L)&&(p=d[L],p!=null&&Rn(o,l,L,p,d,null))}function Pk(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,w=null,N=null,L=null,Q=null,de=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)||Rn(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":w=pe;break;case"name":b=pe;break;case"checked":de=pe;break;case"defaultChecked":xe=pe;break;case"value":N=pe;break;case"defaultValue":L=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:pe!==be&&Rn(o,l,he,pe,p,be)}}ox(o,N,L,Q,de,xe,w,b);return;case"select":pe=N=L=he=null;for(w in d)if(Q=d[w],d.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":pe=Q;default:p.hasOwnProperty(w)||Rn(o,l,w,null,p,Q)}for(b in p)if(w=p[b],Q=d[b],p.hasOwnProperty(b)&&(w!=null||Q!=null))switch(b){case"value":he=w;break;case"defaultValue":L=w;break;case"multiple":N=w;default:w!==Q&&Rn(o,l,b,w,p,Q)}l=L,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(L in d)if(b=d[L],d.hasOwnProperty(L)&&b!=null&&!p.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Rn(o,l,L,null,p,b)}for(N in p)if(b=p[N],w=d[N],p.hasOwnProperty(N)&&(b!=null||w!=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!==w&&Rn(o,l,N,b,p,w)}jC(o,he,pe);return;case"option":for(var qe in d)if(he=d[qe],d.hasOwnProperty(qe)&&he!=null&&!p.hasOwnProperty(qe))switch(qe){case"selected":o.selected=!1;break;default:Rn(o,l,qe,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:Rn(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 ot in d)he=d[ot],d.hasOwnProperty(ot)&&he!=null&&!p.hasOwnProperty(ot)&&Rn(o,l,ot,null,p,he);for(de in p)if(he=p[de],pe=d[de],p.hasOwnProperty(de)&&he!==pe&&(he!=null||pe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:Rn(o,l,de,he,p,pe)}return;default:if(lx(l)){for(var jn in d)he=d[jn],d.hasOwnProperty(jn)&&he!==void 0&&!p.hasOwnProperty(jn)&&Zv(o,l,jn,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||Zv(o,l,xe,he,p,pe);return}}for(var ie in d)he=d[ie],d.hasOwnProperty(ie)&&he!=null&&!p.hasOwnProperty(ie)&&Rn(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||Rn(o,l,be,he,p,pe)}function AR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Uk(){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],w=b.transferSize,N=b.initiatorType,L=b.duration;if(w&&L&&AR(N)){for(N=0,L=b.responseEnd,p+=1;p<d.length;p++){var Q=d[p],de=Q.startTime;if(de>L)break;var xe=Q.transferSize,be=Q.initiatorType;xe&&AR(be)&&(Q=Q.responseEnd,N+=xe*(Q<L?1:(L-de)/(Q-de)))}if(--p,l+=8*(w+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 Yv=null,Wv=null;function Km(o){return o.nodeType===9?o:o.ownerDocument}function DR(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 OR(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 Xv(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 Qv=null;function zk(){var o=window.event;return o&&o.type==="popstate"?o===Qv?!1:(Qv=o,!0):(Qv=null,!1)}var IR=typeof setTimeout=="function"?setTimeout:void 0,Fk=typeof clearTimeout=="function"?clearTimeout:void 0,MR=typeof Promise=="function"?Promise:void 0,Hk=typeof queueMicrotask=="function"?queueMicrotask:typeof MR<"u"?function(o){return MR.resolve(null).then(o).catch($k)}:IR;function $k(o){setTimeout(function(){throw o})}function ki(o){return o==="head"}function kR(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")af(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,af(d);for(var w=d.firstChild;w;){var N=w.nextSibling,L=w.nodeName;w[Ln]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=N}}else d==="body"&&af(o.ownerDocument.body);d=b}while(d);mu(l)}function LR(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 Jv(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":Jv(d),Zn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function Vk(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[Ln])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==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(w=o.getAttribute("src"),(w!==(b.src==null?null:b.src)||o.getAttribute("type")!==(b.type==null?null:b.type)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=ds(o.nextSibling),o===null)break}return null}function Bk(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=ds(o.nextSibling),o===null))return null;return o}function PR(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=ds(o.nextSibling),o===null))return null;return o}function e0(o){return o.data==="$?"||o.data==="$~"}function t0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function Gk(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 ds(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 n0=null;function UR(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return ds(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function zR(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 FR(o,l,d){switch(l=Km(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 af(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Zn(o)}var fs=new Map,HR=new Set;function Zm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var $o=$.d;$.d={f:qk,r:Kk,D:Zk,C:Yk,L:Wk,m:Xk,X:Jk,S:Qk,M:e9};function qk(){var o=$o.f(),l=zm();return o||l}function Kk(o){var l=sn(o);l!==null&&l.tag===5&&l.type==="form"?aw(l):$o.r(o)}var du=typeof document>"u"?null:document;function $R(o,l,d){var p=du;if(p&&typeof l=="string"&&l){var b=as(l);b='link[rel="'+o+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),HR.has(b)||(HR.add(b),o={rel:o,crossOrigin:d,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),Lr(l,"link",o),Nn(l),p.head.appendChild(l)))}}function Zk(o){$o.D(o),$R("dns-prefetch",o,null)}function Yk(o,l){$o.C(o,l),$R("preconnect",o,l)}function Wk(o,l,d){$o.L(o,l,d);var p=du;if(p&&o&&l){var b='link[rel="preload"][as="'+as(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+as(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+as(d.imageSizes)+'"]')):b+='[href="'+as(o)+'"]';var w=b;switch(l){case"style":w=fu(o);break;case"script":w=hu(o)}fs.has(w)||(o=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),fs.set(w,o),p.querySelector(b)!==null||l==="style"&&p.querySelector(sf(w))||l==="script"&&p.querySelector(of(w))||(l=p.createElement("link"),Lr(l,"link",o),Nn(l),p.head.appendChild(l)))}}function Xk(o,l){$o.m(o,l);var d=du;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+as(p)+'"][href="'+as(o)+'"]',w=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=hu(o)}if(!fs.has(w)&&(o=g({rel:"modulepreload",href:o},l),fs.set(w,o),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(of(w)))return}p=d.createElement("link"),Lr(p,"link",o),Nn(p),d.head.appendChild(p)}}}function Qk(o,l,d){$o.S(o,l,d);var p=du;if(p&&o){var b=ns(p).hoistableStyles,w=fu(o);l=l||"default";var N=b.get(w);if(!N){var L={loading:0,preload:null};if(N=p.querySelector(sf(w)))L.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},d),(d=fs.get(w))&&r0(o,d);var Q=N=p.createElement("link");Nn(Q),Lr(Q,"link",o),Q._p=new Promise(function(de,xe){Q.onload=de,Q.onerror=xe}),Q.addEventListener("load",function(){L.loading|=1}),Q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Ym(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:L},b.set(w,N)}}}function Jk(o,l){$o.X(o,l);var d=du;if(d&&o){var p=ns(d).hoistableScripts,b=hu(o),w=p.get(b);w||(w=d.querySelector(of(b)),w||(o=g({src:o,async:!0},l),(l=fs.get(b))&&a0(o,l),w=d.createElement("script"),Nn(w),Lr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function e9(o,l){$o.M(o,l);var d=du;if(d&&o){var p=ns(d).hoistableScripts,b=hu(o),w=p.get(b);w||(w=d.querySelector(of(b)),w||(o=g({src:o,async:!0,type:"module"},l),(l=fs.get(b))&&a0(o,l),w=d.createElement("script"),Nn(w),Lr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function VR(o,l,d,p){var b=(b=ae.current)?Zm(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=ns(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 w=ns(b).hoistableStyles,N=w.get(o);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,N),(w=b.querySelector(sf(o)))&&!w._p&&(N.instance=w,N.state.loading=5),fs.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},fs.set(o,d),w||t9(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=ns(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="'+as(o)+'"'}function sf(o){return'link[rel="stylesheet"]['+o+"]"}function BR(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function t9(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}),Lr(l,"link",d),Nn(l),o.head.appendChild(l))}function hu(o){return'[src="'+as(o)+'"]'}function of(o){return"script[async]"+o}function GR(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+as(d.href)+'"]');if(p)return l.instance=p,Nn(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"),Nn(p),Lr(p,"style",b),Ym(p,d.precedence,o),l.instance=p;case"stylesheet":b=fu(d.href);var w=o.querySelector(sf(b));if(w)return l.state.loading|=4,l.instance=w,Nn(w),w;p=BR(d),(b=fs.get(b))&&r0(p,b),w=(o.ownerDocument||o).createElement("link"),Nn(w);var N=w;return N._p=new Promise(function(L,Q){N.onload=L,N.onerror=Q}),Lr(w,"link",p),l.state.loading|=4,Ym(w,d.precedence,o),l.instance=w;case"script":return w=hu(d.src),(b=o.querySelector(of(w)))?(l.instance=b,Nn(b),b):(p=d,(b=fs.get(w))&&(p=g({},d),a0(p,b)),o=o.ownerDocument||o,b=o.createElement("script"),Nn(b),Lr(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,Ym(p,d.precedence,o));return l.instance}function Ym(o,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,w=b,N=0;N<p.length;N++){var L=p[N];if(L.dataset.precedence===l)w=L;else if(w!==b)break}w?w.parentNode.insertBefore(o,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(o,l.firstChild))}function r0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function a0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Wm=null;function qR(o,l,d){if(Wm===null){var p=new Map,b=Wm=new Map;b.set(d,p)}else b=Wm,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 w=d[b];if(!(w[Ln]||w[ke]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(l)||"";N=o+N;var L=p.get(N);L?L.push(w):p.set(N,[w])}}return p}function KR(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function n9(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 ZR(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function r9(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),w=l.querySelector(sf(b));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Xm.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=w,Nn(w);return}w=l.ownerDocument||l,p=BR(p),(b=fs.get(b))&&r0(p,b),w=w.createElement("link"),Nn(w);var N=w;N._p=new Promise(function(L,Q){N.onload=L,N.onerror=Q}),Lr(w,"link",p),d.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=Xm.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var s0=0;function a9(o,l){return o.stylesheets&&o.count===0&&Jm(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&Jm(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+l);0<o.imgBytes&&s0===0&&(s0=62500*Uk());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Jm(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>s0?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function Xm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Qm=null;function Jm(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Qm=new Map,l.forEach(s9,o),Qm=null,Xm.call(o))}function s9(o,l){if(!(l.state.loading&4)){var d=Qm.get(o);if(d)var p=d.get(null);else{d=new Map,Qm.set(o,d);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var N=b[w];(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"),w=d.get(N)||p,w===p&&d.set(null,b),d.set(N,b),this.count++,p=Xm.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),w?w.parentNode.insertBefore(b,w.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(b,o.firstChild)),l.state.loading|=4}}var lf={$$typeof:_,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function o9(o,l,d,p,b,w,N,L,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=Vn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vn(0),this.hiddenUpdates=Vn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function YR(o,l,d,p,b,w,N,L,Q,de,xe,be){return o=new o9(o,l,d,N,Q,de,xe,be,L),l=1,w===!0&&(l|=24),w=La(3,null,null,l),o.current=w,w.stateNode=o,l=Ux(),l.refCount++,o.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:d,cache:l},$x(w),o}function WR(o){return o?(o=Bc,o):Bc}function XR(o,l,d,p,b,w){b=WR(b),p.context===null?p.context=b:p.pendingContext=b,p=wi(l),p.payload={element:d},w=w===void 0?null:w,w!==null&&(p.callback=w),d=Ri(o,p,l),d!==null&&(ba(d,o,l),zd(d,o,l))}function QR(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function o0(o,l){QR(o,l),(o=o.alternate)&&QR(o,l)}function JR(o){if(o.tag===13||o.tag===31){var l=Pl(o,67108864);l!==null&&ba(l,o,67108864),o0(o,67108864)}}function ej(o){if(o.tag===13||o.tag===31){var l=Ha();l=fe(l);var d=Pl(o,l);d!==null&&ba(d,o,l),o0(o,l)}}var ep=!0;function i9(o,l,d,p){var b=M.T;M.T=null;var w=$.p;try{$.p=2,i0(o,l,d,p)}finally{$.p=w,M.T=b}}function l9(o,l,d,p){var b=M.T;M.T=null;var w=$.p;try{$.p=8,i0(o,l,d,p)}finally{$.p=w,M.T=b}}function i0(o,l,d,p){if(ep){var b=l0(p);if(b===null)Kv(o,l,p,tp,d),nj(o,p);else if(u9(b,o,l,d,p))p.stopPropagation();else if(nj(o,p),l&4&&-1<c9.indexOf(o)){for(;b!==null;){var w=sn(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=In(w.pendingLanes);if(N!==0){var L=w;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var Q=1<<31-kn(N);L.entanglements[1]|=Q,N&=~Q}Js(w),(mn&6)===0&&(Pm=we()+500,tf(0))}}break;case 31:case 13:L=Pl(w,2),L!==null&&ba(L,w,2),zm(),o0(w,2)}if(w=l0(p),w===null&&Kv(o,l,p,tp,d),w===b)break;b=w}b!==null&&p.stopPropagation()}else Kv(o,l,p,null,d)}}function l0(o){return o=ux(o),c0(o)}var tp=null;function c0(o){if(tp=null,o=an(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 tp=o,null}function tj(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(je()){case He:return 2;case mt:return 8;case st:case Wt:return 32;case sr:return 268435456;default:return 32}default:return 32}}var u0=!1,Li=null,Pi=null,Ui=null,cf=new Map,uf=new Map,zi=[],c9="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 nj(o,l){switch(o){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Pi=null;break;case"mouseover":case"mouseout":Ui=null;break;case"pointerover":case"pointerout":cf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":uf.delete(l.pointerId)}}function df(o,l,d,p,b,w){return o===null||o.nativeEvent!==w?(o={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:w,targetContainers:[b]},l!==null&&(l=sn(l),l!==null&&JR(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function u9(o,l,d,p,b){switch(l){case"focusin":return Li=df(Li,o,l,d,p,b),!0;case"dragenter":return Pi=df(Pi,o,l,d,p,b),!0;case"mouseover":return Ui=df(Ui,o,l,d,p,b),!0;case"pointerover":var w=b.pointerId;return cf.set(w,df(cf.get(w)||null,o,l,d,p,b)),!0;case"gotpointercapture":return w=b.pointerId,uf.set(w,df(uf.get(w)||null,o,l,d,p,b)),!0}return!1}function rj(o){var l=an(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,Ge(o.priority,function(){ej(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,Ge(o.priority,function(){ej(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 np(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=l0(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);cx=p,d.target.dispatchEvent(p),cx=null}else return l=sn(d),l!==null&&JR(l),o.blockedOn=d,!1;l.shift()}return!0}function aj(o,l,d){np(o)&&d.delete(l)}function d9(){u0=!1,Li!==null&&np(Li)&&(Li=null),Pi!==null&&np(Pi)&&(Pi=null),Ui!==null&&np(Ui)&&(Ui=null),cf.forEach(aj),uf.forEach(aj)}function rp(o,l){o.blockedOn===l&&(o.blockedOn=null,u0||(u0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,d9)))}var ap=null;function sj(o){ap!==o&&(ap=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ap===o&&(ap=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(c0(p||d)===null)continue;break}var w=sn(d);w!==null&&(o.splice(l,3),l-=3,lv(w,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function mu(o){function l(Q){return rp(Q,o)}Li!==null&&rp(Li,o),Pi!==null&&rp(Pi,o),Ui!==null&&rp(Ui,o),cf.forEach(l),uf.forEach(l);for(var d=0;d<zi.length;d++){var p=zi[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<zi.length&&(d=zi[0],d.blockedOn===null);)rj(d),d.blockedOn===null&&zi.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],w=d[p+1],N=b[ze]||null;if(typeof w=="function")N||sj(d);else if(N){var L=null;if(w&&w.hasAttribute("formAction")){if(b=w,N=w[ze]||null)L=N.formAction;else if(c0(b)!==null)continue}else L=N.action;typeof L=="function"?d[p+1]=L:(d.splice(p,3),p-=3),sj(d)}}}function oj(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.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 w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.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 d0(o){this._internalRoot=o}sp.prototype.render=d0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Ha();XR(d,p,o,l,null,null)},sp.prototype.unmount=d0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;XR(o.current,2,null,o,null,null),zm(),l[Xe]=null}};function sp(o){this._internalRoot=o}sp.prototype.unstable_scheduleHydration=function(o){if(o){var l=_e();o={blockedOn:null,target:o,priority:l};for(var d=0;d<zi.length&&l!==0&&l<zi[d].priority;d++);zi.splice(d,0,o),d===0&&rj(o)}};var ij=t.version;if(ij!=="19.2.1")throw Error(r(527,ij,"19.2.1"));$.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=m(l),o=o!==null?y(o):null,o=o===null?null:o.stateNode,o};var f9={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var op=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!op.isDisabled&&op.supportsFiber)try{Jr=op.inject(f9),fn=op}catch{}}return hf.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",b=mw,w=pw,N=gw;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&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=YR(o,1,!1,null,null,d,p,null,b,w,N,oj),o[Xe]=l.current,qv(o),new d0(l)},hf.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,b="",w=mw,N=pw,L=gw,Q=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(N=d.onCaughtError),d.onRecoverableError!==void 0&&(L=d.onRecoverableError),d.formState!==void 0&&(Q=d.formState)),l=YR(o,1,!0,l,d??null,p,b,Q,w,N,L,oj),l.context=WR(null),d=l.current,p=Ha(),p=fe(p),b=wi(p),b.callback=null,Ri(d,b,p),d=p,l.current.lanes=d,Jt(l,d),Js(l),o[Xe]=l.current,qv(o),new sp(l)},hf.version="19.2.1",hf}var yj;function w9(){if(yj)return m0.exports;yj=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(),m0.exports=E9(),m0.exports}var R9=w9();/**
|
|
50
|
+
* react-router v7.10.1
|
|
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 VN=e=>{throw TypeError(e)},j9=(e,t,n)=>t.has(e)||VN("Cannot "+n),x0=(e,t,n)=>(j9(e,t,"read from private field"),n?n.call(e):t.get(e)),T9=(e,t,n)=>t.has(e)?VN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xj="popstate";function _9(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return Bf("",{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:xo(s)}return A9(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 N9(){return Math.random().toString(36).substring(2,10)}function vj(e,t){return{usr:e.state,key:e.key,idx:t}}function Bf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?gl(t):t,state:n,key:t&&t.key||r||N9()}}function xo({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 gl(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 A9(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,m=y();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function y(){return(c.state||{idx:null}).idx}function g(){u="POP";let E=y(),R=E==null?null:E-m;m=E,f&&f({action:u,location:S.location,delta:R})}function x(E,R){u="PUSH";let j=Bf(S.location,E,R);m=y()+1;let _=vj(j,m),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(E,R){u="REPLACE";let j=Bf(S.location,E,R);m=y();let _=vj(j,m),I=S.createHref(j);c.replaceState(_,"",I),i&&f&&f({action:u,location:S.location,delta:0})}function C(E){return BN(E)}let S={get action(){return u},get location(){return e(s,c)},listen(E){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(xj,g),f=E,()=>{s.removeEventListener(xj,g),f=null}},createHref(E){return t(s,E)},createURL:C,encodeLocation(E){let R=C(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:v,go(E){return c.go(E)}};return S}function BN(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:xo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Tf,bj=class{constructor(e){if(T9(this,Tf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(x0(this,Tf).has(e))return x0(this,Tf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){x0(this,Tf).set(e,t)}};Tf=new WeakMap;var D9=new Set(["lazy","caseSensitive","path","id","index","children"]);function O9(e){return D9.has(e)}var I9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function M9(e){return I9.has(e)}function k9(e){return e.index===!0}function Gf(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`),k9(i)){let m={...i,id:f};return r[f]=Sj(m,t(m)),m}else{let m={...i,id:f,children:void 0};return r[f]=Sj(m,t(m)),i.children&&(m.children=Gf(i.children,t,u,r,s)),m}})}function Sj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ki(e,t,n="/"){return _f(e,t,n,!1)}function _f(e,t,n,r){let s=typeof t=="string"?gl(t):t,i=gs(s.pathname||"/",n);if(i==null)return null;let c=GN(e);P9(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=Z9(i);u=q9(c[f],m,r)}return u}function L9(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 GN(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,m)=>{let y={relativePath:m===void 0?c.path||"":m,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=uo([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}".`),GN(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:B9(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 m of qN(c.path))i(c,u,!0,m)}),t}function qN(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=qN(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 P9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:G9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var U9=/^:[\w-]+$/,z9=3,F9=2,H9=1,$9=10,V9=-2,Cj=e=>e==="*";function B9(e,t){let n=e.split("/"),r=n.length;return n.some(Cj)&&(r+=V9),t&&(r+=F9),n.filter(s=>!Cj(s)).reduce((s,i)=>s+(U9.test(i)?z9:i===""?H9:$9),r)}function G9(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 q9(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],m=u===r.length-1,y=i==="/"?t:t.slice(i.length)||"/",g=Qp({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},y),x=f.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=Qp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},y)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:uo([i,g.pathname]),pathnameBase:Q9(uo([i,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(i=uo([i,g.pathnameBase]))}return c}function Qp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=K9(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((m,{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?m[y]=void 0:m[y]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:i,pathnameBase:c,pattern:e}}function K9(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 Z9(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 gs(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 Y9({basename:e,pathname:t}){return t==="/"?e:uo([e,t])}var W9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bg=e=>W9.test(e);function X9(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?gl(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=Ej(n.substring(1),"/"):i=Ej(n,t)}else i=t;return{pathname:i,search:J9(r),hash:e7(s)}}function Ej(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 v0(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 KN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Gg(e){let t=KN(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=gl(e):(s={...e},Lt(!s.pathname||!s.pathname.includes("?"),v0("?","pathname","search",s)),Lt(!s.pathname||!s.pathname.includes("#"),v0("#","pathname","hash",s)),Lt(!s.search||!s.search.includes("#"),v0("#","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=X9(s,u),m=c&&c!=="/"&&c.endsWith("/"),y=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||y)&&(f.pathname+="/"),f}var uo=e=>e.join("/").replace(/\/\/+/g,"/"),Q9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),J9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,e7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Kg=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 qf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function dh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Qi=Symbol("Uninstrumented");function t7(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[Qi]??i,u=Ou(n[s],c,(...f)=>wj(f[0]));u&&(u[Qi]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[Qi]??s,c=Ou(n.middleware,i,(...u)=>wj(u[0]));return c?(c[Qi]=i,c):s})),r}function n7(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[Qi]??e.navigate,s=Ou(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?xo(c):".",...Rj(e,u??{})}});s&&(s[Qi]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[Qi]??e.fetch,s=Ou(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...Rj(e,f??{})}});s&&(s[Qi]=r,e.fetch=s)}return e}function Ou(e,t,n){return e.length===0?null:async(...r)=>{let s=await ZN(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function ZN(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=ZN(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:r7(t),params:{...r},unstable_pattern:s,context:a7(n)}}function Rj(e,t){return{currentUrl:xo(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 r7(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function a7(e){if(o7(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var s7=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function o7(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")===s7}var YN=["POST","PUT","PATCH","DELETE"],i7=new Set(YN),l7=["GET",...YN],c7=new Set(l7),u7=new Set([301,302,303,307,308]),d7=new Set([307,308]),b0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},f7={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},h7=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),WN="remix-router-transitions",XN=Symbol("ResetLoaderData");function m7(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||h7,i=s;if(e.unstable_instrumentations){let K=e.unstable_instrumentations;i=ee=>({...s(ee),...t7(K.map(fe=>fe.route).filter(Boolean),ee)})}let c={},u=Gf(e.routes,i,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let y=e.dataStrategy||v7,g={...e.future},x=null,v=new Set,C=null,S=null,E=null,R=e.hydrationData!=null,j=Ki(u,e.history.location,m),_=!1,I=null,A;if(j==null&&!e.patchRoutesOnNavigation){let K=hs(404,{pathname:e.history.location.pathname}),{matches:ee,route:fe}=ip(u);A=!0,j=ee,I={[fe.id]:K}}else if(j&&!e.hydrationData&&Gt(j,u,e.history.location.pathname).active&&(j=null),j)if(j.some(K=>K.route.lazy))A=!1;else if(!j.some(K=>Fb(K.route)))A=!0;else{let K=e.hydrationData?e.hydrationData.loaderData:null,ee=e.hydrationData?e.hydrationData.errors:null;if(ee){let fe=j.findIndex(Se=>ee[Se.route.id]!==void 0);A=j.slice(0,fe+1).every(Se=>!R1(Se.route,K,ee))}else A=j.every(fe=>!R1(fe.route,K,ee))}else{A=!1,j=[];let K=Gt(null,u,e.history.location.pathname);K.active&&K.matches&&(_=!0,j=K.matches)}let O,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:A,navigation:b0,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",k=null,B=!1,G,Y=!1,V=new Map,Z=null,F=!1,M=!1,$=new Set,H=new Map,oe=0,ge=-1,P=new Map,U=new Set,z=new Map,X=new Map,W=new Set,ae=new Map,J,le=null;function ye(){if(x=e.history.listen(({action:K,location:ee,delta:fe})=>{if(J){J(),J=void 0;return}Kn(ae.size===0||fe!=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 Se=Cs({currentLocation:T.location,nextLocation:ee,historyAction:K});if(Se&&fe!=null){let _e=new Promise(Ge=>{J=Ge});e.history.go(fe*-1),Da(Se,{state:"blocked",location:ee,proceed(){Da(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),_e.then(()=>e.history.go(fe))},reset(){let Ge=new Map(T.blockers);Ge.set(Se,mf),De({blockers:Ge})}}),k==null||k.resolve(),k=null;return}return zt(K,ee)}),n){k7(t,V);let K=()=>L7(t,V);t.addEventListener("pagehide",K),Z=()=>t.removeEventListener("pagehide",K)}return T.initialized||zt("POP",T.location,{initialHydration:!0}),O}function Ce(){x&&x(),Z&&Z(),v.clear(),G&&G.abort(),T.fetchers.forEach((K,ee)=>Dr(ee)),T.blockers.forEach((K,ee)=>ea(ee))}function Ve(K){return v.add(K),()=>v.delete(K)}function De(K,ee={}){K.matches&&(K.matches=K.matches.map(_e=>{let Ge=c[_e.route.id],Fe=_e.route;return Fe.element!==Ge.element||Fe.errorElement!==Ge.errorElement||Fe.hydrateFallbackElement!==Ge.hydrateFallbackElement?{..._e,route:Ge}:_e})),T={...T,...K};let fe=[],Se=[];T.fetchers.forEach((_e,Ge)=>{_e.state==="idle"&&(W.has(Ge)?fe.push(Ge):Se.push(Ge))}),W.forEach(_e=>{!T.fetchers.has(_e)&&!H.has(_e)&&fe.push(_e)}),[...v].forEach(_e=>_e(T,{deletedFetchers:fe,newErrors:K.errors??null,viewTransitionOpts:ee.viewTransitionOpts,flushSync:ee.flushSync===!0})),fe.forEach(_e=>Dr(_e)),Se.forEach(_e=>T.fetchers.delete(_e))}function et(K,ee,{flushSync:fe}={}){var at,tt;let Se=T.actionData!=null&&T.navigation.formMethod!=null&&ra(T.navigation.formMethod)&&T.navigation.state==="loading"&&((at=K.state)==null?void 0:at._isRedirect)!==!0,_e;ee.actionData?Object.keys(ee.actionData).length>0?_e=ee.actionData:_e=null:Se?_e=T.actionData:_e=null;let Ge=ee.loaderData?kj(T.loaderData,ee.loaderData,ee.matches||[],ee.errors):T.loaderData,Fe=T.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((pt,hn)=>Fe.set(hn,mf)));let ke=F?!1:Xt(K,ee.matches||T.matches),ze=B===!0||T.navigation.formMethod!=null&&ra(T.navigation.formMethod)&&((tt=K.state)==null?void 0:tt._isRedirect)!==!0;f&&(u=f,f=void 0),F||D==="POP"||(D==="PUSH"?e.history.push(K,K.state):D==="REPLACE"&&e.history.replace(K,K.state));let Xe;if(D==="POP"){let pt=V.get(T.location.pathname);pt&&pt.has(K.pathname)?Xe={currentLocation:T.location,nextLocation:K}:V.has(K.pathname)&&(Xe={currentLocation:K,nextLocation:T.location})}else if(Y){let pt=V.get(T.location.pathname);pt?pt.add(K.pathname):(pt=new Set([K.pathname]),V.set(T.location.pathname,pt)),Xe={currentLocation:T.location,nextLocation:K}}De({...ee,actionData:_e,loaderData:Ge,historyAction:D,location:K,initialized:!0,navigation:b0,revalidation:"idle",restoreScrollPosition:ke,preventScrollReset:ze,blockers:Fe},{viewTransitionOpts:Xe,flushSync:fe===!0}),D="POP",B=!1,Y=!1,F=!1,M=!1,k==null||k.resolve(),k=null,le==null||le.resolve(),le=null}async function rt(K,ee){if(k==null||k.resolve(),k=null,typeof K=="number"){k||(k=zj());let hn=k.promise;return e.history.go(K),hn}let fe=w1(T.location,T.matches,m,K,ee==null?void 0:ee.fromRouteId,ee==null?void 0:ee.relative),{path:Se,submission:_e,error:Ge}=jj(!1,fe,ee),Fe=T.location,ke=Bf(T.location,Se,ee&&ee.state);ke={...ke,...e.history.encodeLocation(ke)};let ze=ee&&ee.replace!=null?ee.replace:void 0,Xe="PUSH";ze===!0?Xe="REPLACE":ze===!1||_e!=null&&ra(_e.formMethod)&&_e.formAction===T.location.pathname+T.location.search&&(Xe="REPLACE");let at=ee&&"preventScrollReset"in ee?ee.preventScrollReset===!0:void 0,tt=(ee&&ee.flushSync)===!0,pt=Cs({currentLocation:Fe,nextLocation:ke,historyAction:Xe});if(pt){Da(pt,{state:"blocked",location:ke,proceed(){Da(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),rt(K,ee)},reset(){let hn=new Map(T.blockers);hn.set(pt,mf),De({blockers:hn})}});return}await zt(Xe,ke,{submission:_e,pendingError:Ge,preventScrollReset:at,replace:ee&&ee.replace,enableViewTransition:ee&&ee.viewTransition,flushSync:tt})}function dn(){le||(le=zj()),mt(),De({revalidation:"loading"});let K=le.promise;return T.navigation.state==="submitting"?K:T.navigation.state==="idle"?(zt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),K):(zt(D||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:Y===!0}),K)}async function zt(K,ee,fe){G&&G.abort(),G=null,D=K,F=(fe&&fe.startUninterruptedRevalidation)===!0,Bt(T.location,T.matches),B=(fe&&fe.preventScrollReset)===!0,Y=(fe&&fe.enableViewTransition)===!0;let Se=f||u,_e=fe&&fe.overrideNavigation,Ge=fe!=null&&fe.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Ki(Se,ee,m),Fe=(fe&&fe.flushSync)===!0;if(Ge&&T.initialized&&!M&&T7(T.location,ee)&&!(fe&&fe.submission&&ra(fe.submission.formMethod))){et(ee,{matches:Ge},{flushSync:Fe});return}let ke=Gt(Ge,Se,ee.pathname);if(ke.active&&ke.matches&&(Ge=ke.matches),!Ge){let{error:Zn,notFoundMatches:an,route:sn}=En(ee.pathname);et(ee,{matches:an,loaderData:{},errors:{[sn.id]:Zn}},{flushSync:Fe});return}G=new AbortController;let ze=wu(e.history,ee,G.signal,fe&&fe.submission),Xe=e.getContext?await e.getContext():new bj,at;if(fe&&fe.pendingError)at=[Zi(Ge).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&ra(fe.submission.formMethod)){let Zn=await On(ze,ee,fe.submission,Ge,Xe,ke.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:Fe});if(Zn.shortCircuited)return;if(Zn.pendingActionResult){let[an,sn]=Zn.pendingActionResult;if(Va(sn)&&qf(sn.error)&&sn.error.status===404){G=null,et(ee,{matches:Zn.matches,loaderData:{},errors:{[an]:sn.error}});return}}Ge=Zn.matches||Ge,at=Zn.pendingActionResult,_e=S0(ee,fe.submission),Fe=!1,ke.active=!1,ze=wu(e.history,ze.url,ze.signal)}let{shortCircuited:tt,matches:pt,loaderData:hn,errors:Ln}=await yn(ze,ee,Ge,Xe,ke.active,_e,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,Fe,at);tt||(G=null,et(ee,{matches:pt||Ge,...Lj(at),loaderData:hn,errors:Ln}))}async function On(K,ee,fe,Se,_e,Ge,Fe,ke={}){mt();let ze=I7(ee,fe);if(De({navigation:ze},{flushSync:ke.flushSync===!0}),Ge){let tt=await Vn(Se,ee.pathname,K.signal);if(tt.type==="aborted")return{shortCircuited:!0};if(tt.type==="error"){if(tt.partialMatches.length===0){let{matches:hn,route:Ln}=ip(u);return{matches:hn,pendingActionResult:[Ln.id,{type:"error",error:tt.error}]}}let pt=Zi(tt.partialMatches).route.id;return{matches:tt.partialMatches,pendingActionResult:[pt,{type:"error",error:tt.error}]}}else if(tt.matches)Se=tt.matches;else{let{notFoundMatches:pt,error:hn,route:Ln}=En(ee.pathname);return{matches:pt,pendingActionResult:[Ln.id,{type:"error",error:hn}]}}}let Xe,at=Up(Se,ee);if(!at.route.action&&!at.route.lazy)Xe={type:"error",error:hs(405,{method:K.method,pathname:ee.pathname,routeId:at.route.id})};else{let tt=ku(i,c,K,Se,at,Fe?[]:r,_e),pt=await je(K,tt,_e,null);if(Xe=pt[at.route.id],!Xe){for(let hn of Se)if(pt[hn.route.id]){Xe=pt[hn.route.id];break}}if(K.signal.aborted)return{shortCircuited:!0}}if(tc(Xe)){let tt;return ke&&ke.replace!=null?tt=ke.replace:tt=Oj(Xe.response.headers.get("Location"),new URL(K.url),m)===T.location.pathname+T.location.search,await we(K,Xe,!0,{submission:fe,replace:tt}),{shortCircuited:!0}}if(Va(Xe)){let tt=Zi(Se,at.route.id);return(ke&&ke.replace)!==!0&&(D="PUSH"),{matches:Se,pendingActionResult:[tt.route.id,Xe,at.route.id]}}return{matches:Se,pendingActionResult:[at.route.id,Xe]}}async function yn(K,ee,fe,Se,_e,Ge,Fe,ke,ze,Xe,at,tt){let pt=Ge||S0(ee,Fe),hn=Fe||ke||Uj(pt),Ln=!F&&!Xe;if(_e){if(Ln){let Er=Me(tt);De({navigation:pt,...Er!==void 0?{actionData:Er}:{}},{flushSync:at})}let Ft=await Vn(fe,ee.pathname,K.signal);if(Ft.type==="aborted")return{shortCircuited:!0};if(Ft.type==="error"){if(Ft.partialMatches.length===0){let{matches:Es,route:rs}=ip(u);return{matches:Es,loaderData:{},errors:{[rs.id]:Ft.error}}}let Er=Zi(Ft.partialMatches).route.id;return{matches:Ft.partialMatches,loaderData:{},errors:{[Er]:Ft.error}}}else if(Ft.matches)fe=Ft.matches;else{let{error:Er,notFoundMatches:Es,route:rs}=En(ee.pathname);return{matches:Es,loaderData:{},errors:{[rs.id]:Er}}}}let Zn=f||u,{dsMatches:an,revalidatingFetchers:sn}=Tj(K,Se,i,c,e.history,T,fe,hn,ee,Xe?[]:r,Xe===!0,M,$,W,z,U,Zn,m,e.patchRoutesOnNavigation!=null,tt);if(ge=++oe,!e.dataStrategy&&!an.some(Ft=>Ft.shouldLoad)&&!an.some(Ft=>Ft.route.middleware&&Ft.route.middleware.length>0)&&sn.length===0){let Ft=kn();return et(ee,{matches:fe,loaderData:{},errors:tt&&Va(tt[1])?{[tt[0]]:tt[1].error}:null,...Lj(tt),...Ft?{fetchers:new Map(T.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(Ln){let Ft={};if(!_e){Ft.navigation=pt;let Er=Me(tt);Er!==void 0&&(Ft.actionData=Er)}sn.length>0&&(Ft.fetchers=q(sn)),De(Ft,{flushSync:at})}sn.forEach(Ft=>{fn(Ft.key),Ft.controller&&H.set(Ft.key,Ft.controller)});let Oa=()=>sn.forEach(Ft=>fn(Ft.key));G&&G.signal.addEventListener("abort",Oa);let{loaderResults:ns,fetcherResults:Nn}=await He(an,sn,K,Se);if(K.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Oa),sn.forEach(Ft=>H.delete(Ft.key));let Ia=lp(ns);if(Ia)return await we(K,Ia.result,!0,{replace:ze}),{shortCircuited:!0};if(Ia=lp(Nn),Ia)return U.add(Ia.key),await we(K,Ia.result,!0,{replace:ze}),{shortCircuited:!0};let{loaderData:Mc,errors:Ma}=Mj(T,fe,ns,tt,sn,Nn);Xe&&T.errors&&(Ma={...T.errors,...Ma});let ma=kn(),kc=Ys(ge),Il=ma||kc||sn.length>0;return{matches:fe,loaderData:Mc,errors:Ma,...Il?{fetchers:new Map(T.fetchers)}:{}}}function Me(K){if(K&&!Va(K[1]))return{[K[0]]:K[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function q(K){return K.forEach(ee=>{let fe=T.fetchers.get(ee.key),Se=pf(void 0,fe?fe.data:void 0);T.fetchers.set(ee.key,Se)}),new Map(T.fetchers)}async function ne(K,ee,fe,Se){fn(K);let _e=(Se&&Se.flushSync)===!0,Ge=f||u,Fe=w1(T.location,T.matches,m,fe,ee,Se==null?void 0:Se.relative),ke=Ki(Ge,Fe,m),ze=Gt(ke,Ge,Fe);if(ze.active&&ze.matches&&(ke=ze.matches),!ke){Wt(K,ee,hs(404,{pathname:Fe}),{flushSync:_e});return}let{path:Xe,submission:at,error:tt}=jj(!0,Fe,Se);if(tt){Wt(K,ee,tt,{flushSync:_e});return}let pt=e.getContext?await e.getContext():new bj,hn=(Se&&Se.preventScrollReset)===!0;if(at&&ra(at.formMethod)){await ce(K,ee,Xe,ke,pt,ze.active,_e,hn,at);return}z.set(K,{routeId:ee,path:Xe}),await Oe(K,ee,Xe,ke,pt,ze.active,_e,hn,at)}async function ce(K,ee,fe,Se,_e,Ge,Fe,ke,ze){mt(),z.delete(K);let Xe=T.fetchers.get(K);st(K,M7(ze,Xe),{flushSync:Fe});let at=new AbortController,tt=wu(e.history,fe,at.signal,ze);if(Ge){let on=await Vn(Se,new URL(tt.url).pathname,tt.signal,K);if(on.type==="aborted")return;if(on.type==="error"){Wt(K,ee,on.error,{flushSync:Fe});return}else if(on.matches)Se=on.matches;else{Wt(K,ee,hs(404,{pathname:fe}),{flushSync:Fe});return}}let pt=Up(Se,fe);if(!pt.route.action&&!pt.route.lazy){let on=hs(405,{method:ze.formMethod,pathname:fe,routeId:ee});Wt(K,ee,on,{flushSync:Fe});return}H.set(K,at);let hn=oe,Ln=ku(i,c,tt,Se,pt,r,_e),Zn=await je(tt,Ln,_e,K),an=Zn[pt.route.id];if(!an){for(let on of Ln)if(Zn[on.route.id]){an=Zn[on.route.id];break}}if(tt.signal.aborted){H.get(K)===at&&H.delete(K);return}if(W.has(K)){if(tc(an)||Va(an)){st(K,qo(void 0));return}}else{if(tc(an))if(H.delete(K),ge>hn){st(K,qo(void 0));return}else return U.add(K),st(K,pf(ze)),we(tt,an,!1,{fetcherSubmission:ze,preventScrollReset:ke});if(Va(an)){Wt(K,ee,an.error);return}}let sn=T.navigation.location||T.location,Oa=wu(e.history,sn,at.signal),ns=f||u,Nn=T.navigation.state!=="idle"?Ki(ns,T.navigation.location,m):T.matches;Lt(Nn,"Didn't find any matches after fetcher action");let Ia=++oe;P.set(K,Ia);let Mc=pf(ze,an.data);T.fetchers.set(K,Mc);let{dsMatches:Ma,revalidatingFetchers:ma}=Tj(Oa,_e,i,c,e.history,T,Nn,ze,sn,r,!1,M,$,W,z,U,ns,m,e.patchRoutesOnNavigation!=null,[pt.route.id,an]);ma.filter(on=>on.key!==K).forEach(on=>{let Or=on.key,Ed=T.fetchers.get(Or),ax=pf(void 0,Ed?Ed.data:void 0);T.fetchers.set(Or,ax),fn(Or),on.controller&&H.set(Or,on.controller)}),De({fetchers:new Map(T.fetchers)});let kc=()=>ma.forEach(on=>fn(on.key));at.signal.addEventListener("abort",kc);let{loaderResults:Il,fetcherResults:Ft}=await He(Ma,ma,Oa,_e);if(at.signal.aborted)return;if(at.signal.removeEventListener("abort",kc),P.delete(K),H.delete(K),ma.forEach(on=>H.delete(on.key)),T.fetchers.has(K)){let on=qo(an.data);T.fetchers.set(K,on)}let Er=lp(Il);if(Er)return we(Oa,Er.result,!1,{preventScrollReset:ke});if(Er=lp(Ft),Er)return U.add(Er.key),we(Oa,Er.result,!1,{preventScrollReset:ke});let{loaderData:Es,errors:rs}=Mj(T,Nn,Il,void 0,ma,Ft);Ys(Ia),T.navigation.state==="loading"&&Ia>ge?(Lt(D,"Expected pending action"),G&&G.abort(),et(T.navigation.location,{matches:Nn,loaderData:Es,errors:rs,fetchers:new Map(T.fetchers)})):(De({errors:rs,loaderData:kj(T.loaderData,Es,Nn,rs),fetchers:new Map(T.fetchers)}),M=!1)}async function Oe(K,ee,fe,Se,_e,Ge,Fe,ke,ze){let Xe=T.fetchers.get(K);st(K,pf(ze,Xe?Xe.data:void 0),{flushSync:Fe});let at=new AbortController,tt=wu(e.history,fe,at.signal);if(Ge){let sn=await Vn(Se,new URL(tt.url).pathname,tt.signal,K);if(sn.type==="aborted")return;if(sn.type==="error"){Wt(K,ee,sn.error,{flushSync:Fe});return}else if(sn.matches)Se=sn.matches;else{Wt(K,ee,hs(404,{pathname:fe}),{flushSync:Fe});return}}let pt=Up(Se,fe);H.set(K,at);let hn=oe,Ln=ku(i,c,tt,Se,pt,r,_e),an=(await je(tt,Ln,_e,K))[pt.route.id];if(H.get(K)===at&&H.delete(K),!tt.signal.aborted){if(W.has(K)){st(K,qo(void 0));return}if(tc(an))if(ge>hn){st(K,qo(void 0));return}else{U.add(K),await we(tt,an,!1,{preventScrollReset:ke});return}if(Va(an)){Wt(K,ee,an.error);return}st(K,qo(an.data))}}async function we(K,ee,fe,{submission:Se,fetcherSubmission:_e,preventScrollReset:Ge,replace:Fe}={}){fe||(k==null||k.resolve(),k=null),ee.response.headers.has("X-Remix-Revalidate")&&(M=!0);let ke=ee.response.headers.get("Location");Lt(ke,"Expected a Location header on the redirect Response"),ke=Oj(ke,new URL(K.url),m);let ze=Bf(T.location,ke,{_isRedirect:!0});if(n){let Ln=!1;if(ee.response.headers.has("X-Remix-Reload-Document"))Ln=!0;else if(Bg(ke)){const Zn=BN(ke,!0);Ln=Zn.origin!==t.location.origin||gs(Zn.pathname,m)==null}if(Ln){Fe?t.location.replace(ke):t.location.assign(ke);return}}G=null;let Xe=Fe===!0||ee.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:tt,formEncType:pt}=T.navigation;!Se&&!_e&&at&&tt&&pt&&(Se=Uj(T.navigation));let hn=Se||_e;if(d7.has(ee.response.status)&&hn&&ra(hn.formMethod))await zt(Xe,ze,{submission:{...hn,formAction:ke},preventScrollReset:Ge||B,enableViewTransition:fe?Y:void 0});else{let Ln=S0(ze,Se);await zt(Xe,ze,{overrideNavigation:Ln,fetcherSubmission:_e,preventScrollReset:Ge||B,enableViewTransition:fe?Y:void 0})}}async function je(K,ee,fe,Se){let _e,Ge={};try{_e=await S7(y,K,ee,Se,fe,!1)}catch(Fe){return ee.filter(ke=>ke.shouldLoad).forEach(ke=>{Ge[ke.route.id]={type:"error",error:Fe}}),Ge}if(K.signal.aborted)return Ge;for(let[Fe,ke]of Object.entries(_e))if(D7(ke)){let ze=ke.result;Ge[Fe]={type:"redirect",response:R7(ze,K,Fe,ee,m)}}else Ge[Fe]=await w7(ke);return Ge}async function He(K,ee,fe,Se){let _e=je(fe,K,Se,null),Ge=Promise.all(ee.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let at=(await je(ze.request,ze.matches,Se,ze.key))[ze.match.route.id];return{[ze.key]:at}}else return Promise.resolve({[ze.key]:{type:"error",error:hs(404,{pathname:ze.path})}})})),Fe=await _e,ke=(await Ge).reduce((ze,Xe)=>Object.assign(ze,Xe),{});return{loaderResults:Fe,fetcherResults:ke}}function mt(){M=!0,z.forEach((K,ee)=>{H.has(ee)&&$.add(ee),fn(ee)})}function st(K,ee,fe={}){T.fetchers.set(K,ee),De({fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function Wt(K,ee,fe,Se={}){let _e=Zi(T.matches,ee);Dr(K),De({errors:{[_e.route.id]:fe},fetchers:new Map(T.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function sr(K){return X.set(K,(X.get(K)||0)+1),W.has(K)&&W.delete(K),T.fetchers.get(K)||f7}function $n(K,ee){fn(K,ee==null?void 0:ee.reason),st(K,qo(null))}function Dr(K){let ee=T.fetchers.get(K);H.has(K)&&!(ee&&ee.state==="loading"&&P.has(K))&&fn(K),z.delete(K),P.delete(K),U.delete(K),W.delete(K),$.delete(K),T.fetchers.delete(K)}function Jr(K){let ee=(X.get(K)||0)-1;ee<=0?(X.delete(K),W.add(K)):X.set(K,ee),De({fetchers:new Map(T.fetchers)})}function fn(K,ee){let fe=H.get(K);fe&&(fe.abort(ee),H.delete(K))}function or(K){for(let ee of K){let fe=sr(ee),Se=qo(fe.data);T.fetchers.set(ee,Se)}}function kn(){let K=[],ee=!1;for(let fe of U){let Se=T.fetchers.get(fe);Lt(Se,`Expected fetcher: ${fe}`),Se.state==="loading"&&(U.delete(fe),K.push(fe),ee=!0)}return or(K),ee}function Ys(K){let ee=[];for(let[fe,Se]of P)if(Se<K){let _e=T.fetchers.get(fe);Lt(_e,`Expected fetcher: ${fe}`),_e.state==="loading"&&(fn(fe),P.delete(fe),ee.push(fe))}return or(ee),ee.length>0}function Aa(K,ee){let fe=T.blockers.get(K)||mf;return ae.get(K)!==ee&&ae.set(K,ee),fe}function ea(K){T.blockers.delete(K),ae.delete(K)}function Da(K,ee){let fe=T.blockers.get(K)||mf;Lt(fe.state==="unblocked"&&ee.state==="blocked"||fe.state==="blocked"&&ee.state==="blocked"||fe.state==="blocked"&&ee.state==="proceeding"||fe.state==="blocked"&&ee.state==="unblocked"||fe.state==="proceeding"&&ee.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${ee.state}`);let Se=new Map(T.blockers);Se.set(K,ee),De({blockers:Se})}function Cs({currentLocation:K,nextLocation:ee,historyAction:fe}){if(ae.size===0)return;ae.size>1&&Kn(!1,"A router only supports one blocker at a time");let Se=Array.from(ae.entries()),[_e,Ge]=Se[Se.length-1],Fe=T.blockers.get(_e);if(!(Fe&&Fe.state==="proceeding")&&Ge({currentLocation:K,nextLocation:ee,historyAction:fe}))return _e}function En(K){let ee=hs(404,{pathname:K}),fe=f||u,{matches:Se,route:_e}=ip(fe);return{notFoundMatches:Se,route:_e,error:ee}}function In(K,ee,fe){if(C=K,E=ee,S=fe||null,!R&&T.navigation===b0){R=!0;let Se=Xt(T.location,T.matches);Se!=null&&De({restoreScrollPosition:Se})}return()=>{C=null,E=null,S=null}}function Ye(K,ee){return S&&S(K,ee.map(Se=>L9(Se,T.loaderData)))||K.key}function Bt(K,ee){if(C&&E){let fe=Ye(K,ee);C[fe]=E()}}function Xt(K,ee){if(C){let fe=Ye(K,ee),Se=C[fe];if(typeof Se=="number")return Se}return null}function Gt(K,ee,fe){if(e.patchRoutesOnNavigation)if(K){if(Object.keys(K[0].params).length>0)return{active:!0,matches:_f(ee,fe,m,!0)}}else return{active:!0,matches:_f(ee,fe,m,!0)||[]};return{active:!1,matches:null}}async function Vn(K,ee,fe,Se){if(!e.patchRoutesOnNavigation)return{type:"success",matches:K};let _e=K;for(;;){let Ge=f==null,Fe=f||u,ke=c;try{await e.patchRoutesOnNavigation({signal:fe,path:ee,matches:_e,fetcherKey:Se,patch:(at,tt)=>{fe.aborted||_j(at,tt,Fe,ke,i,!1)}})}catch(at){return{type:"error",error:at,partialMatches:_e}}finally{Ge&&!fe.aborted&&(u=[...u])}if(fe.aborted)return{type:"aborted"};let ze=Ki(Fe,ee,m),Xe=null;if(ze){if(Object.keys(ze[0].params).length===0)return{type:"success",matches:ze};if(Xe=_f(Fe,ee,m,!0),!(Xe&&_e.length<Xe.length&&Jt(_e,Xe.slice(0,_e.length))))return{type:"success",matches:ze}}if(Xe||(Xe=_f(Fe,ee,m,!0)),!Xe||Jt(_e,Xe))return{type:"success",matches:null};_e=Xe}}function Jt(K,ee){return K.length===ee.length&&K.every((fe,Se)=>fe.route.id===ee[Se].route.id)}function Qt(K){c={},f=Gf(K,i,void 0,c)}function Cr(K,ee,fe=!1){let Se=f==null;_j(K,ee,f||u,c,i,fe),Se&&(u=[...u],De({}))}return O={get basename(){return m},get future(){return g},get state(){return T},get routes(){return u},get window(){return t},initialize:ye,subscribe:Ve,enableScrollRestoration:In,navigate:rt,fetch:ne,revalidate:dn,createHref:K=>e.history.createHref(K),encodeLocation:K=>e.history.encodeLocation(K),getFetcher:sr,resetFetcher:$n,deleteFetcher:Jr,dispose:Ce,getBlocker:Aa,deleteBlocker:ea,patchRoutes:Cr,_internalFetchControllers:H,_internalSetRoutes:Qt,_internalSetStateDoNotUseOrYouWillBreakYourApp(K){De(K)}},e.unstable_instrumentations&&(O=n7(O,e.unstable_instrumentations.map(K=>K.router).filter(Boolean))),O}function p7(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function w1(e,t,n,r,s,i){let c,u;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){u=m;break}}else c=t,u=t[t.length-1];let f=qg(r||".",Gg(c),gs(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let m=Hb(f.search);if(u.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&m){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=Y9({basename:n,pathname:f.pathname})),xo(f)}function jj(e,t,n){if(!n||!p7(n))return{path:t};if(n.formMethod&&!O7(n.formMethod))return{path:t,error:hs(405,{method:n.formMethod})};let r=()=>({path:t,error:hs(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=rA(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ra(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(!ra(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=T1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=T1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Ij(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Ij(u)}catch{return r()}let m={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(ra(m.formMethod))return{path:t,submission:m};let y=gl(t);return e&&y.search&&Hb(y.search)&&u.append("index",""),y.search=`?${u}`,{path:xo(y),submission:m}}function Tj(e,t,n,r,s,i,c,u,f,m,y,g,x,v,C,S,E,R,j,_){var Z;let I=_?Va(_[1])?_[1].error:_[1].data:void 0,A=s.createURL(i.location),O=s.createURL(f),T;if(y&&i.errors){let F=Object.keys(i.errors)[0];T=c.findIndex(M=>M.route.id===F)}else if(_&&Va(_[1])){let F=_[0];T=c.findIndex(M=>M.route.id===F)-1}let D=_?_[1].statusCode:void 0,k=D&&D>=400,B={currentUrl:A,currentParams:((Z=i.matches[0])==null?void 0:Z.params)||{},nextUrl:O,nextParams:c[0].params,...u,actionResult:I,actionStatus:D},G=dh(c),Y=c.map((F,M)=>{let{route:$}=F,H=null;if(T!=null&&M>T?H=!1:$.lazy?H=!0:Fb($)?y?H=R1($,i.loaderData,i.errors):g7(i.loaderData,i.matches[M],F)&&(H=!0):H=!1,H!==null)return j1(n,r,e,G,F,m,t,H);let oe=k?!1:g||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||y7(i.matches[M],F),ge={...B,defaultShouldRevalidate:oe},P=Jp(F,ge);return j1(n,r,e,G,F,m,t,P,ge)}),V=[];return C.forEach((F,M)=>{if(y||!c.some(X=>X.route.id===F.routeId)||v.has(M))return;let $=i.fetchers.get(M),H=$&&$.state!=="idle"&&$.data===void 0,oe=Ki(E,F.path,R);if(!oe){if(j&&H)return;V.push({key:M,routeId:F.routeId,path:F.path,matches:null,match:null,request:null,controller:null});return}if(S.has(M))return;let ge=Up(oe,F.path),P=new AbortController,U=wu(s,F.path,P.signal),z=null;if(x.has(M))x.delete(M),z=ku(n,r,U,oe,ge,m,t);else if(H)g&&(z=ku(n,r,U,oe,ge,m,t));else{let X={...B,defaultShouldRevalidate:k?!1:g};Jp(ge,X)&&(z=ku(n,r,U,oe,ge,m,t,X))}z&&V.push({key:M,routeId:F.routeId,path:F.path,matches:z,match:ge,request:U,controller:P})}),{dsMatches:Y,revalidatingFetchers:V}}function Fb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function R1(e,t,n){if(e.lazy)return!0;if(!Fb(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 g7(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function y7(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Jp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function _j(e,t,n,r,s,i){let c;if(e){let m=r[e];Lt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let u=[],f=[];if(t.forEach(m=>{let y=c.find(g=>QN(m,g));y?f.push({existingRoute:y,newRoute:m}):u.push(m)}),u.length>0){let m=Gf(u,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(i&&f.length>0)for(let m=0;m<f.length;m++){let{existingRoute:y,newRoute:g}=f[m],x=y,[v]=Gf([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 QN(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=>QN(n,i))}):!1}var Nj=new WeakMap,JN=({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=Nj.get(s);c||(c={},Nj.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let m=O9(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Kn(!m,"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},Aj=new WeakMap;function x7(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=Aj.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 E=M9(C),j=i[C]!==void 0&&C!=="hasErrorBoundary";E?Kn(!E,"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 Aj.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=JN({key:y,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),y===t&&(f=g))}let m=u.length>0?Promise.all(u).then(()=>{}):void 0;return m==null||m.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:f}}async function Dj(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 v7(e){return e.matches.some(t=>t.route.middleware)?eA(e,()=>Dj(e)):Dj(e)}function eA(e,t){return b7(e,t,r=>r,N7,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(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.shouldCallHandler()),0)),f=Zi(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function b7(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:m}=e,y=i.flatMap(x=>x.route.middleware?x.route.middleware.map(v=>[x.route.id,v]):[]);return await tA({request:c,params:u,context:f,unstable_pattern:m},y,t,n,r,s)}async function tA(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[m,y]=f,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await tA(e,t,n,r,s,i,c+1)},g.value}catch(v){return g={value:await i(v,m,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,m,g)}}function nA(e,t,n,r,s){let i=JN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=x7(r.route,ra(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function j1(e,t,n,r,s,i,c,u,f=null){let m=!1,y=nA(e,t,n,s,i);return{...s,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:f,shouldCallHandler(g){return m=!0,f?typeof g=="boolean"?Jp(s,{...f,defaultShouldRevalidate:g}):Jp(s,f):u},resolve(g){let{lazy:x,loader:v,middleware:C}=s.route,S=m||u||g&&!ra(n.method)&&(x||v),E=C&&C.length>0&&!v&&!x;return S&&(ra(n.method)||!E)?C7({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,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:nA(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:j1(e,t,n,dh(r),f,i,c,!0,u))}async function S7(e,t,n,r,s,i){n.some(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(n.map(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware}));let c={request:t,unstable_pattern:dh(n),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let y=c;return eA(y,()=>m({...y,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var y,g;return[(y=m._lazyPromises)==null?void 0:y.handler,(g=m._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function C7({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,m=ra(e.method),y=m?"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]:[]),E=(async()=>{try{return{type:"data",result:await(i?i(j=>S(j)):S())}}catch(R){return{type:"error",result:R}}})();return Promise.race([E,C])};try{let x=m?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=m?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 hs(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 hs(404,{pathname:C})}}catch(x){return{type:"error",result:x}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function E7(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 w7(e){var r,s,i,c,u;let{result:t,type:n}=e;if(aA(t)){let f;try{f=await E7(t)}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Kg(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?Pj(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:_7(t),statusCode:qf(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:qf(t)?t.status:void 0}:Pj(t)?{type:"data",data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function R7(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=w1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function Oj(e,t,n){if(Bg(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=gs(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function wu(e,t,n,r){let s=e.createURL(rA(t)).toString(),i={signal:n};if(r&&ra(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=T1(r.formData):i.body=r.formData}return new Request(s,i)}function T1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ij(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function j7(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,m={},y=n&&Va(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"),Va(v)){let C=v.error;if(y!==void 0&&(C=y,y=void 0),c=c||{},s)c[x]=C;else{let S=Zi(e,x);c[S.route.id]==null&&(c[S.route.id]=C)}r||(i[x]=XN),f||(f=!0,u=qf(v.error)?v.error.status:500),v.headers&&(m[x]=v.headers)}else i[x]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(m[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:m}}function Mj(e,t,n,r,s,i){let{loaderData:c,errors:u}=j7(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:y,controller:g}=f;if(g&&g.signal.aborted)return;let x=i[m];if(Lt(x,"Did not find corresponding fetcher result"),Va(x)){let v=Zi(e.matches,y==null?void 0:y.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:x.error}),e.fetchers.delete(m)}else if(tc(x))Lt(!1,"Unhandled fetcher revalidation redirect");else{let v=qo(x.data);e.fetchers.set(m,v)}}),{loaderData:c,errors:u}}function kj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==XN).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 Lj(e){return e?Va(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Zi(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 ip(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 hs(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 Kg(e||500,c,new Error(u),!0)}function lp(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 rA(e){let t=typeof e=="string"?gl(e):e;return xo({...t,hash:""})}function T7(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function _7(e){var t,n;return new Kg(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function N7(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&A7(n))}function A7(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function D7(e){return aA(e.result)&&u7.has(e.result.status)}function Va(e){return e.type==="error"}function tc(e){return(e&&e.type)==="redirect"}function Pj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function aA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function O7(e){return c7.has(e.toUpperCase())}function ra(e){return i7.has(e.toUpperCase())}function Hb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Up(e,t){let n=typeof t=="string"?gl(t).search:t.search;if(e[e.length-1].route.index&&Hb(n||""))return e[e.length-1];let r=KN(e);return r[r.length-1]}function Uj(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 S0(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 I7(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 pf(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 M7(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 qo(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 k7(e,t){try{let n=e.sessionStorage.getItem(WN);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 L7(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(WN,JSON.stringify(n))}catch(r){Kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function zj(){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=h.createContext(null);bc.displayName="DataRouter";var fh=h.createContext(null);fh.displayName="DataRouterState";h.createContext(!1);var $b=h.createContext({isTransitioning:!1});$b.displayName="ViewTransition";var sA=h.createContext(new Map);sA.displayName="Fetchers";var P7=h.createContext(null);P7.displayName="Await";var ys=h.createContext(null);ys.displayName="Navigation";var Zg=h.createContext(null);Zg.displayName="Location";var xs=h.createContext({outlet:null,matches:[],isDataRoute:!1});xs.displayName="Route";var Vb=h.createContext(null);Vb.displayName="RouteError";function U7(e,{relative:t}={}){Lt(ad(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(ys),{hash:s,pathname:i,search:c}=hh(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:uo([n,i])),r.createHref({pathname:u,search:c,hash:s})}function ad(){return h.useContext(Zg)!=null}function Vs(){return Lt(ad(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Zg).location}var oA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function iA(e){h.useContext(ys).static||h.useLayoutEffect(e)}function Sc(){let{isDataRoute:e}=h.useContext(xs);return e?Q7():z7()}function z7(){Lt(ad(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(bc),{basename:t,navigator:n}=h.useContext(ys),{matches:r}=h.useContext(xs),{pathname:s}=Vs(),i=JSON.stringify(Gg(r)),c=h.useRef(!1);return iA(()=>{c.current=!0}),h.useCallback((f,m={})=>{if(Kn(c.current,oA),!c.current)return;if(typeof f=="number"){n.go(f);return}let y=qg(f,JSON.parse(i),s,m.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:uo([t,y.pathname])),(m.replace?n.replace:n.push)(y,m.state,m)},[t,n,i,s,e])}var lA=h.createContext(null);function vs(){return h.useContext(lA)}function F7(e){let t=h.useContext(xs).outlet;return h.useMemo(()=>t&&h.createElement(lA.Provider,{value:e},t),[t,e])}function Yg(){let{matches:e}=h.useContext(xs),t=e[e.length-1];return t?t.params:{}}function hh(e,{relative:t}={}){let{matches:n}=h.useContext(xs),{pathname:r}=Vs(),s=JSON.stringify(Gg(n));return h.useMemo(()=>qg(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function H7(e,t,n,r,s){Lt(ad(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=h.useContext(ys),{matches:c}=h.useContext(xs),u=c[c.length-1],f=u?u.params:{},m=u?u.pathname:"/",y=u?u.pathnameBase:"/",g=u&&u.route;{let j=g&&g.path||"";cA(m,!g||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (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=Vs(),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 E=Ki(e,{pathname:S});return Kn(g||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Kn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${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.`),q7(E&&E.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:uo([y,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?y:uo([y,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,s)}function $7(){let e=X7(),t=qf(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=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:i},"ErrorBoundary")," or"," ",h.createElement("code",{style:i},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:s},n):null,c)}var V7=h.createElement($7,null),B7=class extends h.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?h.createElement(xs.Provider,{value:this.props.routeContext},h.createElement(Vb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function G7({routeContext:e,match:t,children:n}){let r=h.useContext(bc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(xs.Provider,{value:e},n)}function q7(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 m=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)??{},unstable_pattern:dh(n.matches),errorInfo:g})}:void 0;return i.reduceRight((y,g,x)=>{let v,C=!1,S=null,E=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||V7,u&&(f<0&&x===0?(cA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,E=null):f===x&&(C=!0,E=g.route.hydrateFallbackElement||null)));let R=t.concat(i.slice(0,x+1)),j=()=>{let _;return v?_=S:C?_=E:g.route.Component?_=h.createElement(g.route.Component,null):g.route.element?_=g.route.element:_=y,h.createElement(G7,{match:g,routeContext:{outlet:y,matches:R,isDataRoute:n!=null},children:_})};return n&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?h.createElement(B7,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:j(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:m}):j()},null)}function Bb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K7(e){let t=h.useContext(bc);return Lt(t,Bb(e)),t}function Z7(e){let t=h.useContext(fh);return Lt(t,Bb(e)),t}function Y7(e){let t=h.useContext(xs);return Lt(t,Bb(e)),t}function Gb(e){let t=Y7(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 W7(){return Gb("useRouteId")}function X7(){var r;let e=h.useContext(Vb),t=Z7("useRouteError"),n=Gb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Q7(){let{router:e}=K7("useNavigate"),t=Gb("useNavigate"),n=h.useRef(!1);return iA(()=>{n.current=!0}),h.useCallback(async(s,i={})=>{Kn(n.current,oA),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Fj={};function cA(e,t,n){!t&&!Fj[e]&&(Fj[e]=!0,Kn(!1,n))}var Hj={};function $j(e,t){!e&&!Hj[t]&&(Hj[t]=!0,console.warn(t))}var J7="useOptimistic",Vj=uh[J7],eL=()=>{};function tL(e){return Vj?Vj(e):[e,eL]}function nL(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:h.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:h.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:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var rL=["HydrateFallback","hydrateFallbackElement"],aL=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 sL({router:e,flushSync:t,unstable_onError:n,unstable_useTransitions:r}){let[s,i]=h.useState(e.state),[c,u]=tL(s),[f,m]=h.useState(),[y,g]=h.useState({isTransitioning:!1}),[x,v]=h.useState(),[C,S]=h.useState(),[E,R]=h.useState(),j=h.useRef(new Map),_=h.useCallback((T,{deletedFetchers:D,newErrors:k,flushSync:B,viewTransitionOpts:G})=>{k&&n&&Object.values(k).forEach(V=>{var Z;return n(V,{location:T.location,params:((Z=T.matches[0])==null?void 0:Z.params)??{},unstable_pattern:dh(T.matches)})}),T.fetchers.forEach((V,Z)=>{V.data!==void 0&&j.current.set(Z,V.data)}),D.forEach(V=>j.current.delete(V)),$j(B===!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 Y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if($j(G==null||Y,"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."),!G||!Y){t&&B?t(()=>i(T)):r===!1?i(T):h.startTransition(()=>{r===!0&&u(V=>Bj(V,T)),i(T)});return}if(t&&B){t(()=>{C&&(x==null||x.resolve(),C.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let V=e.window.document.startViewTransition(()=>{t(()=>i(T))});V.finished.finally(()=>{t(()=>{v(void 0),S(void 0),m(void 0),g({isTransitioning:!1})})}),t(()=>S(V));return}C?(x==null||x.resolve(),C.skipTransition(),R({state:T,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(m(T),g({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[e.window,t,C,x,r,u,n]);h.useLayoutEffect(()=>e.subscribe(_),[e,_]),h.useEffect(()=>{y.isTransitioning&&!y.flushSync&&v(new aL)},[y]),h.useEffect(()=>{if(x&&f&&e.window){let T=f,D=x.promise,k=e.window.document.startViewTransition(async()=>{r===!1?i(T):h.startTransition(()=>{r===!0&&u(B=>Bj(B,T)),i(T)}),await D});k.finished.finally(()=>{v(void 0),S(void 0),m(void 0),g({isTransitioning:!1})}),S(k)}},[f,x,e.window,r,u]),h.useEffect(()=>{x&&f&&c.location.key===f.location.key&&x.resolve()},[x,C,c.location,f]),h.useEffect(()=>{!y.isTransitioning&&E&&(m(E.state),g({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),R(void 0))},[y.isTransitioning,E]);let I=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,D,k)=>e.navigate(T,{state:D,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(T,D,k)=>e.navigate(T,{replace:!0,state:D,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[e]),A=e.basename||"/",O=h.useMemo(()=>({router:e,navigator:I,static:!1,basename:A,unstable_onError:n}),[e,I,A,n]);return h.createElement(h.Fragment,null,h.createElement(bc.Provider,{value:O},h.createElement(fh.Provider,{value:c},h.createElement(sA.Provider,{value:j.current},h.createElement($b.Provider,{value:y},h.createElement(cL,{basename:A,location:c.location,navigationType:c.historyAction,navigator:I,unstable_useTransitions:r===!0},h.createElement(oL,{routes:e.routes,future:e.future,state:c,unstable_onError:n})))))),null)}function Bj(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var oL=h.memo(iL);function iL({routes:e,future:t,state:n,unstable_onError:r}){return H7(e,void 0,n,r,t)}function lL({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}=h.useContext(ys);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}=h.useContext(xs),{pathname:c}=Vs(),u=Sc(),f=qg(e,Gg(i),c,r==="path"),m=JSON.stringify(f);return h.useEffect(()=>{u(JSON.parse(m),{replace:t,state:n,relative:r})},[u,m,r,t,n]),null}function qb(e){return F7(e.context)}function cL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:c}){Lt(!ad(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=h.useMemo(()=>({basename:u,navigator:s,static:i,unstable_useTransitions:c,future:{}}),[u,s,i,c]);typeof n=="string"&&(n=gl(n));let{pathname:m="/",search:y="",hash:g="",state:x=null,key:v="default"}=n,C=h.useMemo(()=>{let S=gs(m,u);return S==null?null:{location:{pathname:S,search:y,hash:g,state:x,key:v},navigationType:r}},[u,m,y,g,x,v,r]);return Kn(C!=null,`<Router basename="${u}"> is not able to match the URL "${m}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:h.createElement(ys.Provider,{value:f},h.createElement(Zg.Provider,{children:t,value:C}))}var zp="get",Fp="application/x-www-form-urlencoded";function Wg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function uL(e){return Wg(e)&&e.tagName.toLowerCase()==="button"}function dL(e){return Wg(e)&&e.tagName.toLowerCase()==="form"}function fL(e){return Wg(e)&&e.tagName.toLowerCase()==="input"}function hL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mL(e,t){return e.button===0&&(!t||t==="_self")&&!hL(e)}function _1(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 pL(e,t){let n=_1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var cp=null;function gL(){if(cp===null)try{new FormData(document.createElement("form"),0),cp=!1}catch{cp=!0}return cp}var yL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function C0(e){return e!=null&&!yL.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fp}"`),null):e}function xL(e,t){let n,r,s,i,c;if(dL(e)){let u=e.getAttribute("action");r=u?gs(u,t):null,n=e.getAttribute("method")||zp,s=C0(e.getAttribute("enctype"))||Fp,i=new FormData(e)}else if(uL(e)||fL(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?gs(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||zp,s=C0(e.getAttribute("formenctype"))||C0(u.getAttribute("enctype"))||Fp,i=new FormData(u,e),!gL()){let{name:m,type:y,value:g}=e;if(y==="image"){let x=m?`${m}.`:"";i.append(`${x}x`,"0"),i.append(`${x}y`,"0")}else m&&i.append(m,g)}}else{if(Wg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=zp,r=null,s=Fp,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 Kb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vL(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&&gs(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function bL(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 SL(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 CL(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await bL(i,n);return c.links?c.links():[]}return[]}));return jL(r.flat(1).filter(SL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Gj(e,t,n,r,s,i){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,u=(f,m)=>{var y;return n[m].pathname!==f.pathname||((y=n[m].route.path)==null?void 0:y.endsWith("*"))&&n[m].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,m)=>c(f,m)||u(f,m)):i==="data"?t.filter((f,m)=>{var g;let y=r.routes[f.route.id];if(!y||!y.hasLoader)return!1;if(c(f,m)||u(f,m))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 EL(e,t,{includeHydrateFallback:n}={}){return wL(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 wL(e){return[...new Set(e)]}function RL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function jL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(RL(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function uA(){let e=h.useContext(bc);return Kb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function TL(){let e=h.useContext(fh);return Kb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Zb=h.createContext(void 0);Zb.displayName="FrameworkContext";function dA(){let e=h.useContext(Zb);return Kb(e,"You must render this element inside a <HydratedRouter> element"),e}function _L(e,t){let n=h.useContext(Zb),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:m,onMouseLeave:y,onTouchStart:g}=t,x=h.useRef(null);h.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=R=>{R.forEach(j=>{c(j.isIntersecting)})},E=new IntersectionObserver(S,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),h.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:gf(u,v),onBlur:gf(f,C),onMouseEnter:gf(m,v),onMouseLeave:gf(y,C),onTouchStart:gf(g,v)}]:[!1,x,{}]}function gf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function NL({page:e,...t}){let{router:n}=uA(),r=h.useMemo(()=>Ki(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(DL,{page:e,matches:r,...t}):null}function AL(e){let{manifest:t,routeModules:n}=dA(),[r,s]=h.useState([]);return h.useEffect(()=>{let i=!1;return CL(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function DL({page:e,matches:t,...n}){let r=Vs(),{manifest:s,routeModules:i}=dA(),{basename:c}=uA(),{loaderData:u,matches:f}=TL(),m=h.useMemo(()=>Gj(e,t,f,s,r,"data"),[e,t,f,s,r]),y=h.useMemo(()=>Gj(e,t,f,s,r,"assets"),[e,t,f,s,r]),g=h.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||(!m.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 E=vL(e,c,"data");return S&&C.size>0&&E.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,u,r,s,m,t,e,i]),x=h.useMemo(()=>EL(y,s),[y,s]),v=AL(y);return h.createElement(h.Fragment,null,g.map(C=>h.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),x.map(C=>h.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),v.map(({key:C,link:S})=>h.createElement("link",{key:C,nonce:n.nonce,...S})))}function OL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var fA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fA&&(window.__reactRouterVersion="7.10.1")}catch{}function IL(e,t){return m7({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:_9({window:t==null?void 0:t.window}),hydrationData:ML(),routes:e,mapRouteProperties:nL,hydrationRouteProperties:rL,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 ML(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:kL(e.errors)}),e}function kL(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 Kg(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 hA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wr=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:m,preventScrollReset:y,viewTransition:g,...x},v){let{basename:C,unstable_useTransitions:S}=h.useContext(ys),E=typeof m=="string"&&hA.test(m),R,j=!1;if(typeof m=="string"&&E&&(R=m,fA))try{let B=new URL(window.location.href),G=m.startsWith("//")?new URL(B.protocol+m):new URL(m),Y=gs(G.pathname,C);G.origin===B.origin&&Y!=null?m=Y+G.search+G.hash:j=!0}catch{Kn(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=U7(m,{relative:s}),[I,A,O]=_L(r,x),T=UL(m,{replace:c,state:u,target:f,preventScrollReset:y,relative:s,viewTransition:g,unstable_useTransitions:S});function D(B){t&&t(B),B.defaultPrevented||T(B)}let k=h.createElement("a",{...x,...O,href:R||_,onClick:j||i?t:D,ref:OL(v,A),target:f,"data-discover":!E&&n==="render"?"true":void 0});return I&&!E?h.createElement(h.Fragment,null,k,h.createElement(NL,{page:_})):k});Wr.displayName="Link";var mh=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...m},y){let g=hh(c,{relative:m.relative}),x=Vs(),v=h.useContext(fh),{navigator:C,basename:S}=h.useContext(ys),E=v!=null&&BL(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&&(_=gs(_,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:E},D=A?t:void 0,k;typeof r=="function"?k=r(T):k=[r,A?"active":null,O?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let B=typeof i=="function"?i(T):i;return h.createElement(Wr,{...m,"aria-current":D,className:k,ref:y,style:B,to:c,viewTransition:u},typeof f=="function"?f(T):f)});mh.displayName="NavLink";var LL=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=zp,action:u,onSubmit:f,relative:m,preventScrollReset:y,viewTransition:g,...x},v)=>{let{unstable_useTransitions:C}=h.useContext(ys),S=$L(),E=VL(u,{relative:m}),R=c.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&hA.test(u),_=I=>{if(f&&f(I),I.defaultPrevented)return;I.preventDefault();let A=I.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||c,T=()=>S(A||I.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:s,state:i,relative:m,preventScrollReset:y,viewTransition:g});C&&n!==!1?h.startTransition(()=>T()):T()};return h.createElement("form",{ref:v,method:R,action:E,onSubmit:r?f:_,...x,"data-discover":!j&&e==="render"?"true":void 0})});LL.displayName="Form";function PL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mA(e){let t=h.useContext(bc);return Lt(t,PL(e)),t}function UL(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c,unstable_useTransitions:u}={}){let f=Sc(),m=Vs(),y=hh(e,{relative:i});return h.useCallback(g=>{if(mL(g,t)){g.preventDefault();let x=n!==void 0?n:xo(m)===xo(y),v=()=>f(e,{replace:x,state:r,preventScrollReset:s,relative:i,viewTransition:c});u?h.startTransition(()=>v()):v()}},[m,f,y,n,r,t,e,s,i,c,u])}function zL(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=h.useRef(_1(e)),n=h.useRef(!1),r=Vs(),s=h.useMemo(()=>pL(r.search,n.current?null:t.current),[r.search]),i=Sc(),c=h.useCallback((u,f)=>{const m=_1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+m,f)},[i,s]);return[s,c]}var FL=0,HL=()=>`__${String(++FL)}__`;function $L(){let{router:e}=mA("useSubmit"),{basename:t}=h.useContext(ys),n=W7(),r=e.fetch,s=e.navigate;return h.useCallback(async(i,c={})=>{let{action:u,method:f,encType:m,formData:y,body:g}=xL(i,t);if(c.navigate===!1){let x=c.fetcherKey||HL();await r(x,n,c.action||u,{preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await s(c.action||u,{preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||f,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,s,t,n])}function VL(e,{relative:t}={}){let{basename:n}=h.useContext(ys),r=h.useContext(xs);Lt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...hh(e||".",{relative:t})},c=Vs();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:uo([n,i.pathname])),xo(i)}function BL(e,{relative:t}={}){let n=h.useContext($b);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=mA("useViewTransitionState"),s=hh(e,{relative:t});if(!n.isTransitioning)return!1;let i=gs(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=gs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qp(s.pathname,c)!=null||Qp(s.pathname,i)!=null}var Ms=$N();const pA=HN(Ms);function GL(e){return h.createElement(sL,{flushSync:Ms.flushSync,...e})}function qj(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=qj(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():qj(e[s],null)}}}}function ht(...e){return h.useCallback(Xr(...e),e)}var qL=Symbol.for("react.lazy"),eg=uh[" use ".trim().toString()];function KL(e){return typeof e=="object"&&e!==null&&"then"in e}function gA(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qL&&"_payload"in e&&KL(e._payload)}function Yb(e){const t=ZL(e),n=h.forwardRef((r,s)=>{let{children:i,...c}=r;gA(i)&&typeof eg=="function"&&(i=eg(i._payload));const u=h.Children.toArray(i),f=u.find(WL);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var ph=Yb("Slot");function ZL(e){const t=h.forwardRef((n,r)=>{let{children:s,...i}=n;if(gA(s)&&typeof eg=="function"&&(s=eg(s._payload)),h.isValidElement(s)){const c=QL(s),u=XL(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YL=Symbol("radix.slottable");function WL(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YL}function XL(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 yA(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=yA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xA(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=yA(e))&&(r&&(r+=" "),r+=t);return r}const Kj=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zj=xA,Cc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Zj(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,c=Object.keys(s).map(m=>{const y=n==null?void 0:n[m],g=i==null?void 0:i[m];if(y===null)return null;const x=Kj(y)||Kj(g);return s[m][x]}),u=n&&Object.entries(n).reduce((m,y)=>{let[g,x]=y;return x===void 0||(m[g]=x),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,y)=>{let{class:g,className:x,...v}=y;return Object.entries(v).every(C=>{let[S,E]=C;return Array.isArray(E)?E.includes({...i,...u}[S]):{...i,...u}[S]===E})?[...m,g,x]:m},[]);return Zj(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 JL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vA=(...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 eP={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 tP=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:c,...u},f)=>h.createElement("svg",{ref:f,...eP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vA("lucide",s),...u},[...c.map(([m,y])=>h.createElement(m,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 Ae=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(tP,{ref:i,iconNode:t,className:vA(`lucide-${JL(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 nP=[["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"}]],Wb=Ae("ArchiveRestore",nP);/**
|
|
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 rP=[["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"}]],Yj=Ae("ArrowDownZA",rP);/**
|
|
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 aP=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sP=Ae("ArrowLeft",aP);/**
|
|
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 oP=[["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"}]],iP=Ae("ArrowRightLeft",oP);/**
|
|
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 lP=[["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"}]],Wj=Ae("ArrowUpAZ",lP);/**
|
|
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 cP=[["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"}]],Xj=Ae("ArrowUpDown",cP);/**
|
|
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 uP=[["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"}]],dP=Ae("Asterisk",uP);/**
|
|
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 fP=[["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"}]],hP=Ae("BadgeAlert",fP);/**
|
|
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 mP=[["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"}]],pP=Ae("Blocks",mP);/**
|
|
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 gP=[["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"}]],yP=Ae("BookOpen",gP);/**
|
|
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 xP=[["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"}]],tg=Ae("Box",xP);/**
|
|
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 vP=[["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"}]],bP=Ae("BriefcaseBusiness",vP);/**
|
|
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 SP=[["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"}]],Xb=Ae("CalendarClock",SP);/**
|
|
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 CP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],oa=Ae("Check",CP);/**
|
|
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 EP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bs=Ae("ChevronDown",EP);/**
|
|
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 wP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],RP=Ae("ChevronLeft",wP);/**
|
|
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 jP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_a=Ae("ChevronRight",jP);/**
|
|
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 TP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qu=Ae("ChevronUp",TP);/**
|
|
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 _P=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],NP=Ae("ChevronsDownUp",_P);/**
|
|
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 AP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Qb=Ae("ChevronsUpDown",AP);/**
|
|
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 DP=[["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"}]],gh=Ae("CircleAlert",DP);/**
|
|
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 OP=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],IP=Ae("CircleCheckBig",OP);/**
|
|
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 MP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],yh=Ae("CircleCheck",MP);/**
|
|
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 kP=[["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"}]],ng=Ae("CircleX",kP);/**
|
|
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 LP=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Jb=Ae("Code",LP);/**
|
|
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 PP=[["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"}]],UP=Ae("Columns3",PP);/**
|
|
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 zP=[["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=Ae("Copy",zP);/**
|
|
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 FP=[["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"}]],bA=Ae("DatabaseZap",FP);/**
|
|
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 HP=[["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=Ae("Database",HP);/**
|
|
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 $P=[["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"}]],VP=Ae("Download",$P);/**
|
|
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 BP=[["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"}]],SA=Ae("EllipsisVertical",BP);/**
|
|
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 GP=[["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"}]],Gs=Ae("Ellipsis",GP);/**
|
|
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 qP=[["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"}]],ai=Ae("ExternalLink",qP);/**
|
|
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 KP=[["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"}]],ZP=Ae("EyeOff",KP);/**
|
|
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 YP=[["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"}]],CA=Ae("Eye",YP);/**
|
|
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 WP=[["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"}]],XP=Ae("FilePenLine",WP);/**
|
|
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"}]],JP=Ae("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 eU=[["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"}]],tU=Ae("FileText",eU);/**
|
|
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 nU=[["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"}]],rU=Ae("FlaskConical",nU);/**
|
|
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 aU=[["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"}]],sU=Ae("FolderTree",aU);/**
|
|
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 oU=[["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"}]],Qj=Ae("Gem",oU);/**
|
|
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 iU=[["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"}]],lU=Ae("Goal",iU);/**
|
|
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 cU=[["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"}]],uU=Ae("GraduationCap",cU);/**
|
|
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 dU=[["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"}]],fU=Ae("Grid2x2Check",dU);/**
|
|
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 hU=[["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"}]],EA=Ae("GripVertical",hU);/**
|
|
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 mU=[["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"}]],pU=Ae("Grip",mU);/**
|
|
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 gU=[["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"}]],yU=Ae("Group",gU);/**
|
|
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 xU=[["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"}]],vU=Ae("History",xU);/**
|
|
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 bU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=Ae("Info",bU);/**
|
|
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 SU=[["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"}]],N1=Ae("KeyRound",SU);/**
|
|
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 CU=[["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"}]],EU=Ae("Layers",CU);/**
|
|
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 wU=[["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"}]],RU=Ae("ListChecks",wU);/**
|
|
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 jU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ec=Ae("LoaderCircle",jU);/**
|
|
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 TU=[["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"}]],_U=Ae("Lock",TU);/**
|
|
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 NU=[["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"}]],AU=Ae("LogOut",NU);/**
|
|
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 DU=[["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"}]],OU=Ae("Menu",DU);/**
|
|
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 IU=[["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"}]],MU=Ae("MessageCircleQuestion",IU);/**
|
|
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 kU=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],LU=Ae("MessageCircle",kU);/**
|
|
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 PU=[["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"}]],wA=Ae("Monitor",PU);/**
|
|
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 UU=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],RA=Ae("Moon",UU);/**
|
|
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 zU=[["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"}]],FU=Ae("Network",zU);/**
|
|
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 HU=[["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"}]],$U=Ae("OctagonAlert",HU);/**
|
|
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 VU=[["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"}]],jA=Ae("OctagonX",VU);/**
|
|
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 BU=[["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"}]],GU=Ae("PackageSearch",BU);/**
|
|
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 qU=[["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"}]],KU=Ae("PenLine",qU);/**
|
|
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 ZU=[["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=Ae("Pencil",ZU);/**
|
|
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 YU=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Xg=Ae("Play",YU);/**
|
|
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 WU=[["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"}]],eS=Ae("Plug",WU);/**
|
|
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 XU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ha=Ae("Plus",XU);/**
|
|
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"}]],JU=Ae("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 ez=[["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"}]],tz=Ae("Route",ez);/**
|
|
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 nz=[["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"}]],rz=Ae("Scale",nz);/**
|
|
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 az=[["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"}]],sz=Ae("ScanSearch",az);/**
|
|
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 oz=[["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"}]],iz=Ae("ScanText",oz);/**
|
|
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 lz=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],wc=Ae("Search",lz);/**
|
|
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 cz=[["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"}]],uz=Ae("Send",cz);/**
|
|
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 dz=[["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"}]],TA=Ae("Settings",dz);/**
|
|
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 fz=[["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"}]],Ji=Ae("Sparkles",fz);/**
|
|
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 hz=[["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"}]],mz=Ae("SquareChartGantt",hz);/**
|
|
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 pz=[["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"}]],gz=Ae("SquareCheckBig",pz);/**
|
|
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 yz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],_A=Ae("SquarePlay",yz);/**
|
|
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 xz=[["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"}]],NA=Ae("Sun",xz);/**
|
|
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 vz=[["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"}]],bz=Ae("SwatchBook",vz);/**
|
|
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 Sz=[["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"}]],AA=Ae("Table",Sz);/**
|
|
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 Cz=[["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"}]],Ez=Ae("Telescope",Cz);/**
|
|
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 wz=[["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"}]],es=Ae("Trash2",wz);/**
|
|
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 Rz=[["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"}]],xh=Ae("TriangleAlert",Rz);/**
|
|
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 jz=[["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"}]],Kf=Ae("Unplug",jz);/**
|
|
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 Tz=[["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"}]],Jj=Ae("Users",Tz);/**
|
|
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 _z=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zu=Ae("X",_z),E0=768;function Nz(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${E0-1}px)`),r=()=>{t(window.innerWidth<E0)};return n.addEventListener("change",r),t(window.innerWidth<E0),()=>n.removeEventListener("change",r)},[]),!!e}const Az=(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},Dz=(e,t)=>({classGroupId:e,validator:t}),DA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rg="-",eT=[],Oz="arbitrary..",Iz=e=>{const t=kz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Mz(c);const u=c.split(rg),f=u[0]===""&&u.length>1?1:0;return OA(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],m=n[c];return f?m?Az(m,f):f:m||eT}return n[c]||eT}}},OA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const m=OA(e,t+1,i);if(m)return m}const c=n.validators;if(c===null)return;const u=t===0?e.join(rg):e.slice(t).join(rg),f=c.length;for(let m=0;m<f;m++){const y=c[m];if(y.validator(u))return y.classGroupId}},Mz=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?Oz+r:void 0})(),kz=e=>{const{theme:t,classGroups:n}=e;return Lz(n,t)},Lz=(e,t)=>{const n=DA();for(const r in e){const s=e[r];tS(s,n,r,t)}return n},tS=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];Pz(c,t,n,r)}},Pz=(e,t,n,r)=>{if(typeof e=="string"){Uz(e,t,n);return}if(typeof e=="function"){zz(e,t,n,r);return}Fz(e,t,n,r)},Uz=(e,t,n)=>{const r=e===""?t:IA(t,e);r.classGroupId=n},zz=(e,t,n,r)=>{if(Hz(e)){tS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Dz(n,e))},Fz=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];tS(f,IA(t,u),n,r)}},IA=(e,t)=>{let n=e;const r=t.split(rg),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=DA(),n.nextPart.set(c,u)),n=u}return n},Hz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$z=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)}}},A1="!",tT=":",Vz=[],nT=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Bz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let c=0,u=0,f=0,m;const y=s.length;for(let S=0;S<y;S++){const E=s[S];if(c===0&&u===0){if(E===tT){i.push(s.slice(f,S)),f=S+1;continue}if(E==="/"){m=S;continue}}E==="["?c++:E==="]"?c--:E==="("?u++:E===")"&&u--}const g=i.length===0?s:s.slice(f);let x=g,v=!1;g.endsWith(A1)?(x=g.slice(0,-1),v=!0):g.startsWith(A1)&&(x=g.slice(1),v=!0);const C=m&&m>f?m-f:void 0;return nT(i,v,x,C)};if(t){const s=t+tT,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):nT(Vz,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Gz=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}},qz=e=>({cache:$z(e.cacheSize),parseClassName:Bz(e),sortModifiers:Gz(e),...Iz(e)}),Kz=/\s+/,Zz=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(Kz);let f="";for(let m=u.length-1;m>=0;m-=1){const y=u[m],{isExternal:g,modifiers:x,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:S}=n(y);if(g){f=y+(f.length>0?" "+f:f);continue}let E=!!S,R=r(E?C.substring(0,S):C);if(!R){if(!E){f=y+(f.length>0?" "+f:f);continue}if(R=r(C),!R){f=y+(f.length>0?" "+f:f);continue}E=!1}const j=x.length===0?"":x.length===1?x[0]:i(x).join(":"),_=v?j+A1:j,I=_+R;if(c.indexOf(I)>-1)continue;c.push(I);const A=s(R,E);for(let O=0;O<A.length;++O){const T=A[O];c.push(_+T)}f=y+(f.length>0?" "+f:f)}return f},Yz=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=MA(n))&&(s&&(s+=" "),s+=r);return s},MA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=MA(e[r]))&&(n&&(n+=" "),n+=t);return n},Wz=(e,...t)=>{let n,r,s,i;const c=f=>{const m=t.reduce((y,g)=>g(y),e());return n=qz(m),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const m=r(f);if(m)return m;const y=Zz(f,n);return s(f,y),y};return i=c,(...f)=>i(Yz(...f))},Xz=[],pr=e=>{const t=n=>n[e]||Xz;return t.isThemeGetter=!0,t},kA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,LA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qz=/^\d+\/\d+$/,Jz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eF=/\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$/,tF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pu=e=>Qz.test(e),kt=e=>!!e&&!Number.isNaN(Number(e)),Hi=e=>!!e&&Number.isInteger(Number(e)),w0=e=>e.endsWith("%")&&kt(e.slice(0,-1)),Vo=e=>Jz.test(e),aF=()=>!0,sF=e=>eF.test(e)&&!tF.test(e),PA=()=>!1,oF=e=>nF.test(e),iF=e=>rF.test(e),lF=e=>!Ke(e)&&!Ze(e),cF=e=>od(e,FA,PA),Ke=e=>kA.test(e),Wl=e=>od(e,HA,sF),R0=e=>od(e,mF,kt),rT=e=>od(e,UA,PA),uF=e=>od(e,zA,iF),up=e=>od(e,$A,oF),Ze=e=>LA.test(e),yf=e=>id(e,HA),dF=e=>id(e,pF),aT=e=>id(e,UA),fF=e=>id(e,FA),hF=e=>id(e,zA),dp=e=>id(e,$A,!0),od=(e,t,n)=>{const r=kA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},id=(e,t,n=!1)=>{const r=LA.exec(e);return r?r[1]?t(r[1]):n:!1},UA=e=>e==="position"||e==="percentage",zA=e=>e==="image"||e==="url",FA=e=>e==="length"||e==="size"||e==="bg-size",HA=e=>e==="length",mF=e=>e==="number",pF=e=>e==="family-name",$A=e=>e==="shadow",gF=()=>{const e=pr("color"),t=pr("font"),n=pr("text"),r=pr("font-weight"),s=pr("tracking"),i=pr("leading"),c=pr("breakpoint"),u=pr("container"),f=pr("spacing"),m=pr("radius"),y=pr("shadow"),g=pr("inset-shadow"),x=pr("text-shadow"),v=pr("drop-shadow"),C=pr("blur"),S=pr("perspective"),E=pr("aspect"),R=pr("ease"),j=pr("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(),Ze,Ke],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],D=()=>[Ze,Ke,f],k=()=>[pu,"full","auto",...D()],B=()=>[Hi,"none","subgrid",Ze,Ke],G=()=>["auto",{span:["full",Hi,Ze,Ke]},Hi,Ze,Ke],Y=()=>[Hi,"auto",Ze,Ke],V=()=>["auto","min","max","fr",Ze,Ke],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...D()],$=()=>[pu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],H=()=>[e,Ze,Ke],oe=()=>[...I(),aT,rT,{position:[Ze,Ke]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",fF,cF,{size:[Ze,Ke]}],U=()=>[w0,yf,Wl],z=()=>["","none","full",m,Ze,Ke],X=()=>["",kt,yf,Wl],W=()=>["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,w0,aT,rT],le=()=>["","none",C,Ze,Ke],ye=()=>["none",kt,Ze,Ke],Ce=()=>["none",kt,Ze,Ke],Ve=()=>[kt,Ze,Ke],De=()=>[pu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vo],breakpoint:[Vo],color:[aF],container:[Vo],"drop-shadow":[Vo],ease:["in","out","in-out"],font:[lF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vo],shadow:[Vo],spacing:["px",kt],text:[Vo],"text-shadow":[Vo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pu,Ke,Ze,E]}],container:["container"],columns:[{columns:[kt,Ke,Ze,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:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Hi,"auto",Ze,Ke]}],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",Ke]}],grow:[{grow:["",kt,Ze,Ke]}],shrink:[{shrink:["",kt,Ze,Ke]}],order:[{order:[Hi,"first","last","none",Ze,Ke]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],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:$()}],w:[{w:[u,"screen",...$()]}],"min-w":[{"min-w":[u,"screen","none",...$()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,yf,Wl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ze,R0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",w0,Ke]}],"font-family":[{font:[dF,Ke,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,Ze,Ke]}],"line-clamp":[{"line-clamp":[kt,"none",Ze,R0]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",Ze,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[kt,"from-font","auto",Ze,Wl]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[kt,"auto",Ze,Ke]}],"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",Ze,Ke]}],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",Ze,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hi,Ze,Ke],radial:["",Ze,Ke],conic:[Hi,Ze,Ke]},hF,uF]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[kt,Ze,Ke]}],"outline-w":[{outline:["",kt,yf,Wl]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",y,dp,up]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",g,dp,up]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[kt,Wl]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",x,dp,up]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[kt,Ze,Ke]}],"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":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"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":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"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":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"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":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"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":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"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":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"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":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ze,Ke]}],"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":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ke]}],filter:[{filter:["","none",Ze,Ke]}],blur:[{blur:le()}],brightness:[{brightness:[kt,Ze,Ke]}],contrast:[{contrast:[kt,Ze,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,dp,up]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",kt,Ze,Ke]}],"hue-rotate":[{"hue-rotate":[kt,Ze,Ke]}],invert:[{invert:["",kt,Ze,Ke]}],saturate:[{saturate:[kt,Ze,Ke]}],sepia:[{sepia:["",kt,Ze,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ke]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[kt,Ze,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[kt,Ze,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",kt,Ze,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[kt,Ze,Ke]}],"backdrop-invert":[{"backdrop-invert":["",kt,Ze,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[kt,Ze,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[kt,Ze,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",kt,Ze,Ke]}],"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",Ze,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[kt,"initial",Ze,Ke]}],ease:[{ease:["linear","initial",R,Ze,Ke]}],delay:[{delay:[kt,Ze,Ke]}],animate:[{animate:["none",j,Ze,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ze,Ke]}],"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:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[Ze,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Ze,Ke]}],"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",Ze,Ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[kt,yf,Wl,R0]}],stroke:[{stroke:["none",...H()]}],"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"]}},yF=Wz(gF);function se(...e){return yF(xA(e))}const nS=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 Ee({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?ph:"button";return a.jsx(i,{"data-slot":"button",className:se(nS({variant:t,size:n,className:e})),...s})}function It({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:se("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 xF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vF=xF.reduce((e,t)=>{const n=Yb(`Primitive.${t}`),r=h.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}},{}),bF="Separator",sT="horizontal",SF=["horizontal","vertical"],VA=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=sT,...s}=e,i=CF(r)?r:sT,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(vF.div,{"data-orientation":i,...u,...s,ref:t})});VA.displayName=bF;function CF(e){return SF.includes(e)}var EF=VA;function BA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(EF,{"data-slot":"separator",decorative:n,orientation:t,className:se("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 Ie(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 wF(e,t){const n=h.createContext(t),r=i=>{const{children:c,...u}=i,f=h.useMemo(()=>u,Object.values(u));return a.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(i){const c=h.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 Sr(e,t=[]){let n=[];function r(i,c){const u=h.createContext(c),f=n.length;n=[...n,c];const m=g=>{var R;const{scope:x,children:v,...C}=g,S=((R=x==null?void 0:x[e])==null?void 0:R[f])||u,E=h.useMemo(()=>C,Object.values(C));return a.jsx(S.Provider,{value:E,children:v})};m.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=h.useContext(v);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,y]}const s=()=>{const i=n.map(c=>h.createContext(c));return function(u){const f=(u==null?void 0:u[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return s.scopeName=e,[r,RF(s,...t)]}function RF(...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:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Hr=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},jF=uh[" useId ".trim().toString()]||(()=>{}),TF=0;function er(e){const[t,n]=h.useState(jF());return Hr(()=>{n(r=>r??String(TF++))},[e]),e||(t?`radix-${t}`:"")}var _F=uh[" useInsertionEffect ".trim().toString()]||Hr;function ia({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=NF({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const y=h.useRef(e!==void 0);h.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 m=h.useCallback(y=>{var g;if(u){const x=AF(y)?y(e):y;x!==e&&((g=c.current)==null||g.call(c,x))}else i(y)},[u,e,i,c]);return[f,m]}function NF({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return _F(()=>{i.current=t},[t]),h.useEffect(()=>{var c;s.current!==n&&((c=i.current)==null||c.call(i,n),s.current=n)},[n,s]),[n,r,i]}function AF(e){return typeof e=="function"}function DF(e){const t=OF(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(MF);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function OF(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=LF(s),u=kF(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IF=Symbol("radix.slottable");function MF(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IF}function kF(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 LF(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 PF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=PF.reduce((e,t)=>{const n=DF(`Primitive.${t}`),r=h.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 GA(e,t){e&&Ms.flushSync(()=>e.dispatchEvent(t))}function Us(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function UF(e,t=globalThis==null?void 0:globalThis.document){const n=Us(e);h.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 zF="DismissableLayer",D1="dismissableLayer.update",FF="dismissableLayer.pointerDownOutside",HF="dismissableLayer.focusOutside",oT,qA=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rc=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,m=h.useContext(qA),[y,g]=h.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),C=ht(t,T=>g(T)),S=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(E),j=y?S.indexOf(y):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,I=j>=R,A=BF(T=>{const D=T.target,k=[...m.branches].some(B=>B.contains(D));!I||k||(s==null||s(T),c==null||c(T),T.defaultPrevented||u==null||u())},x),O=GF(T=>{const D=T.target;[...m.branches].some(B=>B.contains(D))||(i==null||i(T),c==null||c(T),T.defaultPrevented||u==null||u())},x);return UF(T=>{j===m.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},x),h.useEffect(()=>{if(y)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(oT=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),iT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=oT)}},[y,x,n,m]),h.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),iT())},[y,m]),h.useEffect(()=>{const T=()=>v({});return document.addEventListener(D1,T),()=>document.removeEventListener(D1,T)},[]),a.jsx(Je.div,{...f,ref:C,style:{pointerEvents:_?I?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,A.onPointerDownCapture)})});Rc.displayName=zF;var $F="DismissableLayerBranch",VF=h.forwardRef((e,t)=>{const n=h.useContext(qA),r=h.useRef(null),s=ht(t,r);return h.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})});VF.displayName=$F;function BF(e,t=globalThis==null?void 0:globalThis.document){const n=Us(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){KA(FF,n,m,{discrete:!0})};const m={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 GF(e,t=globalThis==null?void 0:globalThis.document){const n=Us(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&KA(HF,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 iT(){const e=new CustomEvent(D1);document.dispatchEvent(e)}function KA(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?GA(s,i):s.dispatchEvent(i)}var j0="focusScope.autoFocusOnMount",T0="focusScope.autoFocusOnUnmount",lT={bubbles:!1,cancelable:!0},qF="FocusScope",vh=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=h.useState(null),m=Us(s),y=Us(i),g=h.useRef(null),x=ht(t,S=>f(S)),v=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let S=function(_){if(v.paused||!u)return;const I=_.target;u.contains(I)?g.current=I:Vi(g.current,{select:!0})},E=function(_){if(v.paused||!u)return;const I=_.relatedTarget;I!==null&&(u.contains(I)||Vi(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Vi(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",E);const j=new MutationObserver(R);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E),j.disconnect()}}},[r,u,v.paused]),h.useEffect(()=>{if(u){uT.add(v);const S=document.activeElement;if(!u.contains(S)){const R=new CustomEvent(j0,lT);u.addEventListener(j0,m),u.dispatchEvent(R),R.defaultPrevented||(KF(QF(ZA(u)),{select:!0}),document.activeElement===S&&Vi(u))}return()=>{u.removeEventListener(j0,m),setTimeout(()=>{const R=new CustomEvent(T0,lT);u.addEventListener(T0,y),u.dispatchEvent(R),R.defaultPrevented||Vi(S??document.body,{select:!0}),u.removeEventListener(T0,y),uT.remove(v)},0)}}},[u,m,y,v]);const C=h.useCallback(S=>{if(!n&&!r||v.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,R=document.activeElement;if(E&&R){const j=S.currentTarget,[_,I]=ZF(j);_&&I?!S.shiftKey&&R===I?(S.preventDefault(),n&&Vi(_,{select:!0})):S.shiftKey&&R===_&&(S.preventDefault(),n&&Vi(I,{select:!0})):R===j&&S.preventDefault()}},[n,r,v.paused]);return a.jsx(Je.div,{tabIndex:-1,...c,ref:x,onKeyDown:C})});vh.displayName=qF;function KF(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vi(r,{select:t}),document.activeElement!==n)return}function ZF(e){const t=ZA(e),n=cT(t,e),r=cT(t.reverse(),e);return[n,r]}function ZA(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 cT(e,t){for(const n of e)if(!YF(n,{upTo:t}))return n}function YF(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 WF(e){return e instanceof HTMLInputElement&&"select"in e}function Vi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WF(e)&&t&&e.select()}}var uT=XF();function XF(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dT(e,t),e.unshift(t)},remove(t){var n;e=dT(e,t),(n=e[0])==null||n.resume()}}}function dT(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 JF="Portal",jc=h.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=h.useState(!1);Hr(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?pA.createPortal(a.jsx(Je.div,{...r,ref:t}),c):null});jc.displayName=JF;function eH(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Vr=e=>{const{present:t,children:n}=e,r=tH(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=ht(r.ref,nH(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};Vr.displayName="Presence";function tH(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),c=e?"mounted":"unmounted",[u,f]=eH(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const m=fp(r.current);i.current=u==="mounted"?m:"none"},[u]),Hr(()=>{const m=r.current,y=s.current;if(y!==e){const x=i.current,v=fp(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(y&&x!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Hr(()=>{if(t){let m;const y=t.ownerDocument.defaultView??window,g=v=>{const S=fp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(f("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=v=>{v.target===t&&(i.current=fp(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:h.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function fp(e){return(e==null?void 0:e.animationName)||"none"}function nH(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 _0=0;function Qg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fT()),document.body.insertAdjacentElement("beforeend",e[1]??fT()),_0++,()=>{_0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_0--}},[])}function fT(){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 oo=function(){return oo=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},oo.apply(this,arguments)};function YA(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 rH(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 Hp="right-scroll-bar-position",$p="width-before-scroll-bar",aH="with-scroll-bars-hidden",sH="--removed-body-scroll-bar-size";function N0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oH(e,t){var n=h.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 iH=typeof window<"u"?h.useLayoutEffect:h.useEffect,hT=new WeakMap;function lH(e,t){var n=oH(null,function(r){return e.forEach(function(s){return N0(s,r)})});return iH(function(){var r=hT.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||N0(u,null)}),i.forEach(function(u){s.has(u)||N0(u,c)})}hT.set(n,e)},[e]),n}function cH(e){return e}function uH(e,t){t===void 0&&(t=cH);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)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(y){c.push(y),m()},filter:function(y){return c=c.filter(y),n}}}};return s}function dH(e){e===void 0&&(e={});var t=uH(null);return t.options=oo({async:!0,ssr:!1},e),t}var WA=function(e){var t=e.sideCar,n=YA(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 h.createElement(r,oo({},n))};WA.isSideCarExport=!0;function fH(e,t){return e.useMedium(t),WA}var XA=dH(),A0=function(){},Jg=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:A0,onWheelCapture:A0,onTouchMoveCapture:A0}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,v=e.noRelative,C=e.noIsolation,S=e.inert,E=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,I=YA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,O=lH([n,t]),T=oo(oo({},I),s);return h.createElement(h.Fragment,null,y&&h.createElement(A,{sideCar:XA,removeScrollBar:m,shards:g,noRelative:v,noIsolation:C,inert:S,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:_}),c?h.cloneElement(h.Children.only(u),oo(oo({},T),{ref:O})):h.createElement(j,oo({},T,{className:f,ref:O}),u))});Jg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jg.classNames={fullWidth:$p,zeroRight:Hp};var hH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hH();return t&&e.setAttribute("nonce",t),e}function pH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mH())&&(pH(t,n),gH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xH=function(){var e=yH();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},QA=function(){var e=xH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},vH={left:0,top:0,right:0,gap:0},D0=function(e){return parseInt(e||"",10)||0},bH=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[D0(n),D0(r),D0(s)]},SH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vH;var t=bH(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])}},CH=QA(),Lu="data-scroll-locked",EH=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(aH,` {
|
|
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(Hp,` {
|
|
550
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.`).concat($p,` {
|
|
554
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.`).concat(Hp," .").concat(Hp,` {
|
|
558
|
+
right: 0 `).concat(r,`;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.`).concat($p," .").concat($p,` {
|
|
562
|
+
margin-right: 0 `).concat(r,`;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
body[`).concat(Lu,`] {
|
|
566
|
+
`).concat(sH,": ").concat(u,`px;
|
|
567
|
+
}
|
|
568
|
+
`)},mT=function(){var e=parseInt(document.body.getAttribute(Lu)||"0",10);return isFinite(e)?e:0},wH=function(){h.useEffect(function(){return document.body.setAttribute(Lu,(mT()+1).toString()),function(){var e=mT()-1;e<=0?document.body.removeAttribute(Lu):document.body.setAttribute(Lu,e.toString())}},[])},RH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;wH();var i=h.useMemo(function(){return SH(s)},[s]);return h.createElement(CH,{styles:EH(i,!t,s,n?"":"!important")})},O1=!1;if(typeof window<"u")try{var hp=Object.defineProperty({},"passive",{get:function(){return O1=!0,!0}});window.addEventListener("test",hp,hp),window.removeEventListener("test",hp,hp)}catch{O1=!1}var gu=O1?{passive:!1}:!1,jH=function(e){return e.tagName==="TEXTAREA"},JA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jH(e)&&n[t]==="visible")},TH=function(e){return JA(e,"overflowY")},_H=function(e){return JA(e,"overflowX")},pT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=e4(e,r);if(s){var i=t4(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},NH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},AH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},e4=function(e,t){return e==="v"?TH(t):_H(t)},t4=function(e,t){return e==="v"?NH(t):AH(t)},DH=function(e,t){return e==="h"&&t==="rtl"?-1:1},OH=function(e,t,n,r,s){var i=DH(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),m=!1,y=c>0,g=0,x=0;do{if(!u)break;var v=t4(e,u),C=v[0],S=v[1],E=v[2],R=S-E-i*C;(C||R)&&e4(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)&&(m=!0),m},mp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gT=function(e){return[e.deltaX,e.deltaY]},yT=function(e){return e&&"current"in e?e.current:e},IH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MH=function(e){return`
|
|
569
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
570
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
571
|
+
`)},kH=0,yu=[];function LH(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(kH++)[0],i=h.useState(QA)[0],c=h.useRef(e);h.useEffect(function(){c.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=rH([e.lockRef.current],(e.shards||[]).map(yT),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=h.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var R=mp(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(),k=D&&D.anchorNode,B=k?k===O||k.contains(O):!1;if(B)return!1;var G=pT(T,O);if(!G)return!0;if(G?A=T:(A=T==="v"?"h":"v",G=pT(T,O)),!G)return!1;if(!r.current&&"changedTouches"in S&&(_||I)&&(r.current=A),!A)return!0;var Y=r.current||A;return OH(Y,E,S,Y==="h"?_:I)},[]),f=h.useCallback(function(S){var E=S;if(!(!yu.length||yu[yu.length-1]!==i)){var R="deltaY"in E?gT(E):mp(E),j=t.current.filter(function(A){return A.name===E.type&&(A.target===E.target||E.target===A.shadowParent)&&IH(A.delta,R)})[0];if(j&&j.should){E.cancelable&&E.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(yT).filter(Boolean).filter(function(A){return A.contains(E.target)}),I=_.length>0?u(E,_[0]):!c.current.noIsolation;I&&E.cancelable&&E.preventDefault()}}},[]),m=h.useCallback(function(S,E,R,j){var _={name:S,delta:E,target:R,should:j,shadowParent:PH(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(I){return I!==_})},1)},[]),y=h.useCallback(function(S){n.current=mp(S),r.current=void 0},[]),g=h.useCallback(function(S){m(S.type,gT(S),S.target,u(S,e.lockRef.current))},[]),x=h.useCallback(function(S){m(S.type,mp(S),S.target,u(S,e.lockRef.current))},[]);h.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 h.createElement(h.Fragment,null,C?h.createElement(i,{styles:MH(s)}):null,v?h.createElement(RH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function PH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const UH=fH(XA,LH);var bh=h.forwardRef(function(e,t){return h.createElement(Jg,oo({},e,{ref:t,sideCar:UH}))});bh.classNames=Jg.classNames;var zH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xu=new WeakMap,pp=new WeakMap,gp={},O0=0,n4=function(e){return e&&(e.host||n4(e.parentNode))},FH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=n4(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})},HH=function(e,t,n,r){var s=FH(t,Array.isArray(e)?e:[e]);gp[n]||(gp[n]=new WeakMap);var i=gp[n],c=[],u=new Set,f=new Set(s),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};s.forEach(m);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,E=(i.get(x)||0)+1;xu.set(x,S),i.set(x,E),c.push(x),S===1&&C&&pp.set(x,!0),E===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(),O0++,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||(pp.has(g)||g.removeAttribute(r),pp.delete(g)),v||g.removeAttribute(n)}),O0--,O0||(xu=new WeakMap,xu=new WeakMap,pp=new WeakMap,gp={})}},ey=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=zH(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),HH(r,s,n,"aria-hidden")):function(){return null}};function $H(e){const t=VH(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(GH);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function VH(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=KH(s),u=qH(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BH=Symbol("radix.slottable");function GH(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BH}function qH(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 KH(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 ty="Dialog",[r4,a4]=Sr(ty),[ZH,qs]=r4(ty),s4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=h.useRef(null),f=h.useRef(null),[m,y]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:ty});return a.jsx(ZH,{scope:t,triggerRef:u,contentRef:f,contentId:er(),titleId:er(),descriptionId:er(),open:m,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};s4.displayName=ty;var o4="DialogTrigger",i4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=qs(o4,n),i=ht(t,s.triggerRef);return a.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sS(s.open),...r,ref:i,onClick:Ie(e.onClick,s.onOpenToggle)})});i4.displayName=o4;var rS="DialogPortal",[YH,l4]=r4(rS,{forceMount:void 0}),c4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=qs(rS,t);return a.jsx(YH,{scope:t,forceMount:n,children:h.Children.map(r,c=>a.jsx(Vr,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:c})}))})};c4.displayName=rS;var ag="DialogOverlay",u4=h.forwardRef((e,t)=>{const n=l4(ag,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=qs(ag,e.__scopeDialog);return i.modal?a.jsx(Vr,{present:r||i.open,children:a.jsx(XH,{...s,ref:t})}):null});u4.displayName=ag;var WH=$H("DialogOverlay.RemoveScroll"),XH=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=qs(ag,n);return a.jsx(bh,{as:WH,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Je.div,{"data-state":sS(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cc="DialogContent",d4=h.forwardRef((e,t)=>{const n=l4(cc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=qs(cc,e.__scopeDialog);return a.jsx(Vr,{present:r||i.open,children:i.modal?a.jsx(QH,{...s,ref:t}):a.jsx(JH,{...s,ref:t})})});d4.displayName=cc;var QH=h.forwardRef((e,t)=>{const n=qs(cc,e.__scopeDialog),r=h.useRef(null),s=ht(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return ey(i)},[]),a.jsx(f4,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault())})}),JH=h.forwardRef((e,t)=>{const n=qs(cc,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(f4,{...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,m;(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;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),f4=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=qs(cc,n),f=h.useRef(null),m=ht(t,f);return Qg(),a.jsxs(a.Fragment,{children:[a.jsx(vh,{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":sS(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(t$,{titleId:u.titleId}),a.jsx(r$,{contentRef:f,descriptionId:u.descriptionId})]})]})}),aS="DialogTitle",h4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=qs(aS,n);return a.jsx(Je.h2,{id:s.titleId,...r,ref:t})});h4.displayName=aS;var m4="DialogDescription",p4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=qs(m4,n);return a.jsx(Je.p,{id:s.descriptionId,...r,ref:t})});p4.displayName=m4;var g4="DialogClose",y4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=qs(g4,n);return a.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>s.onOpenChange(!1))})});y4.displayName=g4;function sS(e){return e?"open":"closed"}var x4="DialogTitleWarning",[e$,v4]=wF(x4,{contentName:cc,titleName:aS,docsSlug:"dialog"}),t$=({titleId:e})=>{const t=v4(x4),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 h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},n$="DialogDescriptionWarning",r$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${v4(n$).contentName}}.`;return h.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},ny=s4,a$=i4,ry=c4,ay=u4,sy=d4,oS=h4,iS=p4,oy=y4;function ci({...e}){return a.jsx(ny,{"data-slot":"sheet",...e})}function s$({...e}){return a.jsx(ry,{"data-slot":"sheet-portal",...e})}function o$({className:e,...t}){return a.jsx(ay,{"data-slot":"sheet-overlay",className:se("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 ui({className:e,children:t,side:n="right",...r}){return a.jsxs(s$,{children:[a.jsx(o$,{}),a.jsxs(sy,{"data-slot":"sheet-content",className:se("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(oy,{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 di({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:se("flex flex-col gap-1 border-b p-4",e),...t})}function fi({className:e,...t}){return a.jsx(oS,{"data-slot":"sheet-title",className:se("text-foreground font-semibold",e),...t})}function yl({className:e,...t}){return a.jsx(iS,{"data-slot":"sheet-description",className:se("text-muted-foreground text-sm",e),...t})}function Ur({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:se("bg-accent animate-pulse rounded-md",e),...t})}const i$=["top","right","bottom","left"],dl=Math.min,Ka=Math.max,sg=Math.round,yp=Math.floor,fo=e=>({x:e,y:e}),l$={left:"right",right:"left",bottom:"top",top:"bottom"},c$={start:"end",end:"start"};function I1(e,t,n){return Ka(e,dl(t,n))}function si(e,t){return typeof e=="function"?e(t):e}function oi(e){return e.split("-")[0]}function ld(e){return e.split("-")[1]}function lS(e){return e==="x"?"y":"x"}function cS(e){return e==="y"?"height":"width"}const u$=new Set(["top","bottom"]);function io(e){return u$.has(oi(e))?"y":"x"}function uS(e){return lS(io(e))}function d$(e,t,n){n===void 0&&(n=!1);const r=ld(e),s=uS(e),i=cS(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=og(c)),[c,og(c)]}function f$(e){const t=og(e);return[M1(e),t,M1(t)]}function M1(e){return e.replace(/start|end/g,t=>c$[t])}const xT=["left","right"],vT=["right","left"],h$=["top","bottom"],m$=["bottom","top"];function p$(e,t,n){switch(e){case"top":case"bottom":return n?t?vT:xT:t?xT:vT;case"left":case"right":return t?h$:m$;default:return[]}}function g$(e,t,n,r){const s=ld(e);let i=p$(oi(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(M1)))),i}function og(e){return e.replace(/left|right|bottom|top/g,t=>l$[t])}function y$(e){return{top:0,right:0,bottom:0,left:0,...e}}function b4(e){return typeof e!="number"?y$(e):{top:e,right:e,bottom:e,left:e}}function ig(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 bT(e,t,n){let{reference:r,floating:s}=e;const i=io(t),c=uS(t),u=cS(c),f=oi(t),m=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&&m?-1:1);break;case"end":v[c]+=x*(n&&m?-1:1);break}return v}const x$=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 m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:y,y:g}=bT(m,r,f),x=r,v={},C=0;for(let S=0;S<u.length;S++){const{name:E,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:m,platform:c,elements:{reference:e,floating:t}});y=j??y,g=_??g,v={...v,[E]:{...v[E],...I}},A&&C<=50&&(C++,typeof A=="object"&&(A.placement&&(x=A.placement),A.rects&&(m=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:y,y:g}=bT(m,x,f)),S=-1)}return{x:y,y:g,placement:x,strategy:s,middlewareData:v}};async function Zf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:c,elements:u,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:x=!1,padding:v=0}=si(t,e),C=b4(v),E=u[x?g==="floating"?"reference":"floating":g],R=ig(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:m,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=ig(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 v$=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:m,padding:y=0}=si(e,t)||{};if(m==null)return{};const g=b4(y),x={x:n,y:r},v=uS(s),C=cS(v),S=await c.getDimensions(m),E=v==="y",R=E?"top":"left",j=E?"bottom":"right",_=E?"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(m));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,k=T/2-S[C]/2-1,B=dl(g[R],k),G=dl(g[j],k),Y=B,V=T-S[C]-G,Z=T/2-S[C]/2+D,F=I1(Y,Z,V),M=!f.arrow&&ld(s)!=null&&Z!==F&&i.reference[C]/2-(Z<Y?B:G)-S[C]/2<0,$=M?Z<Y?Z-Y:Z-V:0;return{[v]:x[v]+$,data:{[v]:F,centerOffset:Z-F-$,...M&&{alignmentOffset:$}},reset:M}}}),b$=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:m}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...E}=si(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const R=oi(s),j=io(u),_=oi(u)===u,I=await(f.isRTL==null?void 0:f.isRTL(m.floating)),A=x||(_||!S?[og(u)]:f$(u)),O=C!=="none";!x&&O&&A.push(...g$(u,S,C,I));const T=[u,...A],D=await Zf(t,E),k=[];let B=((r=i.flip)==null?void 0:r.overflows)||[];if(y&&k.push(D[R]),g){const Z=d$(s,c,I);k.push(D[Z[0]],D[Z[1]])}if(B=[...B,{placement:s,overflows:k}],!k.every(Z=>Z<=0)){var G,Y;const Z=(((G=i.flip)==null?void 0:G.index)||0)+1,F=T[Z];if(F&&(!(g==="alignment"?j!==io(F):!1)||B.every(H=>io(H.placement)===j?H.overflows[0]>0:!0)))return{data:{index:Z,overflows:B},reset:{placement:F}};let M=(Y=B.filter($=>$.overflows[0]<=0).sort(($,H)=>$.overflows[1]-H.overflows[1])[0])==null?void 0:Y.placement;if(!M)switch(v){case"bestFit":{var V;const $=(V=B.filter(H=>{if(O){const oe=io(H.placement);return oe===j||oe==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(oe=>oe>0).reduce((oe,ge)=>oe+ge,0)]).sort((H,oe)=>H[1]-oe[1])[0])==null?void 0:V[0];$&&(M=$);break}case"initialPlacement":M=u;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function ST(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function CT(e){return i$.some(t=>e[t]>=0)}const S$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=si(e,t);switch(r){case"referenceHidden":{const i=await Zf(t,{...s,elementContext:"reference"}),c=ST(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:CT(c)}}}case"escaped":{const i=await Zf(t,{...s,altBoundary:!0}),c=ST(i,n.floating);return{data:{escapedOffsets:c,escaped:CT(c)}}}default:return{}}}}},S4=new Set(["left","top"]);async function C$(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=oi(n),u=ld(n),f=io(n)==="y",m=S4.has(c)?-1:1,y=i&&f?-1:1,g=si(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*m}:{x:x*m,y:v*y}}const E$=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 C$(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}}}}},w$=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:E=>{let{x:R,y:j}=E;return{x:R,y:j}}},...f}=si(e,t),m={x:n,y:r},y=await Zf(t,f),g=io(oi(s)),x=lS(g);let v=m[x],C=m[g];if(i){const E=x==="y"?"top":"left",R=x==="y"?"bottom":"right",j=v+y[E],_=v-y[R];v=I1(j,v,_)}if(c){const E=g==="y"?"top":"left",R=g==="y"?"bottom":"right",j=C+y[E],_=C-y[R];C=I1(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}}}}}},R$=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:m=!0}=si(e,t),y={x:n,y:r},g=io(s),x=lS(g);let v=y[x],C=y[g];const S=si(u,t),E=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[_]+E.mainAxis,A=i.reference[x]+i.reference[_]-E.mainAxis;v<I?v=I:v>A&&(v=A)}if(m){var R,j;const _=x==="y"?"width":"height",I=S4.has(oi(s)),A=i.reference[g]-i.floating[_]+(I&&((R=c.offset)==null?void 0:R[g])||0)+(I?0:E.crossAxis),O=i.reference[g]+i.reference[_]+(I?0:((j=c.offset)==null?void 0:j[g])||0)-(I?E.crossAxis:0);C<A?C=A:C>O&&(C=O)}return{[x]:v,[g]:C}}}},j$=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=()=>{},...m}=si(e,t),y=await Zf(t,m),g=oi(s),x=ld(s),v=io(s)==="y",{width:C,height:S}=i.floating;let E,R;g==="top"||g==="bottom"?(E=g,R=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,E=x==="end"?"top":"bottom");const j=S-y.top-y.bottom,_=C-y.left-y.right,I=dl(S-y[E],j),A=dl(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 B=Ka(y.left,0),G=Ka(y.right,0),Y=Ka(y.top,0),V=Ka(y.bottom,0);v?D=C-2*(B!==0||G!==0?B+G:Ka(y.left,y.right)):T=S-2*(Y!==0||V!==0?Y+V:Ka(y.top,y.bottom))}await f({...t,availableWidth:D,availableHeight:T});const k=await c.getDimensions(u.floating);return C!==k.width||S!==k.height?{reset:{rects:!0}}:{}}}};function iy(){return typeof window<"u"}function cd(e){return C4(e)?(e.nodeName||"").toLowerCase():"#document"}function Wa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(C4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function C4(e){return iy()?e instanceof Node||e instanceof Wa(e).Node:!1}function zs(e){return iy()?e instanceof Element||e instanceof Wa(e).Element:!1}function vo(e){return iy()?e instanceof HTMLElement||e instanceof Wa(e).HTMLElement:!1}function ET(e){return!iy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wa(e).ShadowRoot}const T$=new Set(["inline","contents"]);function Sh(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Fs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!T$.has(s)}const _$=new Set(["table","td","th"]);function N$(e){return _$.has(cd(e))}const A$=[":popover-open",":modal"];function ly(e){return A$.some(t=>{try{return e.matches(t)}catch{return!1}})}const D$=["transform","translate","scale","rotate","perspective"],O$=["transform","translate","scale","rotate","perspective","filter"],I$=["paint","layout","strict","content"];function dS(e){const t=fS(),n=zs(e)?Fs(e):e;return D$.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)||O$.some(r=>(n.willChange||"").includes(r))||I$.some(r=>(n.contain||"").includes(r))}function M$(e){let t=fl(e);for(;vo(t)&&!Yu(t);){if(dS(t))return t;if(ly(t))return null;t=fl(t)}return null}function fS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const k$=new Set(["html","body","#document"]);function Yu(e){return k$.has(cd(e))}function Fs(e){return Wa(e).getComputedStyle(e)}function cy(e){return zs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fl(e){if(cd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ET(e)&&e.host||Co(e);return ET(t)?t.host:t}function E4(e){const t=fl(e);return Yu(t)?e.ownerDocument?e.ownerDocument.body:e.body:vo(t)&&Sh(t)?t:E4(t)}function Yf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=E4(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=Wa(s);if(i){const u=k1(c);return t.concat(c,c.visualViewport||[],Sh(s)?s:[],u&&n?Yf(u):[])}return t.concat(s,Yf(s,[],n))}function k1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function w4(e){const t=Fs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=vo(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=sg(n)!==i||sg(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function hS(e){return zs(e)?e:e.contextElement}function Pu(e){const t=hS(e);if(!vo(t))return fo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=w4(t);let c=(i?sg(n.width):n.width)/r,u=(i?sg(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const L$=fo(0);function R4(e){const t=Wa(e);return!fS()||!t.visualViewport?L$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function P$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wa(e)?!1:t}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=hS(e);let c=fo(1);t&&(r?zs(r)&&(c=Pu(r)):c=Pu(e));const u=P$(i,n,r)?R4(i):fo(0);let f=(s.left+u.x)/c.x,m=(s.top+u.y)/c.y,y=s.width/c.x,g=s.height/c.y;if(i){const x=Wa(i),v=r&&zs(r)?Wa(r):r;let C=x,S=k1(C);for(;S&&r&&v!==C;){const E=Pu(S),R=S.getBoundingClientRect(),j=Fs(S),_=R.left+(S.clientLeft+parseFloat(j.paddingLeft))*E.x,I=R.top+(S.clientTop+parseFloat(j.paddingTop))*E.y;f*=E.x,m*=E.y,y*=E.x,g*=E.y,f+=_,m+=I,C=Wa(S),S=k1(C)}}return ig({width:y,height:g,x:f,y:m})}function uy(e,t){const n=cy(e).scrollLeft;return t?t.left+n:uc(Co(e)).left+n}function j4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-uy(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function U$(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=Co(r),u=t?ly(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=fo(1);const y=fo(0),g=vo(r);if((g||!g&&!i)&&((cd(r)!=="body"||Sh(c))&&(f=cy(r)),vo(r))){const v=uc(r);m=Pu(r),y.x=v.x+r.clientLeft,y.y=v.y+r.clientTop}const x=c&&!g&&!i?j4(c,f):fo(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+y.x+x.x,y:n.y*m.y-f.scrollTop*m.y+y.y+x.y}}function z$(e){return Array.from(e.getClientRects())}function F$(e){const t=Co(e),n=cy(e),r=e.ownerDocument.body,s=Ka(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ka(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+uy(e);const u=-n.scrollTop;return Fs(r).direction==="rtl"&&(c+=Ka(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const wT=25;function H$(e,t){const n=Wa(e),r=Co(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=fS();(!y||y&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const m=uy(r);if(m<=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<=wT&&(i-=C)}else m<=wT&&(i+=m);return{width:i,height:c,x:u,y:f}}const $$=new Set(["absolute","fixed"]);function V$(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=vo(e)?Pu(e):fo(1),c=e.clientWidth*i.x,u=e.clientHeight*i.y,f=s*i.x,m=r*i.y;return{width:c,height:u,x:f,y:m}}function RT(e,t,n){let r;if(t==="viewport")r=H$(e,n);else if(t==="document")r=F$(Co(e));else if(zs(t))r=V$(t,n);else{const s=R4(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ig(r)}function T4(e,t){const n=fl(e);return n===t||!zs(n)||Yu(n)?!1:Fs(n).position==="fixed"||T4(n,t)}function B$(e,t){const n=t.get(e);if(n)return n;let r=Yf(e,[],!1).filter(u=>zs(u)&&cd(u)!=="body"),s=null;const i=Fs(e).position==="fixed";let c=i?fl(e):e;for(;zs(c)&&!Yu(c);){const u=Fs(c),f=dS(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&$$.has(s.position)||Sh(c)&&!f&&T4(e,c))?r=r.filter(y=>y!==c):s=u,c=fl(c)}return t.set(e,r),r}function G$(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?ly(t)?[]:B$(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((m,y)=>{const g=RT(t,y,s);return m.top=Ka(g.top,m.top),m.right=dl(g.right,m.right),m.bottom=dl(g.bottom,m.bottom),m.left=Ka(g.left,m.left),m},RT(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function q$(e){const{width:t,height:n}=w4(e);return{width:t,height:n}}function K$(e,t,n){const r=vo(t),s=Co(t),i=n==="fixed",c=uc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=fo(0);function m(){f.x=uy(s)}if(r||!r&&!i)if((cd(t)!=="body"||Sh(s))&&(u=cy(t)),r){const v=uc(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&m();i&&!r&&s&&m();const y=s&&!r&&!i?j4(s,u):fo(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 I0(e){return Fs(e).position==="static"}function jT(e,t){if(!vo(e)||Fs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Co(e)===n&&(n=n.ownerDocument.body),n}function _4(e,t){const n=Wa(e);if(ly(e))return n;if(!vo(e)){let s=fl(e);for(;s&&!Yu(s);){if(zs(s)&&!I0(s))return s;s=fl(s)}return n}let r=jT(e,t);for(;r&&N$(r)&&I0(r);)r=jT(r,t);return r&&Yu(r)&&I0(r)&&!dS(r)?n:r||M$(e)||n}const Z$=async function(e){const t=this.getOffsetParent||_4,n=this.getDimensions,r=await n(e.floating);return{reference:K$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Y$(e){return Fs(e).direction==="rtl"}const W$={convertOffsetParentRelativeRectToViewportRelativeRect:U$,getDocumentElement:Co,getClippingRect:G$,getOffsetParent:_4,getElementRects:Z$,getClientRects:z$,getDimensions:q$,getScale:Pu,isElement:zs,isRTL:Y$};function N4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function X$(e,t){let n=null,r;const s=Co(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 m=e.getBoundingClientRect(),{left:y,top:g,width:x,height:v}=m;if(u||t(),!x||!v)return;const C=yp(g),S=yp(s.clientWidth-(y+x)),E=yp(s.clientHeight-(g+v)),R=yp(y),_={rootMargin:-C+"px "+-S+"px "+-E+"px "+-R+"px",threshold:Ka(0,dl(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&&!N4(m,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,m=hS(e),y=s||i?[...m?Yf(m):[],...Yf(t)]:[];y.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=m&&u?X$(m,n):null;let x=-1,v=null;c&&(v=new ResizeObserver(R=>{let[j]=R;j&&j.target===m&&v&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),m&&!f&&v.observe(m),v.observe(t));let C,S=f?uc(e):null;f&&E();function E(){const R=uc(e);S&&!N4(S,R)&&n(),S=R,C=requestAnimationFrame(E)}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 J$=E$,eV=w$,tV=b$,nV=j$,rV=S$,TT=v$,aV=R$,sV=(e,t,n)=>{const r=new Map,s={platform:W$,...n},i={...s.platform,_c:r};return x$(e,t,{...s,platform:i})};var oV=typeof document<"u",iV=function(){},Vp=oV?h.useLayoutEffect:iV;function lg(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(!lg(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)&&!lg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function A4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _T(e,t){const n=A4(e);return Math.round(t*n)/n}function M0(e){const t=h.useRef(e);return Vp(()=>{t.current=e}),t}function lV(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:m}=e,[y,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=h.useState(r);lg(x,r)||v(r);const[C,S]=h.useState(null),[E,R]=h.useState(null),j=h.useCallback(H=>{H!==O.current&&(O.current=H,S(H))},[]),_=h.useCallback(H=>{H!==T.current&&(T.current=H,R(H))},[]),I=i||C,A=c||E,O=h.useRef(null),T=h.useRef(null),D=h.useRef(y),k=f!=null,B=M0(f),G=M0(s),Y=M0(m),V=h.useCallback(()=>{if(!O.current||!T.current)return;const H={placement:t,strategy:n,middleware:x};G.current&&(H.platform=G.current),sV(O.current,T.current,H).then(oe=>{const ge={...oe,isPositioned:Y.current!==!1};Z.current&&!lg(D.current,ge)&&(D.current=ge,Ms.flushSync(()=>{g(ge)}))})},[x,t,n,G,Y]);Vp(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(H=>({...H,isPositioned:!1})))},[m]);const Z=h.useRef(!1);Vp(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Vp(()=>{if(I&&(O.current=I),A&&(T.current=A),I&&A){if(B.current)return B.current(I,A,V);V()}},[I,A,V,B,k]);const F=h.useMemo(()=>({reference:O,floating:T,setReference:j,setFloating:_}),[j,_]),M=h.useMemo(()=>({reference:I,floating:A}),[I,A]),$=h.useMemo(()=>{const H={position:n,left:0,top:0};if(!M.floating)return H;const oe=_T(M.floating,y.x),ge=_T(M.floating,y.y);return u?{...H,transform:"translate("+oe+"px, "+ge+"px)",...A4(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:ge}},[n,u,M.floating,y.x,y.y]);return h.useMemo(()=>({...y,update:V,refs:F,elements:M,floatingStyles:$}),[y,V,F,M,$])}const cV=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?TT({element:r.current,padding:s}).fn(n):{}:r?TT({element:r,padding:s}).fn(n):{}}}},uV=(e,t)=>({...J$(e),options:[e,t]}),dV=(e,t)=>({...eV(e),options:[e,t]}),fV=(e,t)=>({...aV(e),options:[e,t]}),hV=(e,t)=>({...tV(e),options:[e,t]}),mV=(e,t)=>({...nV(e),options:[e,t]}),pV=(e,t)=>({...rV(e),options:[e,t]}),gV=(e,t)=>({...cV(e),options:[e,t]});var yV="Arrow",D4=h.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"})})});D4.displayName=yV;var xV=D4;function mS(e){const[t,n]=h.useState(void 0);return Hr(()=>{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,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,u=m.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 pS="Popper",[O4,Eo]=Sr(pS),[vV,I4]=O4(pS),M4=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return a.jsx(vV,{scope:t,anchor:r,onAnchorChange:s,children:n})};M4.displayName=pS;var k4="PopperAnchor",L4=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=I4(k4,n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return h.useEffect(()=>{const m=f.current;f.current=(r==null?void 0:r.current)||c.current,m!==f.current&&i.onAnchorChange(f.current)}),r?null:a.jsx(Je.div,{...s,ref:u})});L4.displayName=k4;var gS="PopperContent",[bV,SV]=O4(gS),P4=h.forwardRef((e,t)=>{var J,le,ye,Ce,Ve,De;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:C,...S}=e,E=I4(gS,n),[R,j]=h.useState(null),_=ht(t,et=>j(et)),[I,A]=h.useState(null),O=mS(I),T=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,k=r+(i!=="center"?"-"+i:""),B=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},G=Array.isArray(m)?m:[m],Y=G.length>0,V={padding:B,boundary:G.filter(EV),altBoundary:Y},{refs:Z,floatingStyles:F,placement:M,isPositioned:$,middlewareData:H}=lV({strategy:"fixed",placement:k,whileElementsMounted:(...et)=>Q$(...et,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[uV({mainAxis:s+D,alignmentAxis:c}),f&&dV({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?fV():void 0,...V}),f&&hV({...V}),mV({...V,apply:({elements:et,rects:rt,availableWidth:dn,availableHeight:zt})=>{const{width:On,height:yn}=rt.reference,Me=et.floating.style;Me.setProperty("--radix-popper-available-width",`${dn}px`),Me.setProperty("--radix-popper-available-height",`${zt}px`),Me.setProperty("--radix-popper-anchor-width",`${On}px`),Me.setProperty("--radix-popper-anchor-height",`${yn}px`)}}),I&&gV({element:I,padding:u}),wV({arrowWidth:T,arrowHeight:D}),x&&pV({strategy:"referenceHidden",...V})]}),[oe,ge]=F4(M),P=Us(C);Hr(()=>{$&&(P==null||P())},[$,P]);const U=(J=H.arrow)==null?void 0:J.x,z=(le=H.arrow)==null?void 0:le.y,X=((ye=H.arrow)==null?void 0:ye.centerOffset)!==0,[W,ae]=h.useState();return Hr(()=>{R&&ae(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:$?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[(Ce=H.transformOrigin)==null?void 0:Ce.x,(Ve=H.transformOrigin)==null?void 0:Ve.y].join(" "),...((De=H.hide)==null?void 0:De.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(bV,{scope:n,placedSide:oe,onArrowChange:A,arrowX:U,arrowY:z,shouldHideArrow:X,children:a.jsx(Je.div,{"data-side":oe,"data-align":ge,...S,ref:_,style:{...S.style,animation:$?void 0:"none"}})})})});P4.displayName=gS;var U4="PopperArrow",CV={top:"bottom",right:"left",bottom:"top",left:"right"},z4=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=SV(U4,r),c=CV[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(xV,{...s,ref:n,style:{...s.style,display:"block"}})})});z4.displayName=U4;function EV(e){return e!==null}var wV=e=>({name:"transformOrigin",options:e,fn(t){var E,R,j;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,y]=F4(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 m==="bottom"?(C=c?g:`${x}px`,S=`${-f}px`):m==="top"?(C=c?g:`${x}px`,S=`${r.floating.height+f}px`):m==="right"?(C=`${-f}px`,S=c?g:`${v}px`):m==="left"&&(C=`${r.floating.width+f}px`,S=c?g:`${v}px`),{data:{x:C,y:S}}}});function F4(e){const[t,n="center"]=e.split("-");return[t,n]}var ud=M4,dd=L4,Ch=P4,Eh=z4,RV=Symbol("radix.slottable");function jV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=RV,t}var H4=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"}),TV="VisuallyHidden",$4=h.forwardRef((e,t)=>a.jsx(Je.span,{...e,ref:t,style:{...H4,...e.style}}));$4.displayName=TV;var _V=$4,[dy]=Sr("Tooltip",[Eo]),fy=Eo(),V4="TooltipProvider",NV=700,L1="tooltip.open",[AV,yS]=dy(V4),B4=e=>{const{__scopeTooltip:t,delayDuration:n=NV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,c=h.useRef(!0),u=h.useRef(!1),f=h.useRef(0);return h.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),a.jsx(AV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:h.useCallback(m=>{u.current=m},[]),disableHoverableContent:s,children:i})};B4.displayName=V4;var Wf="Tooltip",[DV,wh]=dy(Wf),G4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=yS(Wf,e.__scopeTooltip),m=fy(t),[y,g]=h.useState(null),x=er(),v=h.useRef(0),C=c??f.disableHoverableContent,S=u??f.delayDuration,E=h.useRef(!1),[R,j]=ia({prop:r,defaultProp:s??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(L1))):f.onClose(),i==null||i(T)},caller:Wf}),_=h.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),I=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E.current=!1,j(!0)},[j]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),O=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{E.current=!0,j(!0),v.current=0},S)},[S,j]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(ud,{...m,children:a.jsx(DV,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:y,onTriggerChange:g,onTriggerEnter:h.useCallback(()=>{f.isOpenDelayedRef.current?O():I()},[f.isOpenDelayedRef,O,I]),onTriggerLeave:h.useCallback(()=>{C?A():(window.clearTimeout(v.current),v.current=0)},[A,C]),onOpen:I,onClose:A,disableHoverableContent:C,children:n})})};G4.displayName=Wf;var P1="TooltipTrigger",q4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=wh(P1,n),i=yS(P1,n),c=fy(n),u=h.useRef(null),f=ht(t,u,s.onTriggerChange),m=h.useRef(!1),y=h.useRef(!1),g=h.useCallback(()=>m.current=!1,[]);return h.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:Ie(e.onPointerMove,x=>{x.pointerType!=="touch"&&!y.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ie(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Ie(e.onBlur,s.onClose),onClick:Ie(e.onClick,s.onClose)})})});q4.displayName=P1;var xS="TooltipPortal",[OV,IV]=dy(xS,{forceMount:void 0}),K4=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=wh(xS,t);return a.jsx(OV,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};K4.displayName=xS;var Wu="TooltipContent",Z4=h.forwardRef((e,t)=>{const n=IV(Wu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=wh(Wu,e.__scopeTooltip);return a.jsx(Vr,{present:r||c.open,children:c.disableHoverableContent?a.jsx(Y4,{side:s,...i,ref:t}):a.jsx(MV,{side:s,...i,ref:t})})}),MV=h.forwardRef((e,t)=>{const n=wh(Wu,e.__scopeTooltip),r=yS(Wu,e.__scopeTooltip),s=h.useRef(null),i=ht(t,s),[c,u]=h.useState(null),{trigger:f,onClose:m}=n,y=s.current,{onPointerInTransitChange:g}=r,x=h.useCallback(()=>{u(null),g(!1)},[g]),v=h.useCallback((C,S)=>{const E=C.currentTarget,R={x:C.clientX,y:C.clientY},j=UV(R,E.getBoundingClientRect()),_=zV(R,j),I=FV(S.getBoundingClientRect()),A=$V([..._,...I]);u(A),g(!0)},[g]);return h.useEffect(()=>()=>x(),[x]),h.useEffect(()=>{if(f&&y){const C=E=>v(E,y),S=E=>v(E,f);return f.addEventListener("pointerleave",C),y.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",C),y.removeEventListener("pointerleave",S)}}},[f,y,v,x]),h.useEffect(()=>{if(c){const C=S=>{const E=S.target,R={x:S.clientX,y:S.clientY},j=(f==null?void 0:f.contains(E))||(y==null?void 0:y.contains(E)),_=!HV(R,c);j?x():_&&(x(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[f,y,c,m,x]),a.jsx(Y4,{...e,ref:i})}),[kV,LV]=dy(Wf,{isInside:!1}),PV=jV("TooltipContent"),Y4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=wh(Wu,n),m=fy(n),{onClose:y}=f;return h.useEffect(()=>(document.addEventListener(L1,y),()=>document.removeEventListener(L1,y)),[y]),h.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(Ch,{"data-state":f.stateAttribute,...m,...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(PV,{children:r}),a.jsx(kV,{scope:n,isInside:!0,children:a.jsx(_V,{id:f.contentId,role:"tooltip",children:s||r})})]})})});Z4.displayName=Wu;var W4="TooltipArrow",X4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=fy(n);return LV(W4,n).isInside?null:a.jsx(Eh,{...s,...r,ref:t})});X4.displayName=W4;function UV(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 zV(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 FV(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 HV(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],m=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-m)*(r-y)/(x-y)+m&&(s=!s)}return s}function $V(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),VV(t)}function VV(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 BV=B4,GV=G4,qV=q4,KV=K4,ZV=Z4,YV=X4;function Ya({delayDuration:e=0,...t}){return a.jsx(BV,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Et({...e}){return a.jsx(Ya,{children:a.jsx(GV,{"data-slot":"tooltip",...e})})}function wt({...e}){return a.jsx(qV,{"data-slot":"tooltip-trigger",...e})}function Rt({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(KV,{children:a.jsxs(ZV,{"data-slot":"tooltip-content",sideOffset:t,className:se("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(YV,{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 WV="sidebar_state",XV=3600*24*7,QV="16rem",JV="18rem",eB="3rem",tB="b",Q4=h.createContext(null);function Rh(){const e=h.useContext(Q4);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function nB({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=Nz(),[f,m]=h.useState(!1),[y,g]=h.useState(e),x=t??y,v=h.useCallback(R=>{const j=typeof R=="function"?R(x):R;n?n(j):g(j),document.cookie=`${WV}=${j}; path=/; max-age=${XV}`},[n,x]),C=h.useCallback(()=>u?m(R=>!R):v(R=>!R),[u,v,m]);h.useEffect(()=>{const R=j=>{j.key===tB&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),C())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[C]);const S=x?"expanded":"collapsed",E=h.useMemo(()=>({state:S,open:x,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:m,toggleSidebar:C}),[S,x,v,u,f,m,C]);return a.jsx(Q4.Provider,{value:E,children:a.jsx(Ya,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":QV,"--sidebar-width-icon":eB,...s},className:se("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function rB({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:m}=Rh();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:se("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):c?a.jsx(ci,{open:f,onOpenChange:m,...i,children:a.jsxs(ui,{"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":JV},side:e,children:[a.jsxs(di,{className:"sr-only",children:[a.jsx(fi,{children:"Sidebar"}),a.jsx(yl,{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:se("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:se("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 aB({className:e,onClick:t,...n}){const{toggleSidebar:r}=Rh();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(Ee,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:se("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[a.jsx(OU,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function sB({className:e,...t}){const{toggleSidebar:n}=Rh();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:se("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 oB({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:se("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 iB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:se("flex flex-col gap-2 p-2",e),...t})}function lB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:se("flex flex-col gap-2 p-2",e),...t})}function cB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function NT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:se("relative flex w-full min-w-0 flex-col p-2",e),...t})}function AT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:se("w-full text-sm",e),...t})}function uB({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:se("flex w-full min-w-0 flex-col gap-1",e),...t})}function dB({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:se("group/menu-item relative",e),...t})}const fB=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 hB({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?ph:"button",{isMobile:f,state:m}=Rh(),y=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:se(fB({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:y}),a.jsx(Rt,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):y}function U1(e){const t=mB(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(gB);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function mB(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=xB(s),u=yB(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pB=Symbol("radix.slottable");function gB(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pB}function yB(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 xB(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 vB(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=U1(u),m=re.forwardRef((S,E)=>{const{scope:R,children:j}=S,_=i(u,R),I=ht(E,_.collectionRef);return a.jsx(f,{ref:I,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=U1(y),v=re.forwardRef((S,E)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=ht(E,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 E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var bB=h.createContext(void 0);function jh(e){const t=h.useContext(bB);return e||t||"ltr"}function DT(e){const t=SB(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(EB);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function SB(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=RB(s),u=wB(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CB=Symbol("radix.slottable");function EB(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CB}function wB(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 RB(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 jB(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=DT(u),m=re.forwardRef((S,E)=>{const{scope:R,children:j}=S,_=i(u,R),I=ht(E,_.collectionRef);return a.jsx(f,{ref:I,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=DT(y),v=re.forwardRef((S,E)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=ht(E,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 E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var k0="rovingFocusGroup.onEntryFocus",TB={bubbles:!1,cancelable:!0},Th="RovingFocusGroup",[z1,J4,_B]=jB(Th),[NB,hy]=Sr(Th,[_B]),[AB,DB]=NB(Th),e3=h.forwardRef((e,t)=>a.jsx(z1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(z1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(OB,{...e,ref:t})})}));e3.displayName=Th;var OB=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,x=h.useRef(null),v=ht(t,x),C=jh(i),[S,E]=ia({prop:c,defaultProp:u??null,onChange:f,caller:Th}),[R,j]=h.useState(!1),_=Us(m),I=J4(n),A=h.useRef(!1),[O,T]=h.useState(0);return h.useEffect(()=>{const D=x.current;if(D)return D.addEventListener(k0,_),()=>D.removeEventListener(k0,_)},[_]),a.jsx(AB,{scope:n,orientation:r,dir:C,loop:s,currentTabStopId:S,onItemFocus:h.useCallback(D=>E(D),[E]),onItemShiftTab:h.useCallback(()=>j(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(D=>D+1),[]),onFocusableItemRemove:h.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:Ie(e.onMouseDown,()=>{A.current=!0}),onFocus:Ie(e.onFocus,D=>{const k=!A.current;if(D.target===D.currentTarget&&k&&!R){const B=new CustomEvent(k0,TB);if(D.currentTarget.dispatchEvent(B),!B.defaultPrevented){const G=I().filter(M=>M.focusable),Y=G.find(M=>M.active),V=G.find(M=>M.id===S),F=[Y,V,...G].filter(Boolean).map(M=>M.ref.current);r3(F,y)}}A.current=!1}),onBlur:Ie(e.onBlur,()=>j(!1))})})}),t3="RovingFocusGroupItem",n3=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=er(),m=i||f,y=DB(t3,n),g=y.currentTabStopId===m,x=J4(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:S}=y;return h.useEffect(()=>{if(r)return v(),()=>C()},[r,v,C]),a.jsx(z1.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:a.jsx(Je.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...u,ref:t,onMouseDown:Ie(e.onMouseDown,E=>{r?y.onItemFocus(m):E.preventDefault()}),onFocus:Ie(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Ie(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){y.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=kB(E,y.orientation,y.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.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(E.currentTarget);_=y.loop?LB(_,I+1):_.slice(I+1)}setTimeout(()=>r3(_))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:S!=null}):c})})});n3.displayName=t3;var IB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kB(e,t,n){const r=MB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return IB[r]}function r3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function LB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var a3=e3,s3=n3,F1=["Enter"," "],PB=["ArrowDown","PageUp","Home"],o3=["ArrowUp","PageDown","End"],UB=[...PB,...o3],zB={ltr:[...F1,"ArrowRight"],rtl:[...F1,"ArrowLeft"]},FB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_h="Menu",[Xf,HB,$B]=vB(_h),[Tc,i3]=Sr(_h,[$B,Eo,hy]),Nh=Eo(),l3=hy(),[c3,xl]=Tc(_h),[VB,Ah]=Tc(_h),u3=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:c=!0}=e,u=Nh(t),[f,m]=h.useState(null),y=h.useRef(!1),g=Us(i),x=jh(s);return h.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(c3,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:m,children:a.jsx(VB,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:x,modal:c,children:r})})})};u3.displayName=_h;var BB="MenuAnchor",vS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Nh(n);return a.jsx(dd,{...s,...r,ref:t})});vS.displayName=BB;var bS="MenuPortal",[GB,d3]=Tc(bS,{forceMount:void 0}),f3=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=xl(bS,t);return a.jsx(GB,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};f3.displayName=bS;var ps="MenuContent",[qB,SS]=Tc(ps),h3=h.forwardRef((e,t)=>{const n=d3(ps,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=xl(ps,e.__scopeMenu),c=Ah(ps,e.__scopeMenu);return a.jsx(Xf.Provider,{scope:e.__scopeMenu,children:a.jsx(Vr,{present:r||i.open,children:a.jsx(Xf.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(KB,{...s,ref:t}):a.jsx(ZB,{...s,ref:t})})})})}),KB=h.forwardRef((e,t)=>{const n=xl(ps,e.__scopeMenu),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return ey(i)},[]),a.jsx(CS,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ZB=h.forwardRef((e,t)=>{const n=xl(ps,e.__scopeMenu);return a.jsx(CS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),YB=U1("MenuContent.ScrollLock"),CS=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,disableOutsideScroll:C,...S}=e,E=xl(ps,n),R=Ah(ps,n),j=Nh(n),_=l3(n),I=HB(n),[A,O]=h.useState(null),T=h.useRef(null),D=ht(t,T,E.onContentChange),k=h.useRef(0),B=h.useRef(""),G=h.useRef(0),Y=h.useRef(null),V=h.useRef("right"),Z=h.useRef(0),F=C?bh:h.Fragment,M=C?{as:YB,allowPinchZoom:!0}:void 0,$=oe=>{var J,le;const ge=B.current+oe,P=I().filter(ye=>!ye.disabled),U=document.activeElement,z=(J=P.find(ye=>ye.ref.current===U))==null?void 0:J.textValue,X=P.map(ye=>ye.textValue),W=iG(X,ge,z),ae=(le=P.find(ye=>ye.textValue===W))==null?void 0:le.ref.current;(function ye(Ce){B.current=Ce,window.clearTimeout(k.current),Ce!==""&&(k.current=window.setTimeout(()=>ye(""),1e3))})(ge),ae&&setTimeout(()=>ae.focus())};h.useEffect(()=>()=>window.clearTimeout(k.current),[]),Qg();const H=h.useCallback(oe=>{var P,U;return V.current===((P=Y.current)==null?void 0:P.side)&&cG(oe,(U=Y.current)==null?void 0:U.area)},[]);return a.jsx(qB,{scope:n,searchRef:B,onItemEnter:h.useCallback(oe=>{H(oe)&&oe.preventDefault()},[H]),onItemLeave:h.useCallback(oe=>{var ge;H(oe)||((ge=T.current)==null||ge.focus(),O(null))},[H]),onTriggerLeave:h.useCallback(oe=>{H(oe)&&oe.preventDefault()},[H]),pointerGraceTimerRef:G,onPointerGraceIntentChange:h.useCallback(oe=>{Y.current=oe},[]),children:a.jsx(F,{...M,children:a.jsx(vh,{asChild:!0,trapped:s,onMountAutoFocus:Ie(i,oe=>{var ge;oe.preventDefault(),(ge=T.current)==null||ge.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,children:a.jsx(a3,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Ie(f,oe=>{R.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Ch,{role:"menu","aria-orientation":"vertical","data-state":A3(E.open),"data-radix-menu-content":"",dir:R.dir,...j,...S,ref:D,style:{outline:"none",...S.style},onKeyDown:Ie(S.onKeyDown,oe=>{const P=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,U=oe.ctrlKey||oe.altKey||oe.metaKey,z=oe.key.length===1;P&&(oe.key==="Tab"&&oe.preventDefault(),!U&&z&&$(oe.key));const X=T.current;if(oe.target!==X||!UB.includes(oe.key))return;oe.preventDefault();const ae=I().filter(J=>!J.disabled).map(J=>J.ref.current);o3.includes(oe.key)&&ae.reverse(),sG(ae)}),onBlur:Ie(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(k.current),B.current="")}),onPointerMove:Ie(e.onPointerMove,Qf(oe=>{const ge=oe.target,P=Z.current!==oe.clientX;if(oe.currentTarget.contains(ge)&&P){const U=oe.clientX>Z.current?"right":"left";V.current=U,Z.current=oe.clientX}}))})})})})})})});h3.displayName=ps;var WB="MenuGroup",ES=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{role:"group",...r,ref:t})});ES.displayName=WB;var XB="MenuLabel",m3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{...r,ref:t})});m3.displayName=XB;var cg="MenuItem",OT="menu.itemSelect",my=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=h.useRef(null),c=Ah(cg,e.__scopeMenu),u=SS(cg,e.__scopeMenu),f=ht(t,i),m=h.useRef(!1),y=()=>{const g=i.current;if(!n&&g){const x=new CustomEvent(OT,{bubbles:!0,cancelable:!0});g.addEventListener(OT,v=>r==null?void 0:r(v),{once:!0}),GA(g,x),x.defaultPrevented?m.current=!1:c.onClose()}};return a.jsx(p3,{...s,ref:f,disabled:n,onClick:Ie(e.onClick,y),onPointerDown:g=>{var x;(x=e.onPointerDown)==null||x.call(e,g),m.current=!0},onPointerUp:Ie(e.onPointerUp,g=>{var x;m.current||(x=g.currentTarget)==null||x.click()}),onKeyDown:Ie(e.onKeyDown,g=>{const x=u.searchRef.current!=="";n||x&&g.key===" "||F1.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});my.displayName=cg;var p3=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=SS(cg,n),u=l3(n),f=h.useRef(null),m=ht(t,f),[y,g]=h.useState(!1),[x,v]=h.useState("");return h.useEffect(()=>{const C=f.current;C&&v((C.textContent??"").trim())},[i.children]),a.jsx(Xf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(s3,{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:m,onPointerMove:Ie(e.onPointerMove,Qf(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,Qf(C=>c.onItemLeave(C))),onFocus:Ie(e.onFocus,()=>g(!0)),onBlur:Ie(e.onBlur,()=>g(!1))})})})}),QB="MenuCheckboxItem",g3=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(S3,{scope:e.__scopeMenu,checked:n,children:a.jsx(my,{role:"menuitemcheckbox","aria-checked":ug(n)?"mixed":n,...s,ref:t,"data-state":jS(n),onSelect:Ie(s.onSelect,()=>r==null?void 0:r(ug(n)?!0:!n),{checkForDefaultPrevented:!1})})})});g3.displayName=QB;var y3="MenuRadioGroup",[JB,eG]=Tc(y3,{value:void 0,onValueChange:()=>{}}),x3=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Us(r);return a.jsx(JB,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(ES,{...s,ref:t})})});x3.displayName=y3;var v3="MenuRadioItem",b3=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=eG(v3,e.__scopeMenu),i=n===s.value;return a.jsx(S3,{scope:e.__scopeMenu,checked:i,children:a.jsx(my,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":jS(i),onSelect:Ie(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});b3.displayName=v3;var wS="MenuItemIndicator",[S3,tG]=Tc(wS,{checked:!1}),C3=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=tG(wS,n);return a.jsx(Vr,{present:r||ug(i.checked)||i.checked===!0,children:a.jsx(Je.span,{...s,ref:t,"data-state":jS(i.checked)})})});C3.displayName=wS;var nG="MenuSeparator",E3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});E3.displayName=nG;var rG="MenuArrow",w3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Nh(n);return a.jsx(Eh,{...s,...r,ref:t})});w3.displayName=rG;var RS="MenuSub",[aG,R3]=Tc(RS),j3=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=xl(RS,t),c=Nh(t),[u,f]=h.useState(null),[m,y]=h.useState(null),g=Us(s);return h.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),a.jsx(ud,{...c,children:a.jsx(c3,{scope:t,open:r,onOpenChange:g,content:m,onContentChange:y,children:a.jsx(aG,{scope:t,contentId:er(),triggerId:er(),trigger:u,onTriggerChange:f,children:n})})})};j3.displayName=RS;var Nf="MenuSubTrigger",T3=h.forwardRef((e,t)=>{const n=xl(Nf,e.__scopeMenu),r=Ah(Nf,e.__scopeMenu),s=R3(Nf,e.__scopeMenu),i=SS(Nf,e.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},y=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>y,[y]),h.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),a.jsx(vS,{asChild:!0,...m,children:a.jsx(p3,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":A3(n.open),...e,ref:Xr(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:Ie(e.onPointerMove,Qf(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:Ie(e.onPointerLeave,Qf(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,E=S==="right",R=E?-5:5,j=x[E?"left":"right"],_=x[E?"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:Ie(e.onKeyDown,g=>{var v;const x=i.searchRef.current!=="";e.disabled||x&&g.key===" "||zB[r.dir].includes(g.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),g.preventDefault())})})})});T3.displayName=Nf;var _3="MenuSubContent",N3=h.forwardRef((e,t)=>{const n=d3(ps,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=xl(ps,e.__scopeMenu),c=Ah(ps,e.__scopeMenu),u=R3(_3,e.__scopeMenu),f=h.useRef(null),m=ht(t,f);return a.jsx(Xf.Provider,{scope:e.__scopeMenu,children:a.jsx(Vr,{present:r||i.open,children:a.jsx(Xf.Slot,{scope:e.__scopeMenu,children:a.jsx(CS,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:m,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:Ie(e.onFocusOutside,y=>{y.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,y=>{c.onClose(),y.preventDefault()}),onKeyDown:Ie(e.onKeyDown,y=>{var v;const g=y.currentTarget.contains(y.target),x=FB[c.dir].includes(y.key);g&&x&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),y.preventDefault())})})})})})});N3.displayName=_3;function A3(e){return e?"open":"closed"}function ug(e){return e==="indeterminate"}function jS(e){return ug(e)?"indeterminate":e?"checked":"unchecked"}function sG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function oG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function iG(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=oG(e,Math.max(i,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function lG(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],m=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-m)*(r-y)/(x-y)+m&&(s=!s)}return s}function cG(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return lG(n,t)}function Qf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var uG=u3,dG=vS,fG=f3,hG=h3,mG=ES,pG=m3,gG=my,yG=g3,xG=x3,vG=b3,bG=C3,SG=E3,CG=w3,EG=j3,wG=T3,RG=N3,py="DropdownMenu",[jG]=Sr(py,[i3]),Qr=i3(),[TG,D3]=jG(py),O3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Qr(t),m=h.useRef(null),[y,g]=ia({prop:s,defaultProp:i??!1,onChange:c,caller:py});return a.jsx(TG,{scope:t,triggerId:er(),triggerRef:m,contentId:er(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(x=>!x),[g]),modal:u,children:a.jsx(uG,{...f,open:y,onOpenChange:g,dir:r,modal:u,children:n})})};O3.displayName=py;var I3="DropdownMenuTrigger",M3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=D3(I3,n),c=Qr(n);return a.jsx(dG,{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:Xr(t,i.triggerRef),onPointerDown:Ie(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Ie(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});M3.displayName=I3;var _G="DropdownMenuPortal",k3=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Qr(t);return a.jsx(fG,{...r,...n})};k3.displayName=_G;var L3="DropdownMenuContent",P3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=D3(L3,n),i=Qr(n),c=h.useRef(!1);return a.jsx(hG,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,y=f.button===2||m;(!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)"}})});P3.displayName=L3;var NG="DropdownMenuGroup",AG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(mG,{...s,...r,ref:t})});AG.displayName=NG;var DG="DropdownMenuLabel",OG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(pG,{...s,...r,ref:t})});OG.displayName=DG;var IG="DropdownMenuItem",U3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(gG,{...s,...r,ref:t})});U3.displayName=IG;var MG="DropdownMenuCheckboxItem",kG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(yG,{...s,...r,ref:t})});kG.displayName=MG;var LG="DropdownMenuRadioGroup",PG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(xG,{...s,...r,ref:t})});PG.displayName=LG;var UG="DropdownMenuRadioItem",zG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(vG,{...s,...r,ref:t})});zG.displayName=UG;var FG="DropdownMenuItemIndicator",HG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(bG,{...s,...r,ref:t})});HG.displayName=FG;var $G="DropdownMenuSeparator",z3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(SG,{...s,...r,ref:t})});z3.displayName=$G;var VG="DropdownMenuArrow",BG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(CG,{...s,...r,ref:t})});BG.displayName=VG;var GG=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=Qr(t),[u,f]=ia({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx(EG,{...c,open:u,onOpenChange:f,children:n})},qG="DropdownMenuSubTrigger",F3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(wG,{...s,...r,ref:t})});F3.displayName=qG;var KG="DropdownMenuSubContent",H3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(RG,{...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)"}})});H3.displayName=KG;var ZG=O3,YG=M3,$3=k3,WG=P3,XG=U3,QG=z3,JG=GG,eq=F3,tq=H3;function _r({...e}){return a.jsx(ZG,{"data-slot":"dropdown-menu",...e})}function nq({...e}){return a.jsx($3,{"data-slot":"dropdown-menu-portal",...e})}function Nr({...e}){return a.jsx(YG,{"data-slot":"dropdown-menu-trigger",...e})}function Ar({className:e,sideOffset:t=4,...n}){return a.jsx($3,{children:a.jsx(WG,{"data-slot":"dropdown-menu-content",sideOffset:t,className:se("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(XG,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:se("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 ja({className:e,...t}){return a.jsx(QG,{"data-slot":"dropdown-menu-separator",className:se("bg-border -mx-1 my-1 h-px",e),...t})}function TS({...e}){return a.jsx(JG,{"data-slot":"dropdown-menu-sub",...e})}function _S({className:e,inset:t,children:n,...r}){return a.jsxs(eq,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:se("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(_a,{className:"ml-auto size-4"})]})}function NS({className:e,...t}){return a.jsx(tq,{"data-slot":"dropdown-menu-sub-content",className:se("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 rq="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",aq=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:rq,alt:"OWOX Logo",width:e,height:t,className:n}),V3=h.createContext(null),B3=h.createContext(()=>{});function sq(){return h.useContext(B3)}function dg(e){const t=h.useContext(V3);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function G3(){return dg(e=>e.project)}function Dh(){const{data:e,callState:t,error:n}=dg(r=>r.flags);return{flags:e,callState:t,error:n}}function oq({isOpen:e}){const{title:t}=G3();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(aq,{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(Bs,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Zr=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Zr||{});function q3(e,t){return function(){return e.apply(t,arguments)}}const{toString:iq}=Object.prototype,{getPrototypeOf:AS}=Object,{iterator:gy,toStringTag:K3}=Symbol,yy=(e=>t=>{const n=iq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ks=e=>(e=e.toLowerCase(),t=>yy(t)===e),xy=e=>t=>typeof t===e,{isArray:fd}=Array,Xu=xy("undefined");function Oh(e){return e!==null&&!Xu(e)&&e.constructor!==null&&!Xu(e.constructor)&&wa(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Z3=Ks("ArrayBuffer");function lq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Z3(e.buffer),t}const cq=xy("string"),wa=xy("function"),Y3=xy("number"),Ih=e=>e!==null&&typeof e=="object",uq=e=>e===!0||e===!1,Bp=e=>{if(yy(e)!=="object")return!1;const t=AS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(K3 in e)&&!(gy in e)},dq=e=>{if(!Ih(e)||Oh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},fq=Ks("Date"),hq=Ks("File"),mq=Ks("Blob"),pq=Ks("FileList"),gq=e=>Ih(e)&&wa(e.pipe),yq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wa(e.append)&&((t=yy(e))==="formdata"||t==="object"&&wa(e.toString)&&e.toString()==="[object FormData]"))},xq=Ks("URLSearchParams"),[vq,bq,Sq,Cq]=["ReadableStream","Request","Response","Headers"].map(Ks),Eq=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Mh(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(Oh(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 W3(e,t){if(Oh(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,X3=e=>!Xu(e)&&e!==nc;function H1(){const{caseless:e,skipUndefined:t}=X3(this)&&this||{},n={},r=(s,i)=>{const c=e&&W3(n,i)||i;Bp(n[c])&&Bp(s)?n[c]=H1(n[c],s):Bp(s)?n[c]=H1({},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]&&Mh(arguments[s],r);return n}const wq=(e,t,n,{allOwnKeys:r}={})=>(Mh(t,(s,i)=>{n&&wa(s)?e[i]=q3(s,n):e[i]=s},{allOwnKeys:r}),e),Rq=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jq=(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)},Tq=(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&&AS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},_q=(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},Nq=e=>{if(!e)return null;if(fd(e))return e;let t=e.length;if(!Y3(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Aq=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&AS(Uint8Array)),Dq=(e,t)=>{const r=(e&&e[gy]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Oq=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Iq=Ks("HTMLFormElement"),Mq=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),IT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),kq=Ks("RegExp"),Q3=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Mh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},Lq=e=>{Q3(e,(t,n)=>{if(wa(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(wa(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+"'")})}})},Pq=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return fd(e)?r(e):r(String(e).split(t)),n},Uq=()=>{},zq=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Fq(e){return!!(e&&wa(e.append)&&e[K3]==="FormData"&&e[gy])}const Hq=e=>{const t=new Array(10),n=(r,s)=>{if(Ih(r)){if(t.indexOf(r)>=0)return;if(Oh(r))return r;if(!("toJSON"in r)){t[s]=r;const i=fd(r)?[]:{};return Mh(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)},$q=Ks("AsyncFunction"),Vq=e=>e&&(Ih(e)||wa(e))&&wa(e.then)&&wa(e.catch),J3=((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",wa(nc.postMessage)),Bq=typeof queueMicrotask<"u"?queueMicrotask.bind(nc):typeof process<"u"&&process.nextTick||J3,Gq=e=>e!=null&&wa(e[gy]),me={isArray:fd,isArrayBuffer:Z3,isBuffer:Oh,isFormData:yq,isArrayBufferView:lq,isString:cq,isNumber:Y3,isBoolean:uq,isObject:Ih,isPlainObject:Bp,isEmptyObject:dq,isReadableStream:vq,isRequest:bq,isResponse:Sq,isHeaders:Cq,isUndefined:Xu,isDate:fq,isFile:hq,isBlob:mq,isRegExp:kq,isFunction:wa,isStream:gq,isURLSearchParams:xq,isTypedArray:Aq,isFileList:pq,forEach:Mh,merge:H1,extend:wq,trim:Eq,stripBOM:Rq,inherits:jq,toFlatObject:Tq,kindOf:yy,kindOfTest:Ks,endsWith:_q,toArray:Nq,forEachEntry:Dq,matchAll:Oq,isHTMLForm:Iq,hasOwnProperty:IT,hasOwnProp:IT,reduceDescriptors:Q3,freezeMethods:Lq,toObjectSet:Pq,toCamelCase:Mq,noop:Uq,toFiniteNumber:zq,findKey:W3,global:nc,isContextDefined:X3,isSpecCompliantForm:Fq,toJSONObject:Hq,isAsyncFn:$q,isThenable:Vq,setImmediate:J3,asap:Bq,isIterable:Gq};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 eD=St.prototype,tD={};["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=>{tD[e]={value:e}});Object.defineProperties(St,tD);Object.defineProperty(eD,"isAxiosError",{value:!0});St.from=(e,t,n,r,s,i)=>{const c=Object.create(eD);me.toFlatObject(e,c,function(y){return y!==Error.prototype},m=>m!=="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 qq=null;function $1(e){return me.isPlainObject(e)||me.isArray(e)}function nD(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function MT(e,t,n){return e?e.concat(t).map(function(s,i){return s=nD(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Kq(e){return me.isArray(e)&&!e.some($1)}const Zq=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function vy(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,E){return!me.isUndefined(E[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 m(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,E){let R=C;if(C&&!E&&typeof C=="object"){if(me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),C=JSON.stringify(C);else if(me.isArray(C)&&Kq(C)||(me.isFileList(C)||me.endsWith(S,"[]"))&&(R=me.toArray(C)))return S=nD(S),R.forEach(function(_,I){!(me.isUndefined(_)||_===null)&&t.append(c===!0?MT([S],I,i):c===null?S:S+"[]",m(_))}),!1}return $1(C)?!0:(t.append(MT(E,S,i),m(C)),!1)}const g=[],x=Object.assign(Zq,{defaultVisitor:y,convertValue:m,isVisitable:$1});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 kT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function DS(e,t){this._pairs=[],e&&vy(e,this,t)}const rD=DS.prototype;rD.append=function(t,n){this._pairs.push([t,n])};rD.toString=function(t){const n=t?function(r){return t.call(this,r,kT)}:kT;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Yq(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aD(e,t,n){if(!t)return e;const r=n&&n.encode||Yq;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 DS(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class LT{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 sD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wq=typeof URLSearchParams<"u"?URLSearchParams:DS,Xq=typeof FormData<"u"?FormData:null,Qq=typeof Blob<"u"?Blob:null,Jq={isBrowser:!0,classes:{URLSearchParams:Wq,FormData:Xq,Blob:Qq},protocols:["http","https","file","blob","url","data"]},OS=typeof window<"u"&&typeof document<"u",V1=typeof navigator=="object"&&navigator||void 0,eK=OS&&(!V1||["ReactNative","NativeScript","NS"].indexOf(V1.product)<0),tK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",nK=OS&&window.location.href||"http://localhost",rK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:OS,hasStandardBrowserEnv:eK,hasStandardBrowserWebWorkerEnv:tK,navigator:V1,origin:nK},Symbol.toStringTag,{value:"Module"})),Kr={...rK,...Jq};function aK(e,t){return vy(e,new Kr.classes.URLSearchParams,{visitor:function(n,r,s,i){return Kr.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function sK(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function oK(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 oD(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]=oK(s[c])),!u)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,s)=>{t(sK(r),s,n,0)}),n}return null}function iK(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 kh={transitional:sD,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(oD(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 aK(t,this.formSerializer).toString();if((u=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return vy(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),iK(t)):t}],transformResponse:[function(t){const n=this.transitional||kh.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:Kr.classes.FormData,Blob:Kr.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=>{kh.headers[e]={}});const lK=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"]),cK=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]&&lK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},PT=Symbol("internals");function xf(e){return e&&String(e).trim().toLowerCase()}function Gp(e){return e===!1||e==null?e:me.isArray(e)?e.map(Gp):String(e)}function uK(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 dK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function L0(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 fK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function hK(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 Ra=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,m){const y=xf(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||m===!0||m===void 0&&s[g]!==!1)&&(s[g||f]=Gp(u))}const c=(u,f)=>me.forEach(u,(m,y)=>i(m,y,f));if(me.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(me.isString(t)&&(t=t.trim())&&!dK(t))c(cK(t),n);else if(me.isObject(t)&&me.isIterable(t)){let u={},f,m;for(const y of t){if(!me.isArray(y))throw TypeError("Object iterator must return a key-value pair");u[m=y[0]]=(f=u[m])?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=xf(t),t){const r=me.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return uK(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=xf(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||L0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=xf(c),c){const u=me.findKey(r,c);u&&(!n||L0(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||L0(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]=Gp(s),delete n[i];return}const u=t?fK(i):String(i).trim();u!==i&&delete n[i],n[u]=Gp(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[PT]=this[PT]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=xf(c);r[u]||(hK(s,c),r[u]=!0)}return me.isArray(t)?t.forEach(i):i(t),this}};Ra.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(Ra.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(Ra);function P0(e,t){const n=this||kh,r=t||n,s=Ra.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 iD(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 lD(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 mK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function pK(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 m=Date.now(),y=r[i];c||(c=m),n[s]=f,r[s]=m;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),m-c<t)return;const v=y&&m-y;return v?Math.round(x*1e3/v):void 0}}function gK(e,t){let n=0,r=1e3/t,s,i;const c=(m,y=Date.now())=>{n=y,s=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const y=Date.now(),g=y-n;g>=r?c(m,y):(s=m,i||(i=setTimeout(()=>{i=null,c(s)},r-g)))},()=>s&&c(s)]}const fg=(e,t,n=3)=>{let r=0;const s=pK(50,250);return gK(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,m=s(f),y=c<=u;r=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:m||void 0,estimated:m&&u&&y?(u-c)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},UT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},zT=e=>(...t)=>me.asap(()=>e(...t)),yK=Kr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Kr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Kr.origin),Kr.navigator&&/(msie|trident)/i.test(Kr.navigator.userAgent)):()=>!0,xK=Kr.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 vK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function bK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cD(e,t,n){let r=!vK(t);return e&&(r||n==!1)?bK(e,t):t}const FT=e=>e instanceof Ra?{...e}:e;function dc(e,t){t=t||{};const n={};function r(m,y,g,x){return me.isPlainObject(m)&&me.isPlainObject(y)?me.merge.call({caseless:x},m,y):me.isPlainObject(y)?me.merge({},y):me.isArray(y)?y.slice():y}function s(m,y,g,x){if(me.isUndefined(y)){if(!me.isUndefined(m))return r(void 0,m,g,x)}else return r(m,y,g,x)}function i(m,y){if(!me.isUndefined(y))return r(void 0,y)}function c(m,y){if(me.isUndefined(y)){if(!me.isUndefined(m))return r(void 0,m)}else return r(void 0,y)}function u(m,y,g){if(g in t)return r(m,y);if(g in e)return r(void 0,m)}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:(m,y,g)=>s(FT(m),FT(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 uD=e=>{const t=dc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=Ra.from(c),t.url=aD(cD(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(Kr.hasStandardBrowserEnv||Kr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([y,g])=>{m.includes(y.toLowerCase())&&c.set(y,g)})}}if(Kr.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&yK(t.url))){const f=s&&i&&xK.read(i);f&&c.set(s,f)}return t},SK=typeof XMLHttpRequest<"u",CK=SK&&function(e){return new Promise(function(n,r){const s=uD(e);let i=s.data;const c=Ra.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=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 E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const _=Ra.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),A={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:_,config:e,request:E};lD(function(T){n(T),S()},function(T){r(T),S()},A),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(r(new St("Request aborted",St.ECONNABORTED,e,E)),E=null)},E.onerror=function(I){const A=I&&I.message?I.message:"Network Error",O=new St(A,St.ERR_NETWORK,e,E);O.event=I||null,r(O),E=null},E.ontimeout=function(){let I=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||sD;s.timeoutErrorMessage&&(I=s.timeoutErrorMessage),r(new St(I,A.clarifyTimeoutError?St.ETIMEDOUT:St.ECONNABORTED,e,E)),E=null},i===void 0&&c.setContentType(null),"setRequestHeader"in E&&me.forEach(c.toJSON(),function(I,A){E.setRequestHeader(A,I)}),me.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),m&&([x,C]=fg(m,!0),E.addEventListener("progress",x)),f&&E.upload&&([g,v]=fg(f),E.upload.addEventListener("progress",g),E.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(y=_=>{E&&(r(!_||_.type?new hd(null,e,E):_),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(y),s.signal&&(s.signal.aborted?y():s.signal.addEventListener("abort",y)));const j=mK(s.url);if(j&&Kr.protocols.indexOf(j)===-1){r(new St("Unsupported protocol "+j+":",St.ERR_BAD_REQUEST,e));return}E.send(i||null)})},EK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(m){if(!s){s=!0,u();const y=m instanceof Error?m: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(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),e=null)};e.forEach(m=>m.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>me.asap(u),f}},wK=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},RK=async function*(e,t){for await(const n of jK(e))yield*wK(n,t)},jK=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()}},HT=(e,t,n,r)=>{const s=RK(e,t);let i=0,c,u=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:m,value:y}=await s.next();if(m){u(),f.close();return}let g=y.byteLength;if(n){let x=i+=g;n(x)}f.enqueue(new Uint8Array(y))}catch(m){throw u(m),m}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},$T=64*1024,{isFunction:xp}=me,TK=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:VT,TextEncoder:BT}=me.global,GT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_K=e=>{e=me.merge.call({skipUndefined:!0},TK,e);const{fetch:t,Request:n,Response:r}=e,s=t?xp(t):typeof fetch=="function",i=xp(n),c=xp(r);if(!s)return!1;const u=s&&xp(VT),f=s&&(typeof BT=="function"?(C=>S=>C.encode(S))(new BT):async C=>new Uint8Array(await new n(C).arrayBuffer())),m=i&&u&>(()=>{let C=!1;const S=new n(Kr.origin,{body:new VT,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!S}),y=c&&u&>(()=>me.isReadableStream(new r("").body)),g={stream:y&&(C=>C.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(S,E)=>{let R=S&&S[C];if(R)return R.call(S);throw new St(`Response type '${C}' is not supported`,St.ERR_NOT_SUPPORT,E)})});const x=async C=>{if(C==null)return 0;if(me.isBlob(C))return C.size;if(me.isSpecCompliantForm(C))return(await new n(Kr.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 E=me.toFiniteNumber(C.getContentLength());return E??x(S)};return async C=>{let{url:S,method:E,data:R,signal:j,cancelToken:_,timeout:I,onDownloadProgress:A,onUploadProgress:O,responseType:T,headers:D,withCredentials:k="same-origin",fetchOptions:B}=uD(C),G=t||fetch;T=T?(T+"").toLowerCase():"text";let Y=EK([j,_&&_.toAbortSignal()],I),V=null;const Z=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let F;try{if(O&&m&&E!=="get"&&E!=="head"&&(F=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[z,X]=UT(F,fg(zT(O)));R=HT(P.body,$T,z,X)}}me.isString(k)||(k=k?"include":"omit");const M=i&&"credentials"in n.prototype,$={...B,signal:Y,method:E.toUpperCase(),headers:D.normalize().toJSON(),body:R,duplex:"half",credentials:M?k:void 0};V=i&&new n(S,$);let H=await(i?G(V,B):G(S,$));const oe=y&&(T==="stream"||T==="response");if(y&&(A||oe&&Z)){const P={};["status","statusText","headers"].forEach(W=>{P[W]=H[W]});const U=me.toFiniteNumber(H.headers.get("content-length")),[z,X]=A&&UT(U,fg(zT(A),!0))||[];H=new r(HT(H.body,$T,z,()=>{X&&X(),Z&&Z()}),P)}T=T||"text";let ge=await g[me.findKey(g,T)||"text"](H,C);return!oe&&Z&&Z(),await new Promise((P,U)=>{lD(P,U,{data:ge,headers:Ra.from(H.headers),status:H.status,statusText:H.statusText,config:C,request:V})})}catch(M){throw Z&&Z(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new St("Network Error",St.ERR_NETWORK,C,V),{cause:M.cause||M}):St.from(M,M&&M.code,C,V)}}},NK=new Map,dD=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,m,y=NK;for(;u--;)f=i[u],m=y.get(f),m===void 0&&y.set(f,m=u?new Map:_K(t)),y=m;return m};dD();const IS={http:qq,xhr:CK,fetch:{get:dD}};me.forEach(IS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qT=e=>`- ${e}`,AK=e=>me.isFunction(e)||e===null||e===!1;function DK(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,!AK(r)&&(s=IS[(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,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=n?c.length>1?`since :
|
|
578
|
+
`+c.map(qT).join(`
|
|
579
|
+
`):" "+qT(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 fD={getAdapter:DK,adapters:IS};function U0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hd(null,e)}function KT(e){return U0(e),e.headers=Ra.from(e.headers),e.data=P0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),fD.getAdapter(e.adapter||kh.adapter,e)(e).then(function(r){return U0(e),r.data=P0.call(e,e.transformResponse,r),r.headers=Ra.from(r.headers),r},function(r){return iD(r)||(U0(e),r&&r.response&&(r.response.data=P0.call(e,e.transformResponse,r.response),r.response.headers=Ra.from(r.response.headers))),Promise.reject(r)})}const hD="1.13.2",by={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{by[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ZT={};by.transitional=function(t,n,r){function s(i,c){return"[Axios v"+hD+"] 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&&!ZT[c]&&(ZT[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}};by.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function OK(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 qp={assertOptions:OK,validators:by},to=qp.validators;let sc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new LT,response:new LT}}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&&qp.assertOptions(r,{silentJSONParsing:to.transitional(to.boolean),forcedJSONParsing:to.transitional(to.boolean),clarifyTimeoutError:to.transitional(to.boolean)},!1),s!=null&&(me.isFunction(s)?n.paramsSerializer={serialize:s}:qp.assertOptions(s,{encode:to.function,serialize:to.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),qp.assertOptions(n,{baseUrl:to.spelling("baseURL"),withXsrfToken:to.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=Ra.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 m=[];this.interceptors.response.forEach(function(S){m.push(S.fulfilled,S.rejected)});let y,g=0,x;if(!f){const C=[KT.bind(this),void 0];for(C.unshift(...u),C.push(...m),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(E){S.call(this,E);break}}try{y=KT.call(this,v)}catch(C){return Promise.reject(C)}for(g=0,x=m.length;g<x;)y=y.then(m[g++],m[g++]);return y}getUri(t){t=dc(this.defaults,t);const n=cD(t.baseURL,t.url,t.allowAbsoluteUrls);return aD(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 IK=class mD{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 mD(function(s){t=s}),cancel:t}}};function MK(e){return function(n){return e.apply(null,n)}}function kK(e){return me.isObject(e)&&e.isAxiosError===!0}const B1={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(B1).forEach(([e,t])=>{B1[t]=e});function pD(e){const t=new sc(e),n=q3(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 pD(dc(e,s))},n}const tr=pD(kh);tr.Axios=sc;tr.CanceledError=hd;tr.CancelToken=IK;tr.isCancel=iD;tr.VERSION=hD;tr.toFormData=vy;tr.AxiosError=St;tr.Cancel=tr.CanceledError;tr.all=function(t){return Promise.all(t)};tr.spread=MK;tr.isAxiosError=kK;tr.mergeConfig=dc;tr.AxiosHeaders=Ra;tr.formToJSON=e=>oD(me.isHTMLForm(e)?new FormData(e):e);tr.getAdapter=fD.getAdapter;tr.HttpStatusCode=B1;tr.default=tr;const{Axios:Zhe,AxiosError:YT,CanceledError:Yhe,isCancel:Whe,CancelToken:Xhe,VERSION:Qhe,all:Jhe,Cancel:eme,isAxiosError:tme,spread:nme,toFormData:rme,AxiosHeaders:LK,HttpStatusCode:ame,formToJSON:sme,getAdapter:ome,mergeConfig:ime}=tr;function PK(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 UK(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 MS=tr.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function zK(){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 FK(){const e=new URL(Qu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",Qu.SIGN_IN),window.location.href=e.toString()}async function HK(){try{return(await MS.post(Qu.ACCESS_TOKEN,{})).data}catch(e){const t=UK(e);throw new Error(t.message)}}async function $K(e){const t=await MS.get(Qu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return PK(t.data)}async function VK(e){return(await MS.get(Qu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const gD=h.createContext(null);class BK{constructor(t,n){eo(this,"getToken");eo(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let kS=null;function GK(e){kS=e}function LS(){return kS}function vp(){kS=null}const qK=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Le=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",yD(e)},KK=e=>{Le({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},ZK=()=>{Le({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},yD=e=>{var t;if(typeof window<"u"){qK();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function YK(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Zr.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Zr.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Zr.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Zr.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const WK={status:Zr.LOADING,session:null,user:null};function XK({children:e}){var y;const[t,n]=h.useReducer(YK,WK);h.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const x=new BK(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());GK(x)}else vp()},[(y=t.session)==null?void 0:y.accessToken]);const r=h.useCallback(()=>{zK()},[]);async function s(){try{const x=(await HK()).accessToken;if(!x)throw new Error("Invalid token received");const v={accessToken:x},C=await $K(x);return n({type:"SET_USER",payload:{user:C}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),x}catch(g){throw vp(),n({type:"SET_UNAUTHENTICATED"}),g}}const i=h.useCallback(async()=>{await s()},[]),c=h.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),vp(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=h.useCallback(()=>{try{ZK()}finally{FK()}},[]),f=h.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t.user&&(yD({projectId:t.user.projectId}),KK({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),h.useEffect(()=>{const g=()=>{u()};return window.addEventListener("auth:logout",g),()=>{window.removeEventListener("auth:logout",g),vp()}},[u]);const m={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(gD.Provider,{value:m,children:e})}function hi(){const e=h.useContext(gD);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function xD(){const{status:e,session:t,user:n,error:r}=hi();return{status:e,session:t,user:n,error:r,isLoading:e===Zr.LOADING,isAuthenticated:e===Zr.AUTHENTICATED,isUnauthenticated:e===Zr.UNAUTHENTICATED,hasError:e===Zr.ERROR}}function QK(){const{user:e}=hi();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 WT({message:e}){return a.jsx(Uu,{fullScreen:!0,message:e})}function XT(){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(Ee,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function JK({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=xD();return r?a.jsx(WT,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(WT,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(XT,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(XT,{})}const vD=h.createContext(null);function bD(){const e=h.useContext(vD);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const eZ="/ui",tZ=()=>eZ,hg=(e,t)=>{const n=tZ(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function nZ(){const{projects:e,loadProjects:t,error:n,isLoading:r}=bD(),{user:s}=hi();return a.jsxs(TS,{children:[a.jsx(ja,{}),a.jsxs(_S,{className:"flex items-center gap-2",children:[a.jsx(iP,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(nq,{children:a.jsxs(NS,{children:[r&&a.jsx(Nt,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Ec,{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(mh,{to:hg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(oa,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function rZ(){return a.jsx(nZ,{})}const aZ=({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"})}),SD=({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"})]}),CD=({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"})]}),sZ=({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"})]}),oZ=({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"})]}),iZ=({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"})]}),ED=({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"})]}),lZ=({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"})}),cZ=({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"})]}),uZ=({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}}),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",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"})]}),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",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"})]}),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.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"})]}),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",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"})]}),pZ=({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"})]}),gZ=({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"})]}),yZ=({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"})]}),xZ=({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"})]}),vZ=({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)"})})]})]}),bZ=({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"})]}),SZ=({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 wo({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:se("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 wD({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(E,R)=>{if(!E||R.length===0)return!1;try{const j=JSON.parse(E),_=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),[m,y]=h.useState(f),[g,x]=h.useState(!1);h.useEffect(()=>{i?y(!1):(!e||n.length===0||!u(e,n))&&y(!0)},[e,n,i]),h.useEffect(()=>{if(g){const E=setTimeout(()=>{x(!1)},2e3);return()=>{clearTimeout(E)}}},[g]);const v=()=>{navigator.clipboard.writeText(e),x(!0)},C=E=>{if(!E)return"";try{const R=JSON.parse(E),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 k=D.length;k>30?O[T]="*".repeat(Math.min(20,Math.ceil(k/3))):k>10?O[T]="*".repeat(Math.min(10,Math.ceil(k/2))):O[T]="*".repeat(k)}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 E}},S=e&&n.length>0&&u(e,n);return a.jsxs("div",{className:"relative",children:[!m&&S&&!i&&a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(_U,{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(wo,{value:m?e:C(e),onChange:E=>{(m||!S)&&t&&t(E.target.value)},onFocus:E=>{!m&&S&&E.target.blur()},readOnly:!!(!m&&S),className:`font-mono ${r??""} ${!m&&S?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),S&&!i&&a.jsx(Ee,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{y(!m)},children:m?a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ZP,{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(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(CA,{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(Ee,{type:"button",variant:"ghost",className:`absolute ${S&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:g?a.jsxs(a.Fragment,{children:[a.jsx(oa,{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 nn;(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})(nn||(nn={}));var QT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(QT||(QT={}));const Be=nn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gi=e=>{switch(typeof e){case"undefined":return Be.undefined;case"string":return Be.string;case"number":return Number.isNaN(e)?Be.nan:Be.number;case"boolean":return Be.boolean;case"function":return Be.function;case"bigint":return Be.bigint;case"symbol":return Be.symbol;case"object":return Array.isArray(e)?Be.array:e===null?Be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Be.promise:typeof Map<"u"&&e instanceof Map?Be.map:typeof Set<"u"&&e instanceof Set?Be.set:typeof Date<"u"&&e instanceof Date?Be.date:Be.object;default:return Be.unknown}},Te=nn.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 ii 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 m=c.path[f];f===c.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(n(c))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return s(this),r}static assert(t){if(!(t instanceof ii))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nn.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()}}ii.create=e=>new ii(e);const G1=(e,t)=>{let n;switch(e.code){case Te.invalid_type:e.received===Be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,nn.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:n=`Unrecognized key(s) in object: ${nn.joinValues(e.keys,", ")}`;break;case Te.invalid_union:n="Invalid input";break;case Te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${nn.joinValues(e.options)}`;break;case Te.invalid_enum_value:n=`Invalid enum value. Expected ${nn.joinValues(e.options)}, received '${e.received}'`;break;case Te.invalid_arguments:n="Invalid function arguments";break;case Te.invalid_return_type:n="Invalid function return type";break;case Te.invalid_date:n="Invalid date";break;case Te.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}"`:nn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Te.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 Te.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 Te.custom:n="Invalid input";break;case Te.invalid_intersection_types:n="Intersection results could not be merged";break;case Te.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Te.not_finite:n="Number must be finite";break;default:n=t.defaultError,nn.assertNever(e)}return{message:n}};let CZ=G1;function EZ(){return CZ}const wZ=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(m=>!!m).slice().reverse();for(const m of f)u=m(c,{data:t,defaultError:u}).message;return{...s,path:i,message:u}};function Ue(e,t){const n=EZ(),r=wZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===G1?void 0:G1].filter(s=>!!s)});e.common.issues.push(r)}class la{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 ut;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 la.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 ut;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 ut=Object.freeze({status:"aborted"}),Af=e=>({status:"dirty",value:e}),bs=e=>({status:"valid",value:e}),JT=e=>e.status==="aborted",e_=e=>e.status==="dirty",Ju=e=>e.status==="valid",mg=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 bo{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 t_=(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 ii(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 Vt{get description(){return this._def.description}_getType(t){return Gi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Gi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new la,ctx:{common:t.parent.common,data:t.data,parsedType:Gi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(mg(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:Gi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return t_(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:Gi(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:Gi(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(mg(s)?s:Promise.resolve(s));return t_(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:Te.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:dt.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 ei.create(this,this._def)}nullable(){return pc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ho.create(this)}promise(){return Cg.create(this,this._def)}or(t){return yg.create([this,t],this._def)}and(t){return xg.create(this,t,this._def)}transform(t){return new mc({...At(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Eg({...At(this._def),innerType:this,defaultValue:n,typeName:dt.ZodDefault})}brand(){return new _D({typeName:dt.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:dt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return US.create(this,t)}readonly(){return Rg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const RZ=/^c[^\s-]{8,}$/i,jZ=/^[0-9a-z]+$/,TZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_Z=/^[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,NZ=/^[a-z0-9_-]{21}$/i,AZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DZ=/^[-+]?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)?)??$/,OZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let z0;const MZ=/^(?:(?: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])$/,kZ=/^(?:(?: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])$/,LZ=/^(([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]))$/,PZ=/^(([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])$/,UZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RD="((\\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])))",FZ=new RegExp(`^${RD}$`);function jD(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 HZ(e){return new RegExp(`^${jD(e)}$`)}function $Z(e){let t=`${RD}T${jD(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 VZ(e,t){return!!((t==="v4"||!t)&&MZ.test(e)||(t==="v6"||!t)&&LZ.test(e))}function BZ(e,t){if(!AZ.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 GZ(e,t){return!!((t==="v4"||!t)&&kZ.test(e)||(t==="v6"||!t)&&PZ.test(e))}class Jo extends Vt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Be.string){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_type,expected:Be.string,received:i.parsedType}),ut}const r=new la;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.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),Ue(s,{code:Te.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?Ue(s,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&Ue(s,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")OZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"email",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")z0||(z0=new RegExp(IZ,"u")),z0.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"emoji",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")_Z.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"uuid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")NZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"nanoid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")RZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")jZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid2",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")TZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ulid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Ue(s,{validation:"url",code:Te.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),Ue(s,{validation:"regex",code:Te.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),Ue(s,{code:Te.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),Ue(s,{code:Te.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?$Z(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?FZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?HZ(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?DZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"duration",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?VZ(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ip",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?BZ(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"jwt",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?GZ(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cidr",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?UZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?zZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64url",code:Te.invalid_string,message:i.message}),r.dirty()):nn.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Te.invalid_string,...Qe.errToObj(r)})}_addCheck(t){return new Jo({...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 Jo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jo({...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}}Jo.create=e=>new Jo({checks:[],typeName:dt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});function qZ(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 Vt{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)!==Be.number){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_type,expected:Be.number,received:i.parsedType}),ut}let r;const s=new la;for(const i of this._def.checks)i.kind==="int"?nn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.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),Ue(r,{code:Te.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),Ue(r,{code:Te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?qZ(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.not_finite,message:i.message}),s.dirty()):nn.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"&&nn.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:dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class Jf extends Vt{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)!==Be.bigint)return this._getInvalidInput(t);let r;const s=new la;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),Ue(r,{code:Te.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),Ue(r,{code:Te.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),Ue(r,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):nn.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Te.invalid_type,expected:Be.bigint,received:n.parsedType}),ut}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 Jf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new Jf({...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}}Jf.create=e=>new Jf({checks:[],typeName:dt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});class q1 extends Vt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Be.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Be.boolean,received:r.parsedType}),ut}return bs(t.data)}}q1.create=e=>new q1({typeName:dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class pg extends Vt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Be.date){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_type,expected:Be.date,received:i.parsedType}),ut}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_date}),ut}const r=new la;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.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),Ue(s,{code:Te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):nn.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pg({...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}}pg.create=e=>new pg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:dt.ZodDate,...At(e)});class n_ extends Vt{_parse(t){if(this._getType(t)!==Be.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Be.symbol,received:r.parsedType}),ut}return bs(t.data)}}n_.create=e=>new n_({typeName:dt.ZodSymbol,...At(e)});class K1 extends Vt{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Be.undefined,received:r.parsedType}),ut}return bs(t.data)}}K1.create=e=>new K1({typeName:dt.ZodUndefined,...At(e)});class gg extends Vt{_parse(t){if(this._getType(t)!==Be.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Be.null,received:r.parsedType}),ut}return bs(t.data)}}gg.create=e=>new gg({typeName:dt.ZodNull,...At(e)});class r_ extends Vt{constructor(){super(...arguments),this._any=!0}_parse(t){return bs(t.data)}}r_.create=e=>new r_({typeName:dt.ZodAny,...At(e)});class Z1 extends Vt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bs(t.data)}}Z1.create=e=>new Z1({typeName:dt.ZodUnknown,...At(e)});class hl extends Vt{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Te.invalid_type,expected:Be.never,received:n.parsedType}),ut}}hl.create=e=>new hl({typeName:dt.ZodNever,...At(e)});class a_ extends Vt{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Be.void,received:r.parsedType}),ut}return bs(t.data)}}a_.create=e=>new a_({typeName:dt.ZodVoid,...At(e)});class ho extends Vt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Be.array)return Ue(n,{code:Te.invalid_type,expected:Be.array,received:n.parsedType}),ut;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(Ue(n,{code:c?Te.too_big:Te.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&&(Ue(n,{code:Te.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&&(Ue(n,{code:Te.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 bo(n,c,n.path,u)))).then(c=>la.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new bo(n,c,n.path,u)));return la.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new ho({...this._def,minLength:{value:t,message:Qe.toString(n)}})}max(t,n){return new ho({...this._def,maxLength:{value:t,message:Qe.toString(n)}})}length(t,n){return new ho({...this._def,exactLength:{value:t,message:Qe.toString(n)}})}nonempty(t){return this.min(1,t)}}ho.create=(e,t)=>new ho({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.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]=ei.create(Ru(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof ho?new ho({...e._def,type:Ru(e.element)}):e instanceof ei?ei.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 Vt{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=nn.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Be.object){const m=this._getOrReturnCtx(t);return Ue(m,{code:Te.invalid_type,expected:Be.object,received:m.parsedType}),ut}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof hl&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||u.push(m);const f=[];for(const m of c){const y=i[m],g=s.data[m];f.push({key:{status:"valid",value:m},value:y._parse(new bo(s,g,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof hl){const m=this._def.unknownKeys;if(m==="passthrough")for(const y of u)f.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(m==="strict")u.length>0&&(Ue(s,{code:Te.unrecognized_keys,keys:u}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const y of u){const g=s.data[y];f.push({key:{status:"valid",value:y},value:m._parse(new bo(s,g,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const y of f){const g=await y.key,x=await y.value;m.push({key:g,value:x,alwaysSet:y.alwaysSet})}return m}).then(m=>la.mergeObjectSync(r,m)):la.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:dt.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 nn.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 nn.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 nn.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 nn.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ei;)i=i._def.innerType;n[r]=i}return new fr({...this._def,shape:()=>n})}keyof(){return TD(nn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});class yg extends Vt{_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 ii(u.ctx.common.issues));return Ue(n,{code:Te.invalid_union,unionErrors:c}),ut}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 m={...n,common:{...n.common,issues:[]},parent:null},y=f._parseSync({data:n.data,path:n.path,parent:m});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=c.map(f=>new ii(f));return Ue(n,{code:Te.invalid_union,unionErrors:u}),ut}}get options(){return this._def.options}}yg.create=(e,t)=>new yg({options:e,typeName:dt.ZodUnion,...At(t)});const Ko=e=>e instanceof W1?Ko(e.schema):e instanceof mc?Ko(e.innerType()):e instanceof bg?[e.value]:e instanceof hc?e.options:e instanceof Sg?nn.objectValues(e.enum):e instanceof Eg?Ko(e._def.innerType):e instanceof K1?[void 0]:e instanceof gg?[null]:e instanceof ei?[void 0,...Ko(e.unwrap())]:e instanceof pc?[null,...Ko(e.unwrap())]:e instanceof _D||e instanceof Rg?Ko(e.unwrap()):e instanceof wg?Ko(e._def.innerType):[];class PS extends Vt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.object)return Ue(n,{code:Te.invalid_type,expected:Be.object,received:n.parsedType}),ut;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}):(Ue(n,{code:Te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ut)}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=Ko(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 PS({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...At(r)})}}function Y1(e,t){const n=Gi(e),r=Gi(t);if(e===t)return{valid:!0,data:e};if(n===Be.object&&r===Be.object){const s=nn.objectKeys(t),i=nn.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=Y1(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===Be.array&&r===Be.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=Y1(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Be.date&&r===Be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class xg extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(JT(i)||JT(c))return ut;const u=Y1(i.value,c.value);return u.valid?((e_(i)||e_(c))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:Te.invalid_intersection_types}),ut)};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}))}}xg.create=(e,t,n)=>new xg({left:e,right:t,typeName:dt.ZodIntersection,...At(n)});class fc extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.array)return Ue(r,{code:Te.invalid_type,expected:Be.array,received:r.parsedType}),ut;if(r.data.length<this._def.items.length)return Ue(r,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ut;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Te.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 bo(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>la.mergeArray(n,c)):la.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:dt.ZodTuple,rest:null,...At(t)})};class vg extends Vt{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!==Be.object)return Ue(r,{code:Te.invalid_type,expected:Be.object,received:r.parsedType}),ut;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new bo(r,u,r.path,u)),value:c._parse(new bo(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?la.mergeObjectAsync(n,s):la.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Vt?new vg({keyType:t,valueType:n,typeName:dt.ZodRecord,...At(r)}):new vg({keyType:Jo.create(),valueType:t,typeName:dt.ZodRecord,...At(n)})}}class s_ extends Vt{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!==Be.map)return Ue(r,{code:Te.invalid_type,expected:Be.map,received:r.parsedType}),ut;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],m)=>({key:s._parse(new bo(r,u,r.path,[m,"key"])),value:i._parse(new bo(r,f,r.path,[m,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const f of c){const m=await f.key,y=await f.value;if(m.status==="aborted"||y.status==="aborted")return ut;(m.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(m.value,y.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const m=f.key,y=f.value;if(m.status==="aborted"||y.status==="aborted")return ut;(m.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(m.value,y.value)}return{status:n.value,value:u}}}}s_.create=(e,t,n)=>new s_({valueType:t,keyType:e,typeName:dt.ZodMap,...At(n)});class eh extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.set)return Ue(r,{code:Te.invalid_type,expected:Be.set,received:r.parsedType}),ut;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ue(r,{code:Te.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&&(Ue(r,{code:Te.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 m=new Set;for(const y of f){if(y.status==="aborted")return ut;y.status==="dirty"&&n.dirty(),m.add(y.value)}return{status:n.value,value:m}}const u=[...r.data.values()].map((f,m)=>i._parse(new bo(r,f,r.path,m)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new eh({...this._def,minSize:{value:t,message:Qe.toString(n)}})}max(t,n){return new eh({...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)}}eh.create=(e,t)=>new eh({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...At(t)});class W1 extends Vt{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})}}W1.create=(e,t)=>new W1({getter:e,typeName:dt.ZodLazy,...At(t)});class bg extends Vt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Te.invalid_literal,expected:this._def.value}),ut}return{status:"valid",value:t.data}}get value(){return this._def.value}}bg.create=(e,t)=>new bg({value:e,typeName:dt.ZodLiteral,...At(t)});function TD(e,t){return new hc({values:e,typeName:dt.ZodEnum,...At(t)})}class hc extends Vt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:nn.joinValues(r),received:n.parsedType,code:Te.invalid_type}),ut}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 Ue(n,{received:n.data,code:Te.invalid_enum_value,options:r}),ut}return bs(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=TD;class Sg extends Vt{_parse(t){const n=nn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Be.string&&r.parsedType!==Be.number){const s=nn.objectValues(n);return Ue(r,{expected:nn.joinValues(s),received:r.parsedType,code:Te.invalid_type}),ut}if(this._cache||(this._cache=new Set(nn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=nn.objectValues(n);return Ue(r,{received:r.data,code:Te.invalid_enum_value,options:s}),ut}return bs(t.data)}get enum(){return this._def.values}}Sg.create=(e,t)=>new Sg({values:e,typeName:dt.ZodNativeEnum,...At(t)});class Cg extends Vt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.promise&&n.common.async===!1)return Ue(n,{code:Te.invalid_type,expected:Be.promise,received:n.parsedType}),ut;const r=n.parsedType===Be.promise?n.data:Promise.resolve(n.data);return bs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cg.create=(e,t)=>new Cg({type:e,typeName:dt.ZodPromise,...At(t)});class mc extends Vt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.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=>{Ue(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 ut;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?ut:f.status==="dirty"||n.value==="dirty"?Af(f.value):f});{if(n.value==="aborted")return ut;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?ut:u.status==="dirty"||n.value==="dirty"?Af(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"?ut:(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"?ut:(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 ut;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})):ut);nn.assertNever(s)}}mc.create=(e,t,n)=>new mc({schema:e,typeName:dt.ZodEffects,effect:t,...At(n)});mc.createWithPreprocess=(e,t,n)=>new mc({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...At(n)});class ei extends Vt{_parse(t){return this._getType(t)===Be.undefined?bs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ei.create=(e,t)=>new ei({innerType:e,typeName:dt.ZodOptional,...At(t)});class pc extends Vt{_parse(t){return this._getType(t)===Be.null?bs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}pc.create=(e,t)=>new pc({innerType:e,typeName:dt.ZodNullable,...At(t)});class Eg extends Vt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Eg.create=(e,t)=>new Eg({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...At(t)});class wg extends Vt{_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 mg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ii(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ii(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}wg.create=(e,t)=>new wg({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...At(t)});class o_ extends Vt{_parse(t){if(this._getType(t)!==Be.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Be.nan,received:r.parsedType}),ut}return{status:"valid",value:t.data}}}o_.create=e=>new o_({typeName:dt.ZodNaN,...At(e)});class _D extends Vt{_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 US extends Vt{_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"?ut:i.status==="dirty"?(n.dirty(),Af(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"?ut: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 US({in:t,out:n,typeName:dt.ZodPipeline})}}class Rg extends Vt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Ju(s)&&(s.value=Object.freeze(s.value)),s);return mg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Rg.create=(e,t)=>new Rg({innerType:e,typeName:dt.ZodReadonly,...At(t)});var dt;(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"})(dt||(dt={}));const Dt=Jo.create,KZ=ed.create,ZZ=q1.create,YZ=gg.create,WZ=Z1.create;hl.create;const X1=ho.create,rn=fr.create,XZ=yg.create,zS=PS.create;xg.create;fc.create;const QZ=vg.create,Br=bg.create;hc.create;const Sy=Sg.create;Cg.create;ei.create;const JZ=pc.create,F0=ut,ND=rn({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:Te.custom,message:"Service Account must be a valid JSON object"}),F0):n.client_email?e:(t.addIssue({code:Te.custom,message:"Service Account must contain a client_email field"}),F0)}catch(n){return console.error(n),t.addIssue({code:Te.custom,message:"Service Account must be a valid JSON string"}),F0}})}),eY=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:aZ,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:Qj,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:TA,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:Qj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:bP,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:Jj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:Jj,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:Fr,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:Fr,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:LU,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:hP,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:hZ,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:rz,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:dZ,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function i_(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function tY(){const{flags:e}=Dh(),{loadProjects:t,projects:n}=bD(),{id:r}=G3(),s=i_("IDP_PROVIDER","owox",e);h.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:h.useMemo(()=>{const f=eY.filter(x=>typeof x.visible=="boolean"?x.visible:i_(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}),m=new Map;f.forEach(x=>{const v=x.group||"default";m.has(v)||m.set(v,[]);const C=m.get(v);C&&C.push(x)});const y=[],g=Array.from(m.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 nY(){const{visibleMenuItems:e,canSwitchProject:t}=tY();return a.jsxs(Ar,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(ja,{},`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(rZ,{},"switch-project")]})}var bt=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(bt||{});let rY={data:""},aY=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||rY},sY=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,oY=/\/\*[^]*?\*\/| +/g,l_=/\n+/g,Yi=(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"?Yi(c,i):i+"{"+Yi(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=Yi(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+=Yi.p?Yi.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Bo={},AD=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+AD(e[n]);return t}return e},iY=(e,t,n,r,s)=>{let i=AD(e),c=Bo[i]||(Bo[i]=(f=>{let m=0,y=11;for(;m<f.length;)y=101*y+f.charCodeAt(m++)>>>0;return"go"+y})(i));if(!Bo[c]){let f=i!==e?e:(m=>{let y,g,x=[{}];for(;y=sY.exec(m.replace(oY,""));)y[4]?x.shift():y[3]?(g=y[3].replace(l_," ").trim(),x.unshift(x[0][g]=x[0][g]||{})):x[0][y[1]]=y[2].replace(l_," ").trim();return x[0]})(e);Bo[c]=Yi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&Bo.g?Bo.g:null;return n&&(Bo.g=Bo[c]),((f,m,y,g)=>{g?m.data=m.data.replace(g,f):m.data.indexOf(f)===-1&&(m.data=y?f+m.data:m.data+f)})(Bo[c],t,r,u),c},lY=(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?"":Yi(u,""):u===!1?"":u}return r+s+(c??"")},"");function Cy(e){let t=this||{},n=e.call?e(t.p):e;return iY(n.unshift?n.raw?lY(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,aY(t.target),t.g,t.o,t.k)}let DD,Q1,J1;Cy.bind({g:1});let li=Cy.bind({k:1});function cY(e,t,n,r){Yi.p=t,DD=e,Q1=n,J1=r}function vl(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:Q1&&Q1()},u),n.o=/ *go\d+/.test(f),u.className=Cy.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=u.as||e,delete u.as),J1&&m[0]&&J1(u),DD(m,u)}return s}}var uY=e=>typeof e=="function",jg=(e,t)=>uY(e)?e(t):e,dY=(()=>{let e=0;return()=>(++e).toString()})(),OD=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),fY=20,FS="default",ID=(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 ID(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}))}}},Kp=[],MD={toasts:[],pausedAt:void 0,settings:{toastLimit:fY}},lo={},kD=(e,t=FS)=>{lo[t]=ID(lo[t]||MD,e),Kp.forEach(([n,r])=>{n===t&&r(lo[t])})},LD=e=>Object.keys(lo).forEach(t=>kD(e,t)),hY=e=>Object.keys(lo).find(t=>lo[t].toasts.some(n=>n.id===e)),Ey=(e=FS)=>t=>{kD(t,e)},mY={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},pY=(e={},t=FS)=>{let[n,r]=h.useState(lo[t]||MD),s=h.useRef(lo[t]);h.useEffect(()=>(s.current!==lo[t]&&r(lo[t]),Kp.push([t,r]),()=>{let c=Kp.findIndex(([u])=>u===t);c>-1&&Kp.splice(c,1)}),[t]);let i=n.toasts.map(c=>{var u,f,m;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)||mY[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:i}},gY=(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)||dY()}),Lh=e=>(t,n)=>{let r=gY(t,e,n);return Ey(r.toasterId||hY(r.id))({type:2,toast:r}),r.id},Dn=(e,t)=>Lh("blank")(e,t);Dn.error=Lh("error");Dn.success=Lh("success");Dn.loading=Lh("loading");Dn.custom=Lh("custom");Dn.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Ey(t)(n):LD(n)};Dn.dismissAll=e=>Dn.dismiss(void 0,e);Dn.remove=(e,t)=>{let n={type:4,toastId:e};t?Ey(t)(n):LD(n)};Dn.removeAll=e=>Dn.remove(void 0,e);Dn.promise=(e,t,n)=>{let r=Dn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?jg(t.success,s):void 0;return i?Dn.success(i,{id:r,...n,...n==null?void 0:n.success}):Dn.dismiss(r),s}).catch(s=>{let i=t.error?jg(t.error,s):void 0;i?Dn.error(i,{id:r,...n,...n==null?void 0:n.error}):Dn.dismiss(r)}),e};var yY=1e3,xY=(e,t="default")=>{let{toasts:n,pausedAt:r}=pY(e,t),s=h.useRef(new Map).current,i=h.useCallback((g,x=yY)=>{if(s.has(g))return;let v=setTimeout(()=>{s.delete(g),c({type:4,toastId:g})},x);s.set(g,v)},[]);h.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&&Dn.dismiss(v.id);return}return setTimeout(()=>Dn.dismiss(v.id,t),C)});return()=>{x.forEach(v=>v&&clearTimeout(v))}},[n,r,t]);let c=h.useCallback(Ey(t),[t]),u=h.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=h.useCallback((g,x)=>{c({type:1,toast:{id:g,height:x}})},[c]),m=h.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),y=h.useCallback((g,x)=>{let{reverseOrder:v=!1,gutter:C=8,defaultPosition:S}=x||{},E=n.filter(_=>(_.position||S)===(g.position||S)&&_.height),R=E.findIndex(_=>_.id===g.id),j=E.filter((_,I)=>I<R&&_.visible).length;return E.filter(_=>_.visible).slice(...v?[j+1]:[0,j]).reduce((_,I)=>_+(I.height||0)+C,0)},[n]);return h.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:m,calculateOffset:y}}},vY=li`
|
|
581
|
+
from {
|
|
582
|
+
transform: scale(0) rotate(45deg);
|
|
583
|
+
opacity: 0;
|
|
584
|
+
}
|
|
585
|
+
to {
|
|
586
|
+
transform: scale(1) rotate(45deg);
|
|
587
|
+
opacity: 1;
|
|
588
|
+
}`,bY=li`
|
|
589
|
+
from {
|
|
590
|
+
transform: scale(0);
|
|
591
|
+
opacity: 0;
|
|
592
|
+
}
|
|
593
|
+
to {
|
|
594
|
+
transform: scale(1);
|
|
595
|
+
opacity: 1;
|
|
596
|
+
}`,SY=li`
|
|
597
|
+
from {
|
|
598
|
+
transform: scale(0) rotate(90deg);
|
|
599
|
+
opacity: 0;
|
|
600
|
+
}
|
|
601
|
+
to {
|
|
602
|
+
transform: scale(1) rotate(90deg);
|
|
603
|
+
opacity: 1;
|
|
604
|
+
}`,CY=vl("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: ${vY} 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: ${bY} 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: ${SY} 0.15s ease-out forwards;
|
|
634
|
+
animation-delay: 180ms;
|
|
635
|
+
transform: rotate(90deg);
|
|
636
|
+
}
|
|
637
|
+
`,EY=li`
|
|
638
|
+
from {
|
|
639
|
+
transform: rotate(0deg);
|
|
640
|
+
}
|
|
641
|
+
to {
|
|
642
|
+
transform: rotate(360deg);
|
|
643
|
+
}
|
|
644
|
+
`,wY=vl("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: ${EY} 1s linear infinite;
|
|
653
|
+
`,RY=li`
|
|
654
|
+
from {
|
|
655
|
+
transform: scale(0) rotate(45deg);
|
|
656
|
+
opacity: 0;
|
|
657
|
+
}
|
|
658
|
+
to {
|
|
659
|
+
transform: scale(1) rotate(45deg);
|
|
660
|
+
opacity: 1;
|
|
661
|
+
}`,jY=li`
|
|
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
|
+
}`,TY=vl("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: ${RY} 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: ${jY} 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
|
+
`,_Y=vl("div")`
|
|
703
|
+
position: absolute;
|
|
704
|
+
`,NY=vl("div")`
|
|
705
|
+
position: relative;
|
|
706
|
+
display: flex;
|
|
707
|
+
justify-content: center;
|
|
708
|
+
align-items: center;
|
|
709
|
+
min-width: 20px;
|
|
710
|
+
min-height: 20px;
|
|
711
|
+
`,AY=li`
|
|
712
|
+
from {
|
|
713
|
+
transform: scale(0.6);
|
|
714
|
+
opacity: 0.4;
|
|
715
|
+
}
|
|
716
|
+
to {
|
|
717
|
+
transform: scale(1);
|
|
718
|
+
opacity: 1;
|
|
719
|
+
}`,DY=vl("div")`
|
|
720
|
+
position: relative;
|
|
721
|
+
transform: scale(0.6);
|
|
722
|
+
opacity: 0.4;
|
|
723
|
+
min-width: 20px;
|
|
724
|
+
animation: ${AY} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
725
|
+
forwards;
|
|
726
|
+
`,OY=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?h.createElement(DY,null,t):t:n==="blank"?null:h.createElement(NY,null,h.createElement(wY,{...r}),n!=="loading"&&h.createElement(_Y,null,n==="error"?h.createElement(CY,{...r}):h.createElement(TY,{...r})))},IY=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
|
+
`,MY=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
|
+
`,kY="0%{opacity:0;} 100%{opacity:1;}",LY="0%{opacity:1;} 100%{opacity:0;}",PY=vl("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
|
+
`,UY=vl("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
|
+
`,zY=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=OD()?[kY,LY]:[IY(n),MY(n)];return{animation:t?`${li(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${li(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},FY=h.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?zY(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(OY,{toast:e}),c=h.createElement(UY,{...e.ariaProps},jg(e.message,e));return h.createElement(PY,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):h.createElement(h.Fragment,null,i,c))});cY(h.createElement);var HY=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=h.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 h.createElement("div",{ref:i,className:t,style:n},s)},$Y=(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:OD()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},VY=Cy`
|
|
752
|
+
z-index: 9999;
|
|
753
|
+
> * {
|
|
754
|
+
pointer-events: auto;
|
|
755
|
+
}
|
|
756
|
+
`,bp=16,BY=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:m}=xY(n,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:bp,left:bp,right:bp,bottom:bp,pointerEvents:"none",...c},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(y=>{let g=y.position||t,x=m.calculateOffset(y,{reverseOrder:e,gutter:r,defaultPosition:t}),v=$Y(g,x);return h.createElement(HY,{id:y.id,key:y.id,onHeightUpdate:m.updateHeight,className:y.visible?VY:"",style:v},y.type==="custom"?jg(y.message,y):s?s(y):h.createElement(FY,{toast:y,position:g}))}))},Tt=Dn;const un=e=>{var n;return(n=e.response)==null?void 0:n.data};function c_(e,t="Something went wrong"){var s,i;const n=un(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 PD(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 GY{constructor(){eo(this,"isRefreshingToken",!1);eo(this,"refreshTokenPromise",null);eo(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 qY={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},Ea=tr.create(qY),eb=new GY;Ea.interceptors.request.use(e=>{if(e.skipAuthHeader||new LK(e.headers).has("X-OWOX-Authorization"))return e;const n=LS(),r=(n==null?void 0:n.getAccessToken())??eb.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));Ea.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=LS();if(!i)throw new Error("No token provider available");const c=await eb.refreshToken(()=>i.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await Ea(t)}catch{return eb.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&&c_(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&c_(e,"Bad request"),Promise.reject(e)});const UD={projects:[],callState:bt.IDLE,error:null};function KY(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{...UD};default:return e}}function ZY({children:e}){const[t,n]=h.useReducer(KY,UD),r=h.useCallback(async()=>{n({type:"LOADING"});try{const u=LS();if(!u){n({type:"ERROR",payload:un(new YT("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:un(new YT("Unable to obtain access token"))});return}const m=await VK(f);n({type:"SUCCESS",payload:m})}catch(u){n({type:"ERROR",payload:un(u)})}},[]),s=h.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===bt.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(vD.Provider,{value:c,children:e})}function YY(){const[e,t]=h.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(oq,{isOpen:e}),a.jsx(ZY,{children:a.jsx(nY,{})})]})})})})}var WY=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,m=["light","dark"];function y(v){(Array.isArray(e)?e:[e]).forEach(C=>{let S=C==="class",E=S&&i?s.map(R=>i[R]||R):s;S?(f.classList.remove(...E),f.classList.add(i&&i[v]?i[v]:v)):f.setAttribute(C,v)}),g(v)}function g(v){u&&m.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{}},u_=["light","dark"],zD="(prefers-color-scheme: dark)",XY=typeof window>"u",HS=h.createContext(void 0),QY={setTheme:e=>{},themes:[]},md=()=>{var e;return(e=h.useContext(HS))!=null?e:QY},JY=e=>h.useContext(HS)?h.createElement(h.Fragment,null,e.children):h.createElement(tW,{...e}),eW=["light","dark"],tW=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=eW,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:m,nonce:y,scriptProps:g})=>{let[x,v]=h.useState(()=>rW(s,c)),[C,S]=h.useState(()=>x==="system"?H0():x),E=f?Object.values(f):i,R=h.useCallback(A=>{let O=A;if(!O)return;A==="system"&&n&&(O=H0());let T=f?f[O]:O,D=t?aW(y):null,k=document.documentElement,B=G=>{G==="class"?(k.classList.remove(...E),T&&k.classList.add(T)):G.startsWith("data-")&&(T?k.setAttribute(G,T):k.removeAttribute(G))};if(Array.isArray(u)?u.forEach(B):B(u),r){let G=u_.includes(c)?c:null,Y=u_.includes(O)?O:G;k.style.colorScheme=Y}D==null||D()},[y]),j=h.useCallback(A=>{let O=typeof A=="function"?A(x):A;v(O);try{localStorage.setItem(s,O)}catch{}},[x]),_=h.useCallback(A=>{let O=H0(A);S(O),x==="system"&&n&&!e&&R("system")},[x,e]);h.useEffect(()=>{let A=window.matchMedia(zD);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),h.useEffect(()=>{let A=O=>{O.key===s&&(O.newValue?v(O.newValue):j(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[j]),h.useEffect(()=>{R(e??x)},[e,x]);let I=h.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 h.createElement(HS.Provider,{value:I},h.createElement(nW,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:y,scriptProps:g}),m)},nW=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:m})=>{let y=JSON.stringify([n,t,i,e,u,c,r,s]).slice(1,-1);return h.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${WY.toString()})(${y})`}})}),rW=(e,t)=>{if(XY)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},aW=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)}},H0=e=>(e||(e=window.matchMedia(zD)),e.matches?"dark":"light");const sW=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:oW(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:wA},{value:"light",label:"Light",icon:NA},{value:"dark",label:"Dark",icon:RA}]}},{type:"separator"},{type:"item",title:"Sign out",icon:AU,onClick:n,className:"text-red-600 focus:text-red-600"}];function oW(e){switch(e){case"light":return NA;case"dark":return RA;case"system":default:return wA}}var zu=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))(zu||{});function tb({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 iW({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(tb,{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(Bs,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function lW({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(ja,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(TS,{children:[a.jsxs(_S,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(NS,{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(oa,{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 cW(){const{user:e,signOut:t}=hi(),{setTheme:n,theme:r}=md(),[s,i]=h.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,m=c??u??"Unknown User",y=PD(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(iW,{isOpen:s,displayName:m,email:u,avatar:f,initials:y}),a.jsx(lW,{items:sW({theme:r,setTheme:n,signOut:t})})]})})}function uW(){const{user:e,status:t}=hi();return t===Zr.LOADING||t===Zr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function mi(){const e=Sc(),t=uW(),n=h.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=hg(t,i);e(u,c)},[e,t]),r=h.useCallback(i=>t?hg(t,i):i,[t]);return h.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function dW(e,t=500){const[n,r]=h.useState(!1),s=h.useRef(!1),i=h.useRef(null),c=h.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 h.useEffect(()=>()=>{i.current&&clearTimeout(i.current),s.current=!1},[]),{trigger:c,isLocked:n}}function fW(){const{scope:e}=mi();return a.jsxs(mh,{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(ha,{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 hW=[{title:"Data Marts",url:"/data-marts",icon:tg},{title:"Storages",url:"/data-storages",icon:lc},{title:"Destinations",url:"/data-destinations",icon:Wb}];function mW(){const{scope:e}=mi();return a.jsx(uB,{children:hW.map(t=>{const n=t.icon;return a.jsx(dB,{children:a.jsx(mh,{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(Et,{delayDuration:500,children:[a.jsx(wt,{asChild:!0,children:a.jsxs(hB,{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 pW({variant:e="inset",collapsible:t="icon"}){return a.jsxs(rB,{variant:e,collapsible:t,children:[a.jsx(iB,{children:a.jsx(YY,{})}),a.jsxs(cB,{children:[a.jsx(NT,{children:a.jsx(AT,{children:a.jsx(fW,{})})}),a.jsx(NT,{children:a.jsx(AT,{children:a.jsx(mW,{})})})]}),a.jsx(lB,{children:a.jsx(cW,{})}),a.jsx(sB,{})]})}function gW({children:e,...t}){return a.jsx(JY,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class bl{constructor(t){eo(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await Ea.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await Ea.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await Ea.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await Ea.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await Ea.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class yW{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 co=new yW;class xW{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 vW=new xW;function bW({isLoading:e,className:t}){const[n,r]=h.useState(0),[s,i]=h.useState(!1);return h.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:se("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 FD=h.createContext({isLoading:!1});function SW({children:e}){const[t,n]=h.useState(0),r=t>0;return h.useEffect(()=>{const s=Ea.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=Ea.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()=>{Ea.interceptors.request.eject(s),Ea.interceptors.response.eject(i)}},[]),a.jsx(FD.Provider,{value:{isLoading:r},children:e})}function CW(){return h.useContext(FD)}function EW(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 wW=e=>{switch(e){case"success":return TW;case"info":return NW;case"warning":return _W;case"error":return AW;default:return null}},RW=Array(12).fill(0),jW=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},RW.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),TW=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"})),_W=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"})),NW=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"})),AW=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"})),DW=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"})),OW=()=>{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 nb=1;class IW{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:nb++,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 m=>{if(c=["resolve",m],re.isValidElement(m))i=!1,this.create({id:r,type:"default",message:m});else if(kW(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,x=typeof n.description=="function"?await n.description(m):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(m):n.success,x=typeof n.description=="function"?await n.description(m):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:x,...C})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){i=!1;const y=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):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((m,y)=>u.then(()=>c[0]==="reject"?y(c[1]):m(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)||nb++;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 Sa=new IW,MW=(e,t)=>{const n=(t==null?void 0:t.id)||nb++;return Sa.addToast({title:e,...t,id:n}),n},kW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LW=MW,PW=()=>Sa.toasts,UW=()=>Sa.getActiveToasts(),d_=Object.assign(LW,{success:Sa.success,info:Sa.info,warning:Sa.warning,error:Sa.error,custom:Sa.custom,message:Sa.message,promise:Sa.promise,dismiss:Sa.dismiss,loading:Sa.loading},{getHistory:PW,getToasts:UW});EW("[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 Sp(e){return e.label!==void 0}const zW=3,FW="24px",HW="16px",f_=4e3,$W=356,VW=14,BW=45,GW=200;function no(...e){return e.filter(Boolean).join(" ")}function qW(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const KW=e=>{var t,n,r,s,i,c,u,f,m;const{invert:y,toast:g,unstyled:x,interacting:v,setHeights:C,visibleToasts:S,heights:E,index:R,toasts:j,expanded:_,removeToast:I,defaultRichColors:A,closeButton:O,style:T,cancelButtonStyle:D,actionButtonStyle:k,className:B="",descriptionClassName:G="",duration:Y,position:V,gap:Z,expandByDefault:F,classNames:M,icons:$,closeButtonAriaLabel:H="Close toast"}=e,[oe,ge]=re.useState(null),[P,U]=re.useState(null),[z,X]=re.useState(!1),[W,ae]=re.useState(!1),[J,le]=re.useState(!1),[ye,Ce]=re.useState(!1),[Ve,De]=re.useState(!1),[et,rt]=re.useState(0),[dn,zt]=re.useState(0),On=re.useRef(g.duration||Y||f_),yn=re.useRef(null),Me=re.useRef(null),q=R===0,ne=R+1<=S,ce=g.type,Oe=g.dismissible!==!1,we=g.className||"",je=g.descriptionClassName||"",He=re.useMemo(()=>E.findIndex(Ye=>Ye.toastId===g.id)||0,[E,g.id]),mt=re.useMemo(()=>{var Ye;return(Ye=g.closeButton)!=null?Ye:O},[g.closeButton,O]),st=re.useMemo(()=>g.duration||Y||f_,[g.duration,Y]),Wt=re.useRef(0),sr=re.useRef(0),$n=re.useRef(0),Dr=re.useRef(null),[Jr,fn]=V.split("-"),or=re.useMemo(()=>E.reduce((Ye,Bt,Xt)=>Xt>=He?Ye:Ye+Bt.height,0),[E,He]),kn=OW(),Ys=g.invert||y,Aa=ce==="loading";sr.current=re.useMemo(()=>He*Z+or,[He,or]),re.useEffect(()=>{On.current=st},[st]),re.useEffect(()=>{X(!0)},[]),re.useEffect(()=>{const Ye=Me.current;if(Ye){const Bt=Ye.getBoundingClientRect().height;return zt(Bt),C(Xt=>[{toastId:g.id,height:Bt,position:g.position},...Xt]),()=>C(Xt=>Xt.filter(Gt=>Gt.toastId!==g.id))}},[C,g.id]),re.useLayoutEffect(()=>{if(!z)return;const Ye=Me.current,Bt=Ye.style.height;Ye.style.height="auto";const Xt=Ye.getBoundingClientRect().height;Ye.style.height=Bt,zt(Xt),C(Gt=>Gt.find(Jt=>Jt.toastId===g.id)?Gt.map(Jt=>Jt.toastId===g.id?{...Jt,height:Xt}:Jt):[{toastId:g.id,height:Xt,position:g.position},...Gt])},[z,g.title,g.description,C,g.id,g.jsx,g.action,g.cancel]);const ea=re.useCallback(()=>{ae(!0),rt(sr.current),C(Ye=>Ye.filter(Bt=>Bt.toastId!==g.id)),setTimeout(()=>{I(g)},GW)},[g,I,C,sr]);re.useEffect(()=>{if(g.promise&&ce==="loading"||g.duration===1/0||g.type==="loading")return;let Ye;return _||v||kn?(()=>{if($n.current<Wt.current){const Gt=new Date().getTime()-Wt.current;On.current=On.current-Gt}$n.current=new Date().getTime()})():(()=>{On.current!==1/0&&(Wt.current=new Date().getTime(),Ye=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),ea()},On.current))})(),()=>clearTimeout(Ye)},[_,v,g,ce,kn,ea]),re.useEffect(()=>{g.delete&&(ea(),g.onDismiss==null||g.onDismiss.call(g,g))},[ea,g.delete]);function Da(){var Ye;if($!=null&&$.loading){var Bt;return re.createElement("div",{className:no(M==null?void 0:M.loader,g==null||(Bt=g.classNames)==null?void 0:Bt.loader,"sonner-loader"),"data-visible":ce==="loading"},$.loading)}return re.createElement(jW,{className:no(M==null?void 0:M.loader,g==null||(Ye=g.classNames)==null?void 0:Ye.loader),visible:ce==="loading"})}const Cs=g.icon||($==null?void 0:$[ce])||wW(ce);var En,In;return re.createElement("li",{tabIndex:0,ref:Me,className:no(B,we,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[ce],g==null||(n=g.classNames)==null?void 0:n[ce]),"data-sonner-toast":"","data-rich-colors":(En=g.richColors)!=null?En:A,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":z,"data-promise":!!g.promise,"data-swiped":Ve,"data-removed":W,"data-visible":ne,"data-y-position":Jr,"data-x-position":fn,"data-index":R,"data-front":q,"data-swiping":J,"data-dismissible":Oe,"data-type":ce,"data-invert":Ys,"data-swipe-out":ye,"data-swipe-direction":P,"data-expanded":!!(_||F&&z),"data-testid":g.testId,style:{"--index":R,"--toasts-before":R,"--z-index":j.length-R,"--offset":`${W?et:sr.current}px`,"--initial-height":F?"auto":`${dn}px`,...T,...g.style},onDragEnd:()=>{le(!1),ge(null),Dr.current=null},onPointerDown:Ye=>{Ye.button!==2&&(Aa||!Oe||(yn.current=new Date,rt(sr.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(le(!0),Dr.current={x:Ye.clientX,y:Ye.clientY})))},onPointerUp:()=>{var Ye,Bt,Xt;if(ye||!Oe)return;Dr.current=null;const Gt=Number(((Ye=Me.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Vn=Number(((Bt=Me.current)==null?void 0:Bt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jt=new Date().getTime()-((Xt=yn.current)==null?void 0:Xt.getTime()),Qt=oe==="x"?Gt:Vn,Cr=Math.abs(Qt)/Jt;if(Math.abs(Qt)>=BW||Cr>.11){rt(sr.current),g.onDismiss==null||g.onDismiss.call(g,g),U(oe==="x"?Gt>0?"right":"left":Vn>0?"down":"up"),ea(),Ce(!0);return}else{var K,ee;(K=Me.current)==null||K.style.setProperty("--swipe-amount-x","0px"),(ee=Me.current)==null||ee.style.setProperty("--swipe-amount-y","0px")}De(!1),le(!1),ge(null)},onPointerMove:Ye=>{var Bt,Xt,Gt;if(!Dr.current||!Oe||((Bt=window.getSelection())==null?void 0:Bt.toString().length)>0)return;const Jt=Ye.clientY-Dr.current.y,Qt=Ye.clientX-Dr.current.x;var Cr;const K=(Cr=e.swipeDirections)!=null?Cr:qW(V);!oe&&(Math.abs(Qt)>1||Math.abs(Jt)>1)&&ge(Math.abs(Qt)>Math.abs(Jt)?"x":"y");let ee={x:0,y:0};const fe=Se=>1/(1.5+Math.abs(Se)/20);if(oe==="y"){if(K.includes("top")||K.includes("bottom"))if(K.includes("top")&&Jt<0||K.includes("bottom")&&Jt>0)ee.y=Jt;else{const Se=Jt*fe(Jt);ee.y=Math.abs(Se)<Math.abs(Jt)?Se:Jt}}else if(oe==="x"&&(K.includes("left")||K.includes("right")))if(K.includes("left")&&Qt<0||K.includes("right")&&Qt>0)ee.x=Qt;else{const Se=Qt*fe(Qt);ee.x=Math.abs(Se)<Math.abs(Qt)?Se:Qt}(Math.abs(ee.x)>0||Math.abs(ee.y)>0)&&De(!0),(Xt=Me.current)==null||Xt.style.setProperty("--swipe-amount-x",`${ee.x}px`),(Gt=Me.current)==null||Gt.style.setProperty("--swipe-amount-y",`${ee.y}px`)}},mt&&!g.jsx&&ce!=="loading"?re.createElement("button",{"aria-label":H,"data-disabled":Aa,"data-close-button":!0,onClick:Aa||!Oe?()=>{}:()=>{ea(),g.onDismiss==null||g.onDismiss.call(g,g)},className:no(M==null?void 0:M.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(In=$==null?void 0:$.close)!=null?In:DW):null,(ce||g.icon||g.promise)&&g.icon!==null&&(($==null?void 0:$[ce])!==null||g.icon)?re.createElement("div",{"data-icon":"",className:no(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||Da():null,g.type!=="loading"?Cs:null):null,re.createElement("div",{"data-content":"",className:no(M==null?void 0:M.content,g==null||(i=g.classNames)==null?void 0:i.content)},re.createElement("div",{"data-title":"",className:no(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:no(G,je,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&&Sp(g.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||D,onClick:Ye=>{Sp(g.cancel)&&Oe&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Ye),ea())},className:no(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&&Sp(g.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||k,onClick:Ye=>{Sp(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Ye),!Ye.defaultPrevented&&ea())},className:no(M==null?void 0:M.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function h_(){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 ZW(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",u=i?HW:FW;function f(m){["top","right","bottom","left"].forEach(y=>{n[`${c}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(m=>{r[m]===void 0?n[`${c}-${m}`]=u:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):f(u)}),n}const YW=re.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:y,mobileOffset:g,theme:x="light",richColors:v,duration:C,style:S,visibleToasts:E=zW,toastOptions:R,dir:j=h_(),gap:_=VW,icons:I,containerAriaLabel:A="Notifications"}=t,[O,T]=re.useState([]),D=re.useMemo(()=>r?O.filter(z=>z.toasterId===r):O.filter(z=>!z.toasterId),[O,r]),k=re.useMemo(()=>Array.from(new Set([i].concat(D.filter(z=>z.position).map(z=>z.position)))),[D,i]),[B,G]=re.useState([]),[Y,V]=re.useState(!1),[Z,F]=re.useState(!1),[M,$]=re.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=re.useRef(null),oe=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ge=re.useRef(null),P=re.useRef(!1),U=re.useCallback(z=>{T(X=>{var W;return(W=X.find(ae=>ae.id===z.id))!=null&&W.delete||Sa.dismiss(z.id),X.filter(({id:ae})=>ae!==z.id)})},[]);return re.useEffect(()=>Sa.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{T(X=>X.map(W=>W.id===z.id?{...W,delete:!0}:W))});return}setTimeout(()=>{pA.flushSync(()=>{T(X=>{const W=X.findIndex(ae=>ae.id===z.id);return W!==-1?[...X.slice(0,W),{...X[W],...z},...X.slice(W+1)]:[z,...X]})})})}),[O]),re.useEffect(()=>{if(x!=="system"){$(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:X})=>{$(X?"dark":"light")})}catch{z.addListener(({matches:W})=>{try{$(W?"dark":"light")}catch(ae){console.error(ae)}})}},[x]),re.useEffect(()=>{O.length<=1&&V(!1)},[O]),re.useEffect(()=>{const z=X=>{var W;if(c.every(le=>X[le]||X.code===le)){var J;V(!0),(J=H.current)==null||J.focus()}X.code==="Escape"&&(document.activeElement===H.current||(W=H.current)!=null&&W.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[c]),re.useEffect(()=>{if(H.current)return()=>{ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null,P.current=!1)}},[H.current]),re.createElement("section",{ref:n,"aria-label":`${A} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((z,X)=>{var W;const[ae,J]=z.split("-");return D.length?re.createElement("ol",{key:z,dir:j==="auto"?h_():j,tabIndex:-1,ref:H,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ae,"data-x-position":J,style:{"--front-toast-height":`${((W=B[0])==null?void 0:W.height)||0}px`,"--width":`${$W}px`,"--gap":`${_}px`,...S,...ZW(y,g)},onBlur:le=>{P.current&&!le.currentTarget.contains(le.relatedTarget)&&(P.current=!1,ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||P.current||(P.current=!0,ge.current=le.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{Z||V(!1)},onDragEnd:()=>V(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},D.filter(le=>!le.position&&X===0||le.position===z).map((le,ye)=>{var Ce,Ve;return re.createElement(KW,{key:le.id,icons:I,index:ye,toast:le,defaultRichColors:v,duration:(Ce=R==null?void 0:R.duration)!=null?Ce:C,className:R==null?void 0:R.className,descriptionClassName:R==null?void 0:R.descriptionClassName,invert:s,visibleToasts:E,closeButton:(Ve=R==null?void 0:R.closeButton)!=null?Ve:f,interacting:Z,position:z,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(De=>De.position==le.position),heights:B.filter(De=>De.position==le.position),setHeights:G,expandByDefault:u,gap:_,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),WW=({...e})=>{const{theme:t="system"}=md();return a.jsx(YW,{theme:t,className:"toaster group",icons:{success:a.jsx(yh,{className:"size-4"}),info:a.jsx(Fr,{className:"size-4"}),warning:a.jsx(xh,{className:"size-4"}),error:a.jsx(jA,{className:"size-4"}),loading:a.jsx(Ec,{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 XW(){return a.jsx(BY,{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}=xD(),n=QK(),r=Yg(),s=Vs();return h.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 m_="sidebar_state";function JW(){const{state:e,isMobile:t}=Rh(),r=t||e==="collapsed",{isLoading:s}=CW();return a.jsxs(a.Fragment,{children:[a.jsx(WW,{position:"bottom-right",closeButton:!0}),a.jsx(XW,{}),a.jsx(bW,{isLoading:s}),a.jsxs(JK,{redirectTo:"/auth/sign-in",children:[a.jsx(pW,{variant:"inset",collapsible:"icon"}),a.jsxs(oB,{children:[r&&a.jsx(aB,{}),a.jsx(QW,{children:a.jsx(qb,{})})]})]})]})}function eX(){const[e,t]=h.useState(()=>co.get(m_,"boolean")??!0),n=r=>{t(r),co.set(m_,r)};return a.jsx(gW,{children:a.jsx(SW,{children:a.jsx(nB,{open:e,onOpenChange:n,children:a.jsx(JW,{})})})})}function tX(){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 p_(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(Ez,{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(Ee,{variant:"default",asChild:!0,children:a.jsxs(Wr,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(_a,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const nX={items:[],loading:!1,error:null};function rX(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 HD=h.createContext(void 0);function aX({children:e}){const[t,n]=h.useReducer(rX,nX);return a.jsx(HD.Provider,{value:{state:t,dispatch:n},children:e})}function sX(){const e=h.useContext(HD);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class oX extends bl{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 Tn=new oX;var zr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(zr||{}),$e=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))($e||{}),Zp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Zp||{});const iX={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 $D=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))($D||{}),Pr=(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))(Pr||{}),qn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(qn||{});const VD={statuses:{[zr.DRAFT]:{code:zr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[zr.PUBLISHED]:{code:zr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},BD=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,GD=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,lX=e=>e?BD(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",cX=e=>e?GD(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",qD=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)},KD=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)},uX=e=>e?qD(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",dX=e=>e?KD(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var ks=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(ks||{});const fX=[{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 hX(e){return"projectId"in e}function mX(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||{}),Xo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Xo||{});const pX=({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})]})},gX=({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&&hX(t)||e===Re.AWS_ATHENA&&mX(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(pX,{label:s,value:c},i)})})},yX=({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(gX,{type:e,config:t})]})}),xX=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?ph:"span";return a.jsx(s,{"data-slot":"badge",className:se(xX({variant:t}),e),...r})}function ZD(e){return e.type===Re.GOOGLE_BIGQUERY}function YD(e){return e.type===Re.AWS_ATHENA}function WD(e){return e.type===Re.SNOWFLAKE}const Sl={types:{[Re.GOOGLE_BIGQUERY]:{type:Re.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:SD,status:Xo.ACTIVE},[Re.AWS_ATHENA]:{type:Re.AWS_ATHENA,displayName:"AWS Athena",icon:CD,status:Xo.ACTIVE},[Re.SNOWFLAKE]:{type:Re.SNOWFLAKE,displayName:"Snowflake",icon:ED,status:Xo.ACTIVE},[Re.DATABRICKS]:{type:Re.DATABRICKS,displayName:"Databricks",icon:lZ,status:Xo.COMING_SOON},[Re.AWS_REDSHIFT]:{type:Re.AWS_REDSHIFT,displayName:"AWS Redshift",icon:cZ,status:Xo.COMING_SOON},[Re.AZURE_SYNAPSE]:{type:Re.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:uZ,status:Xo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function vX({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(Ur,{className:"h-5 w-24"}),a.jsx(Ur,{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}=Sl.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(yX,{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 bX(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 SX(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 CX(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function EX(e){return`https://${e}.snowflakecomputing.com/`}function wX(e,t){const n=bX(t);if(!n)return null;const{dataset:r,table:s}=n;return ZD(e)?SX(e.config.projectId,r,s):YD(e)?CX(e.config.region):WD(e)?EX(e.config.account):null}function RX(e,t){const n=wX(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function jX(e){return ZD(e)?"Open table in Google BigQuery":YD(e)?"Open region in AWS Athena":WD(e)?"Open console in Snowflake":"Open data in storage"}function XD(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 TX=rn({accessKeyId:Dt().min(1,"Access Key ID is required"),secretAccessKey:Dt().min(1,"Secret Access Key is required")}),_X=rn({authMethod:Br(ks.PASSWORD),username:Dt().min(1,"Username is required"),password:Dt().min(1,"Password is required")}),NX=rn({authMethod:Br(ks.KEY_PAIR),username:Dt().min(1,"Username is required"),privateKey:Dt().min(1,"Private Key is required"),privateKeyPassphrase:Dt().optional()}),AX=zS("authMethod",[_X,NX]),DX=rn({projectId:Dt().min(1,"Project ID is required"),location:Dt().min(1,"Location is required")}),OX=rn({region:Dt().min(1,"Region is required"),outputBucket:Dt().min(1,"Output Bucket is required")}),IX=rn({account:Dt().min(1,"Account is required"),warehouse:Dt().min(1,"Warehouse is required")}),$S=rn({title:Dt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),MX=$S.extend({type:Br(Re.GOOGLE_BIGQUERY),credentials:ND,config:DX}),kX=$S.extend({type:Br(Re.AWS_ATHENA),credentials:TX,config:OX}),LX=$S.extend({type:Br(Re.SNOWFLAKE),credentials:AX,config:IX}),PX=zS("type",[MX,kX,LX]),QD=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},JD=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)},UX=e=>e?QD(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",zX=e=>e?JD(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",FX=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return BD(e);case Re.AWS_ATHENA:return qD(e);case Re.SNOWFLAKE:return QD(e);default:return!1}},HX=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return GD(e);case Re.AWS_ATHENA:return KD(e);case Re.SNOWFLAKE:return JD(e);default:return!1}},$X=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Re.GOOGLE_BIGQUERY:return lX(e);case Re.AWS_ATHENA:return uX(e);case Re.SNOWFLAKE:return UX(e);default:return"Unsupported storage type"}},VX=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Re.GOOGLE_BIGQUERY:return cX(e);case Re.AWS_ATHENA:return dX(e);case Re.SNOWFLAKE:return zX(e);default:return"Unsupported storage type"}},eO=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""}},BX=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""}},tO=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""}},GX=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 Jn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Jn||{});const qX={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:""},KX=e=>qX[e],ZX={[Jn.SUCCESS]:{icon:yh,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"}},[Jn.ERROR]:{icon:jA,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"}},[Jn.WARNING]:{icon:xh,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"}},[Jn.INFO]:{icon:Fr,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"}},[Jn.NEUTRAL]:{icon:Fr,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 Ph({type:e=Jn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=ZX[e],u=f=>{const m="inline-flex items-center gap-1 text-sm",y=KX(f),g=c[f];return se(m,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 nO=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,YX=/[#&]gid=([0-9]+)/;function rO(e){return nO.test(e)}function WX(e){const t=nO.exec(e);return t?t[2]:""}function XX(e){const t=YX.exec(e);return t?t[1]:"0"}function QX(e){return{spreadsheetId:WX(e),sheetId:parseInt(XX(e),10)}}function VS(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function JX(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 $0(e){return JX(e,"client_email")}const aO=h.createContext(void 0);var it=(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))(it||{}),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||{}),_n=(e=>(e.EDIT="edit",e.CREATE="create",e))(_n||{});const eQ={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function tQ(e,t){switch(t.type){case it.FETCH_REPORTS_START:case it.FETCH_REPORT_START:case it.CREATE_REPORT_START:case it.UPDATE_REPORT_START:case it.DELETE_REPORT_START:return{...e,loading:!0,error:null};case it.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case it.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case it.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case it.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case it.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 it.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case it.FETCH_REPORTS_ERROR:case it.FETCH_REPORT_ERROR:case it.FETCH_DESTINATIONS_ERROR:case it.CREATE_REPORT_ERROR:case it.UPDATE_REPORT_ERROR:case it.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case it.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case it.CLEAR_ERROR:return{...e,error:null};case it.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case it.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case it.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case it.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 BS({children:e}){const[t,n]=h.useReducer(tQ,eQ);return a.jsx(aO.Provider,{value:{state:t,dispatch:n},children:e})}function nQ(){const e=h.useContext(aO);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class rQ extends bl{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 Yo=new rQ,aQ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class sQ{constructor(){eo(this,"pollingTimers",new Map);eo(this,"pollCounters",new Map);eo(this,"config",aQ)}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 Yo.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 Cp=new sQ;var Ne=(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))(Ne||{}),_s=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(_s||{}),mo=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(mo||{});class oQ extends bl{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 oQ,aa={types:{[Ne.GOOGLE_SHEETS]:{type:Ne.GOOGLE_SHEETS,displayName:"Google Sheets",icon:sZ,status:_s.ACTIVE},[Ne.LOOKER_STUDIO]:{type:Ne.LOOKER_STUDIO,displayName:"Looker Studio",icon:oZ,status:_s.ACTIVE},[Ne.EMAIL]:{type:Ne.EMAIL,displayName:"Email",icon:SZ,status:_s.CLOUD_ONLY},[Ne.SLACK]:{type:Ne.SLACK,displayName:"Slack",icon:fZ,status:_s.CLOUD_ONLY},[Ne.MS_TEAMS]:{type:Ne.MS_TEAMS,displayName:"Microsoft Teams",icon:vZ,status:_s.CLOUD_ONLY},[Ne.GOOGLE_CHAT]:{type:Ne.GOOGLE_CHAT,displayName:"Google Chat",icon:bZ,status:_s.CLOUD_ONLY},[Ne.ODATA]:{type:Ne.ODATA,displayName:"OData",icon:iZ,status:_s.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},iQ=rn({deploymentUrl:Dt().optional(),destinationId:Dt().optional(),destinationSecretKey:Dt().optional()}),lQ=rn({to:X1(Dt().email()).min(1)}),GS=rn({title:Dt().min(1,"Title is required"),type:Sy(Ne)}),cQ=GS.extend({type:Br(Ne.GOOGLE_SHEETS),credentials:ND}),uQ=GS.extend({type:Br(Ne.LOOKER_STUDIO),credentials:iQ.optional()}),wy=GS.extend({credentials:lQ.optional()}),dQ=wy.extend({type:Br(Ne.EMAIL)}),fQ=wy.extend({type:Br(Ne.SLACK)}),hQ=wy.extend({type:Br(Ne.MS_TEAMS)}),mQ=wy.extend({type:Br(Ne.GOOGLE_CHAT)}),pQ=zS("type",[cQ,uQ,dQ,fQ,hQ,mQ]),sO=h.createContext(void 0);var en=(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))(en||{});const gQ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function yQ(e,t){switch(t.type){case en.FETCH_DESTINATIONS_START:case en.FETCH_DESTINATION_START:case en.CREATE_DESTINATION_START:case en.UPDATE_DESTINATION_START:case en.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case en.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case en.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case en.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case en.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 en.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case en.FETCH_DESTINATIONS_ERROR:case en.FETCH_DESTINATION_ERROR:case en.CREATE_DESTINATION_ERROR:case en.UPDATE_DESTINATION_ERROR:case en.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case en.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case en.CLEAR_ERROR:return{...e,error:null};default:return e}}function Uh({children:e}){const[t,n]=h.useReducer(yQ,gQ);return a.jsx(sO.Provider,{value:{state:t,dispatch:n},children:e})}function xQ(){const e=h.useContext(sO);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Ep{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:mo.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:mo.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===mo.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class vQ{mapFromDto(t){let n="";try{t.credentials.type===mo.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:Ne.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:mo.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Ne.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:mo.GOOGLE_SHEETS_CREDENTIALS}}}}class bQ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Ne.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:mo.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Ne.LOOKER_STUDIO,credentials:{type:mo.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===mo.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const oO={getMapper(e){switch(e){case Ne.GOOGLE_SHEETS:return new vQ;case Ne.LOOKER_STUDIO:return new bQ;case Ne.EMAIL:return new Ep(Ne.EMAIL);case Ne.SLACK:return new Ep(Ne.SLACK);case Ne.MS_TEAMS:return new Ep(Ne.MS_TEAMS);case Ne.GOOGLE_CHAT:return new Ep(Ne.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function ju(e){return oO.getMapper(e.type).mapFromDto(e)}function zh(){const{state:e,dispatch:t}=xQ(),n=h.useCallback(async()=>{t({type:en.FETCH_DESTINATIONS_START});try{const y=(await Ql.getDataDestinations()).map(ju);t({type:en.FETCH_DESTINATIONS_SUCCESS,payload:y})}catch(m){const y=m instanceof Error?m.message:"Failed to load destinations";t({type:en.FETCH_DESTINATIONS_ERROR,payload:y}),Le({event:"data_destination_error",category:"DataDestination",action:"ListError",label:y})}},[t]),r=h.useCallback(async m=>{try{const y=await Ql.getDataDestinationById(m),g=ju(y);t({type:en.FETCH_DESTINATION_SUCCESS,payload:g})}catch(y){const g=y instanceof Error?y.message:"Failed to load destination";t({type:en.FETCH_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"GetError",label:g})}},[t]),s=h.useCallback(async m=>{t({type:en.CREATE_DESTINATION_START});try{const y=await Ql.createDataDestination(m),g=ju(y);return t({type:en.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:en.CREATE_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type}),null}},[t]),i=h.useCallback(async(m,y)=>{t({type:en.UPDATE_DESTINATION_START});try{const g=await Ql.updateDataDestination(m,y),x=ju(g);return t({type:en.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:en.UPDATE_DESTINATION_ERROR,payload:x}),Le({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:x}),null}},[t]),c=h.useCallback(async m=>{t({type:en.DELETE_DESTINATION_START});try{await Ql.deleteDataDestination(m),t({type:en.DELETE_DESTINATION_SUCCESS,payload:m}),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:en.DELETE_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:g}),y}},[t]),u=h.useCallback(()=>{t({type:en.CLEAR_CURRENT_DESTINATION})},[t]),f=h.useCallback(async m=>{try{const y=await Ql.rotateSecretKey(m),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 SQ(e){const t=aa.getInfo(e.type),n=t.status!==_s.COMING_SOON;return{destinationInfo:t,isVisible:n}}function CQ(){const{dataMart:e}=vs(),{fetchReportsByDataMartId:t}=ts(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=zh(),[i,c]=h.useState(!0);return h.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(m){console.error("Failed to fetch Data Mart destinations or reports:",m)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:i||s}}function qS(e){return JSON.stringify(e,null,2)}class EQ{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 wQ{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 RQ{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 jQ={getMapper(e){switch(e){case Tr.GOOGLE_SHEETS_CONFIG:return new wQ;case Tr.LOOKER_STUDIO_CONFIG:return new RQ;case Tr.EMAIL_CONFIG:return new EQ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function TQ(e){return jQ.getMapper(e.type).mapFromDto(e)}function Jl(e){const t=TQ(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 iO=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)},Ry=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")??"",m=s.get("minute")??"",y=s.get("second")??"";return`${i}-${c}-${u} ${f}:${m}:${y}`},vu=e=>Ry(lO(e).toISOString()),lO=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},_Q=(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 cO(e){return JSON.parse(JSON.stringify(e))}function NQ(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 uO=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:s}=t;return!n||!r||!s?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:s}}catch{return null}};function AQ(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function DQ(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}const OQ=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[];function ts(){const{state:e,dispatch:t}=nQ(),n=h.useCallback(async()=>{t({type:it.FETCH_DESTINATIONS_START});try{const E=await Ql.getDataDestinations();t({type:it.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch destinations";t({type:it.FETCH_DESTINATIONS_ERROR,payload:R}),Le({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=h.useCallback(async()=>{t({type:it.FETCH_REPORTS_START});try{const R=(await Yo.getReportsByProject()).map(Jl);t({type:it.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:R}),Le({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=h.useCallback(async(E,R)=>{R!=null&&R.silent||t({type:it.FETCH_REPORTS_START});try{const _=(await Yo.getReportsByDataMartId(E,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(Jl);t({type:it.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:_}),Le({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),i=h.useCallback(async E=>{t({type:it.FETCH_REPORT_START});try{const R=await Yo.getReportById(E),j=Jl(R);t({type:it.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:it.FETCH_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"GetError",label:j})}},[t]),c=h.useCallback(async E=>{t({type:it.CREATE_REPORT_START});try{const R=await Yo.createReport(E),j=Jl(R);return t({type:it.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:it.CREATE_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"CreateError",label:E.destinationConfig.type}),null}},[t]),u=h.useCallback(async(E,R)=>{t({type:it.UPDATE_REPORT_START});try{const j=await Yo.updateReport(E,R),_=Jl(j);return t({type:it.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:it.UPDATE_REPORT_ERROR,payload:_}),Le({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=h.useCallback(async E=>{t({type:it.DELETE_REPORT_START});try{await Yo.deleteReport(E),t({type:it.DELETE_REPORT_SUCCESS,payload:E}),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:it.DELETE_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"DeleteError",label:j})}},[t]),m=h.useCallback(()=>{t({type:it.CLEAR_CURRENT_REPORT})},[t]),y=h.useCallback(()=>{t({type:it.CLEAR_ERROR})},[t]),g=h.useCallback(E=>{Cp.stopPolling(E),t({type:it.STOP_POLLING_REPORT,payload:E})},[t]),x=h.useCallback(E=>{e.polledReportIds.includes(E)&&g(E),t({type:it.START_POLLING_REPORT,payload:E}),Cp.startPolling(E,R=>{const j=Jl(R);t({type:it.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,g]),v=h.useCallback(()=>{Cp.stopAllPolling(),t({type:it.STOP_ALL_POLLING})},[t]),C=h.useCallback(E=>{Cp.setConfig(E)},[]),S=h.useCallback(async E=>{try{g(E),await Yo.runReport(E),await i(E),x(E),Le({event:"report_run_started",category:"Report",action:"Run",label:E}),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 h.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:m,clearError:y}}Mn.SUCCESS+"",Mn.SUCCESS,Mn.RUNNING+"",Mn.RUNNING,Mn.ERROR+"",Mn.ERROR,Mn.CANCELLED+"",Mn.CANCELLED;var V0,jy="HoverCard",[dO]=Sr(jy,[Eo]),Ty=Eo(),[IQ,_y]=dO(jy),fO=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=Ty(t),m=h.useRef(0),y=h.useRef(0),g=h.useRef(!1),x=h.useRef(!1),[v,C]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:jy}),S=h.useCallback(()=>{clearTimeout(y.current),m.current=window.setTimeout(()=>C(!0),c)},[c,C]),E=h.useCallback(()=>{clearTimeout(m.current),!g.current&&!x.current&&(y.current=window.setTimeout(()=>C(!1),u))},[u,C]),R=h.useCallback(()=>C(!1),[C]);return h.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(y.current)},[]),a.jsx(IQ,{scope:t,open:v,onOpenChange:C,onOpen:S,onClose:E,onDismiss:R,hasSelectionRef:g,isPointerDownOnContentRef:x,children:a.jsx(ud,{...f,children:n})})};fO.displayName=jy;var hO="HoverCardTrigger",mO=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=_y(hO,n),i=Ty(n);return a.jsx(dd,{asChild:!0,...i,children:a.jsx(Je.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Ie(e.onPointerEnter,_g(s.onOpen)),onPointerLeave:Ie(e.onPointerLeave,_g(s.onClose)),onFocus:Ie(e.onFocus,s.onOpen),onBlur:Ie(e.onBlur,s.onClose),onTouchStart:Ie(e.onTouchStart,c=>c.preventDefault())})})});mO.displayName=hO;var KS="HoverCardPortal",[MQ,kQ]=dO(KS,{forceMount:void 0}),pO=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=_y(KS,t);return a.jsx(MQ,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};pO.displayName=KS;var Tg="HoverCardContent",gO=h.forwardRef((e,t)=>{const n=kQ(Tg,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=_y(Tg,e.__scopeHoverCard);return a.jsx(Vr,{present:r||i.open,children:a.jsx(LQ,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Ie(e.onPointerEnter,_g(i.onOpen)),onPointerLeave:Ie(e.onPointerLeave,_g(i.onClose)),ref:t})})});gO.displayName=Tg;var LQ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=_y(Tg,n),m=Ty(n),y=h.useRef(null),g=ht(t,y),[x,v]=h.useState(!1);return h.useEffect(()=>{if(x){const C=document.body;return V0=C.style.userSelect||C.style.webkitUserSelect,C.style.userSelect="none",C.style.webkitUserSelect="none",()=>{C.style.userSelect=V0,C.style.webkitUserSelect=V0}}},[x]),h.useEffect(()=>{if(y.current){const C=()=>{v(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.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]),h.useEffect(()=>{y.current&&zQ(y.current).forEach(S=>S.setAttribute("tabindex","-1"))}),a.jsx(Rc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Ie(i,C=>{C.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(Ch,{...m,...u,onPointerDown:Ie(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)"}})})}),PQ="HoverCardArrow",UQ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Ty(n);return a.jsx(Eh,{...s,...r,ref:t})});UQ.displayName=PQ;function _g(e){return t=>t.pointerType==="touch"?void 0:e()}function zQ(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 FQ=fO,HQ=mO,$Q=pO,VQ=gO;const Ny=({...e})=>a.jsx(FQ,{"data-slot":"hover-card",...e});Ny.displayName="HoverCard";const Ay=h.forwardRef(({...e},t)=>a.jsx(HQ,{"data-slot":"hover-card-trigger",ref:t,...e}));Ay.displayName="HoverCardTrigger";const Dy=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},i)=>{const c=u=>{u.stopPropagation(),r&&r(u)};return a.jsx($Q,{children:a.jsx(VQ,{ref:i,align:t,sideOffset:n,className:se("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})})});Dy.displayName="HoverCardContent";const ZS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex gap-4 border-b pb-4",e),...t}));ZS.displayName="HoverCardHeader";const YS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));YS.displayName="HoverCardHeaderIcon";const WS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col space-y-1",e),...t}));WS.displayName="HoverCardHeaderText";const XS=h.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:se("text-md pt-1 leading-snug font-semibold",e),...t}));XS.displayName="HoverCardHeaderTitle";const QS=h.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));QS.displayName="HoverCardHeaderDescription";const JS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col",e),...t}));JS.displayName="HoverCardBody";const el=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex items-center justify-between border-b py-4",e),...t}));el.displayName="HoverCardItem";const tl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));tl.displayName="HoverCardItemLabel";const nl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-sm",e),...t}));nl.displayName="HoverCardItemValue";const e2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("pt-4 pb-2",e),...t}));e2.displayName="HoverCardFooter";function Oy(e){return e.type===Tr.GOOGLE_SHEETS_CONFIG}function yO(e){return e.type===Tr.LOOKER_STUDIO_CONFIG}function B0(e){return e.type===Tr.EMAIL_CONFIG}function Hs({date:e,className:t=""}){const n=h.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)),m=Math.floor(i/(1e3*60*60*24)),y=Math.floor(m/7),g=Math.floor(m/30),x=Math.floor(m/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(m===1){const S=v(e);return c?`Yesterday at ${S}`:`Tomorrow at ${S}`}if(m<7){const S=C(e),E=v(e);return c?`Last ${S} at ${E}`:`This ${S} at ${E}`}if(m<14){const S=C(e),E=v(e);return c?`Last ${S} at ${E}`:`Next ${S} at ${E}`}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 BQ=()=>{const e=h.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=h.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},GQ=re.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=BQ(),i=h.useMemo(()=>t.lastRunStatus?{statusType:ZQ(t.lastRunStatus),statusText:WQ(t.lastRunStatus)}:null,[t.lastRunStatus]),c=h.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),u=h.useMemo(()=>aa.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=h.useMemo(()=>Oy(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),m=h.useCallback(()=>{if(!f.isGoogleSheets||!f.spreadsheetId||!f.sheetId)return;const y=VS(f.spreadsheetId,f.sheetId);window.open(y,"_blank","noopener,noreferrer")},[f]);return a.jsxs(Ny,{children:[a.jsx(Ay,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Dy,{children:[a.jsxs(ZS,{children:[a.jsx(YS,{children:a.jsx(u,{size:20})}),a.jsxs(WS,{children:[a.jsx(XS,{children:t.title||"Unnamed Report"}),a.jsxs(QS,{children:["Last modified ",a.jsx(Hs,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(JS,{children:[a.jsxs(el,{children:[a.jsx(tl,{children:"Last run status:"}),a.jsx(nl,{children:i?a.jsx(Ph,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Last run date:"}),a.jsx(nl,{children:t.lastRunDate?a.jsx(Hs,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(el,{children:[a.jsx(tl,{children:"Error message:"}),a.jsx(nl,{children:t.lastRunError})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Total runs:"}),a.jsxs(nl,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(e2,{children:a.jsxs(Ee,{className:"w-full",variant:"default",onClick:m,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",a.jsx(ai,{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 Xa=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Xa||{});const qQ=e=>{switch(e){case zr.DRAFT:return Jn.NEUTRAL;case zr.PUBLISHED:return Jn.SUCCESS;default:return Jn.NEUTRAL}},KQ=e=>{switch(e){case qn.SUCCESS:return Jn.SUCCESS;case qn.RUNNING:return Jn.INFO;case qn.FAILED:case qn.CANCELLED:case qn.INTERRUPTED:return Jn.ERROR;default:return Jn.NEUTRAL}},ZQ=e=>{switch(e){case Mn.SUCCESS:return Jn.SUCCESS;case Mn.RUNNING:return Jn.INFO;case Mn.ERROR:return Jn.ERROR;default:return Jn.NEUTRAL}},YQ=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"}},WQ=e=>{switch(e){case Mn.SUCCESS:return"Success";case Mn.RUNNING:return"Running";case Mn.ERROR:return"Failed";default:return"Unknown"}},XQ=e=>e?[qn.SUCCESS,qn.FAILED,qn.CANCELLED,qn.INTERRUPTED].includes(e):!0,QQ=e=>e?[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED].includes(e):!0,xO=e=>rn({fullyQualifiedName:Dt().min(1,"Fully qualified name is required").refine(t=>FX(t,e),t=>({message:$X(t,e)}))}),JQ=e=>rn({pattern:Dt().min(1,"Table pattern is required").refine(t=>HX(t,e),t=>({message:VX(t,e)}))}),eJ=e=>{const t=[];return e.status.code===zr.PUBLISHED&&t.push(Zp.ALREADY_PUBLISHED),XD(e.storage)||t.push(Zp.INVALID_STORAGE),e.definition||t.push(Zp.MISSING_DEFINITION),t},tJ=e=>e.map(t=>iX[t]);function nJ(e){return e.map(t=>({id:t.id,title:t.title,status:VD.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 vO(){const{state:e,dispatch:t}=sX(),n=h.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await Tn.getDataMarts(),c=nJ(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=h.useCallback(async i=>{t({type:"SET_LOADING"});try{await Tn.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=h.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 rl(e,t){return typeof e=="function"?e(t):e}function Ja(e,t){return n=>{t.setState(r=>({...r,[e]:rl(n,r[e])}))}}function Iy(e){return e instanceof Function}function rJ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function aJ(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 lt(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 m;if(n.key&&n.debug&&(m=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()-m)*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 ct(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 sJ(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:lt(()=>[e,n,t,i],(c,u,f,m)=>({table:c,column:u,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ct(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(i,n,t,e)},{}),i}function oJ(e,t,n,r){var s,i;const u={...e._getDefaultColumnDef(),...t},f=u.accessorKey;let m=(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]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:y,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:lt(()=>[!0],()=>{var x;return[g,...(x=g.columns)==null?void 0:x.flatMap(v=>v.getFlatColumns())]},ct(e.options,"debugColumns")),getLeafColumns:lt(()=>[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]},ct(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(g,e);return g}const qr="debugHeaders";function g_(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 iJ={createTable:e=>{e.getHeaderGroups=lt(()=>[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:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(s!=null&&s.includes(g.id)));return wp(t,[...u,...m,...f],e)},ct(e.options,qr)),e.getCenterHeaderGroups=lt(()=>[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))),wp(t,n,e,"center")),ct(e.options,qr)),e.getLeftHeaderGroups=lt(()=>[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 wp(t,i,e,"left")},ct(e.options,qr)),e.getRightHeaderGroups=lt(()=>[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 wp(t,i,e,"right")},ct(e.options,qr)),e.getFooterGroups=lt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getLeftFooterGroups=lt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getCenterFooterGroups=lt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getRightFooterGroups=lt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getFlatHeaders=lt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getLeftFlatHeaders=lt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getCenterFlatHeaders=lt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getRightFlatHeaders=lt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getCenterLeafHeaders=lt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getLeftLeafHeaders=lt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getRightLeafHeaders=lt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getLeafHeaders=lt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,c,u,f,m;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(c=(u=n[0])==null?void 0:u.headers)!=null?c:[],...(f=(m=r[0])==null?void 0:m.headers)!=null?f:[]].map(y=>y.getLeafHeaders()).flat()},ct(e.options,qr))}};function wp(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 m=(x,v)=>{const C={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];x.forEach(E=>{const R=[...S].reverse()[0],j=E.column.depth===C.depth;let _,I=!1;if(j&&E.column.parent?_=E.column.parent:(_=E.column,I=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(E);else{const A=g_(n,_,{id:[r,v,_.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:I,placeholderId:I?`${S.filter(O=>O.column===_).length}`:void 0,depth:v,index:S.length});A.subHeaders.push(E),S.push(A)}C.headers.push(E),E.headerGroup=C}),f.push(C),v>0&&m(S,v-1)},y=t.map((x,v)=>g_(n,x,{depth:c,index:v}));m(y,c-1),f.reverse();const g=x=>x.filter(C=>C.column.getIsVisible()).map(C=>{let S=0,E=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 E=E+j,C.colSpan=S,C.rowSpan=E,{colSpan:S,rowSpan:E}});return g((s=(i=f[0])==null?void 0:i.headers)!=null?s:[]),f}const t2=(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 m=e.getColumn(f);if(m!=null&&m.accessorFn)return u._valuesCache[f]=m.accessorFn(u.original,r),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=m.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var m;return(m=u.getValue(f))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>aJ(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const y=m.getParentRow();if(!y)break;f.push(y),m=y}return f.reverse()},getAllCells:lt(()=>[e.getAllLeafColumns()],f=>f.map(m=>sJ(e,u,m,m.id)),ct(e.options,"debugRows")),_getAllCellsByColumnId:lt(()=>[u.getAllCells()],f=>f.reduce((m,y)=>(m[y.column.id]=y,m),{}),ct(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const m=e._features[f];m==null||m.createRow==null||m.createRow(u,e)}return u},lJ={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()}}},bO=(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))};bO.autoRemove=e=>Ls(e);const SO=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};SO.autoRemove=e=>Ls(e);const CO=(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())};CO.autoRemove=e=>Ls(e);const EO=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};EO.autoRemove=e=>Ls(e);const wO=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});wO.autoRemove=e=>Ls(e)||!(e!=null&&e.length);const RO=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});RO.autoRemove=e=>Ls(e)||!(e!=null&&e.length);const jO=(e,t,n)=>e.getValue(t)===n;jO.autoRemove=e=>Ls(e);const TO=(e,t,n)=>e.getValue(t)==n;TO.autoRemove=e=>Ls(e);const n2=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};n2.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]};n2.autoRemove=e=>Ls(e)||Ls(e[0])&&Ls(e[1]);const Wo={includesString:bO,includesStringSensitive:SO,equalsString:CO,arrIncludes:EO,arrIncludesAll:wO,arrIncludesSome:RO,equals:jO,weakEquals:TO,inNumberRange:n2};function Ls(e){return e==null||e===""}const cJ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ja("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"?Wo.includesString:typeof r=="number"?Wo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wo.equals:Array.isArray(r)?Wo.arrIncludes:Wo.weakEquals},e.getFilterFn=()=>{var n,r;return Iy(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:Wo[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=rl(n,i?i.value:void 0);if(y_(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 m;return(m=r==null?void 0:r.map(y=>y.id===e.id?f:y))!=null?m:[]}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=rl(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(y_(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 y_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const uJ=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),dJ=(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},fJ=(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},hJ=(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]},mJ=(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},pJ=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!rJ(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},gJ=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),yJ=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,xJ=(e,t)=>t.length,G0={sum:uJ,min:dJ,max:fJ,extent:hJ,mean:mJ,median:pJ,unique:gJ,uniqueCount:yJ,count:xJ},vJ={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:Ja("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 G0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return G0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Iy(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:G0[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 bJ(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 SJ={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ja("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=lt(n=>[Lf(t,n)],n=>n.findIndex(r=>r.id===e.id),ct(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Lf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Lf(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=lt(()=>[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(),m=u.findIndex(y=>y.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return bJ(i,n,r)},ct(e.options,"debugTable"))}},q0=()=>({left:[],right:[]}),CJ={getInitialState:e=>({columnPinning:q0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ja("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 m,y;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).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=lt(()=>[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))},ct(t.options,"debugRows")),e.getLeftVisibleCells=lt(()=>[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"})),ct(t.options,"debugRows")),e.getRightVisibleCells=lt(()=>[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"})),ct(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?q0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:q0())},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=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ct(e.options,"debugColumns")),e.getRightLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ct(e.options,"debugColumns")),e.getCenterLeafColumns=lt(()=>[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))},ct(e.options,"debugColumns"))}};function EJ(e){return e||(typeof document<"u"?document:null)}const Rp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},K0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),wJ={getDefaultColumnDef:()=>Rp,getInitialState:e=>({columnSizing:{},columnSizingInfo:K0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ja("columnSizing",e),onColumnSizingInfoChange:Ja("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:Rp.minSize,(r=i??e.columnDef.size)!=null?r:Rp.size),(s=e.columnDef.maxSize)!=null?s:Rp.maxSize)},e.getStart=lt(n=>[n,Lf(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ct(t.options,"debugColumns")),e.getAfter=lt(n=>[n,Lf(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ct(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(),Z0(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=Z0(i)?Math.round(i.touches[0].clientX):i.clientX,m={},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(k=>{let[B,G]=k;m[B]=Math.round(Math.max(G+G*D,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},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=EJ(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)}},E=RJ()?{passive:!1}:!1;Z0(i)?(v==null||v.addEventListener("touchmove",S.moveHandler,E),v==null||v.addEventListener("touchend",S.upHandler,E)):(v==null||v.addEventListener("mousemove",C.moveHandler,E),v==null||v.addEventListener("mouseup",C.upHandler,E)),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?K0():(n=e.initialState.columnSizingInfo)!=null?n:K0())},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 jp=null;function RJ(){if(typeof jp=="boolean")return jp;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 jp=e,jp}function Z0(e){return e.type==="touchstart"}const jJ={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ja("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=lt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ct(t.options,"debugRows")),e.getVisibleCells=lt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ct(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>lt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ct(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 Lf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const TJ={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()}}},_J={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ja("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=()=>Wo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Iy(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},NJ={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ja("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()}}}},rb=0,ab=10,Y0=()=>({pageIndex:rb,pageSize:ab}),AJ={getInitialState:e=>({...e,pagination:{...Y0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ja("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=>rl(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?Y0():(s=e.initialState.pagination)!=null?s:Y0())},e.setPageIndex=r=>{e.setPagination(s=>{let i=rl(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?rb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:rb)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?ab:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:ab)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,rl(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=rl(r,(i=e.options.pageCount)!=null?i:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=lt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,c)=>c)),s},ct(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}}},W0=()=>({top:[],bottom:[]}),DJ={getInitialState:e=>({rowPinning:W0(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ja("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(f=>{let{id:m}=f;return m}):[],c=s?e.getParentRows().map(f=>{let{id:m}=f;return m}):[],u=new Set([...c,e.id,...i]);t.setRowPinning(f=>{var m,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:((m=f==null?void 0:f.top)!=null?m:[]).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?W0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:W0())},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=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ct(e.options,"debugRows")),e.getBottomRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ct(e.options,"debugRows")),e.getCenterRows=lt(()=>[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))},ct(e.options,"debugRows"))}},OJ={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ja("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=>{sb(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getFilteredSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getGroupedSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},ct(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 sb(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return r2(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ob(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ob(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)}}}},sb=(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=>sb(e,u.id,n,r,s))};function X0(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var m;const y=r2(f,n);if(y&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),y)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function r2(e,t){var n;return(n=t[e.id])!=null?n:!1}function ob(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()&&(r2(c,t)?i=!0:s=!1),c.subRows&&c.subRows.length)){const u=ob(c,t);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const ib=/([0-9]+)/gm,IJ=(e,t,n)=>_O(ml(e.getValue(n)).toLowerCase(),ml(t.getValue(n)).toLowerCase()),MJ=(e,t,n)=>_O(ml(e.getValue(n)),ml(t.getValue(n))),kJ=(e,t,n)=>a2(ml(e.getValue(n)).toLowerCase(),ml(t.getValue(n)).toLowerCase()),LJ=(e,t,n)=>a2(ml(e.getValue(n)),ml(t.getValue(n))),PJ=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},UJ=(e,t,n)=>a2(e.getValue(n),t.getValue(n));function a2(e,t){return e===t?0:e>t?1:-1}function ml(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function _O(e,t){const n=e.split(ib).filter(Boolean),r=t.split(ib).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 vf={alphanumeric:IJ,alphanumericCaseSensitive:MJ,text:kJ,textCaseSensitive:LJ,datetime:PJ,basic:UJ},zJ={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ja("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 vf.datetime;if(typeof i=="string"&&(r=!0,i.split(ib).length>1))return vf.alphanumeric}return r?vf.text:vf.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 Iy(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:vf[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 m=[],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;m=[...c,{id:e.id,desc:g}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=c.map(v=>v.id===e.id?{...v,desc:g}:v):y==="remove"?m=c.filter(v=>v.id!==e.id):m=[{id:e.id,desc:g}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const 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())}},FJ=[iJ,jJ,SJ,CJ,lJ,cJ,TJ,_J,zJ,vJ,NJ,AJ,DJ,OJ,wJ];function HJ(e){var t,n;const r=[...FJ,...(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 m=[];let y=!1;const g={_features:r,options:{...i,...e},initialState:f,_queue:x=>{m.push(x),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const v=rl(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:lt(()=>[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,E;return(S=(E=C.renderValue())==null||E.toString==null?void 0:E.toString())!=null?S:null},...s._features.reduce((C,S)=>Object.assign(C,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...x}},ct(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:lt(()=>[s._getColumnDefs()],x=>{const v=function(C,S,E){return E===void 0&&(E=0),C.map(R=>{const j=oJ(s,R,E,S),_=R;return j.columns=_.columns?v(_.columns,j,E+1):[],j})};return v(x)},ct(e,"debugColumns")),getAllFlatColumns:lt(()=>[s.getAllColumns()],x=>x.flatMap(v=>v.getFlatColumns()),ct(e,"debugColumns")),_getAllFlatColumnsById:lt(()=>[s.getAllFlatColumns()],x=>x.reduce((v,C)=>(v[C.id]=C,v),{}),ct(e,"debugColumns")),getAllLeafColumns:lt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,v)=>{let C=x.flatMap(S=>S.getLeafColumns());return v(C)},ct(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 Cl(){return e=>lt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,c){i===void 0&&(i=0);const u=[];for(let m=0;m<s.length;m++){const y=t2(e,e._getRowId(s[m],m,c),s[m],m,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[m],m),(f=y.originalSubRows)!=null&&f.length&&(y.subRows=r(y.originalSubRows,i+1,y))}}return u};return n.rows=r(t),n},ct(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function $J(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 VJ(e,t,n){return n.options.filterFromLeafRows?BJ(e,t,n):GJ(e,t,n)}function BJ(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,m){m===void 0&&(m=0);const y=[];for(let x=0;x<f.length;x++){var g;let v=f[x];const C=t2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(C.columnFilters=v.columnFilters,(g=v.subRows)!=null&&g.length&&m<c){if(C.subRows=u(v.subRows,m+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 GJ(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,m){m===void 0&&(m=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&&m<c){const S=t2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);S.subRows=u(v.subRows,m+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=>lt(()=>[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 m,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++){m=s[C];const S=m.id;v.columnFilters[S]=m.filterFn(v,S,m.resolvedValue,E=>{v.columnFiltersMeta[S]=E})}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,E=>{v.columnFiltersMeta[S]=E})){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 VJ(t.rows,g,e)},ct(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Fh(e){return t=>lt(()=>[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 m=s*i,y=m+s;c=c.slice(m,y);let g;t.options.paginateExpandedRows?g={rows:c,flatRows:u,rowsById:f}:g=$J({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},ct(t.options,"debugTable"))}function Nc(){return e=>lt(()=>[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 m;return(m=e.getColumn(f.id))==null?void 0:m.getCanSort()}),c={};i.forEach(f=>{const m=e.getColumn(f.id);m&&(c[f.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=f=>{const m=f.map(y=>({...y}));return m.sort((y,g)=>{for(let v=0;v<i.length;v+=1){var x;const C=i[v],S=c[C.id],E=S.sortUndefined,R=(x=C==null?void 0:C.desc)!=null?x:!1;let j=0;if(E){const _=y.getValue(C.id),I=g.getValue(C.id),A=_===void 0,O=I===void 0;if(A||O){if(E==="first")return A?-1:1;if(E==="last")return A?1:-1;j=A&&O?0:A?E:-E}}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}),m.forEach(y=>{var g;s.push(y),(g=y.subRows)!=null&&g.length&&(y.subRows=u(y.subRows))}),m};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ct(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?qJ(e)?h.createElement(e,t):e:null}function qJ(e){return KJ(e)||typeof e=="function"||ZJ(e)}function KJ(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ZJ(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]=h.useState(()=>({current:HJ(t)})),[r,s]=h.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 wl({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:se("w-full caption-bottom text-sm",e),...t})})}function Rl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:se("[&_tr]:border-b",e),...t})}function jl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:se("[&_tr:last-child]:border-0",e),...t})}function Hn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:se("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Tl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:se("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 $r({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var YJ=Symbol("radix.slottable");function WJ(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=YJ,t}var NO="AlertDialog",[XJ]=Sr(NO,[a4]),pi=a4(),AO=e=>{const{__scopeAlertDialog:t,...n}=e,r=pi(t);return a.jsx(ny,{...r,...n,modal:!0})};AO.displayName=NO;var QJ="AlertDialogTrigger",JJ=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(a$,{...s,...r,ref:t})});JJ.displayName=QJ;var eee="AlertDialogPortal",DO=e=>{const{__scopeAlertDialog:t,...n}=e,r=pi(t);return a.jsx(ry,{...r,...n})};DO.displayName=eee;var tee="AlertDialogOverlay",OO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(ay,{...s,...r,ref:t})});OO.displayName=tee;var Fu="AlertDialogContent",[nee,ree]=XJ(Fu),aee=WJ("AlertDialogContent"),IO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=pi(n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return a.jsx(e$,{contentName:Fu,titleName:MO,docsSlug:"alert-dialog",children:a.jsx(nee,{scope:n,cancelRef:f,children:a.jsxs(sy,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Ie(s.onOpenAutoFocus,m=>{var y;m.preventDefault(),(y=f.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[a.jsx(aee,{children:r}),a.jsx(oee,{contentRef:c})]})})})});IO.displayName=Fu;var MO="AlertDialogTitle",kO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(oS,{...s,...r,ref:t})});kO.displayName=MO;var LO="AlertDialogDescription",PO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(iS,{...s,...r,ref:t})});PO.displayName=LO;var see="AlertDialogAction",UO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(oy,{...s,...r,ref:t})});UO.displayName=see;var zO="AlertDialogCancel",FO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=ree(zO,n),i=pi(n),c=ht(t,s);return a.jsx(oy,{...i,...r,ref:c})});FO.displayName=zO;var oee=({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 \`${LO}\` 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 h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},iee=AO,lee=DO,cee=OO,uee=IO,dee=UO,fee=FO,hee=kO,mee=PO;function HO({...e}){return a.jsx(iee,{"data-slot":"alert-dialog",...e})}function pee({...e}){return a.jsx(lee,{"data-slot":"alert-dialog-portal",...e})}function gee({className:e,...t}){return a.jsx(cee,{"data-slot":"alert-dialog-overlay",className:se("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 $O({className:e,...t}){return a.jsxs(pee,{children:[a.jsx(gee,{}),a.jsx(uee,{"data-slot":"alert-dialog-content",className:se("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 VO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function BO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function GO({className:e,...t}){return a.jsx(hee,{"data-slot":"alert-dialog-title",className:se("text-lg font-semibold",e),...t})}function qO({className:e,...t}){return a.jsx(mee,{"data-slot":"alert-dialog-description",className:se("text-muted-foreground text-sm",e),...t})}function KO({className:e,...t}){return a.jsx(dee,{className:se(nS(),e),...t})}function ZO({className:e,...t}){return a.jsx(fee,{className:se(nS({variant:"outline"}),e),...t})}const YO=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],WO={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:$e.CONNECTOR,icon:pZ},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:$e.CONNECTOR,icon:gZ},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:$e.CONNECTOR,icon:yZ},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:$e.CONNECTOR,icon:xZ},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:$e.CONNECTOR,icon:eS},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:$e.SQL,icon:Jb},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:tg}},x_=YO.map(e=>({key:e,...WO[e]}));function yee(e){if(!e||!YO.includes(e))return;const t=e;return{key:t,...WO[t]}}function xee({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:se("-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 vee({children:e,className:t="",...n}){return a.jsx("div",{className:se("pb-2",t),...n,children:e})}function bee({children:e,className:t="",...n}){return a.jsx("h2",{className:se("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function See({children:e,className:t="",...n}){return a.jsx("p",{className:se("text-muted-foreground text-lg",t),...n,children:e})}function Cee({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:se("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 Eee({children:e,className:t="",...n}){return a.jsx("div",{className:se("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Q0({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:se("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 v_({children:e,className:t="",...n}){return a.jsx("h3",{className:se("mb-4 text-xl font-medium",t),...n,children:e})}function J0({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-wrap items-center gap-4",t),...n,children:e})}function Tp({href:e,icon:t,title:n,variant:r="outline",size:s,className:i="",target:c,...u}){const f=r==="outline"?"lg":"sm",m=a.jsxs("span",{className:se("flex items-center gap-2"),children:[t,n]});return e?a.jsx(Ee,{asChild:!0,variant:r,size:s??f,className:se(r==="ghost"?"text-muted-foreground":"",i),...u,children:a.jsx(Wr,{to:e,target:c,children:m})}):a.jsx(Ee,{variant:r,size:s??f,className:i,...u,children:m})}function wee(){const{scope:e}=mi(),t=x_.filter(r=>r.definitionType===$e.CONNECTOR),n=x_.filter(r=>r.definitionType!==$e.CONNECTOR);return a.jsxs(xee,{children:[a.jsx(Cee,{children:a.jsx(mZ,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(Eee,{children:[a.jsxs(vee,{children:[a.jsx(bee,{children:"Let’s Build Your First Data Mart"}),a.jsx(See,{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(Q0,{children:[a.jsx(v_,{children:"Connect a data source"}),a.jsx(J0,{children:t.map(r=>a.jsx(Tp,{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(Q0,{children:[a.jsx(v_,{children:"Use existing SQL or start from scratch"}),a.jsx(J0,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(Tp,{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(Q0,{separator:!1,children:a.jsxs(J0,{children:[a.jsx(Tp,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(_A,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(Tp,{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(uU,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function Ree(){return a.jsx(Ur,{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"}},jee={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=h.useMemo(()=>({SORTING:`${t}${bu.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${bu.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),u=h.useMemo(()=>jee.extractColumnIds(e),[e]),f=h.useMemo(()=>u.filter(S=>!s.includes(S)),[u,s]),m=h.useCallback(()=>{const S=co.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=h.useCallback(()=>{const S=co.get(c.COLUMN_VISIBILITY,"json");if(S&&typeof S=="object"&&!Array.isArray(S)){const E={};for(const R of u)i.includes(R)||(E[R]=S[R]);return E}return r},[c.COLUMN_VISIBILITY,u,i,r]),[g,x]=h.useState(m),[v,C]=h.useState(y);return h.useEffect(()=>{g.length>0&&f.includes(g[0].id)&&co.set(c.SORTING,g)},[g,f,c.SORTING]),h.useEffect(()=>{const S={};for(const E of u){if(i.includes(E))continue;const R=v[E];typeof R=="boolean"&&(S[E]=R)}co.set(c.COLUMN_VISIBILITY,S)},[v,u,i,c.COLUMN_VISIBILITY]),{sorting:g,setSorting:x,columnVisibility:v,setColumnVisibility:C}}function Tee({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var O;const{navigate:i,scope:c}=mi(),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:y}=Ac({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[g,x]=h.useState([]),[v,C]=h.useState({}),[S,E]=h.useState(!1),[R,j]=h.useState(!1),_=async()=>{try{j(!0);const D=A.getSelectedRowModel().rows.map(k=>k.original.id);for(const k of D)await n(k);Dn.success(`Successfully deleted ${String(D.length)} data mart${D.length!==1?"s":""}`),C({}),await r()}catch(T){console.error("Error deleting data marts:",T),Dn.error("Failed to delete some data marts. Please try again.")}finally{j(!1),E(!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(oa,{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(oa,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Cl(),getPaginationRowModel:Fh(),onSortingChange:f,getSortedRowModel:Nc(),onColumnFiltersChange:x,getFilteredRowModel:pd(),onColumnVisibilityChange:y,onRowSelectionChange:C,state:{sorting:u,columnFilters:g,columnVisibility:m,rowSelection:v},enableRowSelection:!0});return s?a.jsx("div",{children:a.jsx(Ree,{})}):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(Ee,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:R,children:a.jsx(es,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(wc,{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(Wr,{to:c("/data-marts/create"),children:a.jsxs(Ee,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(ha,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(wl,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:A.getHeaderGroups().map(T=>a.jsx(Hn,{className:"dm-card-table-header-row",children:T.headers.map(D=>a.jsx(Tl,{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(jl,{className:"dm-card-table-body",children:A.getRowModel().rows.length?A.getRowModel().rows.map(T=>a.jsx(Hn,{"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 k=T.original.id;i(`/data-marts/${k}/data-setup`)},children:T.getVisibleCells().map(D=>a.jsx($r,{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(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>{A.previousPage()},disabled:!A.getCanPreviousPage(),children:"Previous"}),a.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>{A.nextPage()},disabled:!A.getCanNextPage(),children:"Next"})]}),a.jsx(HO,{open:S,onOpenChange:E,children:a.jsxs($O,{children:[a.jsxs(VO,{children:[a.jsx(GO,{children:"Are you sure?"}),a.jsxs(qO,{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(BO,{children:[a.jsx(ZO,{disabled:R,children:"Cancel"}),a.jsx(KO,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx(wee,{})}function XO({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=PD(t,n);return a.jsxs(Ny,{children:[a.jsx(Ay,{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(tb,{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(Dy,{side:"top",align:"start",className:"w-max p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(tb,{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 s2({...e}){return a.jsx(ny,{"data-slot":"dialog",...e})}function _ee({...e}){return a.jsx(ry,{"data-slot":"dialog-portal",...e})}function Nee({className:e,...t}){return a.jsx(ay,{"data-slot":"dialog-overlay",className:se("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 o2({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(_ee,{"data-slot":"dialog-portal",children:[a.jsx(Nee,{}),a.jsxs(sy,{"data-slot":"dialog-content",className:se("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(oy,{"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 i2({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Aee({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function l2({className:e,...t}){return a.jsx(oS,{"data-slot":"dialog-title",className:se("text-lg leading-none font-semibold",e),...t})}function c2({className:e,...t}){return a.jsx(iS,{"data-slot":"dialog-description",className:se("text-muted-foreground text-sm",e),...t})}const Dee=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(Ee,{variant:"default",className:se(Dee({variant:t}),e),...n}):a.jsx(Ee,{variant:t,className:e,...n})}const br=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:m})=>{const y=()=>{t(!1),u==null||u()};return a.jsx(s2,{open:e,onOpenChange:t,children:a.jsxs(o2,{children:[a.jsxs(i2,{children:[a.jsx(l2,{children:n}),a.jsx(c2,{children:r})]}),m,a.jsxs(Aee,{children:[i&&a.jsx(Hu,{variant:"secondary",onClick:y,children:i}),a.jsx(Hu,{variant:f,onClick:c,children:s})]})]})})},Oee=({row:e,onDeleteSuccess:t})=>{const{scope:n}=mi(),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{deleteDataMart:u,refreshList:f}=vO(),m=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(Ee,{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(Gs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ar,{align:"end",children:[a.jsx(Nt,{children:a.jsxs(Wr,{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(ja,{}),a.jsxs(Nt,{onClick:()=>{s(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(br,{open:r,onOpenChange:s,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void m(),variant:"destructive"})]})},b_={types:{[$e.SQL]:{type:$e.SQL,displayName:"SQL",icon:Jb},[$e.TABLE]:{type:$e.TABLE,displayName:"Table",icon:AA},[$e.VIEW]:{type:$e.VIEW,displayName:"View",icon:pU},[$e.TABLE_PATTERN]:{type:$e.TABLE_PATTERN,displayName:"Pattern",icon:dP},[$e.CONNECTOR]:{type:$e.CONNECTOR,displayName:"Connector",icon:eS}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}};var zn=(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))(zn||{});const $i={[zn.TITLE]:"Title",[zn.DEFINITION_TYPE]:"Input Source",[zn.STORAGE_TYPE]:"Storage",[zn.STATUS]:"Status",[zn.TRIGGERS_COUNT]:"Triggers",[zn.REPORTS_COUNT]:"Reports",[zn.CREATED_AT]:"Created at",[zn.CREATED_BY_USER]:"Created by"};function xr({column:e,children:t,label:n}){const r=e.getIsSorted(),s=h.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(Ee,{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(Bs,{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(Ee,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Gs,{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(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const Iee=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:zn.TITLE,size:40,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.TITLE]}),cell:({row:n})=>a.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===$e.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}=b_.getInfo(r);return s}},id:zn.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case $e.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}=b_.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:zn.STORAGE_TYPE,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=Sl.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:zn.CREATED_AT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.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:zn.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(xr,{column:n,children:$i[zn.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(XO,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:zn.STATUS,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Ph,{type:qQ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:zn.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.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:zn.REPORTS_COUNT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.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(Oee,{row:n,onDeleteSuccess:e})}];var yr=(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))(yr||{});const Mee={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function kee(e,t){switch(t.type){case yr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case yr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case yr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case yr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case yr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case yr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case yr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case yr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case yr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const QO=h.createContext(void 0);function nd({children:e}){const[t,n]=h.useReducer(kee,Mee);return a.jsx(QO.Provider,{value:{state:t,dispatch:n},children:e})}function Lee(){const e=h.useContext(QO);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var As=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(As||{});class Pf extends bl{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 JO(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}=Lee(),n=h.useMemo(()=>JO(e.connectors),[e.connectors]),r=h.useCallback(async()=>{t({type:yr.FETCH_CONNECTORS_START});try{const u=await new Pf().getAvailableConnectors();t({type:yr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:yr.FETCH_CONNECTORS_ERROR,payload:u}),Le({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=h.useCallback(async c=>{t({type:yr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Pf().getConnectorSpecification(c);t({type:yr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:yr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Le({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=h.useCallback(async c=>{t({type:yr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Pf().getConnectorFields(c);t({type:yr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:yr.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 Pee=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=vO(),{connectors:i,fetchAvailableConnectors:c}=Dc();return h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t()},[t]),a.jsx(Tee,{columns:Iee({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function S_(){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(aX,{children:a.jsx(nd,{children:a.jsx(Pee,{})})})})]})}const e5=h.createContext(void 0),bf=e=>{const t=eJ(e);return{...e,canPublish:t.length===0,validationErrors:t}};var Qa=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(Qa||{}),th=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(th||{}),ar=(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))(ar||{}),u2=(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))(u2||{}),d2=(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))(d2||{});const Uee=(e,t)=>e!==$e.CONNECTOR||t===null?!0:t.fields.some(r=>r.status===Qa.CONNECTED),t5={dataMart:null,isLoading:!1,error:null,runs:[]};function zee(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:bf(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:bf({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:bf({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:bf({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:bf({...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 t5;default:return e}}function Ss(){const e=h.useContext(e5);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class Fee{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 Hee{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 $ee{mapFromDto(t){const n=t.config,r=t.credentials,s=r?r.authMethod==="KEY_PAIR"?{authMethod:ks.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:ks.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:ks.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===ks.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}const n5={getMapper(e){switch(e){case Re.GOOGLE_BIGQUERY:return new Fee;case Re.AWS_ATHENA:return new Hee;case Re.SNOWFLAKE:return new $ee;default:throw new Error(`Unknown storage type: ${e}`)}}};function Yp(e){return n5.getMapper(e.type).mapFromDto(e)}function Vee(e){const t=n5.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function Bee(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Gee(e){return{type:e}}let _p=null;async function qee(){if(_p)return _p;const e=await Kee();return _p=JO(e),_p}async function Kee(){return await new Pf().getAvailableConnectors()}async function Zee(e){const t=await qee();return t.length===0?null:t.find(r=>r.name===e)??null}function Yee(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function Wee(e){return{sqlQuery:e.sqlQuery}}function Xee(e){return{sqlQuery:e.sqlQuery}}function Qee(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Jee(e){return{fullyQualifiedName:e.fullyQualifiedName}}function ete(e){return{fullyQualifiedName:e.fullyQualifiedName}}function tte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function nte(e){return{pattern:e.pattern}}function rte(e){return{pattern:e.pattern}}function ate(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 ste(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 ote(e,t){if(!e||!t)return null;switch(e){case $e.SQL:return Xee(t);case $e.TABLE:return Jee(t);case $e.VIEW:return tte(t);case $e.TABLE_PATTERN:return rte(t);case $e.CONNECTOR:{const n=ste(t);return n.connector.info=await Zee(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:VD.getInfo(e.status),storage:Yp(e.storage),definitionType:e.definitionType,definition:await ote(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=Uee(t.definitionType,t.schema),t}function ite(e){return{id:e.id,title:e.title}}const lte=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}),C_=e=>e.runs.map(lte);function r5({children:e}){const[t,n]=h.useReducer(zee,t5),r=h.useCallback(async O=>{try{n({type:"FETCH_DATA_MART_START"});const T=await Tn.getDataMartById(O),D=await Su(T);n({type:"FETCH_DATA_MART_SUCCESS",payload:D})}catch(T){n({type:"FETCH_DATA_MART_ERROR",payload:un(T)})}},[]),s=h.useCallback(async O=>{try{n({type:"CREATE_DATA_MART_START"});const T=await Tn.createDataMart(O),D=ite(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=un(T);throw n({type:"CREATE_DATA_MART_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"CreateError",label:D.message}),T}},[]),i=h.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_START"});const D=await Tn.updateDataMart(O,T),k=await Su(D);n({type:"UPDATE_DATA_MART_SUCCESS",payload:k}),Le({event:"data_mart_updated",category:"DataMart",action:"Update",label:k.id})}catch(D){const k=un(D);n({type:"UPDATE_DATA_MART_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:k.message})}},[]),c=h.useCallback(async O=>{try{n({type:"DELETE_DATA_MART_START"}),await Tn.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=un(T);n({type:"DELETE_DATA_MART_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:D.message})}},[]),u=h.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await Tn.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 k=un(D);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:k.message})}},[]),f=h.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await Tn.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 k=un(D);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:k.message})}},[]),m=h.useCallback(O=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:O})},[]),y=h.useCallback(async(O,T,D)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let k;switch(T){case $e.SQL:k={definitionType:T,definition:Wee(D)};break;case $e.TABLE:k={definitionType:T,definition:Qee(D)};break;case $e.VIEW:k={definitionType:T,definition:ete(D)};break;case $e.TABLE_PATTERN:k={definitionType:T,definition:nte(D)};break;case $e.CONNECTOR:{const Y=D;let V;for(const Z of Y.connector.source.configuration){const F=Z;if(F._copiedFrom){V=F._copiedFrom.dataMartId;break}}k={definitionType:$e.CONNECTOR,definition:ate(Y),sourceDataMartId:V};break}default:throw new Error(`Unsupported definition type: ${String(T)}`)}const B=await Tn.updateDataMartDefinition(O,k),G=await Su(B);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:T,definition:D}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:G}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:T})}catch(k){const B=un(k);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:B}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:B.message})}},[]),g=h.useCallback(async O=>{try{n({type:"PUBLISH_DATA_MART_START"});const T=await Tn.publishDataMart(O),D=await Su(T);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:D}),Tt.success("Data Mart published")}catch(T){const D=un(T);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"PublishError",label:D.message}),T}},[]),x=h.useCallback(async(O,T=5,D=0,k)=>{try{k!=null&&k.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const B=await Tn.getDataMartRuns(O,T,D,k!=null&&k.silent?{skipLoadingIndicator:!0}:void 0),G=C_(B);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:G}),G}catch(B){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:un(B)}),B}},[]),v=h.useCallback(async(O,T,D=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const k=await Tn.getDataMartRuns(O,D,T),B=C_(k);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:B}),B}catch(k){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:un(k)}),k}},[]),C=h.useCallback(async O=>{const T=Tt.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await Tn.runDataMart(O.id,O.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(D){Tt.dismiss(T);const k=un(D);n({type:"RUN_DATA_MART_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"RunError",label:k.message})}},[]),S=h.useCallback(async(O,T)=>{try{await Tn.cancelDataMartRun(O,T),await x(O),Tt.success("Data Mart run canceled")}catch(D){const k=un(D);n({type:"RUN_DATA_MART_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:k.message})}},[x]),E=h.useCallback(async(O,T)=>{try{return await Tn.getDataMartRunById(O,T)}catch(D){const k=un(D);throw Le({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",label:k.message}),D}},[]),R=h.useCallback(async O=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const T=await Tn.actualizeDataMartSchema(O),D=await Su(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:D}),Tt.success("Output schema actualized")}catch(T){const D=un(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:D}),Le({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:D.message})}},[]),j=h.useCallback(async(O,T)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const D=await Tn.updateDataMartSchema(O,{schema:T}),k=await Su(D);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:k}),Tt.success("Output schema updated")}catch(D){const k=un(D);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:k.message})}},[]),_=h.useCallback(()=>{n({type:"RESET"})},[]),I=h.useCallback(()=>t.error?t.error.message:null,[t.error]),A={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:y,publishDataMart:g,runDataMart:C,cancelDataMartRun:S,actualizeDataMartSchema:R,updateDataMartSchema:j,getDataMartRuns:x,getDataMartRunById:E,loadMoreDataMartRuns:v,getErrorMessage:I,reset:_};return a.jsx(e5.Provider,{value:A,children:e})}var Hh=e=>e.type==="checkbox",rc=e=>e instanceof Date,Ca=e=>e==null;const a5=e=>typeof e=="object";var hr=e=>!Ca(e)&&!Array.isArray(e)&&a5(e)&&!rc(e),s5=e=>hr(e)&&e.target?Hh(e.target)?e.target.checked:e.target.value:e,cte=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,o5=(e,t)=>e.has(cte(t)),ute=e=>{const t=e.constructor&&e.constructor.prototype;return hr(t)&&t.hasOwnProperty("isPrototypeOf")},f2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function gr(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(!(f2&&(e instanceof Blob||r))&&(n||hr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!ute(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=gr(e[s]));else return e;return t}var My=e=>/^\w*$/.test(e),Xn=e=>e===void 0,h2=e=>Array.isArray(e)?e.filter(Boolean):[],m2=e=>h2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!hr(e))return n;const r=(My(t)?[t]:m2(t)).reduce((s,i)=>Ca(s)?s:s[i],e);return Xn(r)||r===e?Xn(e[t])?n:e[t]:r},Ba=e=>typeof e=="boolean",Sn=(e,t,n)=>{let r=-1;const s=My(t)?[t]:m2(t),i=s.length,c=i-1;for(;++r<i;){const u=s[r];let f=n;if(r!==c){const m=e[u];f=hr(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Ng={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ds={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Go={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},p2=re.createContext(null);p2.displayName="HookFormContext";const yd=()=>re.useContext(p2),i5=e=>{const{children:t,...n}=e;return re.createElement(p2.Provider,{value:n},t)};var l5=(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]!==Ds.all&&(t._proxyFormState[c]=!r||Ds.all),n&&(n[c]=!0),e[c]}});return s};const g2=typeof window<"u"?re.useLayoutEffect:re.useEffect;function c5(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 g2(()=>n._subscribe({name:s,formState:f.current,exact:i,callback:m=>{!r&&u({...n._formState,...m})}}),[s,r,i]),re.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),re.useMemo(()=>l5(c,n,f.current,!1),[c,n])}var Za=e=>typeof e=="string",lb=(e,t,n,r,s)=>Za(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),cb=e=>Ca(e)||!a5(e);function Os(e,t,n=new WeakSet){if(cb(e)||cb(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)?!Os(c,u,n):!Object.is(c,u))return!1}}return!0}function dte(e){const t=yd(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=re.useRef(s),m=re.useRef(u),y=re.useRef(void 0),g=re.useRef(n),x=re.useRef(r);m.current=u;const[v,C]=re.useState(()=>{const I=n._getWatch(r,f.current);return m.current?m.current(I):I}),S=re.useCallback(I=>{const A=lb(r,n._names,I||n._formValues,!1,f.current);return m.current?m.current(A):A},[n._formValues,n._names,r]),E=re.useCallback(I=>{if(!i){const A=lb(r,n._names,I||n._formValues,!1,f.current);if(m.current){const O=m.current(A);Os(O,y.current)||(C(O),y.current=O)}else C(A)}},[n._formValues,n._names,i,r]);g2(()=>((g.current!==n||!Os(x.current,r))&&(g.current=n,x.current=r,E()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:I=>{E(I.values)}})),[n,c,r,E]),re.useEffect(()=>n._removeUnmounted());const R=g.current!==n,j=x.current,_=re.useMemo(()=>{if(i)return null;const I=!R&&!Os(j,r);return R||I?S():null},[i,R,r,j,S]);return _!==null?_:v}function fte(e){const t=yd(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=o5(s._names.array,n),m=re.useMemo(()=>Pe(s._formValues,n,Pe(s._defaultValues,n,c)),[s,n,c]),y=dte({control:s,name:n,defaultValue:m,exact:u}),g=c5({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,...Ba(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]),E=re.useCallback(I=>C.current.onChange({target:{value:s5(I),name:n},type:Ng.CHANGE}),[n]),R=re.useCallback(()=>C.current.onBlur({target:{value:Pe(s._formValues,n),name:n},type:Ng.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,...Ba(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:E,onBlur:R,ref:j}),[n,r,g.disabled,E,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,...Ba(x.current.disabled)?{disabled:x.current.disabled}:{}});const O=(T,D)=>{const k=Pe(s._fields,T);k&&k._f&&(k._f.mount=D)};if(O(n,!0),I){const T=gr(Pe(s._options.defaultValues,n,x.current.defaultValue));Sn(s._defaultValues,n,T),Xn(Pe(s._formValues,n))&&Sn(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 hte=e=>e.render(fte(e));var y2=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Uf=e=>Array.isArray(e)?e:[e],E_=()=>{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 u5(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=u5(s,i);hr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var na=e=>hr(e)&&!Object.keys(e).length,x2=e=>e.type==="file",Is=e=>typeof e=="function",Ag=e=>{if(!f2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},d5=e=>e.type==="select-multiple",v2=e=>e.type==="radio",mte=e=>v2(e)||Hh(e),e1=e=>Ag(e)&&e.isConnected;function pte(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Xn(e)?r++:e[t[r++]];return e}function gte(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xn(e[t]))return!1;return!0}function dr(e,t){const n=Array.isArray(t)?t:My(t)?[t]:m2(t),r=n.length===1?e:pte(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(hr(r)&&na(r)||Array.isArray(r)&>e(r))&&dr(e,n.slice(0,-1)),e}var yte=e=>{for(const t in e)if(Is(e[t]))return!0;return!1};function f5(e){return Array.isArray(e)||hr(e)&&!yte(e)}function ub(e,t={}){for(const n in e){const r=e[n];f5(r)?(t[n]=Array.isArray(r)?[]:{},ub(r,t[n])):Xn(r)||(t[n]=!0)}return t}function Tu(e,t,n){n||(n=ub(t));for(const r in e){const s=e[r];if(f5(s))Xn(t)||cb(n[r])?n[r]=ub(s,Array.isArray(s)?[]:{}):Tu(s,Ca(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Os(s,i)}}return n}const w_={value:!1,isValid:!1},R_={value:!0,isValid:!0};var h5=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&&!Xn(e[0].attributes.value)?Xn(e[0].value)||e[0].value===""?R_:{value:e[0].value,isValid:!0}:R_:w_}return w_},m5=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Xn(e)?e:t?e===""?NaN:e&&+e:n&&Za(e)?new Date(e):r?r(e):e;const j_={isValid:!1,value:null};var p5=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,j_):j_;function T_(e){const t=e.ref;return x2(t)?t.files:v2(t)?p5(e.refs).value:d5(t)?[...t.selectedOptions].map(({value:n})=>n):Hh(t)?h5(e.refs).value:m5(Xn(t.value)?e.ref.value:t.value,e)}var xte=(e,t,n,r)=>{const s={};for(const i of e){const c=Pe(t,i);c&&Sn(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Dg=e=>e instanceof RegExp,Sf=e=>Xn(e)?e:Dg(e)?e.source:hr(e)?Dg(e.value)?e.value.source:e.value:e,__=e=>({isOnSubmit:!e||e===Ds.onSubmit,isOnBlur:e===Ds.onBlur,isOnChange:e===Ds.onChange,isOnAll:e===Ds.all,isOnTouch:e===Ds.onTouched});const N_="AsyncFunction";var vte=e=>!!e&&!!e.validate&&!!(Is(e.validate)&&e.validate.constructor.name===N_||hr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===N_)),bte=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),A_=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const zf=(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(zf(u,t))break}else if(hr(u)&&zf(u,t))break}}};function D_(e,t,n){const r=Pe(e,n);if(r||My(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 Ste=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return na(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||Ds.all))},Cte=(e,t,n)=>!e||!t||e===t||Uf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Ete=(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,wte=(e,t)=>!h2(Pe(e,t)).length&&dr(e,t),Rte=(e,t,n)=>{const r=Uf(Pe(e,n));return Sn(r,"root",t[n]),Sn(e,n,r),e};function O_(e,t,n="validate"){if(Za(e)||Array.isArray(e)&&e.every(Za)||Ba(e)&&!e)return{type:n,message:Za(e)?e:"",ref:t}}var Cu=e=>hr(e)&&!Dg(e)?e:{value:e,message:""},I_=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:m,minLength:y,min:g,max:x,pattern:v,validate:C,name:S,valueAsNumber:E,mount:R}=e._f,j=Pe(n,S);if(!R||t.has(S))return{};const _=u?u[0]:c,I=Y=>{s&&_.reportValidity&&(_.setCustomValidity(Ba(Y)?"":Y||""),_.reportValidity())},A={},O=v2(c),T=Hh(c),D=O||T,k=(E||x2(c))&&Xn(c.value)&&Xn(j)||Ag(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,B=y2.bind(null,S,r,A),G=(Y,V,Z,F=Go.maxLength,M=Go.minLength)=>{const $=Y?V:Z;A[S]={type:Y?F:M,message:$,ref:c,...B(Y?F:M,$)}};if(i?!Array.isArray(j)||!j.length:f&&(!D&&(k||Ca(j))||Ba(j)&&!j||T&&!h5(u).isValid||O&&!p5(u).isValid)){const{value:Y,message:V}=Za(f)?{value:!!f,message:f}:Cu(f);if(Y&&(A[S]={type:Go.required,message:V,ref:_,...B(Go.required,V)},!r))return I(V),A}if(!k&&(!Ca(g)||!Ca(x))){let Y,V;const Z=Cu(x),F=Cu(g);if(!Ca(j)&&!isNaN(j)){const M=c.valueAsNumber||j&&+j;Ca(Z.value)||(Y=M>Z.value),Ca(F.value)||(V=M<F.value)}else{const M=c.valueAsDate||new Date(j),$=ge=>new Date(new Date().toDateString()+" "+ge),H=c.type=="time",oe=c.type=="week";Za(Z.value)&&j&&(Y=H?$(j)>$(Z.value):oe?j>Z.value:M>new Date(Z.value)),Za(F.value)&&j&&(V=H?$(j)<$(F.value):oe?j<F.value:M<new Date(F.value))}if((Y||V)&&(G(!!Y,Z.message,F.message,Go.max,Go.min),!r))return I(A[S].message),A}if((m||y)&&!k&&(Za(j)||i&&Array.isArray(j))){const Y=Cu(m),V=Cu(y),Z=!Ca(Y.value)&&j.length>+Y.value,F=!Ca(V.value)&&j.length<+V.value;if((Z||F)&&(G(Z,Y.message,V.message),!r))return I(A[S].message),A}if(v&&!k&&Za(j)){const{value:Y,message:V}=Cu(v);if(Dg(Y)&&!j.match(Y)&&(A[S]={type:Go.pattern,message:V,ref:c,...B(Go.pattern,V)},!r))return I(V),A}if(C){if(Is(C)){const Y=await C(j,n),V=O_(Y,_);if(V&&(A[S]={...V,...B(Go.validate,V.message)},!r))return I(V.message),A}else if(hr(C)){let Y={};for(const V in C){if(!na(Y)&&!r)break;const Z=O_(await C[V](j,n),_,V);Z&&(Y={...Z,...B(V,Z.message)},I(Z.message),r&&(A[S]=Y))}if(!na(Y)&&(A[S]={ref:_,...Y},!r))return A}}return I(!0),A};const jte={mode:Ds.onSubmit,reValidateMode:Ds.onChange,shouldFocusError:!0};function Tte(e={}){let t={...jte,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Is(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)?gr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:gr(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,m=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...y};const x={array:E_(),state:E_()},v=t.criteriaMode===Ds.all,C=q=>ne=>{clearTimeout(m),m=setTimeout(q,ne)},S=async q=>{if(!t.disabled&&(y.isValid||g.isValid||q)){const ne=t.resolver?na((await T()).errors):await k(r,!0);ne!==n.isValid&&x.state.next({isValid:ne})}},E=(q,ne)=>{!t.disabled&&(y.isValidating||y.validatingFields||g.isValidating||g.validatingFields)&&((q||Array.from(u.mount)).forEach(ce=>{ce&&(ne?Sn(n.validatingFields,ce,ne):dr(n.validatingFields,ce))}),x.state.next({validatingFields:n.validatingFields,isValidating:!na(n.validatingFields)}))},R=(q,ne=[],ce,Oe,we=!0,je=!0)=>{if(Oe&&ce&&!t.disabled){if(c.action=!0,je&&Array.isArray(Pe(r,q))){const He=ce(Pe(r,q),Oe.argA,Oe.argB);we&&Sn(r,q,He)}if(je&&Array.isArray(Pe(n.errors,q))){const He=ce(Pe(n.errors,q),Oe.argA,Oe.argB);we&&Sn(n.errors,q,He),wte(n.errors,q)}if((y.touchedFields||g.touchedFields)&&je&&Array.isArray(Pe(n.touchedFields,q))){const He=ce(Pe(n.touchedFields,q),Oe.argA,Oe.argB);we&&Sn(n.touchedFields,q,He)}(y.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Tu(s,i)),x.state.next({name:q,isDirty:G(q,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Sn(i,q,ne)},j=(q,ne)=>{Sn(n.errors,q,ne),x.state.next({errors:n.errors})},_=q=>{n.errors=q,x.state.next({errors:n.errors,isValid:!1})},I=(q,ne,ce,Oe)=>{const we=Pe(r,q);if(we){const je=Pe(i,q,Xn(ce)?Pe(s,q):ce);Xn(je)||Oe&&Oe.defaultChecked||ne?Sn(i,q,ne?je:T_(we._f)):Z(q,je),c.mount&&!c.action&&S()}},A=(q,ne,ce,Oe,we)=>{let je=!1,He=!1;const mt={name:q};if(!t.disabled){if(!ce||Oe){(y.isDirty||g.isDirty)&&(He=n.isDirty,n.isDirty=mt.isDirty=G(),je=He!==mt.isDirty);const st=Os(Pe(s,q),ne);He=!!Pe(n.dirtyFields,q),st?dr(n.dirtyFields,q):Sn(n.dirtyFields,q,!0),mt.dirtyFields=n.dirtyFields,je=je||(y.dirtyFields||g.dirtyFields)&&He!==!st}if(ce){const st=Pe(n.touchedFields,q);st||(Sn(n.touchedFields,q,ce),mt.touchedFields=n.touchedFields,je=je||(y.touchedFields||g.touchedFields)&&st!==ce)}je&&we&&x.state.next(mt)}return je?mt:{}},O=(q,ne,ce,Oe)=>{const we=Pe(n.errors,q),je=(y.isValid||g.isValid)&&Ba(ne)&&n.isValid!==ne;if(t.delayError&&ce?(f=C(()=>j(q,ce)),f(t.delayError)):(clearTimeout(m),f=null,ce?Sn(n.errors,q,ce):dr(n.errors,q)),(ce?!Os(we,ce):we)||!na(Oe)||je){const He={...Oe,...je&&Ba(ne)?{isValid:ne}:{},errors:n.errors,name:q};n={...n,...He},x.state.next(He)}},T=async q=>{E(q,!0);const ne=await t.resolver(i,t.context,xte(q||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(q),ne},D=async q=>{const{errors:ne}=await T(q);if(q)for(const ce of q){const Oe=Pe(ne,ce);Oe?Sn(n.errors,ce,Oe):dr(n.errors,ce)}else n.errors=ne;return ne},k=async(q,ne,ce={valid:!0})=>{for(const Oe in q){const we=q[Oe];if(we){const{_f:je,...He}=we;if(je){const mt=u.array.has(je.name),st=we._f&&vte(we._f);st&&y.validatingFields&&E([je.name],!0);const Wt=await I_(we,u.disabled,i,v,t.shouldUseNativeValidation&&!ne,mt);if(st&&y.validatingFields&&E([je.name]),Wt[je.name]&&(ce.valid=!1,ne))break;!ne&&(Pe(Wt,je.name)?mt?Rte(n.errors,Wt,je.name):Sn(n.errors,je.name,Wt[je.name]):dr(n.errors,je.name))}!na(He)&&await k(He,ne,ce)}}return ce.valid},B=()=>{for(const q of u.unMount){const ne=Pe(r,q);ne&&(ne._f.refs?ne._f.refs.every(ce=>!e1(ce)):!e1(ne._f.ref))&&J(q)}u.unMount=new Set},G=(q,ne)=>!t.disabled&&(q&&ne&&Sn(i,q,ne),!Os(ge(),s)),Y=(q,ne,ce)=>lb(q,u,{...c.mount?i:Xn(ne)?s:Za(q)?{[q]:ne}:ne},ce,ne),V=q=>h2(Pe(c.mount?i:s,q,t.shouldUnregister?Pe(s,q,[]):[])),Z=(q,ne,ce={})=>{const Oe=Pe(r,q);let we=ne;if(Oe){const je=Oe._f;je&&(!je.disabled&&Sn(i,q,m5(ne,je)),we=Ag(je.ref)&&Ca(ne)?"":ne,d5(je.ref)?[...je.ref.options].forEach(He=>He.selected=we.includes(He.value)):je.refs?Hh(je.ref)?je.refs.forEach(He=>{(!He.defaultChecked||!He.disabled)&&(Array.isArray(we)?He.checked=!!we.find(mt=>mt===He.value):He.checked=we===He.value||!!we)}):je.refs.forEach(He=>He.checked=He.value===we):x2(je.ref)?je.ref.value="":(je.ref.value=we,je.ref.type||x.state.next({name:q,values:gr(i)})))}(ce.shouldDirty||ce.shouldTouch)&&A(q,we,ce.shouldTouch,ce.shouldDirty,!0),ce.shouldValidate&&oe(q)},F=(q,ne,ce)=>{for(const Oe in ne){if(!ne.hasOwnProperty(Oe))return;const we=ne[Oe],je=q+"."+Oe,He=Pe(r,je);(u.array.has(q)||hr(we)||He&&!He._f)&&!rc(we)?F(je,we,ce):Z(je,we,ce)}},M=(q,ne,ce={})=>{const Oe=Pe(r,q),we=u.array.has(q),je=gr(ne);Sn(i,q,je),we?(x.array.next({name:q,values:gr(i)}),(y.isDirty||y.dirtyFields||g.isDirty||g.dirtyFields)&&ce.shouldDirty&&x.state.next({name:q,dirtyFields:Tu(s,i),isDirty:G(q,je)})):Oe&&!Oe._f&&!Ca(je)?F(q,je,ce):Z(q,je,ce),A_(q,u)&&x.state.next({...n,name:q}),x.state.next({name:c.mount?q:void 0,values:gr(i)})},$=async q=>{c.mount=!0;const ne=q.target;let ce=ne.name,Oe=!0;const we=Pe(r,ce),je=st=>{Oe=Number.isNaN(st)||rc(st)&&isNaN(st.getTime())||Os(st,Pe(i,ce,st))},He=__(t.mode),mt=__(t.reValidateMode);if(we){let st,Wt;const sr=ne.type?T_(we._f):s5(q),$n=q.type===Ng.BLUR||q.type===Ng.FOCUS_OUT,Dr=!bte(we._f)&&!t.resolver&&!Pe(n.errors,ce)&&!we._f.deps||Ete($n,Pe(n.touchedFields,ce),n.isSubmitted,mt,He),Jr=A_(ce,u,$n);Sn(i,ce,sr),$n?(!ne||!ne.readOnly)&&(we._f.onBlur&&we._f.onBlur(q),f&&f(0)):we._f.onChange&&we._f.onChange(q);const fn=A(ce,sr,$n),or=!na(fn)||Jr;if(!$n&&x.state.next({name:ce,type:q.type,values:gr(i)}),Dr)return(y.isValid||g.isValid)&&(t.mode==="onBlur"?$n&&S():$n||S()),or&&x.state.next({name:ce,...Jr?{}:fn});if(!$n&&Jr&&x.state.next({...n}),t.resolver){const{errors:kn}=await T([ce]);if(je(sr),Oe){const Ys=D_(n.errors,r,ce),Aa=D_(kn,r,Ys.name||ce);st=Aa.error,ce=Aa.name,Wt=na(kn)}}else E([ce],!0),st=(await I_(we,u.disabled,i,v,t.shouldUseNativeValidation))[ce],E([ce]),je(sr),Oe&&(st?Wt=!1:(y.isValid||g.isValid)&&(Wt=await k(r,!0)));Oe&&(we._f.deps&&(!Array.isArray(we._f.deps)||we._f.deps.length>0)&&oe(we._f.deps),O(ce,Wt,st,fn))}},H=(q,ne)=>{if(Pe(n.errors,ne)&&q.focus)return q.focus(),1},oe=async(q,ne={})=>{let ce,Oe;const we=Uf(q);if(t.resolver){const je=await D(Xn(q)?q:we);ce=na(je),Oe=q?!we.some(He=>Pe(je,He)):ce}else q?(Oe=(await Promise.all(we.map(async je=>{const He=Pe(r,je);return await k(He&&He._f?{[je]:He}:He)}))).every(Boolean),!(!Oe&&!n.isValid)&&S()):Oe=ce=await k(r);return x.state.next({...!Za(q)||(y.isValid||g.isValid)&&ce!==n.isValid?{}:{name:q},...t.resolver||!q?{isValid:ce}:{},errors:n.errors}),ne.shouldFocus&&!Oe&&zf(r,H,q?we:u.mount),Oe},ge=(q,ne)=>{let ce={...c.mount?i:s};return ne&&(ce=u5(ne.dirtyFields?n.dirtyFields:n.touchedFields,ce)),Xn(q)?ce:Za(q)?Pe(ce,q):q.map(Oe=>Pe(ce,Oe))},P=(q,ne)=>({invalid:!!Pe((ne||n).errors,q),isDirty:!!Pe((ne||n).dirtyFields,q),error:Pe((ne||n).errors,q),isValidating:!!Pe(n.validatingFields,q),isTouched:!!Pe((ne||n).touchedFields,q)}),U=q=>{q&&Uf(q).forEach(ne=>dr(n.errors,ne)),x.state.next({errors:q?n.errors:{}})},z=(q,ne,ce)=>{const Oe=(Pe(r,q,{_f:{}})._f||{}).ref,we=Pe(n.errors,q)||{},{ref:je,message:He,type:mt,...st}=we;Sn(n.errors,q,{...st,...ne,ref:Oe}),x.state.next({name:q,errors:n.errors,isValid:!1}),ce&&ce.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},X=(q,ne)=>Is(q)?x.state.subscribe({next:ce=>"values"in ce&&q(Y(void 0,ne),ce)}):Y(q,ne,!0),W=q=>x.state.subscribe({next:ne=>{Cte(q.name,ne.name,q.exact)&&Ste(ne,q.formState||y,On,q.reRenderRoot)&&q.callback({values:{...i},...n,...ne,defaultValues:s})}}).unsubscribe,ae=q=>(c.mount=!0,g={...g,...q.formState},W({...q,formState:g})),J=(q,ne={})=>{for(const ce of q?Uf(q):u.mount)u.mount.delete(ce),u.array.delete(ce),ne.keepValue||(dr(r,ce),dr(i,ce)),!ne.keepError&&dr(n.errors,ce),!ne.keepDirty&&dr(n.dirtyFields,ce),!ne.keepTouched&&dr(n.touchedFields,ce),!ne.keepIsValidating&&dr(n.validatingFields,ce),!t.shouldUnregister&&!ne.keepDefaultValue&&dr(s,ce);x.state.next({values:gr(i)}),x.state.next({...n,...ne.keepDirty?{isDirty:G()}:{}}),!ne.keepIsValid&&S()},le=({disabled:q,name:ne})=>{(Ba(q)&&c.mount||q||u.disabled.has(ne))&&(q?u.disabled.add(ne):u.disabled.delete(ne))},ye=(q,ne={})=>{let ce=Pe(r,q);const Oe=Ba(ne.disabled)||Ba(t.disabled);return Sn(r,q,{...ce||{},_f:{...ce&&ce._f?ce._f:{ref:{name:q}},name:q,mount:!0,...ne}}),u.mount.add(q),ce?le({disabled:Ba(ne.disabled)?ne.disabled:t.disabled,name:q}):I(q,!0,ne.value),{...Oe?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:Sf(ne.min),max:Sf(ne.max),minLength:Sf(ne.minLength),maxLength:Sf(ne.maxLength),pattern:Sf(ne.pattern)}:{},name:q,onChange:$,onBlur:$,ref:we=>{if(we){ye(q,ne),ce=Pe(r,q);const je=Xn(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,He=mte(je),mt=ce._f.refs||[];if(He?mt.find(st=>st===je):je===ce._f.ref)return;Sn(r,q,{_f:{...ce._f,...He?{refs:[...mt.filter(e1),je,...Array.isArray(Pe(s,q))?[{}]:[]],ref:{type:je.type,name:q}}:{ref:je}}}),I(q,!1,void 0,je)}else ce=Pe(r,q,{}),ce._f&&(ce._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(o5(u.array,q)&&c.action)&&u.unMount.add(q)}}},Ce=()=>t.shouldFocusError&&zf(r,H,u.mount),Ve=q=>{Ba(q)&&(x.state.next({disabled:q}),zf(r,(ne,ce)=>{const Oe=Pe(r,ce);Oe&&(ne.disabled=Oe._f.disabled||q,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(we=>{we.disabled=Oe._f.disabled||q}))},0,!1))},De=(q,ne)=>async ce=>{let Oe;ce&&(ce.preventDefault&&ce.preventDefault(),ce.persist&&ce.persist());let we=gr(i);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:je,values:He}=await T();n.errors=je,we=gr(He)}else await k(r);if(u.disabled.size)for(const je of u.disabled)dr(we,je);if(dr(n.errors,"root"),na(n.errors)){x.state.next({errors:{}});try{await q(we,ce)}catch(je){Oe=je}}else ne&&await ne({...n.errors},ce),Ce(),setTimeout(Ce);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:na(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},et=(q,ne={})=>{Pe(r,q)&&(Xn(ne.defaultValue)?M(q,gr(Pe(s,q))):(M(q,ne.defaultValue),Sn(s,q,gr(ne.defaultValue))),ne.keepTouched||dr(n.touchedFields,q),ne.keepDirty||(dr(n.dirtyFields,q),n.isDirty=ne.defaultValue?G(q,gr(Pe(s,q))):G()),ne.keepError||(dr(n.errors,q),y.isValid&&S()),x.state.next({...n}))},rt=(q,ne={})=>{const ce=q?gr(q):s,Oe=gr(ce),we=na(q),je=we?s:Oe;if(ne.keepDefaultValues||(s=ce),!ne.keepValues){if(ne.keepDirtyValues){const He=new Set([...u.mount,...Object.keys(Tu(s,i))]);for(const mt of Array.from(He))Pe(n.dirtyFields,mt)?Sn(je,mt,Pe(i,mt)):M(mt,Pe(je,mt))}else{if(f2&&Xn(q))for(const He of u.mount){const mt=Pe(r,He);if(mt&&mt._f){const st=Array.isArray(mt._f.refs)?mt._f.refs[0]:mt._f.ref;if(Ag(st)){const Wt=st.closest("form");if(Wt){Wt.reset();break}}}}if(ne.keepFieldsRef)for(const He of u.mount)M(He,Pe(je,He));else r={}}i=t.shouldUnregister?ne.keepDefaultValues?gr(s):{}:gr(je),x.array.next({values:{...je}}),x.state.next({values:{...je}})}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&&!na(je),c.watch=!!t.shouldUnregister,c.action=!1,ne.keepErrors||(n.errors={}),x.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:we?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!Os(q,s)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Tu(s,i):n.dirtyFields:ne.keepDefaultValues&&q?Tu(s,q):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},dn=(q,ne)=>rt(Is(q)?q(i):q,ne),zt=(q,ne={})=>{const ce=Pe(r,q),Oe=ce&&ce._f;if(Oe){const we=Oe.refs?Oe.refs[0]:Oe.ref;we.focus&&(we.focus(),ne.shouldSelect&&Is(we.select)&&we.select())}},On=q=>{n={...n,...q}},Me={control:{register:ye,unregister:J,getFieldState:P,handleSubmit:De,setError:z,_subscribe:W,_runSchema:T,_focusError:Ce,_getWatch:Y,_getDirty:G,_setValid:S,_setFieldArray:R,_setDisabledField:le,_setErrors:_,_getFieldArray:V,_reset:rt,_resetDefaultValues:()=>Is(t.defaultValues)&&t.defaultValues().then(q=>{dn(q,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:Ve,_subjects:x,_proxyFormState:y,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(q){c=q},get _defaultValues(){return s},get _names(){return u},set _names(q){u=q},get _formState(){return n},get _options(){return t},set _options(q){t={...t,...q}}},subscribe:ae,trigger:oe,register:ye,handleSubmit:De,watch:X,setValue:M,getValues:ge,reset:dn,resetField:et,clearErrors:U,unregister:J,setError:z,setFocus:zt,getFieldState:P};return{...Me,formControl:Me}}function Ro(e={}){const t=re.useRef(void 0),n=re.useRef(void 0),[r,s]=re.useState({isDirty:!1,isValidating:!1,isLoading:Is(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:Is(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Is(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=Tte(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,g2(()=>{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&&!Os(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=l5(r,i),t.current}var _te=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nte=_te.reduce((e,t)=>{const n=Yb(`Primitive.${t}`),r=h.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}},{}),Ate="Label",g5=h.forwardRef((e,t)=>a.jsx(Nte.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())}}));g5.displayName=Ate;var Dte=g5;function Ta({className:e,...t}){return a.jsx(Dte,{"data-slot":"label",className:se("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 _l=i5,y5=h.createContext({}),_t=({...e})=>a.jsx(y5.Provider,{value:{name:e.name},children:a.jsx(hte,{...e})}),$h=()=>{const e=h.useContext(y5),t=h.useContext(x5),{getFieldState:n}=yd(),r=c5({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}},x5=h.createContext({});function xt({className:e="",...t}){const n=h.useId();return a.jsx(x5.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:se("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}=$h();return a.jsxs(Ta,{"data-slot":"form-label","data-error":!!i,className:se("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(Et,{...n,children:[a.jsx(wt,{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(Fr,{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}=$h();return a.jsx(ph,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function xn({className:e,...t}){const{formDescriptionId:n}=$h();return a.jsx("div",{"data-slot":"form-description",id:n,className:se("text-muted-foreground text-sm",e),...t})}function Mt({className:e,...t}){const{error:n,formMessageId:r}=$h(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?a.jsx("p",{"data-slot":"form-message",id:r,className:se("text-destructive text-sm",e),...t,children:s}):null}function Nl({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:se("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:se(r,e),children:t})}function Yr({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 Ote({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=$h();return a.jsxs("label",{htmlFor:`${u}-${e}`,className:se("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:se("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:se("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function Ite({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return a.jsx("div",{tabIndex:-1,className:se(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(Ote,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const gi=h.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));gi.displayName="AppForm";function M_(e,[t,n]){return Math.min(n,Math.max(t,e))}function db(e){const t=Mte(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Lte);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Mte(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Ute(s),u=Pte(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kte=Symbol("radix.slottable");function Lte(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kte}function Pte(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 Ute(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 zte(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=db(u),m=re.forwardRef((S,E)=>{const{scope:R,children:j}=S,_=i(u,R),I=ht(E,_.collectionRef);return a.jsx(f,{ref:I,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=db(y),v=re.forwardRef((S,E)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=ht(E,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 E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}function b2(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fte=[" ","Enter","ArrowUp","ArrowDown"],Hte=[" ","Enter"],gc="Select",[ky,Ly,$te]=zte(gc),[xd]=Sr(gc,[$te,Eo]),Py=Eo(),[Vte,Al]=xd(gc),[Bte,Gte]=xd(gc),v5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:m,name:y,autoComplete:g,disabled:x,required:v,form:C}=e,S=Py(t),[E,R]=h.useState(null),[j,_]=h.useState(null),[I,A]=h.useState(!1),O=jh(m),[T,D]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:gc}),[k,B]=ia({prop:c,defaultProp:u,onChange:f,caller:gc}),G=h.useRef(null),Y=E?C||!!E.closest("form"):!0,[V,Z]=h.useState(new Set),F=Array.from(V).map(M=>M.props.value).join(";");return a.jsx(ud,{...S,children:a.jsxs(Vte,{required:v,scope:t,trigger:E,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:I,onValueNodeHasChildrenChange:A,contentId:er(),value:k,onValueChange:B,open:T,onOpenChange:D,dir:O,triggerPointerDownPosRef:G,disabled:x,children:[a.jsx(ky.Provider,{scope:t,children:a.jsx(Bte,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(M=>{Z($=>new Set($).add(M))},[]),onNativeOptionRemove:h.useCallback(M=>{Z($=>{const H=new Set($);return H.delete(M),H})},[]),children:n})}),Y?a.jsxs(V5,{"aria-hidden":!0,required:v,tabIndex:-1,name:y,autoComplete:g,value:k,onChange:M=>B(M.target.value),disabled:x,form:C,children:[k===void 0?a.jsx("option",{value:""}):null,Array.from(V)]},F):null]})})};v5.displayName=gc;var b5="SelectTrigger",S5=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Py(n),c=Al(b5,n),u=c.disabled||r,f=ht(t,c.onTriggerChange),m=Ly(n),y=h.useRef("touch"),[g,x,v]=G5(S=>{const E=m().filter(_=>!_.disabled),R=E.find(_=>_.value===c.value),j=q5(E,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":B5(c.value)?"":void 0,...s,ref:f,onClick:Ie(s.onClick,S=>{S.currentTarget.focus(),y.current!=="mouse"&&C(S)}),onPointerDown:Ie(s.onPointerDown,S=>{y.current=S.pointerType;const E=S.target;E.hasPointerCapture(S.pointerId)&&E.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:Ie(s.onKeyDown,S=>{const E=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(E&&S.key===" ")&&Fte.includes(S.key)&&(C(),S.preventDefault())})})})});S5.displayName=b5;var C5="SelectValue",E5=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Al(C5,n),{onValueNodeHasChildrenChange:m}=f,y=i!==void 0,g=ht(t,f.onValueNodeChange);return Hr(()=>{m(y)},[m,y]),a.jsx(Je.span,{...u,ref:g,style:{pointerEvents:"none"},children:B5(f.value)?a.jsx(a.Fragment,{children:c}):i})});E5.displayName=C5;var qte="SelectIcon",w5=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Je.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});w5.displayName=qte;var Kte="SelectPortal",R5=e=>a.jsx(jc,{asChild:!0,...e});R5.displayName=Kte;var yc="SelectContent",j5=h.forwardRef((e,t)=>{const n=Al(yc,e.__scopeSelect),[r,s]=h.useState();if(Hr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ms.createPortal(a.jsx(T5,{scope:e.__scopeSelect,children:a.jsx(ky.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(_5,{...e,ref:t})});j5.displayName=yc;var Ts=10,[T5,Dl]=xd(yc),Zte="SelectContentImpl",Yte=db("SelectContent.RemoveScroll"),_5=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:E,...R}=e,j=Al(yc,n),[_,I]=h.useState(null),[A,O]=h.useState(null),T=ht(t,J=>I(J)),[D,k]=h.useState(null),[B,G]=h.useState(null),Y=Ly(n),[V,Z]=h.useState(!1),F=h.useRef(!1);h.useEffect(()=>{if(_)return ey(_)},[_]),Qg();const M=h.useCallback(J=>{const[le,...ye]=Y().map(De=>De.ref.current),[Ce]=ye.slice(-1),Ve=document.activeElement;for(const De of J)if(De===Ve||(De==null||De.scrollIntoView({block:"nearest"}),De===le&&A&&(A.scrollTop=0),De===Ce&&A&&(A.scrollTop=A.scrollHeight),De==null||De.focus(),document.activeElement!==Ve))return},[Y,A]),$=h.useCallback(()=>M([D,_]),[M,D,_]);h.useEffect(()=>{V&&$()},[V,$]);const{onOpenChange:H,triggerPointerDownPosRef:oe}=j;h.useEffect(()=>{if(_){let J={x:0,y:0};const le=Ce=>{var Ve,De;J={x:Math.abs(Math.round(Ce.pageX)-(((Ve=oe.current)==null?void 0:Ve.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((De=oe.current)==null?void 0:De.y)??0))}},ye=Ce=>{J.x<=10&&J.y<=10?Ce.preventDefault():_.contains(Ce.target)||H(!1),document.removeEventListener("pointermove",le),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",ye,{capture:!0})}}},[_,H,oe]),h.useEffect(()=>{const J=()=>H(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[H]);const[ge,P]=G5(J=>{const le=Y().filter(Ve=>!Ve.disabled),ye=le.find(Ve=>Ve.ref.current===document.activeElement),Ce=q5(le,J,ye);Ce&&setTimeout(()=>Ce.ref.current.focus())}),U=h.useCallback((J,le,ye)=>{const Ce=!F.current&&!ye;(j.value!==void 0&&j.value===le||Ce)&&(k(J),Ce&&(F.current=!0))},[j.value]),z=h.useCallback(()=>_==null?void 0:_.focus(),[_]),X=h.useCallback((J,le,ye)=>{const Ce=!F.current&&!ye;(j.value!==void 0&&j.value===le||Ce)&&G(J)},[j.value]),W=r==="popper"?fb:N5,ae=W===fb?{side:u,sideOffset:f,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:E}:{};return a.jsx(T5,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:U,selectedItem:D,onItemLeave:z,itemTextRefCallback:X,focusSelectedItem:$,selectedItemText:B,position:r,isPositioned:V,searchRef:ge,children:a.jsx(bh,{as:Yte,allowPinchZoom:!0,children:a.jsx(vh,{asChild:!0,trapped:j.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Ie(s,J=>{var le;(le=j.trigger)==null||le.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(W,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:J=>J.preventDefault(),...R,...ae,onPlaced:()=>Z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Ie(R.onKeyDown,J=>{const le=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!le&&J.key.length===1&&P(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ce=Y().filter(Ve=>!Ve.disabled).map(Ve=>Ve.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Ve=J.target,De=Ce.indexOf(Ve);Ce=Ce.slice(De+1)}setTimeout(()=>M(Ce)),J.preventDefault()}})})})})})})});_5.displayName=Zte;var Wte="SelectItemAlignedPosition",N5=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Al(yc,n),c=Dl(yc,n),[u,f]=h.useState(null),[m,y]=h.useState(null),g=ht(t,T=>y(T)),x=Ly(n),v=h.useRef(!1),C=h.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:R,focusSelectedItem:j}=c,_=h.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&S&&E&&R){const T=i.trigger.getBoundingClientRect(),D=m.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),B=R.getBoundingClientRect();if(i.dir!=="rtl"){const Ve=B.left-D.left,De=k.left-Ve,et=T.left-De,rt=T.width+et,dn=Math.max(rt,D.width),zt=window.innerWidth-Ts,On=M_(De,[Ts,Math.max(Ts,zt-dn)]);u.style.minWidth=rt+"px",u.style.left=On+"px"}else{const Ve=D.right-B.right,De=window.innerWidth-k.right-Ve,et=window.innerWidth-T.right-De,rt=T.width+et,dn=Math.max(rt,D.width),zt=window.innerWidth-Ts,On=M_(De,[Ts,Math.max(Ts,zt-dn)]);u.style.minWidth=rt+"px",u.style.right=On+"px"}const G=x(),Y=window.innerHeight-Ts*2,V=S.scrollHeight,Z=window.getComputedStyle(m),F=parseInt(Z.borderTopWidth,10),M=parseInt(Z.paddingTop,10),$=parseInt(Z.borderBottomWidth,10),H=parseInt(Z.paddingBottom,10),oe=F+M+V+H+$,ge=Math.min(E.offsetHeight*5,oe),P=window.getComputedStyle(S),U=parseInt(P.paddingTop,10),z=parseInt(P.paddingBottom,10),X=T.top+T.height/2-Ts,W=Y-X,ae=E.offsetHeight/2,J=E.offsetTop+ae,le=F+M+J,ye=oe-le;if(le<=X){const Ve=G.length>0&&E===G[G.length-1].ref.current;u.style.bottom="0px";const De=m.clientHeight-S.offsetTop-S.offsetHeight,et=Math.max(W,ae+(Ve?z:0)+De+$),rt=le+et;u.style.height=rt+"px"}else{const Ve=G.length>0&&E===G[0].ref.current;u.style.top="0px";const et=Math.max(X,F+S.offsetTop+(Ve?U:0)+ae)+ye;u.style.height=et+"px",S.scrollTop=le-X+S.offsetTop}u.style.margin=`${Ts}px 0`,u.style.minHeight=ge+"px",u.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,m,S,E,R,i.dir,r]);Hr(()=>_(),[_]);const[I,A]=h.useState();Hr(()=>{m&&A(window.getComputedStyle(m).zIndex)},[m]);const O=h.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}})})})});N5.displayName=Wte;var Xte="SelectPopperPosition",fb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ts,...i}=e,c=Py(n);return a.jsx(Ch,{...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)"}})});fb.displayName=Xte;var[Qte,S2]=xd(yc,{}),hb="SelectViewport",A5=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Dl(hb,n),c=S2(hb,n),u=ht(t,i.onViewportChange),f=h.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(ky.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:Ie(s.onScroll,m=>{const y=m.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-Ts*2,S=parseFloat(g.style.minHeight),E=parseFloat(g.style.height),R=Math.max(S,E);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})})})]})});A5.displayName=hb;var D5="SelectGroup",[Jte,ene]=xd(D5),O5=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=er();return a.jsx(Jte,{scope:n,id:s,children:a.jsx(Je.div,{role:"group","aria-labelledby":s,...r,ref:t})})});O5.displayName=D5;var I5="SelectLabel",tne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ene(I5,n);return a.jsx(Je.div,{id:s.id,...r,ref:t})});tne.displayName=I5;var Og="SelectItem",[nne,M5]=xd(Og),k5=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Al(Og,n),f=Dl(Og,n),m=u.value===r,[y,g]=h.useState(i??""),[x,v]=h.useState(!1),C=ht(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,s)}),S=er(),E=h.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(nne,{scope:n,value:r,disabled:s,textId:S,isSelected:m,onItemTextChange:h.useCallback(j=>{g(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(ky.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":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:C,onFocus:Ie(c.onFocus,()=>v(!0)),onBlur:Ie(c.onBlur,()=>v(!1)),onClick:Ie(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Ie(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Ie(c.onPointerDown,j=>{E.current=j.pointerType}),onPointerMove:Ie(c.onPointerMove,j=>{var _;E.current=j.pointerType,s?(_=f.onItemLeave)==null||_.call(f):E.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Ie(c.onKeyDown,j=>{var I;((I=f.searchRef)==null?void 0:I.current)!==""&&j.key===" "||(Hte.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});k5.displayName=Og;var Df="SelectItemText",L5=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Al(Df,n),u=Dl(Df,n),f=M5(Df,n),m=Gte(Df,n),[y,g]=h.useState(null),x=ht(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=h.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=m;return Hr(()=>(S(C),()=>E(C)),[S,E,C]),a.jsxs(a.Fragment,{children:[a.jsx(Je.span,{id:f.textId,...i,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Ms.createPortal(i.children,c.valueNode):null]})});L5.displayName=Df;var P5="SelectItemIndicator",U5=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return M5(P5,n).isSelected?a.jsx(Je.span,{"aria-hidden":!0,...r,ref:t}):null});U5.displayName=P5;var mb="SelectScrollUpButton",z5=h.forwardRef((e,t)=>{const n=Dl(mb,e.__scopeSelect),r=S2(mb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Hr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollTop>0;i(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(H5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});z5.displayName=mb;var pb="SelectScrollDownButton",F5=h.forwardRef((e,t)=>{const n=Dl(pb,e.__scopeSelect),r=S2(pb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Hr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,y=Math.ceil(f.scrollTop)<m;i(y)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(H5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});F5.displayName=pb;var H5=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Dl("SelectScrollButton",n),c=h.useRef(null),u=Ly(n),f=h.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),Hr(()=>{var y;const m=u().find(g=>g.ref.current===document.activeElement);(y=m==null?void 0:m.ref.current)==null||y.scrollIntoView({block:"nearest"})},[u]),a.jsx(Je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ie(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ie(s.onPointerMove,()=>{var m;(m=i.onItemLeave)==null||m.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ie(s.onPointerLeave,()=>{f()})})}),rne="SelectSeparator",$5=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Je.div,{"aria-hidden":!0,...r,ref:t})});$5.displayName=rne;var gb="SelectArrow",ane=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Py(n),i=Al(gb,n),c=Dl(gb,n);return i.open&&c.position==="popper"?a.jsx(Eh,{...s,...r,ref:t}):null});ane.displayName=gb;var sne="SelectBubbleInput",V5=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=ht(r,s),c=b2(t);return h.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:{...H4,...n.style},ref:i,defaultValue:t})});V5.displayName=sne;function B5(e){return e===""||e===void 0}function G5(e){const t=Us(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(c=>{const u=n.current+c;t(u),(function f(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function q5(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=one(e,Math.max(i,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function one(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ine=v5,lne=S5,cne=E5,une=w5,dne=R5,fne=j5,hne=A5,mne=O5,pne=k5,gne=L5,yne=U5,xne=z5,vne=F5,bne=$5;function ca({...e}){return a.jsx(ine,{"data-slot":"select",...e})}function Uy({...e}){return a.jsx(mne,{"data-slot":"select-group",...e})}function ua({...e}){return a.jsx(cne,{"data-slot":"select-value",...e})}function da({className:e,size:t="default",children:n,...r}){return a.jsxs(lne,{"data-slot":"select-trigger","data-size":t,className:se("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(une,{asChild:!0,children:a.jsx(Bs,{className:"size-4 opacity-50"})})]})}function fa({className:e,children:t,position:n="popper",...r}){return a.jsx(dne,{children:a.jsxs(fne,{"data-slot":"select-content",className:se("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(Sne,{}),a.jsx(hne,{className:se("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(Cne,{})]})})}function Gn({className:e,children:t,...n}){return a.jsxs(pne,{"data-slot":"select-item",className:se("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(yne,{children:a.jsx(oa,{className:"size-4"})})}),a.jsx(gne,{children:t})]})}function K5({className:e,...t}){return a.jsx(bne,{"data-slot":"select-separator",className:se("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function Sne({className:e,...t}){return a.jsx(xne,{"data-slot":"select-scroll-up-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(qu,{className:"size-4"})})}function Cne({className:e,...t}){return a.jsx(vne,{"data-slot":"select-scroll-down-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Bs,{className:"size-4"})})}const Ene=rn({title:Dt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:Dt().min(1,"Storage is required")});function wne(){const{createDataMart:e,isLoading:t,error:n}=Ss();return{handleCreate:h.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function Rne(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,reset:v,dataMart:C,isLoading:S,error:E,getErrorMessage:R,runs:j}=Ss();return h.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:C,isLoading:S,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,runs:j,getDataMart:t}}const k_=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},yb=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?k_(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>k_(s,n,e))}},L_=(e,t)=>{t.shouldUseNativeValidation&&yb(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(jne(t.names||Object.keys(e),r)){const c=Object.assign({},Pe(n,r));Sn(c,"root",i),Sn(n,r,c)}else Sn(n,r,i)}return n},jne=(e,t)=>{const n=P_(t);return e.some(r=>P_(r).match(`^${n}\\.\\d+`))};function P_(e){return e.replace(/\]|\[/g,"")}function Z5(e,t,n){function r(u,f){var m;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(m=u._zod).traits??(m.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 m=n!=null&&n.Parent?new i:this;r(m,u),(f=m._zod).deferred??(f.deferred=[]);for(const y of m._zod.deferred)y();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:u=>{var f,m;return n!=null&&n.Parent&&u instanceof n.Parent?!0:(m=(f=u==null?void 0:u._zod)==null?void 0:f.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Tne extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const _ne={};function Y5(e){return _ne}function Nne(e,t){return typeof t=="bigint"?t.toString():t}const W5=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Np(e){return typeof e=="string"?e:e==null?void 0:e.message}function X5(e,t,n){var s,i,c,u,f,m;const r={...e,path:e.path??[]};if(!e.message){const y=Np((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??Np((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??Np((f=n.customError)==null?void 0:f.call(n,e))??Np((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=y}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const Q5=(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,Nne,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ane=Z5("$ZodError",Q5),J5=Z5("$ZodError",Q5,{Parent:Error}),Dne=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 Tne;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>X5(f,i,Y5())));throw W5(u,s==null?void 0:s.callee),u}return c.value},One=Dne(J5),Ine=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=>X5(f,i,Y5())));throw W5(u,s==null?void 0:s.callee),u}return c.value},Mne=Ine(J5);function U_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function kne(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,m=f&&f[r.code];n[c]=y2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Lne(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,m=f&&f[r.code];n[c]=y2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function yi(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(U_(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&yb({},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:L_(kne(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(U_(function(){return Promise.resolve((n.mode==="sync"?One:Mne)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&yb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof Ane})(c))return{values:{},errors:L_(Lne(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 e6=h.createContext(void 0);function Pne(){const e=h.useContext(e6);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var tn=(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))(tn||{});const Une={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function zne(e,t){switch(t.type){case tn.FETCH_STORAGES_START:case tn.FETCH_STORAGE_START:case tn.CREATE_STORAGE_START:case tn.UPDATE_STORAGE_START:return{...e,error:null};case tn.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case tn.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case tn.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case tn.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case tn.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 tn.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case tn.FETCH_STORAGES_ERROR:case tn.FETCH_STORAGE_ERROR:case tn.CREATE_STORAGE_ERROR:case tn.UPDATE_STORAGE_ERROR:case tn.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case tn.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case tn.CLEAR_ERROR:return{...e,error:null};default:return e}}function C2({children:e}){const[t,n]=h.useReducer(zne,Une);return a.jsx(e6.Provider,{value:{state:t,dispatch:n},children:e})}class Fne extends bl{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 Cf=new Fne;function zy(){const{state:e,dispatch:t}=Pne(),n=h.useCallback(async()=>{t({type:tn.FETCH_STORAGES_START});try{const f=await Cf.getDataStorages();t({type:tn.FETCH_STORAGES_SUCCESS,payload:f.map(Bee)})}catch(f){throw t({type:tn.FETCH_STORAGES_ERROR,payload:un(f)}),f}},[t]),r=h.useCallback(async f=>{try{const m=await Cf.getDataStorageById(f),y=Yp(m);t({type:tn.FETCH_STORAGE_SUCCESS,payload:y})}catch(m){throw t({type:tn.FETCH_STORAGE_ERROR,payload:un(m)}),m}},[t]),s=h.useCallback(async f=>{t({type:tn.CREATE_STORAGE_START});try{const m=Gee(f),y=await Cf.createDataStorage(m),g=Yp(y);return t({type:tn.CREATE_STORAGE_SUCCESS,payload:g}),Le({event:"data_storage_created",category:"DataStorage",action:"Create",label:g.type}),Tt.success("Storage created"),g}catch(m){return t({type:tn.CREATE_STORAGE_ERROR,payload:un(m)}),null}},[t]),i=h.useCallback(async(f,m)=>{t({type:tn.UPDATE_STORAGE_START});try{const y=Vee(m),g=await Cf.updateDataStorage(f,y),x=Yp(g);return t({type:tn.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:tn.UPDATE_STORAGE_ERROR,payload:un(y)}),null}},[t]),c=h.useCallback(async f=>{t({type:tn.DELETE_STORAGE_START});try{await Cf.deleteDataStorage(f),t({type:tn.DELETE_STORAGE_SUCCESS,payload:f}),Le({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),Tt.success("Storage deleted")}catch(m){throw t({type:tn.DELETE_STORAGE_ERROR,payload:un(m)}),m}},[t]),u=h.useCallback(()=>{t({type:tn.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 t6=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=dW(n,1e3);return a.jsx(s2,{open:e,onOpenChange:t,children:a.jsxs(o2,{className:"sm:max-w-sm",children:[a.jsxs(i2,{children:[a.jsx(l2,{children:"New Storage"}),a.jsx(c2,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:Sl.getAllTypes().map(c=>{const u=c.icon,f=c.status===Xo.ACTIVE;return a.jsxs(Ee,{variant:"outline",className:"flex px-4 py-6 select-none",onClick:()=>{s(c.type)},disabled:!f||r||i,onDoubleClick:m=>{m.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 Hne({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=wne(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:m}=zy(),[y,g]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{u()},[u]);const C=Ro({resolver:yi(Ene),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),S=async j=>{const _=await n(j);_&&t&&t(_)},E=()=>{g(!0)},R=async j=>{v(!0);try{const _=await f(j);_!=null&&_.id&&(await m(_.id),C.setValue("storageId",_.id))}catch(_){console.error("Failed to create storage:",_)}g(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(_l,{...C,children:a.jsxs(gi,{onSubmit:j=>{C.handleSubmit(S)(j)},children:[a.jsxs(Nl,{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(ca,{onValueChange:_=>{_==="create_new"?E():j.onChange(_)},value:j.value,disabled:r||c,children:[a.jsx(da,{className:"w-full",children:a.jsx(ua,{placeholder:"Select a storage"})}),a.jsx(fa,{children:a.jsxs(Uy,{children:[c&&a.jsx(Gn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(_=>{const I=Sl.getInfo(_.type).icon;return a.jsx(Gn,{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(K5,{}),a.jsx(Gn,{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(ha,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(Mt,{})]})})]}),a.jsxs(Oc,{variant:"light",children:[a.jsx(Ee,{type:"submit",children:"Create Data Mart"}),a.jsx(Ee,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(t6,{isOpen:y,onClose:()=>{g(!1)},onSelect:j=>R(j),isCreatingDataStorage:x})]})}function n6({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[i,c]=h.useState(e),[u,f]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{c(e)},[e]),h.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.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:se("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(wo,{ref:m,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:se("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||{}),r6=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(r6||{}),Fy="Tabs",[$ne]=Sr(Fy,[hy]),a6=hy(),[Vne,E2]=$ne(Fy),s6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,y=jh(u),[g,x]=ia({prop:r,onChange:s,defaultProp:i??"",caller:Fy});return a.jsx(Vne,{scope:n,baseId:er(),value:g,onValueChange:x,orientation:c,dir:y,activationMode:f,children:a.jsx(Je.div,{dir:y,"data-orientation":c,...m,ref:t})})});s6.displayName=Fy;var o6="TabsList",i6=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=E2(o6,n),c=a6(n);return a.jsx(a3,{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})})});i6.displayName=o6;var l6="TabsTrigger",c6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=E2(l6,n),u=a6(n),f=f6(c.baseId,r),m=h6(c.baseId,r),y=r===c.value;return a.jsx(s3,{asChild:!0,...u,focusable:!s,active:y,children:a.jsx(Je.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":m,"data-state":y?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Ie(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:Ie(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:Ie(e.onFocus,()=>{const g=c.activationMode!=="manual";!y&&!s&&g&&c.onValueChange(r)})})})});c6.displayName=l6;var u6="TabsContent",d6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=E2(u6,n),f=f6(u.baseId,r),m=h6(u.baseId,r),y=r===u.value,g=h.useRef(y);return h.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Vr,{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:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:x&&i})})});d6.displayName=u6;function f6(e,t){return`${e}-trigger-${t}`}function h6(e,t){return`${e}-content-${t}`}var Bne=s6,Gne=i6,qne=c6,Kne=d6;function w2({className:e,...t}){return a.jsx(Bne,{"data-slot":"tabs",className:se("flex flex-col gap-2",e),...t})}function R2({className:e,...t}){return a.jsx(Gne,{"data-slot":"tabs-list",className:se("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function nh({className:e,...t}){return a.jsx(qne,{"data-slot":"tabs-trigger",className:se("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 Zne({className:e,...t}){return a.jsx(Kne,{"data-slot":"tabs-content",className:se("flex-1 outline-none",e),...t})}var Hy="Collapsible",[Yne,m6]=Sr(Hy),[Wne,j2]=Yne(Hy),p6=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,m]=ia({prop:r,defaultProp:s??!1,onChange:c,caller:Hy});return a.jsx(Wne,{scope:n,disabled:i,contentId:er(),open:f,onOpenToggle:h.useCallback(()=>m(y=>!y),[m]),children:a.jsx(Je.div,{"data-state":A2(f),"data-disabled":i?"":void 0,...u,ref:t})})});p6.displayName=Hy;var g6="CollapsibleTrigger",T2=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=j2(g6,n);return a.jsx(Je.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":A2(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ie(e.onClick,s.onOpenToggle)})});T2.displayName=g6;var _2="CollapsibleContent",N2=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=j2(_2,e.__scopeCollapsible);return a.jsx(Vr,{present:n||s.open,children:({present:i})=>a.jsx(Xne,{...r,ref:t,present:i})})});N2.displayName=_2;var Xne=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=j2(_2,n),[u,f]=h.useState(r),m=h.useRef(null),y=ht(t,m),g=h.useRef(0),x=g.current,v=h.useRef(0),C=v.current,S=c.open||u,E=h.useRef(S),R=h.useRef(void 0);return h.useEffect(()=>{const j=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(j)},[]),Hr(()=>{const j=m.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,E.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(Je.div,{"data-state":A2(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 A2(e){return e?"open":"closed"}var y6=p6,Qne=T2,Jne=N2;const ere=y6,tre=T2,nre=N2;function rre({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function are({children:e,className:t="",...n}){return a.jsx("div",{className:se("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 sre({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:se(s,t),...r,children:e})}function Bi({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:se("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 ore({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:se("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(Ga,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(R2,{children:r.map(m=>a.jsx(nh,{value:m.value,children:m.label},m.value))})]}),t]})})}function x6({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=h.useState(n);return a.jsxs(ere,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:se("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(tre,{asChild:!0,children:a.jsxs("button",{type:"button",className:se("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(_a,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(nre,{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 Ga({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Ta,{"data-slot":"wizard-step-label",className:se("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...i,children:[t?a.jsxs(Et,{...r,children:[a.jsx(wt,{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(Et,{...r,children:[a.jsx(wt,{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(Fr,{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 al({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:se("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 ti({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:se("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(Ee,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ai,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:se("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(Ee,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(Wr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ai,{className:"h-4 w-4"})]})})]})}function ni({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:se("space-y-4",t),...n,children:e})}function ire({children:e,className:t="",...n}){return a.jsx("div",{className:se("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function lre({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:i,className:c="",...u}){return a.jsxs("div",{className:se("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(Et,{children:[a.jsx(wt,{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 v6({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:m,onChange:y,className:g="",...x}){const v=S=>{y&&y(e==="checkbox"?S.target.checked:S.target.value)},C=h.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:S=>{if(u)return;const E=S.target;E.tagName==="INPUT"||E.tagName==="LABEL"||E.closest("label")||C.current&&C.current.click()},className:se("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:se("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(Ga,{htmlFor:t,className:se("cursor-pointer",u&&"cursor-not-allowed"),children:s}),(f||m)&&a.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(Fr,{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})]}),m&&a.jsx("div",{className:"flex items-center",children:m})]})]})}function D2({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:se(s,n),children:Array.from({length:r}).map((i,c)=>a.jsx(Ur,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function z_(e){const t=cre(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(dre);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function cre(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=hre(s),u=fre(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ure=Symbol("radix.slottable");function dre(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ure}function fre(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 hre(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 mre(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=z_(u),m=re.forwardRef((S,E)=>{const{scope:R,children:j}=S,_=i(u,R),I=ht(E,_.collectionRef);return a.jsx(f,{ref:I,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=z_(y),v=re.forwardRef((S,E)=>{const{scope:R,children:j,..._}=S,I=re.useRef(null),A=ht(E,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 E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var Zs="Accordion",pre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[O2,gre,yre]=mre(Zs),[$y]=Sr(Zs,[yre,m6]),I2=m6(),b6=re.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(O2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(Sre,{...i,ref:t}):a.jsx(bre,{...s,ref:t})})});b6.displayName=Zs;var[S6,xre]=$y(Zs),[C6,vre]=$y(Zs,{collapsible:!1}),bre=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=ia({prop:n,defaultProp:r??"",onChange:s,caller:Zs});return a.jsx(S6,{scope:e.__scopeAccordion,value:re.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:re.useCallback(()=>i&&f(""),[i,f]),children:a.jsx(C6,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(E6,{...c,ref:t})})})}),Sre=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=ia({prop:n,defaultProp:r??[],onChange:s,caller:Zs}),f=re.useCallback(y=>u((g=[])=>[...g,y]),[u]),m=re.useCallback(y=>u((g=[])=>g.filter(x=>x!==y)),[u]);return a.jsx(S6,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:a.jsx(C6,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(E6,{...i,ref:t})})})}),[Cre,Vy]=$y(Zs),E6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=re.useRef(null),f=ht(u,t),m=gre(n),g=jh(s)==="ltr",x=Ie(e.onKeyDown,v=>{var D;if(!pre.includes(v.key))return;const C=v.target,S=m().filter(k=>{var B;return!((B=k.ref.current)!=null&&B.disabled)}),E=S.findIndex(k=>k.ref.current===C),R=S.length;if(E===-1)return;v.preventDefault();let j=E;const _=0,I=R-1,A=()=>{j=E+1,j>I&&(j=_)},O=()=>{j=E-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(Cre,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(O2.Slot,{scope:n,children:a.jsx(Je.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:x})})})}),Ig="AccordionItem",[Ere,M2]=$y(Ig),w6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=Vy(Ig,n),c=xre(Ig,n),u=I2(n),f=er(),m=r&&c.value.includes(r)||!1,y=i.disabled||e.disabled;return a.jsx(Ere,{scope:n,open:m,disabled:y,triggerId:f,children:a.jsx(y6,{"data-orientation":i.orientation,"data-state":A6(m),...u,...s,ref:t,disabled:y,open:m,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});w6.displayName=Ig;var R6="AccordionHeader",j6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Vy(Zs,n),i=M2(R6,n);return a.jsx(Je.h3,{"data-orientation":s.orientation,"data-state":A6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});j6.displayName=R6;var xb="AccordionTrigger",T6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Vy(Zs,n),i=M2(xb,n),c=vre(xb,n),u=I2(n);return a.jsx(O2.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})})});T6.displayName=xb;var _6="AccordionContent",N6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Vy(Zs,n),i=M2(_6,n),c=I2(n);return a.jsx(Jne,{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}})});N6.displayName=_6;function A6(e){return e?"open":"closed"}var wre=b6,Rre=w6,jre=j6,Tre=T6,_re=N6;const k2={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(MU,{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}},D6=h.createContext("default");function Cn({variant:e="default",...t}){return a.jsx(D6.Provider,{value:e,children:a.jsx(wre,{"data-slot":"accordion",...t})})}function L2(e){const t=h.useContext(D6);return e??t??"default"}function Kt({className:e,variant:t,...n}){const r=L2(t),{itemClass:s}=k2[r];return a.jsx(Rre,{"data-slot":"accordion-item",className:se(s,e),...n})}function Zt({className:e,children:t,variant:n,...r}){const s=L2(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=k2[s];return a.jsx(jre,{className:f,children:a.jsxs(Tre,{"data-slot":"accordion-trigger",className:se(i,e),...r,children:[c,t,a.jsx(Bs,{className:u,"aria-hidden":"true"})]})})}function Yt({className:e,children:t,variant:n,...r}){const s=L2(n),{contentClass:i,contentInnerClass:c}=k2[s];return a.jsx(_re,{"data-slot":"accordion-content",className:se(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function gn({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:se("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(ai,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function F_(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"connector-state-details",children:[a.jsx(Zt,{children:"What’s connector state?"}),a.jsxs(Yt,{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(gn,{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 Nre({configuration:e,connectorState:t}){const r=((e==null?void 0:e.connector.source.configuration)??[]).map((u,f)=>{const m=u;return typeof m._id=="string"?{id:m._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 m=i.get(u);return m?{state:m,index:f}:void 0}).filter(u=>!!u);return a.jsx(x6,{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(xn,{children:a.jsx(F_,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const m=u.at||"",y=m?Ry(lO(m).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(wD,{value:x,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(xn,{children:a.jsx(F_,{})})]},u._id)})})})}function Are({configuration:e,onClose:t,onSubmit:n}){const[r,s]=h.useState(new Set),i=h.useId(),c=Ro({defaultValues:{runType:ec.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:y}=Dc(),{dataMart:g}=Ss(),x=h.useCallback(async E=>{!r.has(E)&&!f&&(s(R=>new Set(R).add(E)),await y(E))},[r,f,y]);h.useEffect(()=>{e!=null&&e.connector.source.name&&x(e.connector.source.name)},[e,u,x]);const v=E=>{n&&n(E)},C=()=>{t&&t()},S=E=>{if(!E)return"text";switch(E){case As.DATE:return"date";case As.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):m?a.jsx(_l,{...c,children:a.jsxs(gi,{id:i,noValidate:!0,onSubmit:E=>void c.handleSubmit(v)(E),children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(_t,{control:c.control,name:"runType",render:({field:E})=>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(Ite,{options:[{value:ec.INCREMENTAL,label:"Incremental load"},{value:ec.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:E.value,onChange:E.onChange,orientation:"horizontal"}),a.jsx(xn,{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(Nre,{configuration:e,connectorState:(g==null?void 0:g.connectorState)??null})]}),c.watch("runType")===ec.MANUAL_BACKFILL&&a.jsx(Yr,{title:"Run configuration",children:m.filter(E=>{var R;return(R=E.attributes)==null?void 0:R.includes(r6.MANUAL_BACKFILL)}).map(E=>a.jsx(_t,{control:c.control,name:`data.${E.name}`,render:()=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:E.description,children:E.title??E.name}),a.jsx(Ct,{children:a.jsx(It,{id:E.name,placeholder:E.description,type:S(E.requiredType),defaultValue:typeof E.default=="string"||typeof E.default=="number"?E.default.toString():void 0,...c.register(`data.${E.name}`,{required:!0})})}),a.jsx(Mt,{})]},E.name)}))})]}),a.jsxs(Oc,{children:[a.jsx(Ee,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(Ee,{type:"button",variant:"outline",onClick:C,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function Dre({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return a.jsx(ci,{open:e,onOpenChange:t,children:a.jsxs(ui,{children:[a.jsx(di,{children:a.jsx(fi,{children:"Manual Run"})}),a.jsx(Are,{configuration:n,onClose:t,onSubmit:r})]})})}function O6({children:e,configuration:t,onManualRun:n,open:r}){const[s,i]=h.useState(r??!1),c=()=>{i(!0)},u=m=>{n(m),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(Dre,{isOpen:s,onClose:()=>{i(!1)},configuration:t,onSubmit:u})})]})}const Ore=1e3;function Ire(e,t){const[n,r]=h.useState(!1),[s,i]=h.useState(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(!0),m=h.useRef(t);m.current=t;const y=h.useCallback(E=>{f.current&&r(E)},[]),g=h.useCallback(E=>{f.current&&i(E)},[]),x=h.useCallback((E,R)=>{const j=E instanceof Error?E.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=h.useCallback(async()=>{var R;const E=c.current;if((R=u.current)==null||R.abort(),E){Tt.dismiss(E);try{await Tn.abortSchemaActualizeTrigger(e,E)}catch{}}c.current=null,u.current=null,y(!1)},[e,y]),C=h.useCallback(async(E,R)=>{var _;const j=I=>I===Xa.SUCCESS||I===Xa.ERROR||I===Xa.CANCELLED;for(;!R.aborted&&c.current===E;)try{const I=await Tn.getSchemaActualizeTriggerStatus(e,E);if(j(I)){try{const A=await Tn.getSchemaActualizeTriggerResponse(e,E);if(Tt.dismiss(E),A.success)(_=m.current)==null||_.call(m),Tt.success("Output schema actualized",{duration:void 0,id:E});else{const O=A.error??"Schema actualization failed";g(O),Tt.error(O,{duration:void 0,id:E})}}catch(A){const O=A instanceof Error?A.message:"Schema actualization failed";Tt.dismiss(E),g(O),Tt.error(O,{duration:void 0,id:E})}y(!1),c.current=null,u.current=null;return}await new Promise(A=>setTimeout(A,Ore))}catch(I){x(I,E)}},[e,g,y,x]),S=h.useCallback(async()=>{c.current&&await v(),g(null),y(!0);try{const{triggerId:E}=await Tn.createSchemaActualizeTrigger(e);Tt.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:E}),c.current=E;const R=new AbortController;u.current=R;try{await C(E,R.signal)}catch(j){x(j,E)}}catch(E){y(!1),g(E instanceof Error?E.message:"Failed to start schema actualization")}},[e,v,C,g,y,x]);return h.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const E=c.current;(R=u.current)==null||R.abort(),E&&(Tt.dismiss(E),Tn.abortSchemaActualizeTrigger(e,E).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:S,isLoading:n,cancel:v,error:s}}function Mre({id:e}){const{navigate:t}=mi(),{user:n}=hi(),{flags:r}=Dh(),{dataMart:s,deleteDataMart:i,updateDataMartTitle:c,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:y,publishDataMart:g,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:S,isLoading:E,error:R,getErrorMessage:j,runs:_,getDataMart:I}=Rne(e),[A,O]=h.useState(!1),[T,D]=h.useState(!1),{id:k="",canPublish:B=!1,canActualizeSchema:G=!1,status:Y={code:null,displayName:"",description:""},title:V="",definition:Z=null,definitionType:F=null,validationErrors:M=[]}=s??{},$=h.useCallback(()=>{k&&I(k)},[k,I]),{run:H,isLoading:oe}=Ire(k,$),ge=h.useCallback(async()=>{G&&await H()},[G,H]),P=r==null?void 0:r.INSIGHTS_ENABLED_PROJECT_IDS,U=(n==null?void 0:n.projectId)??"",z=U.length>0&&OQ(P??"").includes(U),X=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...z?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],W=h.useCallback(async le=>{k&&await c(k,le)},[k,c]),ae=h.useCallback(async()=>{if(k){D(!0);try{await g(k),ge()}catch(le){console.log(le instanceof Error?le.message:"Failed to publish Data Mart")}finally{D(!1)}}},[k,g,ge]),J=h.useCallback(async le=>{if(k){if(Y.code!==zr.PUBLISHED){Dn.error("Manual run is only available for published Data Marts");return}await x({id:k,payload:le})}},[k,Y,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(sP,{className:"h-5 w-5"})}),a.jsx(n6,{title:V,onUpdate:W,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(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Ph,{type:Y.code===zr.PUBLISHED?Jn.SUCCESS:Jn.NEUTRAL,variant:"subtle",children:Y.displayName})})}),a.jsx(Rt,{children:Y.code===zr.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),Y.code===zr.DRAFT&&a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{children:a.jsxs(Hu,{variant:"default",onClick:()=>{ae()},disabled:T||!B,className:"ml-2 flex items-center gap-1",children:[a.jsx(yh,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!B&&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:tJ(M).map((le,ye)=>a.jsx("li",{children:le},ye))})]})]})]}),a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(Hu,{variant:"ghost",children:a.jsx(SA,{className:"h-5 w-5"})})}),a.jsxs(Ar,{align:"end",children:[F===$e.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(O6,{configuration:Z??null,onManualRun:le=>{J({runType:le.runType,data:le.data})},children:a.jsxs(Nt,{onClick:le=>{le.preventDefault()},children:[a.jsx(Xg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(ja,{})]}),a.jsxs(Nt,{onClick:()=>{O(!0)},children:[a.jsx(es,{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:X.map(le=>a.jsx(mh,{to:le.path,className:({isActive:ye})=>se("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:le.name},le.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(qb,{context:{dataMart:s,isLoading:E,error:R,getErrorMessage:j,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:y,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:S,runs:_,getDataMart:I,runSchemaActualization:ge,isSchemaActualizationLoading:oe}})}),a.jsx(br,{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:['"',V,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await i(k),O(!1),t("/data-marts")}catch(le){console.error("Failed to delete Data Mart:",le)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(Ur,{className:"h-16 w-full"},0),Array.from({length:3}).map((le,ye)=>a.jsx(Ur,{className:"h-48 w-full"},ye+1))]})}function kre({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:i="100px"}){const[c,u]=h.useState(e??""),[f,m]=h.useState(!1),[y,g]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{u(e??"")},[e]),h.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??"")){m(!1);return}try{g(!0),await t(R===""?null:R),m(!1)}catch(_){console.error("Failed to update description:",_),u(e??"")}finally{g(!1)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),S()):R.key==="Escape"&&(R.preventDefault(),u(e??""),m(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(wo,{ref:x,value:c,onChange:C,onBlur:()=>void S(),onKeyDown:E,placeholder:r,className:se("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:()=>{m(!0)},className:se("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 Lre(){const{dataMart:e,updateDataMartDescription:t}=vs(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(kre,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function H_(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 Pre(e){if(Array.isArray(e))return e}function Ure(e,t,n){return(t=Gre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zre(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,m=!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){m=!0,s=y}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function Fre(){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 $_(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 V_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$_(Object(n),!0).forEach(function(r){Ure(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hre(e,t){if(e==null)return{};var n,r,s=$re(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 $re(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 Vre(e,t){return Pre(e)||zre(e,t)||qre(e,t)||Fre()}function Bre(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 Gre(e){var t=Bre(e,"string");return typeof t=="symbol"?t:t+""}function qre(e,t){if(e){if(typeof e=="string")return H_(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)?H_(e,t):void 0}}function Kre(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B_(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 G_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B_(Object(n),!0).forEach(function(r){Kre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zre(){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 Of(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 Mg(e){return{}.toString.call(e).includes("Object")}function Yre(e){return!Object.keys(e).length}function rh(e){return typeof e=="function"}function Wre(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xre(e,t){return Mg(t)||ll("changeType"),Object.keys(t).some(function(n){return!Wre(e,n)})&&ll("changeField"),t}function Qre(e){rh(e)||ll("selectorType")}function Jre(e){rh(e)||Mg(e)||ll("handlerType"),Mg(e)&&Object.values(e).some(function(t){return!rh(t)})&&ll("handlersType")}function eae(e){e||ll("initialIsRequired"),Mg(e)||ll("initialType"),Yre(e)&&ll("initialContent")}function tae(e,t){throw new Error(e[t]||e.default)}var nae={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"},ll=Of(tae)(nae),Ap={changes:Xre,selector:Qre,handler:Jre,initial:eae};function rae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ap.initial(e),Ap.handler(t);var n={current:e},r=Of(oae)(n,t),s=Of(sae)(n),i=Of(Ap.changes)(e),c=Of(aae)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Ap.selector(m),m(n.current)}function f(m){Zre(r,s,i,c)(m)}return[u,f]}function aae(e,t){return rh(t)?t(e.current):t}function sae(e,t){return e.current=G_(G_({},e.current),t),t}function oae(e,t,n){return rh(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 iae={create:rae},lae={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function cae(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 uae(e){return{}.toString.call(e).includes("Object")}function dae(e){return e||q_("configIsRequired"),uae(e)||q_("configType"),e.urls?(fae(),{paths:{vs:e.urls.monacoBase}}):e}function fae(){console.warn(I6.deprecation)}function hae(e,t){throw new Error(e[t]||e.default)}var I6={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
|
+
`},q_=cae(hae)(I6),mae={config:dae},pae=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 M6(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],M6(e[n],t[n]))}),V_(V_({},e),t)}var gae={type:"cancelation",msg:"operation is manually canceled"};function t1(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(gae):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var yae=["monaco"],xae=iae.create({config:lae,isInitialized:!1,resolve:null,reject:null,monaco:null}),k6=Vre(xae,2),Vh=k6[0],By=k6[1];function vae(e){var t=mae.config(e),n=t.monaco,r=Hre(t,yae);By(function(s){return{config:M6(s.config,r),monaco:n}})}function bae(){var e=Vh(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(By({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),t1(n1);if(window.monaco&&window.monaco.editor)return L6(window.monaco),e.resolve(window.monaco),t1(n1);pae(Sae,Eae)(wae)}return t1(n1)}function Sae(e){return document.body.appendChild(e)}function Cae(e){var t=document.createElement("script");return e&&(t.src=e),t}function Eae(e){var t=Vh(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=Cae("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function wae(){var e=Vh(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;L6(r),e.resolve(r)},function(n){e.reject(n)})}function L6(e){Vh().monaco||By({monaco:e})}function Rae(){return Vh(function(e){var t=e.monaco;return t})}var n1=new Promise(function(e,t){return By({resolve:e,reject:t})}),P6={config:vae,init:bae,__getMonacoInstance:Rae},jae={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},r1=jae,Tae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},_ae=Tae;function Nae({children:e}){return re.createElement("div",{style:_ae.container},e)}var Aae=Nae,Dae=Aae;function Oae({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return re.createElement("section",{style:{...r1.wrapper,width:e,height:t},...c},!n&&re.createElement(Dae,null,r),re.createElement("div",{ref:s,style:{...r1.fullWidth,...!n&&r1.hide},className:i}))}var Iae=Oae,U6=h.memo(Iae);function Mae(e){h.useEffect(e,[])}var z6=Mae;function kae(e,t,n=!0){let r=h.useRef(!0);h.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var qa=kae;function Ff(){}function Iu(e,t,n,r){return Lae(e,r)||Pae(e,t,n,r)}function Lae(e,t){return e.editor.getModel(F6(e,t))}function Pae(e,t,n,r){return e.editor.createModel(t,n,r?F6(e,r):void 0)}function F6(e,t){return e.Uri.parse(t)}function Uae({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:y="Loading...",options:g={},height:x="100%",width:v="100%",className:C,wrapperProps:S={},beforeMount:E=Ff,onMount:R=Ff}){let[j,_]=h.useState(!1),[I,A]=h.useState(!0),O=h.useRef(null),T=h.useRef(null),D=h.useRef(null),k=h.useRef(R),B=h.useRef(E),G=h.useRef(!1);z6(()=>{let F=P6.init();return F.then(M=>(T.current=M)&&A(!1)).catch(M=>(M==null?void 0:M.type)!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>O.current?Z():F.cancel()}),qa(()=>{if(O.current&&T.current){let F=O.current.getOriginalEditor(),M=Iu(T.current,e||"",r||n||"text",i||"");M!==F.getModel()&&F.setModel(M)}},[i],j),qa(()=>{if(O.current&&T.current){let F=O.current.getModifiedEditor(),M=Iu(T.current,t||"",s||n||"text",c||"");M!==F.getModel()&&F.setModel(M)}},[c],j),qa(()=>{let F=O.current.getModifiedEditor();F.getOption(T.current.editor.EditorOption.readOnly)?F.setValue(t||""):t!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[t],j),qa(()=>{var F,M;(M=(F=O.current)==null?void 0:F.getModel())==null||M.original.setValue(e||"")},[e],j),qa(()=>{let{original:F,modified:M}=O.current.getModel();T.current.editor.setModelLanguage(F,r||n||"text"),T.current.editor.setModelLanguage(M,s||n||"text")},[n,r,s],j),qa(()=>{var F;(F=T.current)==null||F.editor.setTheme(m)},[m],j),qa(()=>{var F;(F=O.current)==null||F.updateOptions(g)},[g],j);let Y=h.useCallback(()=>{var $;if(!T.current)return;B.current(T.current);let F=Iu(T.current,e||"",r||n||"text",i||""),M=Iu(T.current,t||"",s||n||"text",c||"");($=O.current)==null||$.setModel({original:F,modified:M})},[n,t,s,e,r,i,c]),V=h.useCallback(()=>{var F;!G.current&&D.current&&(O.current=T.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...g}),Y(),(F=T.current)==null||F.editor.setTheme(m),_(!0),G.current=!0)},[g,m,Y]);h.useEffect(()=>{j&&k.current(O.current,T.current)},[j]),h.useEffect(()=>{!I&&!j&&V()},[I,j,V]);function Z(){var M,$,H,oe;let F=(M=O.current)==null?void 0:M.getModel();u||(($=F==null?void 0:F.original)==null||$.dispose()),f||((H=F==null?void 0:F.modified)==null||H.dispose()),(oe=O.current)==null||oe.dispose()}return re.createElement(U6,{width:v,height:x,isEditorReady:j,loading:y,_ref:D,className:C,wrapperProps:S})}var zae=Uae;h.memo(zae);function Fae(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var Hae=Fae,Dp=new Map;function $ae({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:m={},overrideServices:y={},saveViewState:g=!0,keepCurrentModel:x=!1,width:v="100%",height:C="100%",className:S,wrapperProps:E={},beforeMount:R=Ff,onMount:j=Ff,onChange:_,onValidate:I=Ff}){let[A,O]=h.useState(!1),[T,D]=h.useState(!0),k=h.useRef(null),B=h.useRef(null),G=h.useRef(null),Y=h.useRef(j),V=h.useRef(R),Z=h.useRef(),F=h.useRef(r),M=Hae(i),$=h.useRef(!1),H=h.useRef(!1);z6(()=>{let P=P6.init();return P.then(U=>(k.current=U)&&D(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>B.current?ge():P.cancel()}),qa(()=>{var U,z,X,W;let P=Iu(k.current,e||r||"",t||s||"",i||n||"");P!==((U=B.current)==null?void 0:U.getModel())&&(g&&Dp.set(M,(z=B.current)==null?void 0:z.saveViewState()),(X=B.current)==null||X.setModel(P),g&&((W=B.current)==null||W.restoreViewState(Dp.get(i))))},[i],A),qa(()=>{var P;(P=B.current)==null||P.updateOptions(m)},[m],A),qa(()=>{!B.current||r===void 0||(B.current.getOption(k.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(H.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),H.current=!1))},[r],A),qa(()=>{var U,z;let P=(U=B.current)==null?void 0:U.getModel();P&&s&&((z=k.current)==null||z.editor.setModelLanguage(P,s))},[s],A),qa(()=>{var P;u!==void 0&&((P=B.current)==null||P.revealLine(u))},[u],A),qa(()=>{var P;(P=k.current)==null||P.editor.setTheme(c)},[c],A);let oe=h.useCallback(()=>{var P;if(!(!G.current||!k.current)&&!$.current){V.current(k.current);let U=i||n,z=Iu(k.current,r||e||"",t||s||"",U||"");B.current=(P=k.current)==null?void 0:P.editor.create(G.current,{model:z,automaticLayout:!0,...m},y),g&&B.current.restoreViewState(Dp.get(U)),k.current.editor.setTheme(c),u!==void 0&&B.current.revealLine(u),O(!0),$.current=!0}},[e,t,n,r,s,i,m,y,g,c,u]);h.useEffect(()=>{A&&Y.current(B.current,k.current)},[A]),h.useEffect(()=>{!T&&!A&&oe()},[T,A,oe]),F.current=r,h.useEffect(()=>{var P,U;A&&_&&((P=Z.current)==null||P.dispose(),Z.current=(U=B.current)==null?void 0:U.onDidChangeModelContent(z=>{H.current||_(B.current.getValue(),z)}))},[A,_]),h.useEffect(()=>{if(A){let P=k.current.editor.onDidChangeMarkers(U=>{var X;let z=(X=B.current.getModel())==null?void 0:X.uri;if(z&&U.find(W=>W.path===z.path)){let W=k.current.editor.getModelMarkers({resource:z});I==null||I(W)}});return()=>{P==null||P.dispose()}}return()=>{}},[A,I]);function ge(){var P,U;(P=Z.current)==null||P.dispose(),x?g&&Dp.set(i,B.current.saveViewState()):(U=B.current.getModel())==null||U.dispose(),B.current.dispose()}return re.createElement(U6,{width:v,height:C,isEditorReady:A,loading:f,_ref:G,className:S,wrapperProps:E})}var Vae=$ae,P2=h.memo(Vae);function Bae({initialValue:e,onChange:t}){const[n,r]=h.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=md();h.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(P2,{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 vb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:i}){const c=e;return a.jsxs("div",{className:se("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(_a,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var K_=1,Gae=.9,qae=.8,Kae=.17,a1=.1,s1=.999,Zae=.9999,Yae=.99,Wae=/[\\\/_+.#"@\[\(\{&]/,Xae=/[\\\/_+.#"@\[\(\{&]/g,Qae=/[\s-]/,H6=/[\s-]/g;function bb(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?K_:Yae;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),m=n.indexOf(f,s),y=0,g,x,v,C;m>=0;)g=bb(e,t,n,r,m+1,i+1,c),g>y&&(m===s?g*=K_:Wae.test(e.charAt(m-1))?(g*=qae,v=e.slice(s,m-1).match(Xae),v&&s>0&&(g*=Math.pow(s1,v.length))):Qae.test(e.charAt(m-1))?(g*=Gae,C=e.slice(s,m-1).match(H6),C&&s>0&&(g*=Math.pow(s1,C.length))):(g*=Kae,s>0&&(g*=Math.pow(s1,m-s))),e.charAt(m)!==t.charAt(i)&&(g*=Zae)),(g<a1&&n.charAt(m-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(m-1)!==r.charAt(i))&&(x=bb(e,t,n,r,m+1,i+2,c),x*a1>g&&(g=x*a1)),g>y&&(y=g),m=n.indexOf(f,m+1);return c[u]=y,y}function Z_(e){return e.toLowerCase().replace(H6," ")}function Jae(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,bb(e,t,Z_(e),Z_(t),0,0,{})}var Ef='[cmdk-group=""]',o1='[cmdk-group-items=""]',ese='[cmdk-group-heading=""]',$6='[cmdk-item=""]',Y_=`${$6}:not([aria-disabled="true"])`,Sb="cmdk-item-select",_u="data-value",tse=(e,t,n)=>Jae(e,t,n),V6=h.createContext(void 0),Bh=()=>h.useContext(V6),B6=h.createContext(void 0),U2=()=>h.useContext(B6),G6=h.createContext(void 0),q6=h.forwardRef((e,t)=>{let n=Nu(()=>{var U,z;return{search:"",value:(z=(U=e.value)!=null?U:e.defaultValue)!=null?z:"",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=K6(e),{label:f,children:m,value:y,onValueChange:g,filter:x,shouldFilter:v,loop:C,disablePointerSelection:S=!1,vimBindings:E=!0,...R}=e,j=er(),_=er(),I=er(),A=h.useRef(null),O=fse();xc(()=>{if(y!==void 0){let U=y.trim();n.current.value=U,T.emit()}},[y]),xc(()=>{O(6,V)},[]);let T=h.useMemo(()=>({subscribe:U=>(c.current.add(U),()=>c.current.delete(U)),snapshot:()=>n.current,setState:(U,z,X)=>{var W,ae,J,le;if(!Object.is(n.current[U],z)){if(n.current[U]=z,U==="search")Y(),B(),O(1,G);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(I);ye?ye.focus():(W=document.getElementById(j))==null||W.focus()}if(O(7,()=>{var ye;n.current.selectedItemId=(ye=Z())==null?void 0:ye.id,T.emit()}),X||O(5,V),((ae=u.current)==null?void 0:ae.value)!==void 0){let ye=z??"";(le=(J=u.current).onValueChange)==null||le.call(J,ye);return}}T.emit()}},emit:()=>{c.current.forEach(U=>U())}}),[]),D=h.useMemo(()=>({value:(U,z,X)=>{var W;z!==((W=i.current.get(U))==null?void 0:W.value)&&(i.current.set(U,{value:z,keywords:X}),n.current.filtered.items.set(U,k(z,X)),O(2,()=>{B(),T.emit()}))},item:(U,z)=>(r.current.add(U),z&&(s.current.has(z)?s.current.get(z).add(U):s.current.set(z,new Set([U]))),O(3,()=>{Y(),B(),n.current.value||G(),T.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let X=Z();O(4,()=>{Y(),(X==null?void 0:X.getAttribute("id"))===U&&G(),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 k(U,z){var X,W;let ae=(W=(X=u.current)==null?void 0:X.filter)!=null?W:tse;return U?ae(U,n.current.search,z):0}function B(){if(!n.current.search||u.current.shouldFilter===!1)return;let U=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(W=>{let ae=s.current.get(W),J=0;ae.forEach(le=>{let ye=U.get(le);J=Math.max(ye,J)}),z.push([W,J])});let X=A.current;F().sort((W,ae)=>{var J,le;let ye=W.getAttribute("id"),Ce=ae.getAttribute("id");return((J=U.get(Ce))!=null?J:0)-((le=U.get(ye))!=null?le:0)}).forEach(W=>{let ae=W.closest(o1);ae?ae.appendChild(W.parentElement===ae?W:W.closest(`${o1} > *`)):X.appendChild(W.parentElement===X?W:W.closest(`${o1} > *`))}),z.sort((W,ae)=>ae[1]-W[1]).forEach(W=>{var ae;let J=(ae=A.current)==null?void 0:ae.querySelector(`${Ef}[${_u}="${encodeURIComponent(W[0])}"]`);J==null||J.parentElement.appendChild(J)})}function G(){let U=F().find(X=>X.getAttribute("aria-disabled")!=="true"),z=U==null?void 0:U.getAttribute(_u);T.setState("value",z||void 0)}function Y(){var U,z,X,W;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 le=(z=(U=i.current.get(J))==null?void 0:U.value)!=null?z:"",ye=(W=(X=i.current.get(J))==null?void 0:X.keywords)!=null?W:[],Ce=k(le,ye);n.current.filtered.items.set(J,Ce),Ce>0&&ae++}for(let[J,le]of s.current)for(let ye of le)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=ae}function V(){var U,z,X;let W=Z();W&&(((U=W.parentElement)==null?void 0:U.firstChild)===W&&((X=(z=W.closest(Ef))==null?void 0:z.querySelector(ese))==null||X.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function Z(){var U;return(U=A.current)==null?void 0:U.querySelector(`${$6}[aria-selected="true"]`)}function F(){var U;return Array.from(((U=A.current)==null?void 0:U.querySelectorAll(Y_))||[])}function M(U){let z=F()[U];z&&T.setState("value",z.getAttribute(_u))}function $(U){var z;let X=Z(),W=F(),ae=W.findIndex(le=>le===X),J=W[ae+U];(z=u.current)!=null&&z.loop&&(J=ae+U<0?W[W.length-1]:ae+U===W.length?W[0]:W[ae+U]),J&&T.setState("value",J.getAttribute(_u))}function H(U){let z=Z(),X=z==null?void 0:z.closest(Ef),W;for(;X&&!W;)X=U>0?use(X,Ef):dse(X,Ef),W=X==null?void 0:X.querySelector(Y_);W?T.setState("value",W.getAttribute(_u)):$(U)}let oe=()=>M(F().length-1),ge=U=>{U.preventDefault(),U.metaKey?oe():U.altKey?H(1):$(1)},P=U=>{U.preventDefault(),U.metaKey?M(0):U.altKey?H(-1):$(-1)};return h.createElement(Je.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:U=>{var z;(z=R.onKeyDown)==null||z.call(R,U);let X=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||X))switch(U.key){case"n":case"j":{E&&U.ctrlKey&&ge(U);break}case"ArrowDown":{ge(U);break}case"p":case"k":{E&&U.ctrlKey&&P(U);break}case"ArrowUp":{P(U);break}case"Home":{U.preventDefault(),M(0);break}case"End":{U.preventDefault(),oe();break}case"Enter":{U.preventDefault();let W=Z();if(W){let ae=new Event(Sb);W.dispatchEvent(ae)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:mse},f),Gy(e,U=>h.createElement(B6.Provider,{value:T},h.createElement(V6.Provider,{value:D},U))))}),nse=h.forwardRef((e,t)=>{var n,r;let s=er(),i=h.useRef(null),c=h.useContext(G6),u=Bh(),f=K6(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;xc(()=>{if(!m)return u.item(s,c==null?void 0:c.id)},[m]);let y=Z6(s,i,[e.value,e.children,i],e.keywords),g=U2(),x=pl(O=>O.value&&O.value===y.current),v=pl(O=>m||u.filter()===!1?!0:O.search?O.filtered.items.get(s)>0:!0);h.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(Sb,C),()=>O.removeEventListener(Sb,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:E,value:R,onSelect:j,forceMount:_,keywords:I,...A}=e;return h.createElement(Je.div,{ref:Xr(i,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||u.getDisablePointerSelection()?void 0:S,onClick:E?void 0:C},e.children)}),rse=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,c=er(),u=h.useRef(null),f=h.useRef(null),m=er(),y=Bh(),g=pl(v=>s||y.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);xc(()=>y.group(c),[]),Z6(c,u,[e.value,e.heading,f]);let x=h.useMemo(()=>({id:c,forceMount:s}),[s]);return h.createElement(Je.div,{ref:Xr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&h.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Gy(e,v=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},h.createElement(G6.Provider,{value:x},v))))}),ase=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),i=pl(c=>!c.search);return!n&&!i?null:h.createElement(Je.div,{ref:Xr(s,t),...r,"cmdk-separator":"",role:"separator"})}),sse=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=U2(),c=pl(m=>m.search),u=pl(m=>m.selectedItemId),f=Bh();return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.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:m=>{s||i.setState("search",m.target.value),n==null||n(m.target.value)}})}),ose=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=h.useRef(null),c=h.useRef(null),u=pl(m=>m.selectedItemId),f=Bh();return h.useEffect(()=>{if(c.current&&i.current){let m=c.current,y=i.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=m.offsetHeight;y.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(g),x.unobserve(m)}}},[]),h.createElement(Je.div,{ref:Xr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},Gy(e,m=>h.createElement("div",{ref:Xr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),ise=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return h.createElement(ny,{open:n,onOpenChange:r},h.createElement(ry,{container:c},h.createElement(ay,{"cmdk-overlay":"",className:s}),h.createElement(sy,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(q6,{ref:t,...u}))))}),lse=h.forwardRef((e,t)=>pl(n=>n.filtered.count===0)?h.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),cse=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return h.createElement(Je.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Gy(e,c=>h.createElement("div",{"aria-hidden":!0},c)))}),vd=Object.assign(q6,{List:ose,Item:nse,Input:sse,Group:rse,Separator:ase,Dialog:ise,Empty:lse,Loading:cse});function use(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function dse(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function K6(e){let t=h.useRef(e);return xc(()=>{t.current=e}),t}var xc=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Nu(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function pl(e){let t=U2(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function Z6(e,t,n,r=[]){let s=h.useRef(),i=Bh();return xc(()=>{var c;let u=(()=>{var m;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():s.current}})(),f=r.map(m=>m.trim());i.value(e,u,f),(c=t.current)==null||c.setAttribute(_u,u),s.current=u}),s}var fse=()=>{let[e,t]=h.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 hse(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Gy({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(hse(t),{ref:t.ref},n(t.props.children)):n(t)}var mse={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Y6({className:e,...t}){return a.jsx(vd,{"data-slot":"command",className:se("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function W6({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(wc,{className:"size-4 shrink-0 opacity-50"}),a.jsx(vd.Input,{"data-slot":"command-input",className:se("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 pse({className:e,...t}){return a.jsx(vd.List,{"data-slot":"command-list",className:se("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function X6({...e}){return a.jsx(vd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Q6({className:e,...t}){return a.jsx(vd.Group,{"data-slot":"command-group",className:se("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 J6({className:e,...t}){return a.jsx(vd.Item,{"data-slot":"command-item",className:se("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 gse(e){const t=yse(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(vse);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function yse(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Sse(s),u=bse(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xse=Symbol("radix.slottable");function vse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xse}function bse(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 Sse(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 qy="Popover",[eI]=Sr(qy,[Eo]),Gh=Eo(),[Cse,Ol]=eI(qy),tI=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=Gh(t),f=h.useRef(null),[m,y]=h.useState(!1),[g,x]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:qy});return a.jsx(ud,{...u,children:a.jsx(Cse,{scope:t,contentId:er(),triggerRef:f,open:g,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:m,onCustomAnchorAdd:h.useCallback(()=>y(!0),[]),onCustomAnchorRemove:h.useCallback(()=>y(!1),[]),modal:c,children:n})})};tI.displayName=qy;var nI="PopoverAnchor",Ese=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ol(nI,n),i=Gh(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return h.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(dd,{...i,...r,ref:t})});Ese.displayName=nI;var rI="PopoverTrigger",aI=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ol(rI,n),i=Gh(n),c=ht(t,s.triggerRef),u=a.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":cI(s.open),...r,ref:c,onClick:Ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(dd,{asChild:!0,...i,children:u})});aI.displayName=rI;var z2="PopoverPortal",[wse,Rse]=eI(z2,{forceMount:void 0}),sI=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Ol(z2,t);return a.jsx(wse,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(jc,{asChild:!0,container:s,children:r})})})};sI.displayName=z2;var rd="PopoverContent",oI=h.forwardRef((e,t)=>{const n=Rse(rd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Ol(rd,e.__scopePopover);return a.jsx(Vr,{present:r||i.open,children:i.modal?a.jsx(Tse,{...s,ref:t}):a.jsx(_se,{...s,ref:t})})});oI.displayName=rd;var jse=gse("PopoverContent.RemoveScroll"),Tse=h.forwardRef((e,t)=>{const n=Ol(rd,e.__scopePopover),r=h.useRef(null),s=ht(t,r),i=h.useRef(!1);return h.useEffect(()=>{const c=r.current;if(c)return ey(c)},[]),a.jsx(bh,{as:jse,allowPinchZoom:!0,children:a.jsx(iI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;i.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),_se=h.forwardRef((e,t)=>{const n=Ol(rd,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(iI,{...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,m;(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;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),iI=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:y,...g}=e,x=Ol(rd,n),v=Gh(n);return Qg(),a.jsx(vh,{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:m,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(Ch,{"data-state":cI(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)"}})})})}),lI="PopoverClose",Nse=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ol(lI,n);return a.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>s.onOpenChange(!1))})});Nse.displayName=lI;var Ase="PopoverArrow",Dse=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Gh(n);return a.jsx(Eh,{...s,...r,ref:t})});Dse.displayName=Ase;function cI(e){return e?"open":"closed"}var Ose=tI,Ise=aI,Mse=sI,kse=oI;function F2({...e}){return a.jsx(Ose,{"data-slot":"popover",...e})}function H2({...e}){return a.jsx(Ise,{"data-slot":"popover-trigger",...e})}function $2({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(Mse,{children:a.jsx(kse,{"data-slot":"popover-content",align:t,sideOffset:n,className:se("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 V2({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:i,disabled:c=!1}){const[u,f]=h.useState(!1),[m,y]=h.useState(""),g=h.useMemo(()=>{const C={};return e.forEach(S=>{const E=S.group??"";Object.prototype.hasOwnProperty.call(C,E)||(C[E]=[]),C[E].push(S)}),C},[e]),x=e.find(C=>C.value===t),v=h.useCallback(C=>{n(C),requestAnimationFrame(()=>{y(""),f(!1)})},[n]);return a.jsxs(F2,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(H2,{asChild:!0,children:a.jsxs(Ee,{variant:"outline",role:"combobox","aria-expanded":u,className:se("w-full justify-between",!t&&"text-muted-foreground",i),disabled:c,children:[x?x.label:r,a.jsx(Qb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx($2,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(Y6,{children:[a.jsx(W6,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:y}),a.jsx(X6,{children:s}),Object.entries(g).map(([C,S])=>a.jsx(Q6,{heading:C,children:S.map(E=>a.jsxs(J6,{value:E.value,onSelect:()=>{v(E.value)},keywords:[E.label],children:[a.jsx(oa,{className:se("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},C||"default"))]})})]})}function Lse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"service-account-details",children:[a.jsx(Zt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Yt,{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(gn,{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 Pse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"project-id-details",children:[a.jsx(Zt,{children:"How do I find my Project ID?"}),a.jsxs(Yt,{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(gn,{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 Use(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"gbq-location-details",children:[a.jsx(Zt,{children:"How do I find my dataset location?"}),a.jsxs(Yt,{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(gn,{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 zse=({form:e})=>{const[t,n]=h.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?uO(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{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(xn,{children:a.jsx(Pse,{})}),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(V2,{options:fX,value:u.value,onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(xn,{children:a.jsx(Use,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{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(Ee,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(Ee,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(Ct,{children:!t&&c?a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(gn,{href:c.url,children:c.email})}),a.jsx(Rt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(wo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(xn,{children:a.jsx(Lse,{})}),a.jsx(Mt,{})]})})})]})};function Fse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-region-details",children:[a.jsx(Zt,{children:"How do I find my Athena region?"}),a.jsxs(Yt,{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(gn,{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 Hse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-output-bucket-details",children:[a.jsx(Zt,{children:"How do I find a bucket?"}),a.jsxs(Yt,{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(gn,{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 $se(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-access-key-id-details",children:[a.jsx(Zt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(Yt,{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(gn,{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(BA,{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(gn,{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 Vse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-secret-access-key-details",children:[a.jsx(Zt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(Yt,{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(gn,{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 Bse=({form:e})=>{const[t,n]=h.useState("");return h.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(Yr,{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(xn,{children:a.jsx(Fse,{})}),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(xn,{children:a.jsx(Hse,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{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(xn,{children:a.jsx($se,{})}),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(xn,{children:a.jsx(Vse,{})}),a.jsx(Mt,{})]})})]})]})};function Gse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-account-details",children:[a.jsx(Zt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx(gn,{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(gn,{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(gn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function qse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-warehouse-details",children:[a.jsx(Zt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(Yt,{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 Kse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-auth-method-details",children:[a.jsx(Zt,{children:"Which authentication method should I choose?"}),a.jsxs(Yt,{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(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function Zse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-username-details",children:[a.jsx(Zt,{children:"How do I find my Snowflake username?"}),a.jsxs(Yt,{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 Yse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-password-details",children:[a.jsx(Zt,{children:"How do I manage my Snowflake password?"}),a.jsxs(Yt,{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(gn,{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 Wse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-keypair-details",children:[a.jsx(Zt,{children:"How do I set up key pair authentication?"}),a.jsxs(Yt,{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(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function Xse(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-passphrase-details",children:[a.jsx(Zt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(Yt,{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(Yr,{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(xn,{children:a.jsx(Gse,{})}),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(xn,{children:a.jsx(qse,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{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(R2,{children:[a.jsx(nh,{value:ks.PASSWORD,children:"Username & Password"}),a.jsx(nh,{value:ks.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(xn,{children:a.jsx(Kse,{})}),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(xn,{children:a.jsx(Zse,{})}),a.jsx(Mt,{})]})}),t===ks.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(xn,{children:a.jsx(Yse,{})}),a.jsx(Mt,{})]})}),t===ks.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(wo,{...n,placeholder:`-----BEGIN PRIVATE KEY-----
|
|
794
|
+
...
|
|
795
|
+
-----END PRIVATE KEY-----`,rows:6})}),a.jsx(xn,{children:a.jsx(Wse,{})}),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(xn,{children:a.jsx(Xse,{})}),a.jsx(Mt,{})]})})]})]})]})},Jse=()=>a.jsx(a.Fragment,{children:a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(Kt,{value:"snowflake-setup",children:[a.jsx(Zt,{children:"How do I get started with Snowflake?"}),a.jsxs(Yt,{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(gn,{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 eoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"bigquery-api-details",children:[a.jsx(Zt,{children:"How do I enable the BigQuery API?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(gn,{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 toe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-api-details",children:[a.jsx(Zt,{children:"How do I activate Athena API?"}),a.jsxs(Yt,{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(gn,{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 noe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Ro({resolver:yi(PX),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,m=i("type");re.useEffect(()=>{r==null||r(u)},[u,r]);const y=async g=>{const{dirtyFields:x}=s.formState,v=cO(g);return x.credentials||delete v.credentials,t(v)};return a.jsx(_l,{...s,children:a.jsxs(gi,{onSubmit:g=>{s.handleSubmit(y)(g)},noValidate:!0,children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{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(ca,{value:g.value,onValueChange:g.onChange,disabled:!!e,children:[a.jsx(da,{className:"w-full",children:a.jsx(ua,{placeholder:"Select a storage type"})}),a.jsx(fa,{children:a.jsx(Uy,{children:Sl.getAllTypes().map(({type:x,displayName:v,icon:C,status:S})=>a.jsx(Gn,{value:x,disabled:S===Xo.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C,{size:20}),v]})},x))})})]})}),a.jsxs(xn,{children:[m===Re.GOOGLE_BIGQUERY&&a.jsx(eoe,{}),m===Re.AWS_ATHENA&&a.jsx(toe,{}),m===Re.SNOWFLAKE&&a.jsx(Jse,{})]}),a.jsx(Mt,{})]})})]}),m===Re.GOOGLE_BIGQUERY&&a.jsx(zse,{form:s}),m===Re.AWS_ATHENA&&a.jsx(Bse,{form:s}),m===Re.SNOWFLAKE&&a.jsx(Qse,{form:s})]}),a.jsxs(Oc,{children:[a.jsx(Ee,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!u||f,children:"Save"}),a.jsx(Ee,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Ic(e){const[t,n]=h.useState(!1),[r,s]=h.useState(!1),i=h.useCallback(()=>{r?n(!0):e()},[r,e]),c=h.useCallback(()=>{n(!1),s(!1),e()},[e]),u=h.useCallback(m=>{s(m)},[]),f=h.useCallback(()=>{s(!1),e()},[e]);return{showUnsavedDialog:t,setShowUnsavedDialog:n,isDirty:r,handleClose:i,confirmClose:c,handleFormDirtyChange:u,handleFormSubmitSuccess:f}}function uI({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=zy(),{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=Ic(t),g=async v=>{if(n){const C=await s(n.id,v);C&&(r(C),y())}},x=h.useRef(!1);return h.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(ci,{open:e,onOpenChange:v=>{v||u()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:"Configure Storage Provider"}),a.jsx(yl,{children:"Customize settings for your storage provider"})]}),a.jsx(noe,{initialData:n??void 0,onSubmit:g,onCancel:u,onDirtyChange:m})]})}),a.jsx(br,{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 roe=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=h.useState(!1),s=Sl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{if(!XD(e))return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(xh,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(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(gn,{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:"•"}),m("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:[m("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:"•"}),m("Warehouse",x)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(vb,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(C2,{children:a.jsx(uI,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function aoe({initialType:e,onTypeSelect:t}){var c;const[n,r]=h.useState(e??null);h.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=u=>{r(u),t(u)},i=[{type:$e.SQL,label:"SQL",description:"SQL query"},{type:$e.TABLE,label:"Table",description:"Existing table"},{type:$e.VIEW,label:"View",description:"Existing view"},{type:$e.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:$e.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return a.jsxs("div",{className:"dm-card-block",children:[a.jsx(Ta,{className:"text-foreground",children:"Definition Type"}),a.jsxs(ca,{value:n??"",onValueChange:u=>{s(u)},children:[a.jsx(da,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(ua,{placeholder:"Select definition type",children:n&&((c=i.find(u=>u.type===n))==null?void 0:c.label)})}),a.jsx(fa,{children:a.jsx(Uy,{children:i.map(u=>a.jsxs(Gn,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const soe=rn({definitionType:Br($e.SQL),definition:rn({sqlQuery:Dt().min(1,"SQL query is required")})}),ooe=e=>{const t=xO(e);return rn({definitionType:Br($e.TABLE),definition:t})},ioe=e=>{const t=xO(e);return rn({definitionType:Br($e.VIEW),definition:t})},loe=e=>{const t=JQ(e);return rn({definitionType:Br($e.TABLE_PATTERN),definition:t})},coe=rn({definitionType:Br($e.CONNECTOR),definition:rn({connector:rn({source:rn({name:Dt().min(1,"Connector name is required"),configuration:X1(QZ(WZ())).min(1,"At least one configuration is required"),node:Dt().min(1,"Node is required"),fields:X1(Dt()).min(1,"At least one field is required")}),storage:rn({fullyQualifiedName:Dt().min(1,"fully qualified name is required")})})})}),uoe=(e,t)=>{if(!e)return rn({definitionType:JZ(Sy($e)),definition:rn({}).optional()});switch(e){case $e.SQL:return soe;case $e.TABLE:return ooe(t);case $e.VIEW:return ioe(t);case $e.TABLE_PATTERN:return loe(t);case $e.CONNECTOR:return coe;default:return rn({})}};function doe({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(Bae,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(Mt,{})]})})}function foe({control:e,storageType:t}){const n=eO(t),r=tO(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(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function hoe({control:e,storageType:t}){const n=eO(t),r=tO(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(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function moe({control:e,storageType:t}){const n=BX(t),r=GX(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(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}const B2=e=>{switch(e){case $e.SQL:return{sqlQuery:""};case $e.TABLE:return{fullyQualifiedName:""};case $e.VIEW:return{fullyQualifiedName:""};case $e.TABLE_PATTERN:return{pattern:""};case $e.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},poe=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 G2({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:se(poe({variant:t}),e),...n})}function dI({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function q2({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:se("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function goe({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return n?a.jsx(D2,{variant:"grid"}):r?a.jsxs(G2,{variant:"destructive",children:[a.jsx(gh,{className:"h-4 w-4"}),a.jsx(q2,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(ni,{children:[a.jsx(al,{title:"Choose Connector",children:a.jsx(ire,{children:e.map(c=>a.jsx(lre,{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(ti,{icon:a.jsx(Kf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function yoe({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:m="Back",finishLabel:y="Save"}){const g=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(Ee,{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(Ee,{variant:"outline",onClick:c,disabled:s,children:[a.jsx(RP,{className:"h-4 w-4"}),m]})}),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(Ee,{variant:"default",onClick:u,disabled:!n||s,children:y}):a.jsxs(Ee,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(_a,{className:"h-4 w-4"})]})})]})}function oc({connector:e,size:t=24,variant:n="compact"}){return a.jsx(ti,{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(Ee,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(ai,{className:"h-4 w-4"})]})})})}const Cb="**********";function xoe({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(Ta,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(Ga,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function voe({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 boe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(wo,{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(m=>m.trim());n(r,f)}})}function Soe({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 m=typeof f=="string"?f:f.toString();try{const y=new Date(m);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 Coe({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 Eoe({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(wo,{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 woe({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?Cb: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 Roe({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:i,default:c}=e,u=e.title??e.name,f=r.map(m=>({value:m,label:m}));return a.jsx(V2,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function joe(){const e=h.useRef(new Pf),t=h.useCallback(async(s,i,c)=>await e.current.exchangeCredentials(s,{fieldPath:c,payload:i}),[]),n=h.useCallback(async(s,i)=>{try{return await e.current.checkOAuthStatus(s,i)}catch{return{valid:!1}}},[]),r=h.useCallback(async(s,i)=>await e.current.getOAuthSettings(s,i),[]);return{exchangeCredentials:t,checkStatus:n,getSettings:r}}let wf=null;function Toe({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=h.useState(!1),[f,m]=h.useState(!1),[y,g]=h.useState(null);h.useEffect(()=>{if(window.FB){m(!0);return}if(document.getElementById("facebook-jssdk")){const E=setInterval(()=>{window.FB&&(m(!0),clearInterval(E))},100);return()=>{clearInterval(E)}}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"}),m(!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 E;if(S.status==="connected"&&S.authResponse){const{accessToken:R,expiresIn:j,userID:_}=S.authResponse;(E=window.FB)==null||E.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(Ee,{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 _oe({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(Toe,{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 fI({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,m]=h.useState(!1),[y,g]=h.useState(null),[x,v]=h.useState(null),[C,S]=h.useState(null),E=h.useMemo(()=>{const V=n[e.name],Z=t!=null&&t.value&&V?V[t.value]:V;return Z==null?void 0:Z._source_credential_id},[n,e.name,t==null?void 0:t.value]),R=h.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),j=h.useMemo(()=>{const V=n[e.name];if(t!=null&&t.value&&V){const Z=V[t.value];return Z&&typeof Z=="object"&&!Array.isArray(Z)?Z:{}}return V&&typeof V=="object"&&!Array.isArray(V)?V:{}},[n,e.name,t==null?void 0:t.value]),_=h.useMemo(()=>{const V=j;return"_source_credential_id"in V?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(F=>F in V&&V[F]!==void 0&&V[F]!==""))},[j,t]),[I,A]=h.useState(_);h.useEffect(()=>{const V="_source_credential_id"in j,Z=(t==null?void 0:t.items)&&Object.keys(t.items).some(F=>F in j&&j[F]!==void 0&&j[F]!=="");V&&I?A(!1):Z&&!I&&A(!0)},[j,t,I]);const O=(V,Z)=>{if(!(t!=null&&t.value))return;const F=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...F,[t.value]:{...typeof F[t.value]=="object"&&F[t.value]!==null?F[t.value]:{},[V]:Z}})},{checkStatus:T,getSettings:D,exchangeCredentials:k}=joe(),B=async V=>{try{m(!0),S(null);const Z=await k(s,V,R),F=n[e.name];t?r(e.name,{...F,[t.value]:{_source_credential_id:Z.credentialId}}):r(e.name,{_source_credential_id:Z.credentialId})}catch(Z){const F=Z instanceof Error?Z.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",Z),S(F)}finally{m(!1)}};h.useEffect(()=>{if(!E){g(null),m(!1);return}let V=!1;return(async()=>{try{m(!0);const F=await T(s,E);V||g(F)}catch(F){V||(console.error("Failed to validate credentials:",F),g({valid:!1}))}finally{V||m(!1)}})(),()=>{V=!0}},[E,s,T]),h.useEffect(()=>{(async()=>{try{const Z=await D(s,R);v(Z)}catch(Z){console.error("Failed to fetch settings:",Z),v(null)}})()},[s,R,D]);const G=!!(x!=null&&x.isEnabled);if((I||!G)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([V,Z])=>{const F=Array.isArray(Z.attributes)?Z.attributes.includes("SECRET")&&j[V]!==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(Ga,{htmlFor:V,required:Z.required,tooltip:Z.description,className:"mb-2 justify-start",children:Z.title??V}),F&&u&&i&&a.jsx(Ee,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!M)},children:M?"Cancel":"Edit"})]}),K2({specification:{...Z,name:V},configuration:j,onValueChange:($,H)=>{O($,H)},flags:{isEditingExisting:u,isSecret:F,isSecretEditing:M},connectorName:s})]},V)}),G&&a.jsx(Ee,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!1),m(!1)},className:"px-0",children:"Back to OAuth"})]});const Y=(()=>{switch(s){case"FacebookMarketing":return a.jsx(_oe,{isLoading:f,status:y,settings:x,onOAuthSuccess:B});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[Y,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(Ee,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!0)},className:"px-0",children:"Manually"})]})}function K2({specification:e,configuration:t,onValueChange:n,flags:r,connectorName:s}){const{requiredType:i,options:c}=e,{isSecret:u=!1,isEditingExisting:f=!1,isSecretEditing:m=!1}=r??{};if(e.attributes&&Array.isArray(e.attributes)&&e.attributes.includes("OAUTH_FLOW"))return a.jsx(fI,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(woe,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:m});if(c&&c.length>0)return a.jsx(Roe,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case As.BOOLEAN:return a.jsx(xoe,{specification:e,configuration:t,onValueChange:n});case As.NUMBER:return a.jsx(voe,{specification:e,configuration:t,onValueChange:n});case As.ARRAY:return a.jsx(boe,{specification:e,configuration:t,onValueChange:n});case As.OBJECT:return a.jsx(Eoe,{specification:e,configuration:t,onValueChange:n});case As.DATE:return a.jsx(Soe,{specification:e,configuration:t,onValueChange:n});case As.STRING:default:return a.jsx(Coe,{specification:e,configuration:t,onValueChange:n})}}function Noe({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(Bi,{children:[e.requiredType!==As.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ga,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&a.jsx(Ee,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),K2({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function Aoe({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=h.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,m]=h.useState(u);if(h.useEffect(()=>{m(u)},[u]),h.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=>{m(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(ore,{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(Zne,{value:x.value,children:v?a.jsx(fI,{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 E=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(S.attributes)&&Object.keys(E)[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(Ga,{htmlFor:C,required:S.required,tooltip:S.description,className:"mb-2 justify-start",children:C}),R&&r&&a.jsx(Ee,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),K2({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 W_(e,t,n,r,s,i,c){return e.map(u=>{const f=Array.isArray(u.attributes)?u.attributes.includes("SECRET"):!1,m=s[u.name];return u.oneOf&&u.requiredType===As.OBJECT?a.jsx(Aoe,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:m,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(Noe,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:m,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function X_({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx(x6,{title:e,children:W_(t,n,r,s,i,c,u)}):W_(t,n,r,s,i,c,u)}function Doe({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=h.useState([]),[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(async()=>{c(!0);try{const x=await Tn.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);h.useEffect(()=>{u&&m()},[u,m]);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},E=(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])=>{E(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))E(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(Ya,{children:a.jsxs(_r,{open:u,onOpenChange:f,children:[a.jsx(Nr,{asChild:!0,children:a.jsxs(Ee,{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(_a,{className:se("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(GU,{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(Et,{delayDuration:300,children:[a.jsx(wt,{asChild:!0,children:a.jsxs(Nt,{onSelect:()=>{y(x,C[0])},children:[a.jsx(tg,{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(TS,{children:[a.jsxs(_S,{className:"flex items-center gap-2",children:[a.jsx(tg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:x.title})]}),a.jsx(NS,{children:C.map((S,E)=>a.jsxs(Et,{delayDuration:300,children:[a.jsx(wt,{asChild:!0,children:a.jsxs(Nt,{onSelect:()=>{y(x,S)},children:["Configuration ",E+1]})}),a.jsx(Rt,{side:"right",className:"max-w-sm",children:g(S)})]},E))})]},x.id)})})]})})]})})}function Q_({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:i=!1,isEditingExisting:c=!1}){const[u,f]=h.useState({}),m=h.useRef(!1),y=h.useRef(!1),[g,x]=h.useState({});h.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]=Cb)}),f(O),m.current=!0,setTimeout(()=>{y.current=!1},0)}},[t,s,c]),h.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(y.current=!0,f({...s}),setTimeout(()=>{y.current=!1},0))},[s]),h.useEffect(()=>{m.current&&!y.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(O,T)=>{f(D=>({...D,[O]:T}))},C=h.useCallback(O=>!(O==null||typeof O=="string"&&O.trim()===""||typeof O=="number"&&isNaN(O)||Array.isArray(O)&&O.length===0),[]),S=h.useCallback((O,T)=>{var k,B;if(typeof O!="object"||O===null)return C(O);if((k=T.attributes)!=null&&k.includes("OAUTH_FLOW")&&"_source_credential_id"in O)return!0;const D=(B=T.oneOf)==null?void 0:B.filter(G=>G.value===Object.keys(O)[0]);return D?D.every(G=>{var Y;if((Y=G.attributes)!=null&&Y.includes("OAUTH_FLOW")){const V=O[G.value];if(typeof V=="object"&&V!==null){if("_source_credential_id"in V)return!0;const Z=Object.entries(G.items).filter(([,F])=>F.required);if(Z.length>0)return Z.every(([F])=>{const M=V[F];return C(M)})}return!1}return Object.entries(G.items).every(([,V])=>G.value in O?S(O[G.value],V):!1)}):C(O[T.name])},[C]),E=h.useCallback((O,T)=>{const D=T.filter(Y=>Y.required&&Y.oneOf),k=D.length===0?!0:D.some(Y=>S(O[Y.name],Y)),G=T.filter(Y=>Y.required&&Y.name!=="Fields").every(Y=>C(O[Y.name]));return k&&G},[C,S]),R=(O,T)=>{x(D=>({...D,[O]:T})),f(T?D=>({...D,[O]:""}):D=>({...D,[O]:Cb}))},j=O=>{const T={...u};Object.entries(O.configuration).forEach(([D,k])=>{["_id","_copiedFrom"].includes(D)||(T[D]=k)}),T._copiedFrom={dataMartId:O.dataMartId,dataMartTitle:O.dataMartTitle,configId:O.configId},f(T)};if(h.useEffect(()=>{if(t&&r){const O=E(u,t);r(O)}},[u,t,r,E]),i)return a.jsx(D2,{variant:"list"});if(!t||t.length===0)return a.jsxs(ni,{children:[a.jsx(oc,{connector:e}),a.jsx(ti,{icon:a.jsx(Kf,{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=k=>{const B=k.default!=null&&k.default!=="";return k.required&&!B?1:k.required&&B?2:!k.required&&!B?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(ni,{children:[a.jsx(oc,{connector:e}),a.jsxs(al,{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(Doe,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),I.length>0&&a.jsx(X_,{items:I,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name}),A.length>0&&a.jsx(X_,{collapsibleTitle:"Advanced Settings",items:A,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name})]})]})})}function Ooe({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(D2,{variant:"list"}):!t||t.length===0?a.jsxs(ni,{children:[a.jsx(oc,{connector:e}),a.jsx(ti,{icon:a.jsx(Kf,{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(ni,{children:[a.jsx(oc,{connector:e}),a.jsxs(al,{title:c,children:[t.map(u=>a.jsx(v6,{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(Wr,{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(_a,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name)),a.jsx($u,{label:"Missing some data?"})]})]})}var ao=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(ao||{});function J_({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const i=h.useRef(null),[c,u]=h.useState(""),[f,m]=h.useState(ao.ORIGINAL),y=t==null?void 0:t.find(R=>R.name===n),g=h.useMemo(()=>(y==null?void 0:y.fields)??[],[y==null?void 0:y.fields]),x=h.useMemo(()=>(y==null?void 0:y.uniqueKeys)??[],[y==null?void 0:y.uniqueKeys]),v=h.useMemo(()=>{const R=new Map;return g.forEach((j,_)=>R.set(j.name,_)),R},[g]),C=h.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===ao.ASC)return _.name.localeCompare(I.name);if(f===ao.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),E=r.filter(R=>S.includes(R)).length;return h.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]),h.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(k=>k.name),D=O.filter(k=>!r.includes(k)).length>0;O.forEach(k=>{s(k,D)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[g,r,s]),!n||!t?a.jsxs(ni,{children:[a.jsx(oc,{connector:e}),a.jsx(ti,{icon:a.jsx(Kf,{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(ni,{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(wc,{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(Ee,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===ao.ASC&&a.jsx(Wj,{className:"text-muted-foreground h-4 w-4"}),f===ao.DESC&&a.jsx(Yj,{className:"text-muted-foreground h-4 w-4"}),f===ao.ORIGINAL&&a.jsx(Xj,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(Ar,{align:"end",children:[a.jsxs(Nt,{onSelect:()=>{m(ao.ASC)},children:[a.jsx(Wj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(Nt,{onSelect:()=>{m(ao.DESC)},children:[a.jsx(Yj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(Nt,{onSelect:()=>{m(ao.ORIGINAL)},children:[a.jsx(Xj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(al,{title:`Selected ${String(E)} of ${String(S.length)} fields for "${n}" data`,children:[C.map(R=>{const j=x.includes(R.name);return a.jsx(v6,{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(N1,{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(N1,{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(ni,{children:[a.jsx(oc,{connector:e}),a.jsx(ti,{icon:a.jsx(Kf,{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 hI=h.createContext(void 0),mI={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Ioe(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 mI;default:return e}}class Moe extends bl{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 so=new Moe;var Fn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(Fn||{});const sl={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class Eb{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!==Fn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Yo.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:Fn.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 koe{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:Fn.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 i1={getMapper(e){switch(e){case Fn.REPORT_RUN:return new Eb;case Fn.CONNECTOR_RUN:return new koe;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Rf={mapFromDto(e){return i1.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 Fn.REPORT_RUN:return new Eb().enhanceWithReportData(n);case Fn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new Eb,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===Fn.REPORT_RUN),i=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case Fn.REPORT_RUN:return i.find(u=>u.id===c.id)??c;case Fn.CONNECTOR_RUN:{const u=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:u}}}default:return c}})},mapToCreateRequest(e){return i1.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return i1.getMapper(e.type).mapToUpdateRequest(e)}};function Loe({children:e}){const[t,n]=h.useReducer(Ioe,mI),{dataMart:r}=Ss(),{fetchAvailableConnectors:s}=Dc();if(!r)throw new Error("Trigger provider must be used within a data mart context");const i=h.useCallback(async v=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const C=await so.getScheduledTriggers(v),S=await Rf.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=h.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await so.getScheduledTriggers(v)).filter(j=>j.type===C),R=await Rf.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(S){const E=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:E})}},[r]),u=h.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGER_START"});try{const S=await so.getScheduledTrigger(v,C),E=await Rf.mapFromDtoWithReportData(S,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(S){const E=S instanceof Error?S.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:E}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:E})}},[r]),f=h.useCallback(async(v,C,S,E,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:C,cronExpression:S,timeZone:E,isActive:R,triggerConfig:j},I=await so.createScheduledTrigger(v,_),A=await Rf.mapFromDtoWithReportData(I,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Le({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:C}),Dn.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]),m=h.useCallback(async(v,C,S,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:S,timeZone:E,isActive:R},_=await so.updateScheduledTrigger(v,C,j),I=await Rf.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:I}),Le({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:I.type}),Dn.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=h.useCallback(async(v,C)=>{n({type:"DELETE_TRIGGER_START"});try{await so.deleteScheduledTrigger(v,C),n({type:"DELETE_TRIGGER_SUCCESS",payload:C}),Le({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:C}),Dn.success("Trigger deleted")}catch(S){const E=S instanceof Error?S.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:E}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:E}),S}},[]),g=h.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),x=h.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(hI.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:y,selectScheduledTrigger:g,reset:x},children:e})}function pI(){const e=h.useContext(hI);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function Poe(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:m,selectedTrigger:y,isLoading:g,error:x}=pI();return h.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,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,E,R,j)=>s(v,C,S,E,R,j),updateScheduledTrigger:(v,C,S,E,R)=>i(v,C,S,E,R),deleteScheduledTrigger:(v,C)=>c(v,C),selectScheduledTrigger:u}}const Uoe=rn({type:Br(sl.SCHEDULED_REPORT_RUN),reportId:Dt().min(1,"Report ID is required")}),zoe=YZ(),Foe=rn({type:Sy(Fn),cronExpression:Dt().min(1,"Cron expression is required"),timeZone:Dt().min(1,"Time zone is required"),isActive:ZZ(),triggerConfig:XZ([Uoe,zoe])});function Hoe({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Ro({resolver:yi(Foe),defaultValues:{type:e?e.type:n??Fn.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:sl.SCHEDULED_REPORT_RUN,reportId:t??""}}});h.useEffect(()=>{t&&s.getValues("type")===Fn.REPORT_RUN&&s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),h.useEffect(()=>{n&&(s.setValue("type",n),n===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const i=u=>{s.setValue("type",u),u===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:sl.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 $oe=[Ne.GOOGLE_SHEETS,Ne.EMAIL,Ne.SLACK,Ne.MS_TEAMS,Ne.GOOGLE_CHAT];function Voe({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=ts(),{dataMart:i}=Ss();h.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>$oe.includes(u.dataDestination.type));return a.jsxs(ca,{value:e,onValueChange:t,disabled:n,children:[a.jsx(da,{className:"w-full",children:a.jsx(ua,{placeholder:"Select a report"})}),a.jsx(fa,{children:c.map(u=>{const f=aa.getInfo(u.dataDestination.type).icon;return a.jsx(Gn,{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 Ky="Switch",[Boe]=Sr(Ky),[Goe,qoe]=Boe(Ky),gI=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:m,form:y,...g}=e,[x,v]=h.useState(null),C=ht(t,_=>v(_)),S=h.useRef(!1),E=x?y||!!x.closest("form"):!0,[R,j]=ia({prop:s,defaultProp:i??!1,onChange:m,caller:Ky});return a.jsxs(Goe,{scope:n,checked:R,disabled:u,children:[a.jsx(Je.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":bI(R),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:C,onClick:Ie(e.onClick,_=>{j(I=>!I),E&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),E&&a.jsx(vI,{control:x,bubbles:!S.current,name:r,value:f,checked:R,required:c,disabled:u,form:y,style:{transform:"translateX(-100%)"}})]})});gI.displayName=Ky;var yI="SwitchThumb",xI=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=qoe(yI,n);return a.jsx(Je.span,{"data-state":bI(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});xI.displayName=yI;var Koe="SwitchBubbleInput",vI=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=h.useRef(null),u=ht(c,i),f=b2(n),m=mS(t);return h.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,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});vI.displayName=Koe;function bI(e){return e?"checked":"unchecked"}var Zoe=gI,Yoe=xI;function Z2({className:e,...t}){return a.jsx(Zoe,{"data-slot":"switch",className:se("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(Yoe,{"data-slot":"switch-thumb",className:se("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 Woe(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 wb(e,t="UTC"){const n=Woe(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),m=Number.parseInt(s),y=!isNaN(f)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(m)&&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(m)&&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(m)&&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 SI({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:i=3}){const[c,u]=h.useState(!1),f=g=>{const x=t.includes(g)?t.filter(v=>v!==g):[...t,g].sort((v,C)=>v-C);n(x)},m=(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=>m(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=>m(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(F2,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(H2,{asChild:!0,children:a.jsxs(Ee,{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(Qb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx($2,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(Y6,{className:"h-full overflow-visible",children:[a.jsx(W6,{placeholder:s,className:"h-8"}),a.jsxs(pse,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(X6,{children:"No items found."}),a.jsx(Q6,{className:"h-full overflow-visible",children:e.map(g=>a.jsxs(J6,{value:g.value.toString(),onSelect:()=>f(g.value),className:"text-sm",children:[a.jsx(oa,{className:se("mr-2 h-3 w-3",t.includes(g.value)?"opacity-100":"opacity-0")}),g.label]},g.value))})]})]})})]})}const CI=[{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"}],Op=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function EI(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=CI.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 Xoe(e,t,n=!0){const r=wb(e,t);return EI(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"}`})),Rb=[5,10,15,30],jb=[1,2,3,4,6,8,12],Joe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Type"}),a.jsxs(ca,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(da,{className:"w-full",children:a.jsx(ua,{})}),a.jsxs(fa,{children:[a.jsx(Gn,{value:"daily",children:"Daily"}),a.jsx(Gn,{value:"weekly",children:"Weekly"}),a.jsx(Gn,{value:"monthly",children:"Monthly"}),a.jsx(Gn,{value:"interval",children:"Interval"})]})]})]}),eie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{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})})]}),eN=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Ta,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(V2,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),tie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(SI,{options:CI,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),nie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(SI,{options:Qoe,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),rie=({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(Ta,{children:"Type"}),a.jsxs(ca,{value:e,onValueChange:i=>{n(i)},disabled:s,children:[a.jsx(da,{className:"w-full",children:a.jsx(ua,{})}),a.jsxs(fa,{children:[a.jsx(Gn,{value:"minutes",children:"Minutes"}),a.jsx(Gn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Every"}),a.jsxs(ca,{value:t.toString(),onValueChange:i=>{r(Number.parseInt(i)||1)},disabled:s,children:[a.jsx(da,{className:"w-full",children:a.jsx(ua,{})}),a.jsx(fa,{children:(e==="minutes"?Rb:jb).map(i=>a.jsxs(Gn,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),aie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ta,{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 Tb({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:i=!0,showSaveButton:c=!1,hideEnableSwitch:u=!1}){const[f,m]=h.useState(n),[y,g]=h.useState(t??Op()),[x,v]=h.useState(!1),C=h.useMemo(()=>vW.getTimezonesWithOffset().map(F=>({value:F.identifier,label:F.displayName,offset:F.offsetString,isDST:F.isDST})),[]),[S,E]=h.useState(()=>wb(e,y)),[R,j]=h.useState(""),[_,I]=h.useState("");h.useEffect(()=>{m(n)},[n]),h.useEffect(()=>{const F=t??Op();g(F)},[t]),h.useEffect(()=>{if(e){const F=wb(e,y);E(F)}},[e,y]);const A=F=>{const[M,$]=F.time.split(":").map(Number);switch(F.type){case"daily":return`${String($)} ${String(M)} * * *`;case"weekly":return`${String($)} ${String(M)} * * ${F.weekdays.join(",")}`;case"monthly":return`${String($)} ${String(M)} ${F.monthDays.join(",")} * *`;case"interval":return F.intervalType==="minutes"?`*/${String(F.intervalValue)} * * * *`:`0 */${String(F.intervalValue)} * * *`;case"custom":return F.customCron;default:return`${String($)} ${String(M)} * * *`}},O=h.useCallback(F=>{E(M=>{if(M.intervalType===F)return console.log("Type unchanged, skipping update"),M;const H=(F==="minutes"?Rb:jb)[0];return{...M,intervalType:F,intervalValue:H}})},[]),T=h.useCallback(F=>{E(M=>(M.intervalType==="minutes"?Rb:jb).includes(F)?{...M,intervalValue:F}:M)},[]),D=h.useMemo(()=>F=>EI(F,f),[f]);h.useEffect(()=>{const F=A(S);j(F),I(D(S))},[S,f,y,D]);const k=h.useRef(""),B=h.useRef(""),G=h.useRef(!1);h.useEffect(()=>{const F=A(S);r&&(k.current!==F||B.current!==y||G.current!==f)&&(r({cron:F,timezone:y,enabled:f}),k.current=F,B.current=y,G.current=f)},[S,y,f,r]);const Y=F=>{m(F)},V=F=>{g(F),E(M=>({...M,timezone:F}))},Z=["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(Ta,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),a.jsx(Z2,{id:"schedule-enabled",checked:f,onCheckedChange:Y})]})})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[a.jsx(Joe,{value:S.type,onChange:F=>{E(M=>({...M,type:F}))},disabled:!f}),S.type!=="custom"&&S.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(eie,{value:S.time,onChange:F=>{E(M=>({...M,time:F}))},disabled:!f}),Z&&a.jsx(eN,{value:y,onChange:V,disabled:!f,timezones:C})]}),(S.type==="interval"||S.type==="custom")&&a.jsx(eN,{value:y,onChange:V,disabled:!f,timezones:C}),S.type==="weekly"&&a.jsx(tie,{value:S.weekdays,onChange:F=>{E(M=>({...M,weekdays:F}))},disabled:!f}),S.type==="monthly"&&a.jsx(nie,{value:S.monthDays,onChange:F=>{E(M=>({...M,monthDays:F}))},disabled:!f}),S.type==="interval"&&a.jsx(rie,{intervalType:S.intervalType,intervalValue:S.intervalValue,onTypeChange:O,onValueChange:T,disabled:!f}),S.type==="custom"&&a.jsx(aie,{value:S.customCron,onChange:F=>{E(M=>({...M,customCron:F}))},disabled:!f})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(BA,{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(TA,{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(Bs,{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&&Z&&y!==Op()&&a.jsxs(G2,{className:"border-amber-200 bg-amber-50",children:[a.jsx(gh,{className:"h-4 w-4"}),a.jsx(dI,{children:"Time Zone"}),a.jsxs(q2,{children:["Schedule runs in ",y," (not your local ",Op()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(Ee,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function sie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"trigger-type-options-description-details",children:[a.jsx(Zt,{children:"How do I choose a type?"}),a.jsxs(Yt,{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 oie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"trigger-type-change-description-details",children:[a.jsx(Zt,{children:"How do I change the trigger type?"}),a.jsx(Yt,{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 iie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"report-change-description-details",children:[a.jsx(Zt,{children:"How do I change a report?"}),a.jsx(Yt,{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 lie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"report-select-description-details",children:[a.jsx(Zt,{children:"How do I choose the report?"}),a.jsxs(Yt,{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 cie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=h.useState(!1),{form:f,handleTypeChange:m,handleSubmit:y,isDirty:g}=Hoe({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{u(!0);try{await r(E)}finally{u(!1)}}});h.useEffect(()=>{i==null||i(g)},[g,i]);const{control:x,watch:v}=f,S=v("type")===Fn.REPORT_RUN;return a.jsx(_l,{...f,children:a.jsxs(gi,{onSubmit:E=>void y(E),noValidate:!1,children:[a.jsxs(Nl,{children:[a.jsx(_t,{control:x,name:"type",render:({field:E})=>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(ca,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(Ct,{children:a.jsx(da,{className:"w-full",children:a.jsx(ua,{placeholder:"Select trigger type"})})}),a.jsxs(fa,{children:[a.jsx(Gn,{value:Fn.REPORT_RUN,children:"Report Run"}),a.jsx(Gn,{value:Fn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(xn,{children:e?a.jsx(oie,{}):a.jsx(sie,{})}),a.jsx(Mt,{})]})}),S&&a.jsx(_t,{control:x,name:"triggerConfig.reportId",render:({field:E})=>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(BS,{children:a.jsx(Voe,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),a.jsx(xn,{children:e!=null&&e.triggerConfig?a.jsx(iie,{}):a.jsx(lie,{})}),a.jsx(Mt,{})]})}),a.jsx(Tb,{showPreview:!1,cron:v("cronExpression"),timezone:v("timeZone"),enabled:v("isActive"),onChange:E=>{f.setValue("cronExpression",E.cron,{shouldDirty:!0}),f.setValue("timeZone",E.timezone,{shouldDirty:!0}),f.setValue("isActive",E.enabled,{shouldDirty:!0})},className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4"})]}),a.jsxs(Oc,{children:[a.jsx(Ee,{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(Ee,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function uie({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=h.useMemo(()=>Xoe(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 die({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=h.useState(!1),[i,c]=h.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(Ee,{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(Gs,{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(ja,{}),a.jsxs(Nt,{onClick:()=>{c(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(br,{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 fie({connector:e}){const{connectors:t}=Dc(),n=Yee(e,t);return a.jsx(a.Fragment,{children:n})}function wI({connector:e}){return a.jsx(fie,{connector:e})}function hie(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 mie=e=>{const{connectors:t}=Dc();return h.useMemo(()=>t.find(n=>n.name===e),[t,e])},pie=re.memo(function({connector:t,children:n}){const r=mie(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=Ss();h.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const u=h.useMemo(()=>r!=null&&r.logoBase64?a.jsx(_c,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=h.useCallback(()=>{s!=null&&s.storage&&RX(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=h.useMemo(()=>hie(i),[i]),y=h.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:KQ(m.lastRunStatus),statusText:YQ(m.lastRunStatus),date:m.lastRunDate},[m]),g=h.useMemo(()=>(s==null?void 0:s.storage)&&jX(s.storage),[s]),x=h.useMemo(()=>{const v=t.source.fields.length.toString();return`${t.source.node} • ${v} fields`},[t.source.node,t.source.fields.length]);return a.jsxs(Ny,{children:[a.jsx(Ay,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Dy,{children:[a.jsxs(ZS,{children:[a.jsx(YS,{children:u}),a.jsxs(WS,{children:[a.jsx(XS,{children:a.jsx(wI,{connector:t})}),a.jsx(QS,{children:x})]})]}),a.jsxs(JS,{children:[a.jsxs(el,{children:[a.jsx(tl,{children:"Last run status:"}),a.jsx(nl,{children:y?a.jsx(Ph,{type:y.statusType,variant:"ghost",children:y.statusText}):"Not run yet"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Last run date:"}),a.jsx(nl,{children:y?a.jsx(Hs,{date:y.date}):"Never run"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Total runs:"}),a.jsxs(nl,{children:[m.totalRuns," runs",m.firstRunDate&&a.jsxs(a.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),a.jsx(e2,{children:a.jsxs(Ee,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[g,a.jsx(ai,{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 gie(e){const t=e.triggerConfig,n=aa.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(GQ,{report:t.report,children:a.jsx(Fr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function yie(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(wI,{connector:n}),a.jsx(pie,{connector:n,children:a.jsx(Fr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function xie({trigger:e}){switch(e.type){case Fn.REPORT_RUN:return gie(e);case Fn.CONNECTOR_RUN:return yie(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function vie({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===Fn.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(xie,{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(uie,{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(Hs,{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(Hs,{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(Ph,{type:r?Jn.SUCCESS:Jn.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(die,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function bie({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(Ee,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(Ee,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function Y2({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=pI(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=Ic(t),C=!!u,S=h.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===Fn.REPORT_RUN?{type:sl.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),E=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=h.useRef(!1);return h.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(ci,{open:e,onOpenChange:j=>{j||y()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsxs(fi,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(yl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(cie,{preSelectedReportId:r,preSelectedType:s,initialData:S,onSubmit:E,onCancel:y,onDirtyChange:x})]})}),a.jsx(br,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function Sie({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,i]=h.useState(!1),c=h.useCallback(()=>{i(!1)},[]),u=h.useCallback(R=>{r(R)},[r]),f=h.useMemo(()=>vie({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:m,setSorting:y,columnVisibility:g,setColumnVisibility:x}=Ac({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=El({data:e,columns:f,getCoreRowModel:Cl(),getPaginationRowModel:Fh(),onSortingChange:y,getSortedRowModel:Nc(),getFilteredRowModel:pd(),state:{sorting:m,columnVisibility:g},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),C=h.useCallback(()=>{v.previousPage()},[v]),S=h.useCallback(()=>{v.nextPage()},[v]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(wl,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(Rl,{className:"dm-card-table-header",children:v.getHeaderGroups().map(R=>a.jsx(Hn,{className:"dm-card-table-header-row",children:R.headers.map(j=>a.jsx(Tl,{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(jl,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map((R,j)=>a.jsx(Hn,{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($r,{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(Hn,{children:a.jsx($r,{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(bie,{table:v,onPreviousClick:C,onNextClick:S}),a.jsx(Y2,{isOpen:s,onClose:c,dataMartId:t})]})}function Cie({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=Poe(e),[i,c]=h.useState(!1);h.useEffect(()=>{s&&c(!0)},[s]);const u=y=>{const g=t.find(x=>x.id===y);g&&r(g)},f=()=>{c(!1),r(null)},m=async y=>{try{await n(e,y)}catch(g){console.error("Error deleting trigger:",g)}};return a.jsxs(a.Fragment,{children:[a.jsx(Sie,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:y=>void m(y)}),a.jsx(Y2,{isOpen:i,onClose:f,dataMartId:e})]})}function W2(){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(Xb,{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 Ip(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function kg(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Eie({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]=h.useState(""),[m,y]=h.useState(""),[g,x]=h.useState(""),[v,C]=h.useState(null),[S,E]=h.useState(null),[R,j]=h.useState(null),_=(D,k=!1)=>D.trim()?k&&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=h.useCallback((D,k,B,G,Y,V)=>{let Z;if(e===Re.SNOWFLAKE&&Y){const M=Ip(Y),$=Ip(k);Z=`${D}.${M}.${$}`}else Z=`${D}.${k}`;const F=e===Re.SNOWFLAKE?!!(D&&Y&&k&&B===null&&V===null&&G===null):!!(D&&k&&B===null&&G===null);s({fullyQualifiedName:Z,isValid:F})},[s,e]);h.useEffect(()=>{let D="",k="",B="";if(t!=null&&t.fullyQualifiedName){const M=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===Re.SNOWFLAKE&&M.length===3){const $=M[0],H=M[1],oe=M[2];$&&H&&oe&&(D=$,k=kg(H),B=kg(oe))}else if(M.length>=2){const $=M[0],H=M[1];$&&H&&(D=$,B=H)}}else D=`${c}_owox`,e===Re.SNOWFLAKE&&(k="PUBLIC"),B=i;const G=_(D),Y=e===Re.SNOWFLAKE?_(k,!0):null,V=_(B,e===Re.SNOWFLAKE);f(D),y(k),x(B),C(G),E(Y),j(V);const Z=e===Re.SNOWFLAKE&&k?`${D}.${Ip(k)}.${Ip(B)}`:`${D}.${B}`,F=e===Re.SNOWFLAKE?!!(D&&k&&B&&G===null&&Y===null&&V===null):!!(D&&B&&G===null&&V===null);((t==null?void 0:t.fullyQualifiedName)!==Z||t.isValid!==F)&&I(D,B,G,V,k,Y)},[t,i,c,e,I]);const A=D=>{f(D);const k=_(D);C(k),I(D,g,k,R,m,S)},O=D=>{y(D);const k=_(D,!0);E(k),I(u,g,v,R,D,k)},T=D=>{x(D);const k=_(D,e===Re.SNOWFLAKE);j(k),I(u,D,v,k,m,S)};return a.jsxs(ni,{children:[e===Re.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(ti,{icon:a.jsx(SD,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Bi,{children:[a.jsx(Ga,{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(Bi,{children:[a.jsx(Ga,{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(ti,{icon:a.jsx(CD,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Bi,{children:[a.jsx(Ga,{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(Bi,{children:[a.jsx(Ga,{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(ti,{icon:a.jsx(ED,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Bi,{children:[a.jsx(Ga,{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(Bi,{children:[a.jsx(Ga,{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:m,"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(Bi,{children:[a.jsx(Ga,{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(al,{title:"Schedule updates",children:a.jsx(W2,{})})]})}function wie({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:i,preselectedConnector:c,onDirtyChange:u}){const[f,m]=h.useState(!1),[y,g]=h.useState(null),[x,v]=h.useState(""),[C,S]=h.useState([]),[E,R]=h.useState(1),[j,_]=h.useState({}),[I,A]=h.useState(!1),[O,T]=h.useState(new Set),[D,k]=h.useState(new Set),{connectors:B,connectorSpecification:G,connectorFields:Y,loading:V,loadingSpecification:Z,loadingFields:F,error:M,fetchAvailableConnectors:$,fetchConnectorSpecification:H,fetchConnectorFields:oe}=Dc();h.useEffect(()=>{u==null||u(f)},[f,u]);const[ge,P]=h.useState(null),U=h.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]),z=U.length,X=h.useCallback(async Me=>{!O.has(Me)&&!Z&&(T(q=>new Set(q).add(Me)),await H(Me))},[O,Z,H]),W=h.useCallback(async Me=>{D.has(Me)||(k(q=>new Set(q).add(Me)),await oe(Me))},[D,oe]);h.useEffect(()=>{if(!c||y||B.length===0)return;const Me=B.find(q=>q.name===c);Me&&(g(Me),R(i??2),X(Me.name),!n&&s!=="fields-only"&&W(Me.name))},[c,B,y,i,n,s,X,W]),h.useEffect(()=>{if(B.length===0&&!V&&$(),r&&B.length>0&&!y){const{source:Me,storage:q}=r;v(Me.node),S(Me.fields),_(Me.configuration[0]||{}),P({fullyQualifiedName:q.fullyQualifiedName,isValid:!0});const ne=B.find(ce=>ce.name===Me.name);ne&&(g(ne),X(ne.name),!n&&s!=="fields-only"&&W(ne.name),s==="fields-only"&&W(ne.name))}if(n&&B.length>0&&!y&&!r){const Me=B[0];g(Me),X(Me.name)}},[s,r,B,n,V,$,X,W,y]);const ae=Me=>{g(Me),_({}),A(!1),m(!0),T(q=>{const ne=new Set(q);return ne.delete(Me.name),ne}),X(Me.name),W(Me.name),Le({event:"connector_setup",category:Me.name,action:"connector_selected",label:Me.displayName})},J=Me=>{v(Me),S([]),m(!0)},le=(Me,q)=>{S(q?ne=>ne.includes(Me)?ne:[...ne,Me]:ne=>ne.filter(ce=>ce!==Me)),m(!0)},ye=(Me,q)=>{S(q?ne=>{const ce=Me.filter(Oe=>!ne.includes(Oe));return[...ne,...ce]}:ne=>ne.filter(ce=>!Me.includes(ce))),m(!0)},Ce=Me=>{P(Me),m(!0)},Ve=h.useCallback(Me=>{_(Me),m(!0)},[]),De=h.useCallback(Me=>{A(Me)},[]);h.useEffect(()=>{G&&(G.some(q=>q.required&&q.name!=="Fields")||A(!0))},[G]),h.useEffect(()=>{var q;const Me=((q=U[E-1])==null?void 0:q.title)??`Step ${String(E)}`;Le({event:"connector_setup",category:(y==null?void 0:y.name)??"unknown",action:"step",label:Me})},[E,y]);const et=()=>{E<z&&R(E+1)},rt=()=>{E>1&&R(E-1)},dn=()=>{if(n)return y!==null&&I;if(s==="fields-only")switch(E){case 1:return C.length>0;default:return!1}switch(E){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}},zt=()=>E>1,On=(Me,q)=>{if(!Me)return q;const ne=Me.find(ce=>ce.name===q);return(ne==null?void 0:ne.destinationName)??q},yn=()=>{if(n&&E===1)return G&&y?a.jsx(Q_,{connector:y,connectorSpecification:G,onConfigurationChange:Ve,onValidationChange:De,initialConfiguration:j,loading:Z,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(E){case 1:return y&&x&&Y?a.jsx(J_,{connector:y,connectorFields:Y,selectedField:x,selectedFields:C,onFieldToggle:le,onSelectAllFields:ye}):null;default:return null}switch(E){case 1:return a.jsx(goe,{connectors:B,selectedConnector:y,loading:V,error:M,onConnectorSelect:ae,onConnectorDoubleClick:()=>{R(Me=>Me<z?Me+1:Me)}});case 2:return y&&G?a.jsx(Q_,{connector:y,connectorSpecification:G,onConfigurationChange:Ve,onValidationChange:De,initialConfiguration:j,loading:Z,isEditingExisting:!1}):null;case 3:return y&&Y?a.jsx(Ooe,{connectorFields:Y,connector:y,selectedField:x,connectorName:y.displayName,loading:F,onFieldSelect:J}):null;case 4:return y&&x&&Y?a.jsx(J_,{connector:y,connectorFields:Y,selectedField:x,selectedFields:C,onFieldToggle:le,onSelectAllFields:ye}):null;case 5:return x&&Y?a.jsx(Eie,{dataStorageType:t,destinationName:On(Y,x),connectorName:(y==null?void 0:y.displayName)??"",target:ge,onTargetChange:Ce}):null;default:return null}};return a.jsxs(rre,{children:[a.jsx(are,{children:yn()}),a.jsx(sre,{variant:"horizontal",children:a.jsx(yoe,{currentStep:E,totalSteps:z,canGoNext:dn(),canGoBack:zt(),isLoading:Z||F,onNext:et,onBack:rt,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"})),m(!1)}})})]})}const RI=20,jI=20;function TI({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 _I(e=30,t=0){TI({vertical:jI+e,horizontal:RI+t})}function ah(){TI({vertical:jI,horizontal:RI})}function NI({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:i=null,mode:c="full",initialStep:u,preselectedConnector:f}){h.useEffect(()=>(e?_I(55):ah(),()=>{ah()}),[e]);const{showUnsavedDialog:m,setShowUnsavedDialog:y,handleClose:g,confirmClose:x,handleFormDirtyChange:v,handleFormSubmitSuccess:C}=Ic(t);return a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:S=>{S||g()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(yl,{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(wie,{onSubmit:S=>{r(S),C()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:v})]})}),a.jsx(br,{open:m,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 X2=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,m]=h.useState(!1),[y,g]=h.useState(1),[x,v]=h.useState();h.useEffect(()=>{c!==void 0&&m(c)},[c]);const C=()=>{v(void 0),g(1),m(!0)},S=()=>{m(!1),u==null||u()};return h.useEffect(()=>{i&&(i==="connector"?(v(void 0),g(1),m(!0)):(v(i),g(2),m(!0)))},[i]),a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{onClick:C,style:{cursor:"pointer"},children:n}),a.jsx(nd,{children:a.jsx(NI,{isOpen:f,onClose:S,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:y,preselectedConnector:x})})]})};function Rie({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(X2,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:a.jsxs(Ee,{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(eS,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(_a,{className:"h-6 w-6"})]})})}const jie=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,jf=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 Tie({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=Sl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=Dc();h.useEffect(()=>{f()},[f]);const m=C=>{const S=u.find(E=>E.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(Et,{children:[a.jsx(wt,{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(_a,{className:"h-3 w-3"})]})}),a.jsx(Rt,{children:"Edit connector configuration"})]})]})},g=(C,S,E)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",a.jsx(gn,{href:E,onClick:R=>{R.stopPropagation()},children:S})]}),x=()=>{switch(i.type){case Re.GOOGLE_BIGQUERY:{const C=i.config.projectId,S=t.connector.storage.fullyQualifiedName,E=S.split(".")[0],R=S.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${E}`,_=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${E}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Dataset",E,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,_),a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(Fr,{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,[E,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",E,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,j),a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(Fr,{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,E=t.connector.storage.fullyQualifiedName.split("."),R=E[0],j=E[1],_=E[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",kg(j),O),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",kg(_),T),a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(Fr,{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(X2,{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(vb,{icon:m(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(vb,{title:jie(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(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("span",{children:a.jsx(Ee,{type:"button",variant:"ghost",onClick:()=>{v()&&n(e)},disabled:!v(),children:a.jsx(es,{className:"h-4 w-4"})})})}),!v()&&a.jsx(Rt,{children:"Remove last configuration only after adding a new one."})]})})]})}function _ie({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(X2,{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(Ee,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(ha,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function Nie({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=vs(),{setValue:u,getValues:f,trigger:m}=yd(),[y,g]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{r&&v(!0)},[r]);const C=(i==null?void 0:i.status)??zr.DRAFT,S=async Z=>{u("definition",Z,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},E=async Z=>{const F=Z.source,M=Z.storage;await S({connector:{source:F,storage:M}})},R=async Z=>{if(i){if(i.status.code!==zr.PUBLISHED){Tt.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:Z})}},j=Z=>async F=>{const $=f().definition;if(typeof $=="object"&&Au($)){const H=[...$.connector.source.configuration];H[Z]=F.source.configuration[0]||{};const oe={connector:{...$.connector,source:{...$.connector.source,configuration:H}}};await S(oe)}},_=async Z=>{const M=f().definition;if(typeof M=="object"&&Au(M)){const $={connector:{...M.connector,source:{...M.connector.source,fields:Z.source.fields}}};await S($)}g(!1)},I=Z=>{R({runType:Z.runType,data:Z.data})},A=Z=>{const F=Z.connector.source.fields.length;return a.jsxs(Ee,{type:"button",variant:"outline",onClick:()=>{g(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(KU,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(F),")"]})]})},[O,T]=h.useState(null),[D,k]=h.useState(!1),B=Z=>{T(Z),k(!0)},G=async()=>{O!==null&&(await Y(O),T(null),k(!1))},Y=async Z=>{const M=f().definition;if(Au(M)&&M.connector.source.configuration.length<=1){const $=B2($e.CONNECTOR);await S($)}if(typeof M=="object"&&Au(M)&&M.connector.source.configuration.length>1){const $={...M.connector.source,configuration:M.connector.source.configuration.filter((oe,ge)=>ge!==Z)},H={connector:{...M.connector,source:$}};await S(H)}},V=async Z=>{const M=f().definition;if(Au(M)){const $={...M.connector.source,configuration:[...M.connector.source.configuration,Z]},H={connector:{...M.connector,source:$}};await S(H)}};return a.jsxs(a.Fragment,{children:[a.jsx(_t,{control:e,name:"definition",render:({field:Z})=>a.jsxs(xt,{className:"dark:bg-white/2",children:[a.jsx(Ct,{children:a.jsx("div",{className:"space-y-3",children:!jf(Z.value)||C===zr.DRAFT?a.jsx(Rie,{storageType:t,onSetupConnector:F=>{E(F),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(_ie,{storageType:t,onAddConfiguration:F=>void V(F),existingConnector:jf(Z.value)?{source:Z.value.connector.source,storage:Z.value.connector.storage}:void 0}),jf(Z.value)&&A(Z.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:i&&i.definitionType===$e.CONNECTOR&&a.jsx(O6,{configuration:i.definition,onManualRun:I,children:a.jsxs(Ee,{variant:"outline",children:[a.jsx(Xg,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:jf(Z.value)&&(i!=null&&i.storage)?Z.value.connector.source.configuration.map((F,M)=>{const $=Z.value;return a.jsx(nd,{children:a.jsx(Tie,{configIndex:M,connectorDef:$,dataStorage:i.storage,onRemoveConfiguration:H=>{B(H)},onUpdateConfiguration:H=>j(H),dataMartStatus:typeof C=="object"?C.code:C,totalConfigurations:$.connector.source.configuration.length},M)},M)}):null})]})})}),a.jsx(Mt,{})]})}),a.jsx(nd,{children:a.jsx(NI,{isOpen:y,onClose:()=>{g(!1)},onSubmit:Z=>void _(Z),dataStorageType:t,existingConnector:jf(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(br,{open:D,onOpenChange:k,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{G()},onCancel:()=>{T(null)},variant:"destructive"})]})}function Aie({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=yd(),[i,c]=h.useState(!1);return h.useEffect(()=>{e===$e.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),a.jsxs("div",{className:"space-y-2",children:[e===$e.SQL&&a.jsx(doe,{control:s}),e===$e.TABLE&&a.jsx(foe,{control:s,storageType:t}),e===$e.VIEW&&a.jsx(hoe,{control:s,storageType:t}),e===$e.TABLE_PATTERN&&a.jsx(moe,{control:s,storageType:t}),e===$e.CONNECTOR&&a.jsx(Nie,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function AI(){const[e]=zL(),t=e.get("preset");return h.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return yee(n)},[t])}function Die(e,t){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const Oie=1e3,Iie=[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED];function Mie(e){const[t,n]=h.useState(!1),[r,s]=h.useState(null),i=h.useRef({triggerId:null,abortController:null}),c=h.useCallback(g=>i.current.triggerId===g,[]),u=h.useCallback(g=>{s({isValid:!1,error:g instanceof Error?g.message:"Validation failed"}),n(!1)},[]),f=h.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 Tn.abortSqlDryRunTrigger(e,g)}catch(v){console.error("Failed to cancel trigger:",v)}}},[e]),m=h.useCallback(async(g,x)=>{for(;!x.aborted&&c(g);)try{const v=await Tn.getSqlDryRunTriggerStatus(e,g);if(Iie.includes(v)){const C=await Tn.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,Oie))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),y=h.useCallback(async g=>{await f(),n(!0),s(null);try{const{triggerId:x}=await Tn.createSqlDryRunTrigger(e,g),v=new AbortController;i.current={triggerId:x,abortController:v},await m(x,v.signal)}catch(x){u(x)}},[e,f,m,u]);return h.useEffect(()=>()=>{const{triggerId:g,abortController:x}=i.current;x==null||x.abort(),g&&Tn.abortSqlDryRunTrigger(e,g).catch(()=>{})},[e]),{validateSql:y,isLoading:t,result:r,cancel:f}}const kie=300;function Lie({sql:e,dataMartId:t,debounceDelay:n=kie,className:r="",onValidationStateChange:s}){const i=Die(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:m}=Mie(t);h.useEffect(()=>{if(!i){m();const g={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(g);return}c(i)},[i,c,m,s]),h.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(Ec,{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(IP,{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(Et,{children:[a.jsx(wt,{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:NQ(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(ng,{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 Pie={isValid:null,isLoading:!1,error:null},Uie=(e,t)=>{if(e!==$e.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},zie=e=>B2(e);function Fie({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=vs(),c=AI();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:m}}=r,[,y]=h.useState(Pie),[g,x]=h.useState(!1),v=h.useCallback(()=>{if(!e)return;const V={definitionType:e,definition:B2(e)};return u?{definitionType:e,definition:u}:V},[e,u]),C=h.useCallback(()=>{if(!e)return;const V=uoe(e,m);return yi(V)},[e,m]),S=Ro({resolver:C(),defaultValues:v(),mode:"onChange"}),{handleSubmit:E,reset:R,watch:j,formState:{isDirty:_,isValid:I}}=S,A=j("definition"),O=Uie(e,A);h.useEffect(()=>{e&&R(v())},[e,R,v]),h.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const V={definitionType:c.definitionType,definition:zie(c.definitionType)};R(V)}},[c,e,t,R,n]);const T=h.useCallback(V=>{y({isLoading:V.isLoading,isValid:V.isValid,error:V.error})},[]),D=h.useCallback(V=>{n(V)},[n]),k=h.useCallback(async V=>{if(e&&f)try{await s(f,V.definitionType,V.definition),x(!0),R(V)}catch(Z){console.error("Failed to update data mart definition:",Z)}},[f,e,s,R]);h.useEffect(()=>{g&&(x(!1),i==null||i())},[g,i]);const B=h.useCallback(V=>{V==null||V.preventDefault(),E(k)(V)},[E,k]),G=h.useCallback(()=>{R(v())},[R,v]),Y=()=>e?a.jsxs("form",{onSubmit:B,className:"space-y-4",children:[a.jsx(Aie,{definitionType:e,storageType:m,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:B}),e!==$e.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Ee,{variant:"default",type:"submit",disabled:!I||!_,children:"Save"}),a.jsx(Ee,{type:"button",variant:"ghost",onClick:G,disabled:!_,children:"Discard"}),e===$e.SQL&&O&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(Lie,{sql:O,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(i5,{...S,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(aoe,{initialType:e,onTypeSelect:D}),Y()]})})}function Hie(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 DI(e){return e.type==="bigquery-data-mart-schema"}function OI(e){return e.type==="athena-data-mart-schema"}function II(e){return e.type==="snowflake-data-mart-schema"}function tN(e){return e!==null&&typeof e=="object"&&"mode"in e}function nN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function rN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function $ie(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function l1(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Vie(e){const t=l1(e),[n,r]=h.useState(t),[s,i]=h.useState(!1);h.useEffect(()=>{const f=l1(e);r(f),i(!1)},[e]);const c=h.useCallback(f=>{n?DI(n)&&f.every(tN)?(r({...n,fields:f}),i(!0)):OI(n)&&f.every(nN)?(r({...n,fields:f}),i(!0)):II(n)&&f.every(rN)&&(r({...n,fields:f}),i(!0)):f.length>0&&(tN(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):nN(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):rN(f[0])&&(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)))},[n]),u=h.useCallback(()=>{const f=l1(e);r(f),i(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:u,setIsDirty:i}}function Bie(e,t){const n=h.useRef(!1),r=h.useRef(!1),[s,i]=h.useState("idle");return h.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 Gie(e){const t=h.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]=h.useState({});return h.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function MI(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=>MI(c,t)):!1}function kI(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,m=s.description?s.description.toLowerCase().includes(t):!1;if((u||f||m)&&r.push(c),s.fields&&s.fields.length>0){const y=kI(s.fields,t,c);y.length>0&&(r.includes(c)||r.push(c),r.push(...y))}}),r}function qie(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return MI(r,s)}function Kie(e){const[t,n]=h.useState(""),r=h.useCallback(i=>{n(i),e.setGlobalFilter(i)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}function Zie(e){const[t,n]=h.useState(new Set),[r,s]=h.useState(null),i=h.useRef(""),c=h.useMemo(()=>{const C=S=>S.some(E=>E.type===ar.RECORD||E.type===ar.STRUCT||E.fields&&C(E.fields));return C(e)},[e]),u=h.useCallback(C=>{n(S=>{const E=new Set(S);return E.has(C)?E.delete(C):E.add(C),E})},[]),f=h.useCallback(()=>{const C=[],S=(E,R="")=>{E.forEach((j,_)=>{const I=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(I),S(j.fields,I))})};S(e),n(E=>C.every(j=>E.has(j))?new Set:new Set(C))},[e]),m=h.useMemo(()=>{const C=[],S=(E,R="",j=0)=>{E.forEach((_,I)=>{const A=R?`${R}.${String(I)}`:String(I),O=_.type===ar.RECORD||_.type===ar.STRUCT;C.push({..._,path:A,level:j}),O&&_.fields&&t.has(A)&&S(_.fields,A,j+1)})};return S(e),C},[e,t]),y=h.useCallback(C=>{if(C!==i.current)if(i.current=C,C){r===null&&s(new Set(t));const E=kI(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===ar.RECORD||I.type===ar.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 E.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),s(null))},[e,t,r]),g=h.useCallback(C=>{const S=m[C];return S.type===ar.RECORD||S.type===ar.STRUCT},[m]),x=h.useMemo(()=>e.map(C=>({...C,fields:void 0})),[e]),v=h.useMemo(()=>{const C=[],S=(E,R="")=>{E.forEach((j,_)=>{const I=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(I),S(j.fields,I))})};return S(e),C.length===0?!1:C.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:u,toggleAllRecords:f,flattenedFields:m,handleSearchChange:y,isRecordType:g,topLevelFields:x,allExpanded:v}}function Yie(e,t,n,r){const s=h.useCallback((f,m)=>{if(n){const y=[...e],g=t[f].path;if(!g)y[f]={...y[f],...m};else{const x=g.split(".").map(Number);let v=y,C;for(let E=0;E<x.length-1;E++)C=v[x[E]],v=C.fields??[];const S=x[x.length-1];v[S]&&(v[S]={...v[S],...m})}n(y)}},[e,t,n]),i=h.useCallback(()=>{if(n){const f={name:"",type:ar.STRING,mode:th.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED};n([...e,f])}},[e,n]),c=h.useCallback(f=>{if(n){const m=[...e],y=t[f].path;if(!y)m.splice(f,1);else{const g=y.split(".").map(Number);let x=m,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(m)}},[e,t,n]),u=h.useCallback(f=>{var m,y;if(n&&r){const g=[...e],x=t[f].path,v={name:"",type:ar.STRING,mode:th.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED};if(!x)(m=g[f]).fields??(m.fields=[]),g[f].fields.push(v);else{const C=x.split(".").map(Number);let S=g;for(let E=0;E<C.length;E++){const R=C[E];E===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 Q2(e,t,n){return{handleDragEnd:h.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 m=n[u].path,y=n[f].path,g=[...e];if(!m&&!y){const[x]=g.splice(u,1);g.splice(f,0,x),t(g);return}if(m&&y){const x=m.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],E=v[v.length-1],[R]=C.splice(S,1);C.splice(E,0,R),t(g)}}},[e,n,t])}}function Wie(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Zy=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 J2(e){return"nodeType"in e}function Na(e){var t,n;return e?bd(e)?e:J2(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function eC(e){const{Document:t}=Na(e);return e instanceof t}function qh(e){return bd(e)?!1:e instanceof Na(e).HTMLElement}function LI(e){return e instanceof Na(e).SVGElement}function Sd(e){return e?bd(e)?e.document:J2(e)?eC(e)?e:qh(e)||LI(e)?e.ownerDocument:document:document:document}const So=Zy?h.useLayoutEffect:h.useEffect;function tC(e){const t=h.useRef(e);return So(()=>{t.current=e}),h.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 Xie(){const e=h.useRef(null),t=h.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function sh(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return So(()=>{n.current!==e&&(n.current=e)},t),n}function Kh(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Lg(e){const t=tC(e),n=h.useRef(null),r=h.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function _b(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let c1={};function Zh(e,t){return h.useMemo(()=>{if(t)return t;const n=c1[e]==null?0:c1[e]+1;return c1[e]=n,e+"-"+n},[e,t])}function PI(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,m]of u){const y=i[f];y!=null&&(i[f]=y+e*m)}return i},{...t})}}const Vu=PI(1),Pg=PI(-1);function Qie(e){return"clientX"in e&&"clientY"in e}function nC(e){if(!e)return!1;const{KeyboardEvent:t}=Na(e.target);return t&&e instanceof t}function Jie(e){if(!e)return!1;const{TouchEvent:t}=Na(e.target);return t&&e instanceof t}function Nb(e){if(Jie(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 oh=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[oh.Translate.toString(e),oh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),aN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ele(e){return e.matches(aN)?e:e.querySelector(aN)}const tle={display:"none"};function nle(e){let{id:t,value:n}=e;return re.createElement("div",{id:t,style:tle},n)}function rle(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 ale(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const UI=h.createContext(null);function sle(e){const t=h.useContext(UI);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ole(){const[e]=h.useState(()=>new Set),t=h.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[h.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 ile={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
|
+
`},lle={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 cle(e){let{announcements:t=lle,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=ile}=e;const{announce:i,announcement:c}=ale(),u=Zh("DndLiveRegion"),[f,m]=h.useState(!1);if(h.useEffect(()=>{m(!0)},[]),sle(h.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(nle,{id:r,value:s.draggable}),re.createElement(rle,{id:u,announcement:c}));return n?Ms.createPortal(y,n):y}var vr;(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"})(vr||(vr={}));function Ug(){}function rC(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function aC(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const $s=Object.freeze({x:0,y:0});function ule(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function fle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function hle(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function sN(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 sC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=sN(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const m=ule(sN(f),s);i.push({id:u,data:{droppableContainer:c,value:m}})}}return i.sort(dle)};function mle(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,m=e.width*e.height,y=c*u,g=y/(f+m-y);return Number(g.toFixed(4))}return 0}const ple=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=mle(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(fle)};function gle(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function zI(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:$s}function yle(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 xle=yle(1);function vle(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 ble(e,t,n){const r=vle(t);if(!r)return e;const{scaleX:s,scaleY:i,x:c,y:u}=r,f=e.left-c-(1-s)*parseFloat(n),m=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:m,right:f+y,bottom:m+g,left:f}}const Sle={ignoreTransform:!1};function Cd(e,t){t===void 0&&(t=Sle);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:y}=Na(e).getComputedStyle(e);m&&(n=ble(n,m,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 oN(e){return Cd(e,{ignoreTransform:!0})}function Cle(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Ele(e,t){return t===void 0&&(t=Na(e).getComputedStyle(e)),t.position==="fixed"}function wle(e,t){t===void 0&&(t=Na(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 oC(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(eC(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!qh(s)||LI(s)||n.includes(s))return n;const i=Na(e).getComputedStyle(s);return s!==e&&wle(s,i)&&n.push(s),Ele(s,i)?n:r(s.parentNode)}return e?r(e):n}function FI(e){const[t]=oC(e,1);return t??null}function u1(e){return!Zy||!e?null:bd(e)?e:J2(e)?eC(e)||e===Sd(e).scrollingElement?window:qh(e)?e:null:null}function HI(e){return bd(e)?e.scrollX:e.scrollLeft}function $I(e){return bd(e)?e.scrollY:e.scrollTop}function Ab(e){return{x:HI(e),y:$I(e)}}var Rr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Rr||(Rr={}));function VI(e){return!Zy||!e?!1:e===document.scrollingElement}function BI(e){const t={x:0,y:0},n=VI(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 Rle={x:.2,y:.2};function jle(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=Rle);const{isTop:m,isBottom:y,isLeft:g,isRight:x}=BI(e),v={x:0,y:0},C={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!m&&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 Tle(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 GI(e){return e.reduce((t,n)=>Vu(t,Ab(n)),$s)}function _le(e){return e.reduce((t,n)=>t+HI(n),0)}function Nle(e){return e.reduce((t,n)=>t+$I(n),0)}function Ale(e,t){if(t===void 0&&(t=Cd),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);FI(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Dle=[["x",["left","right"],_le],["y",["top","bottom"],Nle]];class iC{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=oC(n),s=GI(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of Dle)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=u(r),y=s[i]-m;return this.rect[f]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Hf{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 Ole(e){const{EventTarget:t}=Na(e);return e instanceof t?e:Sd(e)}function d1(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 ms;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ms||(ms={}));function iN(e){e.preventDefault()}function Ile(e){e.stopPropagation()}var pn;(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"})(pn||(pn={}));const qI={start:[pn.Space,pn.Enter],cancel:[pn.Esc],end:[pn.Space,pn.Enter,pn.Tab]},Mle=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case pn.Right:return{...n,x:n.x+25};case pn.Left:return{...n,x:n.x-25};case pn.Down:return{...n,y:n.y+25};case pn.Up:return{...n,y:n.y-25}}};class KI{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 Hf(Sd(n)),this.windowListeners=new Hf(Na(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ms.Resize,this.handleCancel),this.windowListeners.add(ms.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ms.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ale(r),n($s)}handleKeyDown(t){if(nC(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=qI,coordinateGetter:c=Mle,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:m}=r.current,y=m?{x:m.left,y:m.top}:$s;this.referenceCoordinates||(this.referenceCoordinates=y);const g=c(t,{active:n,context:r.current,currentCoordinates:y});if(g){const x=Pg(g,y),v={x:0,y:0},{scrollableAncestors:C}=r.current;for(const S of C){const E=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:I,maxScroll:A,minScroll:O}=BI(S),T=Tle(S),D={x:Math.min(E===pn.Right?T.right-T.width/2:T.right,Math.max(E===pn.Right?T.left:T.left+T.width/2,g.x)),y:Math.min(E===pn.Down?T.bottom-T.height/2:T.bottom,Math.max(E===pn.Down?T.top:T.top+T.height/2,g.y))},k=E===pn.Right&&!j||E===pn.Left&&!_,B=E===pn.Down&&!I||E===pn.Up&&!R;if(k&&D.x!==g.x){const G=S.scrollLeft+x.x,Y=E===pn.Right&&G<=A.x||E===pn.Left&&G>=O.x;if(Y&&!x.y){S.scrollTo({left:G,behavior:u});return}Y?v.x=S.scrollLeft-G:v.x=E===pn.Right?S.scrollLeft-A.x:S.scrollLeft-O.x,v.x&&S.scrollBy({left:-v.x,behavior:u});break}else if(B&&D.y!==g.y){const G=S.scrollTop+x.y,Y=E===pn.Down&&G<=A.y||E===pn.Up&&G>=O.y;if(Y&&!x.x){S.scrollTo({top:G,behavior:u});return}Y?v.y=S.scrollTop-G:v.y=E===pn.Down?S.scrollTop-A.y:S.scrollTop-O.y,v.y&&S.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,Vu(Pg(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()}}KI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=qI,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 lN(e){return!!(e&&"distance"in e)}function cN(e){return!!(e&&"delay"in e)}class lC{constructor(t,n,r){var s;r===void 0&&(r=Ole(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 Hf(this.document),this.listeners=new Hf(r),this.windowListeners=new Hf(Na(c)),this.initialCoordinates=(s=Nb(i))!=null?s:$s,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(ms.Resize,this.handleCancel),this.windowListeners.add(ms.DragStart,iN),this.windowListeners.add(ms.VisibilityChange,this.handleCancel),this.windowListeners.add(ms.ContextMenu,iN),this.documentListeners.add(ms.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(cN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(lN(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(ms.Click,Ile,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ms.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=Nb(t))!=null?n:$s,m=Pg(s,f);if(!r&&u){if(lN(u)){if(u.tolerance!=null&&d1(m,u.tolerance))return this.handleCancel();if(d1(m,u.distance))return this.handleStart()}if(cN(u)&&d1(m,u.tolerance))return this.handleCancel();this.handlePending(u,m);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===pn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const kle={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yh extends lC{constructor(t){const{event:n}=t,r=Sd(n.target);super(t,kle,r)}}Yh.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 Lle={move:{name:"mousemove"},end:{name:"mouseup"}};var Db;(function(e){e[e.RightClick=2]="RightClick"})(Db||(Db={}));class Ple extends lC{constructor(t){super(t,Lle,Sd(t.event.target))}}Ple.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Db.RightClick?!1:(r==null||r({event:n}),!0)}}];const f1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ule extends lC{constructor(t){super(t,f1)}static setup(){return window.addEventListener(f1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(f1.move.name,t)};function t(){}}}Ule.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 $f;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($f||($f={}));var zg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zg||(zg={}));function zle(e){let{acceleration:t,activator:n=$f.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=zg.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:y,delta:g,threshold:x}=e;const v=Hle({delta:g,disabled:!i}),[C,S]=Xie(),E=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),j=h.useMemo(()=>{switch(n){case $f.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case $f.DraggableRect:return s}},[n,s,f]),_=h.useRef(null),I=h.useCallback(()=>{const O=_.current;if(!O)return;const T=E.current.x*R.current.x,D=E.current.y*R.current.y;O.scrollBy(T,D)},[]),A=h.useMemo(()=>u===zg.TreeOrder?[...m].reverse():m,[u,m]);h.useEffect(()=>{if(!i||!m.length||!j){S();return}for(const O of A){if((r==null?void 0:r(O))===!1)continue;const T=m.indexOf(O),D=y[T];if(!D)continue;const{direction:k,speed:B}=jle(O,D,j,t,x);for(const G of["x","y"])v[G][k[G]]||(B[G]=0,k[G]=0);if(B.x>0||B.y>0){S(),_.current=O,C(I,c),E.current=B,R.current=k;return}}E.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,m,A,y,JSON.stringify(x)])}const Fle={x:{[Rr.Backward]:!1,[Rr.Forward]:!1},y:{[Rr.Backward]:!1,[Rr.Forward]:!1}};function Hle(e){let{delta:t,disabled:n}=e;const r=_b(t);return Kh(s=>{if(n||!r||!s)return Fle;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 $le(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Kh(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function Vle(e,t){return h.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 ih;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ih||(ih={}));var Ob;(function(e){e.Optimized="optimized"})(Ob||(Ob={}));const uN=new Map;function Ble(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,c]=h.useState(null),{frequency:u,measure:f,strategy:m}=s,y=h.useRef(e),g=E(),x=sh(g),v=h.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[x]),C=h.useRef(null),S=Kh(R=>{if(g&&!n)return uN;if(!R||R===uN||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 iC(f(I),I):null;_.rect.current=A,A&&j.set(_.id,A)}return j}return R},[e,i,n,g,f]);return h.useEffect(()=>{y.current=e},[e]),h.useEffect(()=>{g||v()},[n,g]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.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 E(){switch(m){case ih.Always:return!1;case ih.BeforeDragging:return n;default:return!n}}}function ZI(e,t){return Kh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Gle(e,t){return ZI(e,t)}function qle(e){let{callback:t,disabled:n}=e;const r=tC(t),s=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return h.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Yy(e){let{callback:t,disabled:n}=e;const r=tC(t),s=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return h.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Kle(e){return new iC(Cd(e),e)}function dN(e,t,n){t===void 0&&(t=Kle);const[r,s]=h.useState(null);function i(){s(f=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=f??n)!=null?m:null}const y=t(e);return JSON.stringify(f)===JSON.stringify(y)?f:y})}const c=qle({callback(f){if(e)for(const m of f){const{type:y,target:g}=m;if(y==="childList"&&g instanceof HTMLElement&&g.contains(e)){i();break}}}}),u=Yy({callback:i});return So(()=>{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 Zle(e){const t=ZI(e);return zI(e,t)}const fN=[];function Yle(e){const t=h.useRef(e),n=Kh(r=>e?r&&r!==fN&&e&&t.current&&e.parentNode===t.current.parentNode?r:oC(e):fN,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function Wle(e){const[t,n]=h.useState(null),r=h.useRef(e),s=h.useCallback(i=>{const c=u1(i.target);c&&n(u=>u?(u.set(c,Ab(c)),new Map(u)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const m=u1(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,Ab(m)]):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 m=u1(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Vu(i,c),$s):GI(e):$s,[e,t])}function hN(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==$s;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pg(e,n.current):$s}function Xle(e){h.useEffect(()=>{if(!Zy)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 h.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=c=>{i(c,t)},n},{}),[e,t])}function YI(e){return h.useMemo(()=>e?Cle(e):null,[e])}const mN=[];function Jle(e,t){t===void 0&&(t=Cd);const[n]=e,r=YI(n?Na(n):null),[s,i]=h.useState(mN);function c(){i(()=>e.length?e.map(f=>VI(f)?r:new iC(t(f),f)):mN)}const u=Yy({callback:c});return So(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function ece(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return qh(t)?t:e}function tce(e){let{measure:t}=e;const[n,r]=h.useState(null),s=h.useCallback(m=>{for(const{target:y}of m)if(qh(y)){r(g=>{const x=t(y);return g?{...g,width:x.width,height:x.height}:x});break}},[t]),i=Yy({callback:s}),c=h.useCallback(m=>{const y=ece(m);i==null||i.disconnect(),y&&(i==null||i.observe(y)),r(y?t(y):null)},[t,i]),[u,f]=Lg(c);return h.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const nce=[{sensor:Yh,options:{}},{sensor:KI,options:{}}],rce={current:{}},Wp={draggable:{measure:oN},droppable:{measure:oN,strategy:ih.WhileDragging,frequency:Ob.Optimized},dragOverlay:{measure:Cd}};class Vf 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 ace={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Vf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ug},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Wp,measureDroppableContainers:Ug,windowRect:null,measuringScheduled:!1},sce={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ug,draggableNodes:new Map,over:null,measureDroppableContainers:Ug},Wy=h.createContext(sce),WI=h.createContext(ace);function oce(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Vf}}}function ice(e,t){switch(t.type){case vr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case vr.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 vr.DragEnd:case vr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case vr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Vf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case vr.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 Vf(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case vr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Vf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function lce(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=h.useContext(Wy),i=_b(r),c=_b(n==null?void 0:n.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!nC(i)||document.activeElement===i.target)return;const u=s.get(c);if(!u)return;const{activatorNode:f,node:m}=u;if(!f.current&&!m.current)return;requestAnimationFrame(()=>{for(const y of[f.current,m.current]){if(!y)continue;const g=ele(y);if(g){g.focus();break}}})}},[r,t,s,c,i]),null}function cce(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function uce(e){return h.useMemo(()=>({draggable:{...Wp.draggable,...e==null?void 0:e.draggable},droppable:{...Wp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Wp.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 dce(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=h.useRef(!1),{x:c,y:u}=typeof s=="boolean"?{x:s,y:s}:s;So(()=>{if(!c&&!u||!t){i.current=!1;return}if(i.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const y=n(m),g=zI(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=FI(m);x&&x.scrollBy({top:g.y,left:g.x})}},[t,c,u,r,n])}const XI=h.createContext({...$s,scaleX:1,scaleY:1});var qi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(qi||(qi={}));const cC=h.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:m,sensors:y=nce,collisionDetection:g=ple,measuring:x,modifiers:v,...C}=t;const S=h.useReducer(ice,void 0,oce),[E,R]=S,[j,_]=ole(),[I,A]=h.useState(qi.Uninitialized),O=I===qi.Initialized,{draggable:{active:T,nodes:D,translate:k},droppable:{containers:B}}=E,G=T!=null?D.get(T):null,Y=h.useRef({initial:null,translated:null}),V=h.useMemo(()=>{var En;return T!=null?{id:T,data:(En=G==null?void 0:G.data)!=null?En:rce,rect:Y}:null},[T,G]),Z=h.useRef(null),[F,M]=h.useState(null),[$,H]=h.useState(null),oe=sh(C,Object.values(C)),ge=Zh("DndDescribedBy",c),P=h.useMemo(()=>B.getEnabled(),[B]),U=uce(x),{droppableRects:z,measureDroppableContainers:X,measuringScheduled:W}=Ble(P,{dragging:O,dependencies:[k.x,k.y],config:U.droppable}),ae=$le(D,T),J=h.useMemo(()=>$?Nb($):null,[$]),le=Cs(),ye=Gle(ae,U.draggable.measure);dce({activeNode:T!=null?D.get(T):null,config:le.layoutShiftCompensation,initialRect:ye,measure:U.draggable.measure});const Ce=dN(ae,U.draggable.measure,ye),Ve=dN(ae?ae.parentElement:null),De=h.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),et=B.getNodeFor((n=De.current.over)==null?void 0:n.id),rt=tce({measure:U.dragOverlay.measure}),dn=(r=rt.nodeRef.current)!=null?r:ae,zt=O?(s=rt.rect)!=null?s:Ce:null,On=!!(rt.nodeRef.current&&rt.rect),yn=Zle(On?null:Ce),Me=YI(dn?Na(dn):null),q=Yle(O?et??ae:null),ne=Jle(q),ce=cce(v,{transform:{x:k.x-yn.x,y:k.y-yn.y,scaleX:1,scaleY:1},activatorEvent:$,active:V,activeNodeRect:Ce,containerNodeRect:Ve,draggingNodeRect:zt,over:De.current.over,overlayNodeRect:rt.rect,scrollableAncestors:q,scrollableAncestorRects:ne,windowRect:Me}),Oe=J?Vu(J,k):null,we=Wle(q),je=hN(we),He=hN(we,[Ce]),mt=Vu(ce,je),st=zt?xle(zt,ce):null,Wt=V&&st?g({active:V,collisionRect:st,droppableRects:z,droppableContainers:P,pointerCoordinates:Oe}):null,sr=hle(Wt,"id"),[$n,Dr]=h.useState(null),Jr=On?ce:Vu(ce,He),fn=gle(Jr,(i=$n==null?void 0:$n.rect)!=null?i:null,Ce),or=h.useRef(null),kn=h.useCallback((En,In)=>{let{sensor:Ye,options:Bt}=In;if(Z.current==null)return;const Xt=D.get(Z.current);if(!Xt)return;const Gt=En.nativeEvent,Vn=new Ye({active:Z.current,activeNode:Xt,event:Gt,options:Bt,context:De,onAbort(Qt){if(!D.get(Qt))return;const{onDragAbort:K}=oe.current,ee={id:Qt};K==null||K(ee),j({type:"onDragAbort",event:ee})},onPending(Qt,Cr,K,ee){if(!D.get(Qt))return;const{onDragPending:Se}=oe.current,_e={id:Qt,constraint:Cr,initialCoordinates:K,offset:ee};Se==null||Se(_e),j({type:"onDragPending",event:_e})},onStart(Qt){const Cr=Z.current;if(Cr==null)return;const K=D.get(Cr);if(!K)return;const{onDragStart:ee}=oe.current,fe={activatorEvent:Gt,active:{id:Cr,data:K.data,rect:Y}};Ms.unstable_batchedUpdates(()=>{ee==null||ee(fe),A(qi.Initializing),R({type:vr.DragStart,initialCoordinates:Qt,active:Cr}),j({type:"onDragStart",event:fe}),M(or.current),H(Gt)})},onMove(Qt){R({type:vr.DragMove,coordinates:Qt})},onEnd:Jt(vr.DragEnd),onCancel:Jt(vr.DragCancel)});or.current=Vn;function Jt(Qt){return async function(){const{active:K,collisions:ee,over:fe,scrollAdjustedTranslate:Se}=De.current;let _e=null;if(K&&Se){const{cancelDrop:Ge}=oe.current;_e={activatorEvent:Gt,active:K,collisions:ee,delta:Se,over:fe},Qt===vr.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(_e))&&(Qt=vr.DragCancel)}Z.current=null,Ms.unstable_batchedUpdates(()=>{R({type:Qt}),A(qi.Uninitialized),Dr(null),M(null),H(null),or.current=null;const Ge=Qt===vr.DragEnd?"onDragEnd":"onDragCancel";if(_e){const Fe=oe.current[Ge];Fe==null||Fe(_e),j({type:Ge,event:_e})}})}}},[D]),Ys=h.useCallback((En,In)=>(Ye,Bt)=>{const Xt=Ye.nativeEvent,Gt=D.get(Bt);if(Z.current!==null||!Gt||Xt.dndKit||Xt.defaultPrevented)return;const Vn={active:Gt};En(Ye,In.options,Vn)===!0&&(Xt.dndKit={capturedBy:In.sensor},Z.current=Bt,kn(Ye,In))},[D,kn]),Aa=Vle(y,Ys);Xle(y),So(()=>{Ce&&I===qi.Initializing&&A(qi.Initialized)},[Ce,I]),h.useEffect(()=>{const{onDragMove:En}=oe.current,{active:In,activatorEvent:Ye,collisions:Bt,over:Xt}=De.current;if(!In||!Ye)return;const Gt={active:In,activatorEvent:Ye,collisions:Bt,delta:{x:mt.x,y:mt.y},over:Xt};Ms.unstable_batchedUpdates(()=>{En==null||En(Gt),j({type:"onDragMove",event:Gt})})},[mt.x,mt.y]),h.useEffect(()=>{const{active:En,activatorEvent:In,collisions:Ye,droppableContainers:Bt,scrollAdjustedTranslate:Xt}=De.current;if(!En||Z.current==null||!In||!Xt)return;const{onDragOver:Gt}=oe.current,Vn=Bt.get(sr),Jt=Vn&&Vn.rect.current?{id:Vn.id,rect:Vn.rect.current,data:Vn.data,disabled:Vn.disabled}:null,Qt={active:En,activatorEvent:In,collisions:Ye,delta:{x:Xt.x,y:Xt.y},over:Jt};Ms.unstable_batchedUpdates(()=>{Dr(Jt),Gt==null||Gt(Qt),j({type:"onDragOver",event:Qt})})},[sr]),So(()=>{De.current={activatorEvent:$,active:V,activeNode:ae,collisionRect:st,collisions:Wt,droppableRects:z,draggableNodes:D,draggingNode:dn,draggingNodeRect:zt,droppableContainers:B,over:$n,scrollableAncestors:q,scrollAdjustedTranslate:mt},Y.current={initial:zt,translated:st}},[V,ae,Wt,st,D,dn,zt,z,B,$n,q,mt]),zle({...le,delta:k,draggingRect:st,pointerCoordinates:Oe,scrollableAncestors:q,scrollableAncestorRects:ne});const ea=h.useMemo(()=>({active:V,activeNode:ae,activeNodeRect:Ce,activatorEvent:$,collisions:Wt,containerNodeRect:Ve,dragOverlay:rt,draggableNodes:D,droppableContainers:B,droppableRects:z,over:$n,measureDroppableContainers:X,scrollableAncestors:q,scrollableAncestorRects:ne,measuringConfiguration:U,measuringScheduled:W,windowRect:Me}),[V,ae,Ce,$,Wt,Ve,rt,D,B,z,$n,X,q,ne,U,W,Me]),Da=h.useMemo(()=>({activatorEvent:$,activators:Aa,active:V,activeNodeRect:Ce,ariaDescribedById:{draggable:ge},dispatch:R,draggableNodes:D,over:$n,measureDroppableContainers:X}),[$,Aa,V,Ce,R,ge,D,$n,X]);return re.createElement(UI.Provider,{value:_},re.createElement(Wy.Provider,{value:Da},re.createElement(WI.Provider,{value:ea},re.createElement(XI.Provider,{value:fn},m)),re.createElement(lce,{disabled:(u==null?void 0:u.restoreFocus)===!1})),re.createElement(cle,{...u,hiddenTextDescribedById:ge}));function Cs(){const En=(F==null?void 0:F.autoScrollEnabled)===!1,In=typeof f=="object"?f.enabled===!1:f===!1,Ye=O&&!En&&!In;return typeof f=="object"?{...f,enabled:Ye}:{enabled:Ye}}}),fce=h.createContext(null),pN="button",hce="Draggable";function mce(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Zh(hce),{activators:c,activatorEvent:u,active:f,activeNodeRect:m,ariaDescribedById:y,draggableNodes:g,over:x}=h.useContext(Wy),{role:v=pN,roleDescription:C="draggable",tabIndex:S=0}=s??{},E=(f==null?void 0:f.id)===t,R=h.useContext(E?XI:fce),[j,_]=Lg(),[I,A]=Lg(),O=Qle(c,t),T=sh(n);So(()=>(g.set(t,{id:t,key:i,node:j,activatorNode:I,data:T}),()=>{const k=g.get(t);k&&k.key===i&&g.delete(t)}),[g,t]);const D=h.useMemo(()=>({role:v,tabIndex:S,"aria-disabled":r,"aria-pressed":E&&v===pN?!0:void 0,"aria-roledescription":C,"aria-describedby":y.draggable}),[r,v,S,E,C,y.draggable]);return{active:f,activatorEvent:u,activeNodeRect:m,attributes:D,isDragging:E,listeners:r?void 0:O,node:j,over:x,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function pce(){return h.useContext(WI)}const gce="Droppable",yce={timeout:25};function xce(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Zh(gce),{active:c,dispatch:u,over:f,measureDroppableContainers:m}=h.useContext(Wy),y=h.useRef({disabled:n}),g=h.useRef(!1),x=h.useRef(null),v=h.useRef(null),{disabled:C,updateMeasurementsFor:S,timeout:E}={...yce,...s},R=sh(S??r),j=h.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),v.current=null},E)},[E]),_=Yy({callback:j,disabled:C||!c}),I=h.useCallback((D,k)=>{_&&(k&&(_.unobserve(k),g.current=!1),D&&_.observe(D))},[_]),[A,O]=Lg(I),T=sh(t);return h.useEffect(()=>{!_||!A.current||(_.disconnect(),g.current=!1,_.observe(A.current))},[A,_]),h.useEffect(()=>(u({type:vr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:x,data:T}}),()=>u({type:vr.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==y.current.disabled&&(u({type:vr.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 QI(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function vce(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function Mp(e){return e!==null&&e>=0}function bce(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 Sce(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const JI=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=QI(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}},kp={scaleX:1,scaleY:1},uC=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 m=i[c];return m?{x:0,y:n<c?m.top+m.height-(u.top+u.height):m.top-u.top,...kp}:null}const f=Cce(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...kp}:s<n&&s>=c?{x:0,y:u.height+f,...kp}:{x:0,y:0,...kp}};function Cce(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 eM="Sortable",tM=re.createContext({activeIndex:-1,containerId:eM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:JI,disabled:{draggable:!1,droppable:!1}});function dC(e){let{children:t,id:n,items:r,strategy:s=JI,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:m,measureDroppableContainers:y}=pce(),g=Zh(eM,n),x=u.rect!==null,v=h.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),C=c!=null,S=c?v.indexOf(c.id):-1,E=m?v.indexOf(m.id):-1,R=h.useRef(v),j=!bce(v,R.current),_=E!==-1&&S===-1||j,I=Sce(i);So(()=>{j&&C&&y(v)},[j,v,C,y]),h.useEffect(()=>{R.current=v},[v]);const A=h.useMemo(()=>({activeIndex:S,containerId:g,disabled:I,disableTransforms:_,items:v,overIndex:E,useDragOverlay:x,sortedRects:vce(v,f),strategy:s}),[S,g,I.draggable,I.droppable,_,v,E,f,x,s]);return re.createElement(tM.Provider,{value:A},t)}const Ece=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return QI(n,r,s).indexOf(t)},wce=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:c,previousItems:u,previousContainerId:f,transition:m}=e;return!m||!r||u!==i&&s===c?!1:n?!0:c!==s&&t===f},Rce={duration:200,easing:"ease"},nM="transform",jce=oh.Transition.toString({property:nM,duration:0,easing:"linear"}),Tce={roleDescription:"sortable"};function _ce(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=h.useState(null),u=h.useRef(n);return So(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const m=Cd(r.current,{ignoreTransform:!0}),y={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(y.x||y.y)&&c(y)}}n!==u.current&&(u.current=n)},[t,n,r,s]),h.useEffect(()=>{i&&c(null)},[i]),i}function Nce(e){let{animateLayoutChanges:t=wce,attributes:n,disabled:r,data:s,getNewIndex:i=Ece,id:c,strategy:u,resizeObserverConfig:f,transition:m=Rce}=e;const{items:y,containerId:g,activeIndex:x,disabled:v,disableTransforms:C,sortedRects:S,overIndex:E,useDragOverlay:R,strategy:j}=h.useContext(tM),_=Ace(r,v),I=y.indexOf(c),A=h.useMemo(()=>({sortable:{containerId:g,index:I,items:y},...s}),[g,s,I,y]),O=h.useMemo(()=>y.slice(y.indexOf(c)),[y,c]),{rect:T,node:D,isOver:k,setNodeRef:B}=xce({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:G,activatorEvent:Y,activeNodeRect:V,attributes:Z,setNodeRef:F,listeners:M,isDragging:$,over:H,setActivatorNodeRef:oe,transform:ge}=mce({id:c,data:A,attributes:{...Tce,...n},disabled:_.draggable}),P=Wie(B,F),U=!!G,z=U&&!C&&Mp(x)&&Mp(E),X=!R&&$,W=X&&z?ge:null,J=z?W??(u??j)({rects:S,activeNodeRect:V,activeIndex:x,overIndex:E,index:I}):null,le=Mp(x)&&Mp(E)?i({id:c,items:y,activeIndex:x,overIndex:E}):I,ye=G==null?void 0:G.id,Ce=h.useRef({activeId:ye,items:y,newIndex:le,containerId:g}),Ve=y!==Ce.current.items,De=t({active:G,containerId:g,isDragging:$,isSorting:U,id:c,index:I,items:y,newIndex:Ce.current.newIndex,previousItems:Ce.current.items,previousContainerId:Ce.current.containerId,transition:m,wasDragging:Ce.current.activeId!=null}),et=_ce({disabled:!De,index:I,node:D,rect:T});return h.useEffect(()=>{U&&Ce.current.newIndex!==le&&(Ce.current.newIndex=le),g!==Ce.current.containerId&&(Ce.current.containerId=g),y!==Ce.current.items&&(Ce.current.items=y)},[U,le,g,y]),h.useEffect(()=>{if(ye===Ce.current.activeId)return;if(ye&&!Ce.current.activeId){Ce.current.activeId=ye;return}const dn=setTimeout(()=>{Ce.current.activeId=ye},50);return()=>clearTimeout(dn)},[ye]),{active:G,activeIndex:x,attributes:Z,data:A,rect:T,index:I,newIndex:le,items:y,isOver:k,isSorting:U,isDragging:$,listeners:M,node:D,overIndex:E,over:H,setNodeRef:P,setActivatorNodeRef:oe,setDroppableNodeRef:B,setDraggableNodeRef:F,transform:et??J,transition:rt()};function rt(){if(et||Ve&&Ce.current.newIndex===I)return jce;if(!(X&&!nC(Y)||!m)&&(U||De))return oh.Transition.toString({...m,property:nM})}}function Ace(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}}pn.Down,pn.Right,pn.Up,pn.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,m]=h.useState(!1),[y,g]=h.useState(e),x=h.useRef(null),v=j=>{g(j.target.value)},C=()=>{n&&y!==e&&n(y.trim()),m(!1)},S=()=>{g(e),m(!1)},E=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),C()):j.key==="Escape"&&(j.preventDefault(),S())},R=j=>{m(j),j?(g(e),setTimeout(()=>{x.current&&x.current.focus()},0)):S()};return a.jsxs(F2,{open:f,onOpenChange:R,children:[a.jsx(H2,{asChild:!0,children:a.jsx("div",{className:se("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",i),children:e||t})}),a.jsxs($2,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(wo,{ref:x,value:y,onChange:v,onKeyDown:E,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(Ee,{variant:"outline",size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(Ee,{size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Dce({isAllExpanded:e,onToggle:t}){return a.jsx(Ee,{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(NP,{className:"h-4 w-4"}):a.jsx(Qb,{className:"h-4 w-4"})})}function Oce({isExpanded:e,onToggle:t,ariaLabel:n}){return a.jsx(Ee,{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(Bs,{className:"h-4 w-4"}):a.jsx(_a,{className:"h-4 w-4"})})}function Ice({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(EA,{className:"h-4 w-4 text-gray-400"})})}function fC({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=Nce({id:e}),f={transform:oh.Transform.toString(i),transition:c,opacity:u?.75:1},m=h.Children.toArray(t),y=[a.jsx($r,{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(Ice,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return a.jsx(Hn,{ref:s,style:f,className:"group",children:y})}function rM({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,i]=h.useState(!1),c=()=>{t&&t(e.index),i(!1)},u=r&&n&&r(e.index),f=!!t,m=u&&f;return a.jsxs("div",{className:"px-3 text-right",children:[a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(Ee,{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(Gs,{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(ha,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&a.jsx(ja,{}),f&&a.jsxs(Nt,{onClick:()=>{i(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(br,{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 Mce({mode:e,onModeChange:t}){const n=Object.values(th),r=s=>{t&&t(s)};return a.jsxs(ca,{value:e,onValueChange:r,children:[a.jsx(da,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(ua,{placeholder:"Select field mode"})}),a.jsx(fa,{className:"max-h-[300px]",children:n.map(s=>a.jsx(Gn,{value:s,children:s},s))})]})}var Xy="Checkbox",[kce]=Sr(Xy),[Lce,hC]=kce(Xy);function Pce(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:m,value:y="on",internal_do_not_use_render:g}=e,[x,v]=ia({prop:n,defaultProp:s??!1,onChange:f,caller:Xy}),[C,S]=h.useState(null),[E,R]=h.useState(null),j=h.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:m,defaultChecked:cl(s)?!1:s,isFormControl:_,bubbleInput:E,setBubbleInput:R};return a.jsx(Lce,{scope:t,...I,children:Uce(g)?g(I):r})}var aM="CheckboxTrigger",sM=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:m,setControl:y,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:C}=hC(aM,e),S=ht(s,y),E=h.useRef(f);return h.useEffect(()=>{const R=i==null?void 0:i.form;if(R){const j=()=>g(E.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[i,g]),a.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":cl(f)?"mixed":f,"aria-required":m,"data-state":dM(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:S,onKeyDown:Ie(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Ie(n,R=>{g(j=>cl(j)?!0:!j),C&&v&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});sM.displayName=aM;var oM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:m,form:y,...g}=e;return a.jsx(Pce,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:m,name:r,form:y,value:f,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(sM,{...g,ref:t,__scopeCheckbox:n}),x&&a.jsx(uM,{__scopeCheckbox:n})]})})});oM.displayName=Xy;var iM="CheckboxIndicator",lM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=hC(iM,n);return a.jsx(Vr,{present:r||cl(i.checked)||i.checked===!0,children:a.jsx(Je.span,{"data-state":dM(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});lM.displayName=iM;var cM="CheckboxBubbleInput",uM=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:m,value:y,form:g,bubbleInput:x,setBubbleInput:v}=hC(cM,e),C=ht(n,v),S=b2(i),E=mS(r);h.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=cl(i),A.call(j,cl(i)?!1:i),j.dispatchEvent(T)}},[x,S,i,s]);const R=h.useRef(cl(i)?!1:i);return a.jsx(Je.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:u,disabled:f,name:m,value:y,form:g,...t,tabIndex:-1,ref:C,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uM.displayName=cM;function Uce(e){return typeof e=="function"}function cl(e){return e==="indeterminate"}function dM(e){return cl(e)?"indeterminate":e?"checked":"unchecked"}function zce({className:e,...t}){return a.jsx(oM,{"data-slot":"checkbox",className:se("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(lM,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5"})})})}function fM({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(zce,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const gN={[Qa.CONNECTED]:{icon:yh,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[Qa.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:xh,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[Qa.DISCONNECTED]:{icon:$U,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function hM({status:e}){if(!(e in gN))return null;const t=gN[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(n,{className:se("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 mC({type:e,storageType:t,onTypeChange:n}){const r=t===Re.GOOGLE_BIGQUERY?Object.values(ar):t===Re.AWS_ATHENA?Object.values(u2):Object.values(d2),s=i=>{n&&(t===Re.GOOGLE_BIGQUERY||Re.AWS_ATHENA,n(i))};return a.jsxs(ca,{value:e,onValueChange:s,children:[a.jsx(da,{className:"cursor-pointer",size:"sm",children:a.jsx(ua,{placeholder:"Select field type"})}),a.jsx(fa,{className:"max-h-[300px]",children:r.map(i=>a.jsx(Gn,{value:i,children:i},i))})]})}function Fce({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(Ee,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Gs,{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(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function Hce({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:i,"aria-label":c}){const[u,f]=h.useState(n),m=h.useRef(!0);h.useEffect(()=>{(n===""||m.current)&&(f(n),m.current=!1)},[n]);const y=h.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(wc,{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 $ce({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(Hce,{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(hM,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:u})]},c))}),a.jsxs(Ee,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:i,"aria-label":"Add new field",children:[a.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const Vce={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function yN(e,t={}){const n=Vce[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 Bce({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:i,dragContextProps:c,rowComponent:u=Hn,getRowId:f}){const{isSchemaActualizationLoading:m}=vs(),y=t,g=i,x=u,{columnVisibility:v,setColumnVisibility:C}=Gie(y),S=El({data:e,columns:y,getCoreRowModel:Cl(),getFilteredRowModel:pd(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:C,enableGlobalFilter:!0,globalFilterFn:qie,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:E,onChange:R,searchValue:j}=Kie(S),_=h.useRef("");h.useEffect(()=>{s&&j!==_.current&&(_.current=j,s(j))},[j,s]);const I=h.useMemo(()=>{const T={[Qa.CONNECTED]:0,[Qa.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[Qa.DISCONNECTED]:0};return(r??e).forEach(k=>{k.status in T&&T[k.status]++}),T},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx($ce,{table:S,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:E,onFilterChange:R,statusCounts:I,disabled:m}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(wl,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:S.getHeaderGroups().map(T=>a.jsx(Hn,{className:"dm-card-table-header-row",children:T.headers.map(D=>a.jsx(Tl,{className:"bg-secondary dark:bg-background",style:yN(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(jl,{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($r,{className:"bg-background dark:bg-muted",style:yN(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(Hn,{children:a.jsx($r,{colSpan:y.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.jsxs(Ee,{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:m,"aria-label":"Add new field",children:[a.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function pC({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:y,aliasColumnCell:g,descriptionColumnCell:x,actionsColumnCell:v,dragContext:C,dragContextProps:S,rowComponent:E,getRowId:R}){const j=h.useCallback((T,D)=>{if(t){const k=[...e];k[T]={...k[T],...D},t(k)}},[e,t]),_=h.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),I=h.useCallback(T=>{if(t){const D=[...e];D.splice(T,1),t(D)}},[e,t]),A=h.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(hM,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(Et,{children:[a.jsx(wt,{className:"cursor-default",children:"Name"}),a.jsx(Rt,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>m?m({row:T,updateField:j}):a.jsx(Bu,{value:$ie(T.getValue("name")),onValueChange:D=>{j(T.index,{name:D})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(Et,{children:[a.jsx(wt,{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(fM,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:D=>{j(T.index,{isPrimaryKey:D})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(Et,{children:[a.jsx(wt,{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(Et,{children:[a.jsx(wt,{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(Fce,{table:T}),cell:({row:T,table:D})=>v?v({row:T,table:D}):a.jsx(rM,{row:T,onDeleteRow:t?I:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,I,t,f,m,y,g,x,v]),O=h.useMemo(()=>{const D={accessorKey:"type",header:()=>a.jsxs(Et,{children:[a.jsx(wt,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(Rt,{children:"Data type of the field"})]}),size:80,cell:B=>s({row:B.row,updateField:j}),enableHiding:!1},k=[...A];if(k.splice(3,0,D),i.length>0){const B=[...i];B.sort((G,Y)=>{const V=G.columnIndex??1/0,Z=Y.columnIndex??1/0;return V-Z}),B.forEach(G=>{if(G.columnIndex!==void 0){const Y=Math.min(Math.max(0,G.columnIndex),k.length);k.splice(Y,0,G)}else k.splice(k.length-1,0,G)})}return k},[A,s,j,i]);return a.jsx(Bce,{fields:e,columns:O,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:C,dragContextProps:S,rowComponent:E,getRowId:R})}function Gce({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:m,allExpanded:y}=Zie(e),{updateField:g,handleDeleteRow:x,handleAddNestedField:v,handleAddRow:C}=Yie(e,c,t,G=>G),S=h.useCallback(()=>({name:"",type:ar.STRING,mode:th.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),E=h.useCallback(({row:G})=>a.jsx(mC,{type:G.getValue("type"),storageType:Re.GOOGLE_BIGQUERY,onTypeChange:Y=>{g(G.index,{type:Y})}}),[g]),R=h.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(Et,{children:[a.jsx(wt,{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:G})=>a.jsx(Mce,{mode:G.getValue("mode"),onModeChange:Y=>{g(G.index,{mode:Y})}}),columnIndex:4}],[g]),j=h.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(Dce,{isAllExpanded:y,onToggle:i}),a.jsxs(Et,{children:[a.jsx(wt,{className:"cursor-default",children:"Name"}),a.jsx(Rt,{children:"Field name in the output schema"})]})]}),[r,y,i]),_=h.useCallback(({row:G})=>{const Y=c[G.index],Z=(Y.type===ar.RECORD||Y.type===ar.STRUCT)&&Y.fields&&Y.fields.length>0,F=Y.path??"",M=Y.level??0,$=n.has(F);return a.jsxs("div",{className:"flex items-center",children:[M>0&&a.jsx("div",{style:{width:`${String(M*16-(Z?4:0))}px`},className:"flex-shrink-0"}),Z?a.jsx(Oce,{isExpanded:$,onToggle:()=>{s(F)},ariaLabel:$?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(Bu,{value:G.getValue("name"),onValueChange:H=>{g(G.index,{name:H})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,g]),I=h.useCallback(({row:G})=>{const Y=c[G.index],V=Y.type===ar.RECORD||Y.type===ar.STRUCT;return(Y.level??0)===0&&!V?a.jsx(fM,{isPrimaryKey:G.getValue("isPrimaryKey"),onPrimaryKeyChange:F=>{g(G.index,{isPrimaryKey:F})}}):a.jsx("div",{})},[c,g]),A=h.useCallback(({row:G})=>a.jsx(Bu,{value:G.getValue("description"),onValueChange:Y=>{g(G.index,{description:Y})},minRows:5,placeholder:"-"}),[g]),O=h.useCallback(({row:G})=>a.jsx(Bu,{value:G.getValue("alias"),onValueChange:Y=>{g(G.index,{alias:Y})},placeholder:"-"}),[g]),T=h.useCallback(({row:G})=>a.jsx(rM,{row:G,onDeleteRow:t?x:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,x,v,f]),{handleDragEnd:D}=Q2(e,t,c),k=h.useCallback(G=>{const Y=c[G.index];return Y.path??String(c.indexOf(Y))},[c]),B=aC(rC(Yh,{activationConstraint:{distance:5}}));return a.jsx(cC,{sensors:B,collisionDetection:sC,onDragEnd:D,children:a.jsx(pC,{fields:c,onFieldsChange:t,onAddRow:C,createNewField:S,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:u,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:I,aliasColumnCell:O,descriptionColumnCell:A,actionsColumnCell:T,dragContext:dC,dragContextProps:{items:c.map(G=>G.path??String(c.indexOf(G))),strategy:uC},rowComponent:fC,getRowId:k})})}function qce({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:u2.STRING,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(mC,{type:c.getValue("type"),storageType:Re.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=Q2(e,t),i=aC(rC(Yh,{activationConstraint:{distance:5}}));return a.jsx(cC,{sensors:i,collisionDetection:sC,onDragEnd:s,children:a.jsx(pC,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:dC,dragContextProps:{items:e.map((c,u)=>u),strategy:uC},rowComponent:fC})})}function Kce({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:d2.VARCHAR,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(mC,{type:c.getValue("type"),storageType:Re.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=Q2(e,t),i=aC(rC(Yh,{activationConstraint:{distance:5}}));return a.jsx(cC,{sensors:i,collisionDetection:sC,onDragEnd:s,children:a.jsx(pC,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:dC,dragContextProps:{items:e.map((c,u)=>u),strategy:uC},rowComponent:fC})})}function Zce({schema:e,storageType:t,onFieldsChange:n}){const r=h.useMemo(()=>{if(!e){const s=Hie(t);return n(s.fields),s}return e},[e,t,n]);return DI(r)?a.jsx(Gce,{fields:r.fields,onFieldsChange:n}):OI(r)?a.jsx(qce,{fields:r.fields,onFieldsChange:n}):II(r)?a.jsx(Kce,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function Yce({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=vs(),{id:u="",schema:f}=t??{},{schema:m,isDirty:y,updateSchema:g,resetSchema:x}=Vie(f),{operationStatus:v,startSaveOperation:C}=Bie(r,s);h.useEffect(()=>{v==="success"&&x()},[v,x]);const S=h.useCallback(I=>{g(I)},[g]),E=h.useCallback(()=>{u&&m&&(C(),n(u,m).then(()=>{i==null||i()}))},[u,m,C,n,i]),R=h.useCallback(()=>{i==null||i()},[i]),j=h.useCallback(()=>{x()},[x]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(Zce,{schema:m,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(Ee,{variant:"default",onClick:E,disabled:!y||_,children:"Save"}),a.jsx(Ee,{type:"button",variant:"ghost",onClick:j,disabled:!y||_,children:"Discard"})]}),a.jsx(Ee,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function Wce(){const e=Yg(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(r5,{children:a.jsx(Mre,{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 Xce({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:se("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:se("@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 Jce({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:se("leading-none font-semibold",e),...t})}function eue({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:se("text-muted-foreground text-sm",e),...t})}function tue({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:se("px-6",e),...t})}function nue({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:se("flex items-center px-6 [.border-t]:pt-6",e),...t})}const gC=h.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function po({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=h.useContext(gC);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(Jce,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(eue,{className:se("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{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(Fr,{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})})]})})]})}po.displayName="CollapsibleCardHeaderTitle";function Wh({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:se("flex items-center gap-2 self-center",t),onClick:n,children:e})}Wh.displayName="CollapsibleCardHeaderActions";function go({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=h.useContext(gC);let s,i;return h.Children.forEach(e,c=>{if(h.isValidElement(c))switch(c.type){case po:s=c;break;case Wh:i=c;break}}),a.jsxs(Qce,{className:se("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:se("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:se("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(Bs,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}go.displayName="CollapsibleCardHeader";function yo({children:e}){return a.jsx(tue,{className:"px-4 pt-1",children:e})}yo.displayName="CollapsibleCardContent";function ri({left:e,right:t}){return a.jsxs(nue,{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})]})}ri.displayName="CollapsibleCardFooter";const xN="collapsed-card-";function ul({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?co.get(`${xN}${c}`,"boolean")??s:s,[f,m]=h.useState(u);h.useEffect(()=>{c&&co.set(`${xN}${c}`,f)},[f,c]);const y=()=>{const S=!f;m(S),i==null||i(S)};let g,x,v;h.Children.forEach(e,S=>{if(h.isValidElement(S))switch(S.type){case go:g=S;break;case yo:x=S;break;case ri: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(gC.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:y},children:a.jsxs(Xce,{className:se(C[n],t),children:[g,a.jsx("div",{className:se("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[x,v]})})]})})}function rue(){const{dataMart:e,updateDataMartStorage:t}=Ss(),n=(e==null?void 0:e.definitionType)??null,[r,s]=h.useState(n);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs(ul,{collapsible:!0,name:"data-storage",children:[a.jsx(go,{children:a.jsx(po,{icon:lc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(yo,{children:(e==null?void 0:e.storage)&&a.jsx(roe,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(ri,{})]}),a.jsxs(ul,{collapsible:!0,name:"input-source",children:[a.jsx(go,{children:a.jsx(po,{icon:Jb,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(yo,{children:e&&a.jsx(Fie,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(ri,{})]}),a.jsxs(ul,{collapsible:!0,name:"output-schema",children:[a.jsx(go,{children:a.jsx(po,{icon:UP,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(yo,{children:e&&a.jsx(Yce,{definitionType:r})}),a.jsx(ri,{})]})]})}function aue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:y,runReport:g}=ts(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,y,t,e.original.id,e.original.dataMart.id]),C=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=h.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]),E=h.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(Ee,{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(Gs,{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"]}),Oy(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(ja,{}),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(Xg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(Nt,{asChild:!0,children:a.jsxs("a",{href:VS(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(tU,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(ja,{}),a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(br,{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 sue={[Mn.SUCCESS]:{icon:yh,color:"text-green-500",label:"Success"},[Mn.ERROR]:{icon:ng,color:"text-red-500",label:"Fail"},[Mn.RUNNING]:{icon:Ec,color:"text-primary animate-spin",label:"In progress"},[Mn.CANCELLED]:{icon:ng,color:"text-gray-500",label:"Cancelled"}};function mM({status:e,error:t}){if(!e)return null;const n=sue[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(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(r,{className:se("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 ol=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ol||{});const oue={[ol.TITLE]:"Title",[ol.LAST_RUN_DATE]:"Last Run Date",[ol.LAST_RUN_STATUS]:"Last Run Status"},iue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ol.TITLE,header:({column:n})=>a.jsx(xr,{column:n,children:oue[ol.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ol.LAST_RUN_DATE,header:({column:n})=>a.jsx(xr,{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(Hs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ol.LAST_RUN_STATUS,header:({column:n})=>a.jsx(xr,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(mM,{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(aue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function lue({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=ts(),s=h.useMemo(()=>n.filter(x=>x.dataDestination.type===Ne.GOOGLE_SHEETS&&x.dataDestination.id===e.id),[n,e.id]);h.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=h.useMemo(()=>iue({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:m}=Ac({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),y=El({data:s,columns:i,getCoreRowModel:Cl(),onSortingChange:u,getSortedRowModel:Nc(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:m}),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(wl,{id:g,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(Rl,{className:"dm-card-table-header",children:y.getHeaderGroups().map(x=>a.jsx(Hn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(Tl,{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(jl,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((x,v)=>a.jsx(Hn,{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($r,{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(Hn,{children:a.jsx($r,{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 cue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:y,runReport:g}=ts(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[m,y,t,e.original.id,e.original.dataMart.id]),C=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=h.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]),E=h.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(Ee,{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(Gs,{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(ja,{}),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(Xg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(ja,{}),a.jsxs(Nt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(br,{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 h1({column:e,children:t,label:n}){const r=e.getIsSorted(),s=h.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(Ee,{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(Bs,{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 il=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(il||{});const pM={[il.TITLE]:"Title",[il.LAST_RUN_DATE]:"Last Run Date",[il.LAST_RUN_STATUS]:"Last Run Status"};function uue({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(Ee,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Gs,{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=pM[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(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const due=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:il.TITLE,header:({column:n})=>a.jsx(h1,{column:n,children:pM[il.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:il.LAST_RUN_DATE,header:({column:n})=>a.jsx(h1,{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(Hs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:il.LAST_RUN_STATUS,header:({column:n})=>a.jsx(h1,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(mM,{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(uue,{table:n}),cell:({row:n})=>a.jsx(cue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function fue({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=ts(),i=h.useMemo(()=>r.filter(v=>v.dataDestination.type===e&&v.dataDestination.id===t.id),[r,t.id,e]);h.useEffect(()=>{s({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[s]);const c=h.useMemo(()=>due({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:y}=Ac({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),g=El({data:i,columns:c,getCoreRowModel:Cl(),onSortingChange:f,getSortedRowModel:Nc(),state:{sorting:u,columnVisibility:m},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(wl,{id:x,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(Rl,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>a.jsx(Hn,{className:"dm-card-table-header-row",children:v.headers.map(C=>a.jsx(Tl,{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(jl,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,C)=>a.jsx(Hn,{onClick:()=>{const S=r.find(E=>E.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,E)=>a.jsx($r,{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":E+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},v.id)):a.jsx(Hn,{children:a.jsx($r,{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 hue({children:e,className:t,...n}){return a.jsx("div",{className:se("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 mue({children:e,className:t,...n}){return a.jsx("div",{className:se("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function pue({children:e,className:t,...n}){return a.jsx("div",{className:se("text-md font-medium",t),...n,children:e})}function gue({children:e,className:t,...n}){return a.jsx("div",{className:se("text-muted-foreground text-sm",t),...n,children:e})}function yue({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(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?a.jsx(Ec,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(Z2,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(Rt,{children:u})]})}function xue({icon:e,className:t,...n}){return a.jsx("div",{className:se("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(_a,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function vue(e){const{dataMart:t}=vs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=ts(),[c,u]=h.useState(!1),f=h.useMemo(()=>n.find(v=>v.dataDestination.type===Ne.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),m=h.useMemo(()=>(t==null?void 0:t.status.code)===zr.PUBLISHED,[t==null?void 0:t.status.code]),y=h.useMemo(()=>!!f,[f]),g=h.useMemo(()=>y?"Available in Looker Studio":"Not available in Looker Studio",[y]),x=h.useCallback(async v=>{if(!(!t||!m)){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,m,e,f,r,s,i]);return{existingReport:f,isLoading:c,isEnabled:m,isChecked:y,dynamicTitle:g,handleSwitchChange:x}}function bue({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=vue(e),m=h.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(hue,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[a.jsx(yue,{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(mue,{children:[a.jsx(pue,{children:u}),a.jsx(gue,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===Mn.SUCCESS&&"successfully ",a.jsx(Hs,{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(xue,{})]})}function Sue(){const{scope:e}=mi();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(Wb,{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(Ee,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(_a,{className:"h-4 w-4"})]})})]})})}function Cue(){const[e,t]=h.useState(!1),[n,r]=h.useState(_n.CREATE),[s,i]=h.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(_n.CREATE),i(null),t(!0),Le({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(_n.EDIT),i(m),t(!0),Le({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),Le({event:"report_close",category:"Report",action:n===_n.EDIT?"Edit":"Create",label:"ReportForm"})}}}const Eue=[Ne.GOOGLE_SHEETS,Ne.EMAIL,Ne.SLACK,Ne.MS_TEAMS,Ne.GOOGLE_CHAT];function wue({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=SQ(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:m}=Cue();return r?a.jsxs(a.Fragment,{children:[a.jsxs(ul,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(go,{children:[a.jsx(po,{icon:n.icon,children:e.title}),a.jsx(Wh,{children:Eue.includes(e.type)&&a.jsx(Rue,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(yo,{children:a.jsx(Sde,{destination:e,onEditReport:f})}),a.jsx(ri,{})]}),a.jsx(bde,{destination:e,isOpen:s,onClose:m,mode:i,initialReport:c})]}):null}function Rue({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===zr.DRAFT;return a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("span",{children:a.jsxs(Ee,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(ha,{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 jue({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){h.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 Tue=rn({title:Dt().min(1,"Title is required"),documentUrl:Dt().refine(rO,"Enter a valid Google Sheets URL"),dataDestinationId:Dt().min(1,"Destination is required")});function _ue({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=ts();h.useEffect(()=>{f&&x&&(u(x),m(!1))},[x,f]);const C=Ro({resolver:yi(Tue),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Oy(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:E,formState:R,reset:j}=C,{errors:_,isDirty:I}=R,A=h.useCallback(async O=>{try{u(null),v(),m(!0);const{spreadsheetId:T,sheetId:D}=QX(O.documentUrl);if(!T){u("Invalid Google Sheets URL");return}let k;if(t===_n.CREATE)k=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}k=await y(e.id,{title:O.title,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Tr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:D}})}if(!k||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(k))}catch(B){console.error("onAfterSubmit failed",B)}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:E,errors:_,isDirty:I,reset:j,formError:c,isSubmitting:f,setFormError:u,getValues:C.getValues,onSubmit:A}}function Nue(e){return e.type===sl.SCHEDULED_REPORT_RUN}function Aue(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 vN=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,bN="0 9 * * *";function Due(e){return{id:e.id,cron:e.cronExpression,timezone:e.timeZone,enabled:e.isActive,lastRun:e.lastRunTimestamp??null,nextRun:e.nextRunTimestamp??null}}async function SN(e,t){return(await so.getScheduledTriggers(e)).filter(s=>s.type===Fn.REPORT_RUN&&Nue(s.triggerConfig)&&s.triggerConfig.reportId===t).map(Due)}const yC=h.forwardRef(({dataMartId:e,reportId:t,onDirtyChange:n},r)=>{const[s,i]=h.useState([]),[c,u]=h.useState([]),f=h.useRef(!1),[m,y]=h.useState(null);h.useEffect(()=>{let S=!1;async function E(){if(!e||!t){u([]),i([]),f.current=!0,n==null||n(!1);return}try{const R=await SN(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 E(),()=>{S=!0}},[e,t,n]),h.useEffect(()=>{f.current&&(n==null||n(!Aue(s,c)))},[s,c,n]),h.useImperativeHandle(r,()=>({persist:async S=>{const E=c.filter(A=>A.id!==null),R=s.filter(A=>A.id!==null),j=new Map(E.map(A=>[A.id,A])),_=new Map(R.map(A=>[A.id,A]));for(const[A]of j.entries())_.get(A)||await so.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 so.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 so.createScheduledTrigger(e,{type:Fn.REPORT_RUN,cronExpression:A.cron,timeZone:A.timezone,isActive:A.enabled,triggerConfig:{type:sl.SCHEDULED_REPORT_RUN,reportId:S}});try{const A=await SN(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:bN,timezone:vN(),enabled:!0}])},x=S=>{i(E=>E.filter((R,j)=>j!==S))},v=(S,E)=>{i(R=>R.map((j,_)=>_===S?{...j,...E}:j))},C=s.length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[C?s.map((S,E)=>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(Ta,{htmlFor:`trigger-enabled-${String(E)}`,className:"text-sm font-normal",children:S.enabled?"Enabled":"Disabled"}),a.jsx(Z2,{id:`trigger-enabled-${String(E)}`,checked:S.enabled,onCheckedChange:R=>{v(E,{enabled:R})}})]}),a.jsx("div",{children:a.jsx(Ee,{variant:"ghost",size:"sm",type:"button","aria-label":"Delete trigger",onClick:()=>{y(E)},children:a.jsx(es,{className:"h-4 w-4","aria-hidden":"true"})})})]}),a.jsx(Tb,{cron:S.cron,timezone:S.timezone,enabled:S.enabled,onChange:v.bind(null,E),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(Hs,{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(Hs,{date:new Date(S.nextRun)})]})]}),m===E&&a.jsx(HO,{open:m===E,onOpenChange:R=>{R||y(null)},children:a.jsxs($O,{children:[a.jsxs(VO,{children:[a.jsx(GO,{children:"Delete trigger?"}),a.jsx(qO,{children:"This action will remove this schedule from the report."})]}),a.jsxs(BO,{children:[a.jsx(ZO,{onClick:()=>{y(null)},children:"Cancel"}),a.jsx(KO,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{x(E),y(null)},children:"Delete"})]})]})})]},`${S.id??"new"}:${String(E)}`)):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(Tb,{cron:bN,timezone:vN(),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(Ee,{variant:"outline",type:"button",onClick:g,size:"sm",children:"+ Add trigger"})})]}),C&&a.jsx("div",{children:a.jsx(Ee,{variant:"outline",type:"button",onClick:g,children:"+ Add trigger"})})]})});yC.displayName="ReportSchedulesInlineList";function Oue(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"service-account-details",children:[a.jsx(Zt,{children:"How do I get a correct document link?"}),a.jsxs(Yt,{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 m1(e){return"serviceAccount"in e}function gM({value:e,children:t,doNotTruncateContent:n}){const[r,s]=h.useState(!1),i=async()=>{e&&(await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3))};return a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c=>c.key==="Enter"&&i(),className:se("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(oa,{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 Iue=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 Mue({className:e,orientation:t,...n}){return a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:se(Iue({orientation:t}),e),...n})}const yM=({mode:e,isSubmitting:t,isDirty:n,triggersDirty:r,onRunAndSave:s,onCancel:i})=>{const c=t||!(n||r),u=e===_n.CREATE?"Create & Run report":n||r?"Save & Run report":"Run report";return a.jsxs(Oc,{children:[a.jsxs(Mue,{className:"w-full",children:[a.jsx(Ee,{variant:"default",type:"submit",disabled:c,className:"flex-1",children:e===_n.CREATE?"Create new report":"Save changes to report"}),a.jsxs(_r,{children:[a.jsx(Nr,{asChild:!0,children:a.jsx(Ee,{variant:"default",type:"button",disabled:c,"aria-label":"More actions",children:a.jsx(Bs,{className:"size-4","aria-hidden":"true"})})}),a.jsx(Ar,{align:"start",children:a.jsx(Nt,{onClick:s,disabled:t,children:u})})]})]}),i&&a.jsx(Ee,{variant:"outline",type:"button",onClick:i,disabled:t,children:"Cancel"})]})},kue=h.forwardRef(({initialReport:e,mode:t=_n.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",y="google-sheets-document-url-input",g="google-sheets-data-destination-select",{dataMart:x}=vs(),{scope:v}=mi(),{dataDestinations:C,fetchDataDestinations:S,loading:E}=zh(),[R,j]=h.useState([]);h.useEffect(()=>{x&&S()},[x,S]),h.useEffect(()=>{if(C.length>0){const M=C.filter($=>$.type===Ne.GOOGLE_SHEETS);j(M)}},[C]),jue({elementId:m,isOpen:!0,delay:150});const _=h.useRef(null),I=h.useRef(!1),[A,O]=h.useState(!1),{runReport:T}=ts(),{isDirty:D,reset:k,form:B,isSubmitting:G,formError:Y,onSubmit:V}=_ue({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onAfterSubmit:async M=>{var $;try{await(($=_.current)==null?void 0:$.persist(M.id))}catch(H){console.error("Failed to persist schedule for report",H)}if(I.current)try{await T(M.id)}catch(H){throw console.error("Failed to run report",H),H}finally{I.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(Y)},[Y,r]),h.useEffect(()=>{if(t===_n.EDIT&&e&&Oy(e.destinationConfig))k({title:e.title,documentUrl:VS(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===_n.CREATE){const M=(c==null?void 0:c.id)??"";k({title:"",documentUrl:"",dataDestinationId:M})}},[e,t,k,c]),h.useEffect(()=>{n==null||n(D||A)},[D,A,n]);const Z=B.watch("documentUrl"),F=Z&&rO(Z.trim());return a.jsx(_l,{...B,children:a.jsxs(gi,{id:f,ref:u,noValidate:!0,onSubmit:M=>void B.handleSubmit(V)(M),children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(_t,{control:B.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:m,placeholder:"Enter a report title",...M})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:B.control,name:"dataDestinationId",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(ca,{onValueChange:M.onChange,value:M.value,disabled:E||R.length===0,children:[a.jsx(Ct,{children:a.jsx(da,{id:g,className:"w-full max-w-full overflow-hidden",children:a.jsx(ua,{className:"truncate",placeholder:"Select a destination",children:M.value&&R.length>0&&(()=>{const $=R.find(H=>H.id===M.value);if($){const oe=aa.getInfo($.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(oe,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:$.title})})]})}return null})()})})}),a.jsx(fa,{children:R.map($=>{const oe=aa.getInfo($.type).icon;return a.jsx(Gn,{value:$.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(oe,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:$.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(m1($.credentials)&&$0($.credentials.serviceAccount))??"No email found"})]})]})},$.id)})})]}),R.length===0&&!E&&a.jsxs(G2,{className:"mt-2",children:[a.jsx(gh,{className:"h-4 w-4"}),a.jsx(dI,{children:"No destinations available"}),a.jsxs(q2,{children:["You need to create a Destination before you can create a report."," ",a.jsx(Wr,{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 $=R.find(H=>H.id===M.value);return $?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Service Account Email"}),a.jsx(gM,{value:m1($.credentials)?$0($.credentials.serviceAccount)??"No email found":"",children:m1($.credentials)?$0($.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(Mt,{})]})}),a.jsx(_t,{control:B.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(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${F?"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:()=>{F&&window.open(Z.trim(),"_blank","noopener,noreferrer")},disabled:!F,"aria-label":F?"Open document in new tab":"Document link is not valid",children:a.jsx(ai,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(Rt,{side:"top",align:"center",role:"tooltip",children:F?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(xn,{children:a.jsx(Oue,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Automate Report Runs",children:x!=null&&x.id?a.jsx(yC,{ref:_,dataMartId:x.id,reportId:t===_n.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:O}):a.jsx(W2,{})})]}),a.jsx(yM,{mode:t,isSubmitting:G,isDirty:D,triggersDirty:A,onRunAndSave:()=>{I.current=!0,B.handleSubmit(V)()},onCancel:i})]})})});function Lue({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=Ic(t);return a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:r===_n.CREATE?"Create new report":"Edit report"}),a.jsx(yl,{children:r===_n.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(Uh,{children:a.jsx(kue,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(br,{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 Pue=rn({cacheLifetime:KZ().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Uue({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=h.useState(null),{createReport:c,updateReport:u}=ts(),f=Ro({resolver:yi(Pue),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&yO(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 zue(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"cache-lifetime-details",children:[a.jsx(Zt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(Yt,{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 Fue=[{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"}],Hue=h.forwardRef(({initialReport:e,mode:t=_n.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:m}=vs(),{isDirty:y,reset:g,form:x,isSubmitting:v,formError:C,onSubmit:S}=Uue({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return h.useEffect(()=>{r&&r(C)},[C,r]),h.useEffect(()=>{t===_n.EDIT&&e&&yO(e.destinationConfig)?g({cacheLifetime:e.destinationConfig.cacheLifetime}):t===_n.CREATE&&g({cacheLifetime:300})},[e,t,g]),h.useEffect(()=>{n==null||n(y)},[y,n]),a.jsx(_l,{...x,children:a.jsxs(gi,{id:f,ref:u,noValidate:!0,onSubmit:E=>void x.handleSubmit(S)(E),children:[a.jsx(Nl,{children:a.jsx(Yr,{title:"Cache Configuration",children:a.jsx(_t,{control:x.control,name:"cacheLifetime",render:({field:E})=>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(ca,{onValueChange:R=>{E.onChange(parseInt(R,10))},value:E.value.toString(),defaultValue:"300",children:[a.jsx(Ct,{children:a.jsx(da,{className:"w-full",children:a.jsx(ua,{placeholder:"Select cache time"})})}),a.jsx(fa,{children:Fue.map(R=>a.jsx(Gn,{value:R.value.toString(),children:R.label},R.value))})]}),a.jsx(Mt,{}),a.jsx(xn,{children:a.jsx(zue,{})})]})})})}),a.jsxs(Oc,{children:[a.jsx(Ee,{variant:"default",type:"submit",className:"w-full","aria-label":t===_n.CREATE?"Create":"Save changes",disabled:!y||v,children:v?t===_n.CREATE?"Creating...":"Saving...":t===_n.CREATE?"Create":"Save changes"}),i&&a.jsx(Ee,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function $ue({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=Ic(t);return a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(yl,{children:r===_n.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(Uh,{children:a.jsx(Hue,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(br,{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 CN=({destination:e})=>{const n=aa.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 Vue(e){return"to"in e}const Bue=({destination:e})=>{if(!e)return null;const t=e.credentials,n=Vue(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(gM,{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 Gue=rn({title:Dt().min(1,"Title is required"),dataDestinationId:Dt().min(1,"Destination is required"),reportCondition:Sy(ac),subject:Dt().min(1,"Subject is required"),messageTemplate:Dt().min(1,"Message body is required")});function que({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=ts();h.useEffect(()=>{f&&x&&(u(x),m(!1))},[x,f]);const C=Ro({resolver:yi(Gue),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&&B0(e.destinationConfig)?e.destinationConfig.reportCondition:ac.ALWAYS,subject:e!=null&&e.destinationConfig&&B0(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&B0(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:S,formState:E,reset:R}=C,{isDirty:j,errors:_}=E,I=h.useCallback(async A=>{try{u(null),v(),m(!0);let O;const T={type:Tr.EMAIL_CONFIG,reportCondition:A.reportCondition,subject:A.subject,messageTemplate:A.messageTemplate};if(t===_n.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 Kue({value:e,onChange:t,onBlur:n,height:r=240,theme:s="light",options:i,className:c,placeholder:u="Start writing your message…"}){const f=m=>{n&&m.onDidBlurEditorText(n)};return a.jsx(P2,{language:"markdown",height:r,value:e,onChange:m=>{t(m??"")},onMount:f,theme:s,options:{wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",folding:!1,scrollBeyondLastLine:!1,automaticLayout:!0,placeholder:u,...i},className:c})}const Zue=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ur,{className:"h-6 w-3/4"}),a.jsx(Ur,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ur,{className:"h-4 w-full"}),a.jsx(Ur,{className:"h-4 w-5/6"}),a.jsx(Ur,{className:"h-4 w-4/5"}),a.jsx(Ur,{className:"h-4 w-3/4"})]})]});function xM({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]=h.useState({bg:"#fff",fg:"#000"});return h.useEffect(()=>{if(typeof window>"u")return;let m;const y=requestAnimationFrame(()=>{m=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(m)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx(Zue,{}),!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 Yue({value:e,onChange:t}){return a.jsx(w2,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(R2,{children:[a.jsx(nh,{value:"markdown",children:"Markdown"}),a.jsx(nh,{value:"preview",children:"Preview"})]})})}function Wue({markdown:e,enabled:t=!0,debounceMs:n=300,toHtml:r}){const[s,i]=h.useState(""),[c,u]=h.useState(!1),[f,m]=h.useState(null),y=h.useRef(null);return h.useEffect(()=>{var C;if(!t)return;const g=e;if(!g.trim()){i(""),m(null),u(!1);return}const x=new AbortController;(C=y.current)==null||C.abort(),y.current=x,u(!0),m(null);const v=setTimeout(()=>{r(g,x.signal).then(S=>{i(S)}).catch(S=>{if(x.signal.aborted)return;const E=S instanceof Error?S.message:"Failed to load preview";m(E)}).finally(()=>{x.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),x.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function Xue(e,t){return Ea.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function vM(e){const t=h.useCallback(Xue,[]);return Wue({...e,toHtml:t})}function Que(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"message-details",children:[a.jsx(Zt,{children:"How can I format my message?"}),a.jsxs(Yt,{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(gn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function Jue(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"sending-condition-details",children:[a.jsx(Zt,{children:"What are Data Mart Run results?"}),a.jsxs(Yt,{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 ede(){return a.jsxs(Kt,{value:"sheets-api-details",children:[a.jsx(Zt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(gn,{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 tde(){return a.jsxs(Kt,{value:"looker-studio-details",children:[a.jsx(Zt,{children:"How do I connect to Looker Studio?"}),a.jsxs(Yt,{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(gn,{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(gn,{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 nde(){return a.jsxs(Kt,{value:"odata-details",children:[a.jsx(Zt,{children:"How do I use OData?"}),a.jsxs(Yt,{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 rde(){return a.jsxs(Kt,{value:"email-details",children:[a.jsx(Zt,{children:"How do I start sending Email?"}),a.jsxs(Yt,{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(gn,{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 ade(){return a.jsxs(Kt,{value:"slack-details",children:[a.jsx(Zt,{children:"How do I start sending to Slack?"}),a.jsxs(Yt,{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(gn,{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 sde(){return a.jsxs(Kt,{value:"msteams-details",children:[a.jsx(Zt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(Yt,{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(gn,{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 ode(){return a.jsxs(Kt,{value:"googlechat-details",children:[a.jsx(Zt,{children:"How do I start sending to Google Chat?"}),a.jsxs(Yt,{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(gn,{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 ide={[Ne.GOOGLE_SHEETS]:ede,[Ne.LOOKER_STUDIO]:tde,[Ne.ODATA]:nde,[Ne.EMAIL]:rde,[Ne.SLACK]:ade,[Ne.MS_TEAMS]:sde,[Ne.GOOGLE_CHAT]:ode};function lde({destinationType:e}){const t=ide[e];return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function cde({form:e,isEditMode:t,allowedDestinationTypes:n}){const{flags:r}=Dh();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(ca,{onValueChange:s.onChange,defaultValue:s.value,disabled:!!t,children:[a.jsx(Ct,{children:a.jsx(da,{className:"w-full",children:a.jsx(ua,{placeholder:"Select a destination type"})})}),a.jsx(fa,{children:a.jsx(Uy,{children:aa.getAllTypes().filter(({type:i})=>n&&n.length>0?n.includes(i):!0).map(({type:i,displayName:c,icon:u,status:f})=>{const m=f===_s.COMING_SOON,y=f===_s.CLOUD_ONLY&&DQ(r);return a.jsx(a.Fragment,{children:y?a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Gn,{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(Wr,{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(ai,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(Wr,{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(ai,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Gn,{value:i,disabled:m,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,m&&a.jsx(jr,{variant:"outline",children:f})]})},i)})})})})]}),a.jsx(xn,{children:a.jsx(lde,{destinationType:s.value})}),a.jsx(Mt,{})]})})}const bM="credentials.to",ude=/[,;\n]/,dde=", ",SM="Enter emails separated by comma, semicolon or newline",fde="Emails list";function EN(e){const t=new Set,n=[];for(const r of e.split(ude)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function p1(e){return e.join(dde)}function wN(e,t){e.setValue(bM,t,{shouldDirty:!0,shouldTouch:!0})}function hde({field:e,form:t}){const n=Array.isArray(e.value)?p1(e.value):"",[r,s]=h.useState(n),[i,c]=h.useState(!1),u=Array.isArray(e.value)?p1(e.value):"";h.useEffect(()=>{i||s(u)},[u,i]);const f=g=>{const x=g.target.value;s(x),wN(t,EN(x))},m=()=>{c(!0)},y=g=>{c(!1),e.onBlur();const x=EN(g.target.value);wN(t,x),s(p1(x))};return a.jsx(wo,{name:e.name,ref:e.ref,onFocus:m,onBlur:y,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:SM})}function Lp({form:e,emailsFieldTitle:t=fde}){return a.jsx(_t,{control:e.control,name:bM,render:({field:n})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(yt,{tooltip:SM,children:t})}),a.jsx(Ct,{children:a.jsx(hde,{field:n,form:e})}),a.jsx(Mt,{})]})})}function mde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"service-account-details",children:[a.jsx(Zt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Yt,{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(gn,{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 pde({form:e}){const[t,n]=h.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?uO(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(Ee,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(Ee,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(Ct,{children:!t&&c?a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(gn,{href:c.url,children:c.email})}),a.jsx(Rt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(wo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(xn,{children:a.jsx(mde,{})}),a.jsx(Mt,{})]})})}function xC(e){return"destinationSecretKey"in e}function gde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"json-config-details",children:[a.jsx(Zt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(Yt,{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 yde({form:e}){const t=e.getValues("credentials"),n=h.useMemo(()=>t&&xC(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=h.useMemo(()=>qS(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(wD,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(Mt,{}),a.jsx(xn,{children:a.jsx(gde,{})})]})})})}function xde({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r,isEditMode:s,allowedDestinationTypes:i}){const c=Ro({resolver:yi(pQ),defaultValues:e??{title:"New Destination",type:Ne.GOOGLE_SHEETS},mode:"onTouched"}),u=c.watch("type");h.useEffect(()=>{r==null||r(c.formState.isDirty)},[c.formState.isDirty,r]);const f=async m=>{const{dirtyFields:y}=c.formState,g=cO(m);return y.credentials||delete g.credentials,t(g)};return a.jsx(_l,{...c,children:a.jsxs(gi,{onSubmit:m=>{c.handleSubmit(f)(m)},children:[a.jsxs(Nl,{children:[a.jsx(_t,{control:c.control,name:"title",render:({field:m})=>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",...m})}),a.jsx(Mt,{})]})}),a.jsx(cde,{form:c,isEditMode:s,allowedDestinationTypes:i}),u===Ne.GOOGLE_SHEETS&&a.jsx(pde,{form:c}),u===Ne.LOOKER_STUDIO&&a.jsx(yde,{form:c}),u===Ne.EMAIL&&a.jsx(Lp,{form:c,emailsFieldTitle:"Enter user emails list"}),u===Ne.SLACK&&a.jsx(Lp,{form:c,emailsFieldTitle:"Enter Slack channel emails list"}),u===Ne.MS_TEAMS&&a.jsx(Lp,{form:c,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),u===Ne.GOOGLE_CHAT&&a.jsx(Lp,{form:c,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(Oc,{children:[a.jsxs(Ee,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!c.formState.isDirty||c.formState.isSubmitting,children:[c.formState.isSubmitting&&a.jsx(Ec,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(Ee,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function CM({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r,initialFormData:s,allowedDestinationTypes:i}){const{updateDataDestination:c,createDataDestination:u}=zh(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=Ic(t),C=async E=>{const R=oO.getMapper(E.type);if(n){const j=R.mapToUpdateRequest(E),_=await c(n.id,j);_&&r(_)}else{const j=R.mapToCreateRequest(E),_=await u(j);_&&r(_)}v()},S=h.useRef(!1);return h.useEffect(()=>{const E=n?"Edit":"Create";e&&!S.current?(Le({event:"data_destination_config_open",category:"DataDestination",action:E,label:n==null?void 0:n.type}),S.current=!0):!e&&S.current&&(Le({event:"data_destination_config_close",category:"DataDestination",action:E,label:n==null?void 0:n.type}),S.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:E=>{E||y()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:"Configure destination"}),a.jsx(yl,{children:"Customize settings for your destination"})]}),a.jsx(xde,{initialData:n??s??null,onSubmit:C,onCancel:y,onDirtyChange:x,isEditMode:!!n,allowedDestinationTypes:i})]})}),a.jsx(br,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const vde=[Ne.EMAIL,Ne.SLACK,Ne.GOOGLE_CHAT,Ne.MS_TEAMS],EM=h.forwardRef(({initialReport:e,mode:t=_n.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c,prefill:u,allowedDestinationTypes:f},m)=>{const y="email-report-edit-form",{dataMart:g}=Ss(),x=h.useRef(null),v=h.useRef(!1),[C,S]=h.useState(!1),{runReport:E}=ts(),{dataDestinations:R,fetchDataDestinations:j,loading:_}=zh(),[I,A]=h.useState([]),[O,T]=h.useState(!1);h.useEffect(()=>{g&&j()},[g,j]),h.useEffect(()=>{if(R.length>0){const W=f??(c!=null&&c.type?[c.type]:vde),ae=R.filter(J=>W.includes(J.type));A(ae)}},[R,c==null?void 0:c.type,f]);const{isDirty:D,reset:k,form:B,isSubmitting:G,formError:Y,onSubmit:V}=que({initialReport:e,mode:t,dataMartId:(g==null?void 0:g.id)??"",onAfterSubmit:async W=>{var ae;try{await((ae=x.current)==null?void 0:ae.persist(W.id))}catch(J){console.error("Failed to persist schedule for report",J)}if(v.current)try{await E(W.id)}catch(J){throw console.error("Failed to run report",J),J}finally{v.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(Y)},[Y,r]),h.useEffect(()=>{if(!(t===_n.EDIT&&e)){if(t===_n.CREATE){const W=(c==null?void 0:c.id)??"";k({title:(u==null?void 0:u.title)??"",dataDestinationId:W,reportCondition:ac.ALWAYS,subject:(u==null?void 0:u.subject)??"",messageTemplate:(u==null?void 0:u.messageTemplate)??""})}}},[e,t,k,c,u==null?void 0:u.title,u==null?void 0:u.subject,u==null?void 0:u.messageTemplate]),h.useEffect(()=>{n==null||n(D||C)},[D,C,n]);const Z=h.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:F}=md(),M=F==="dark"?"vs-dark":"light",[$,H]=h.useState("markdown"),oe=B.watch("messageTemplate"),{html:ge,loading:P,error:U}=vM({markdown:oe,enabled:$==="preview"}),z=B.watch("dataDestinationId"),X=h.useMemo(()=>z&&I.length>0?I.find(W=>W.id===z)??null:null,[z,I]);return a.jsxs(a.Fragment,{children:[a.jsx(_l,{...B,children:a.jsxs(gi,{id:y,ref:m,noValidate:!0,onSubmit:W=>{B.handleSubmit(V)(W)},children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(_t,{control:B.control,name:"title",render:({field:W})=>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",...W})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:B.control,name:"dataDestinationId",render:({field:W})=>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(ca,{onValueChange:ae=>{if(ae==="__create_new__"){T(!0);return}W.onChange(ae)},value:W.value,disabled:_,children:[a.jsx(Ct,{children:a.jsx(da,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ua,{className:"truncate",placeholder:"Select a destination",children:X&&a.jsx(CN,{destination:X})})})}),a.jsxs(fa,{children:[I.map(ae=>a.jsx(Gn,{value:ae.id,children:a.jsx(CN,{destination:ae})},ae.id)),I.length>0&&a.jsx(K5,{}),!c&&a.jsx(Gn,{value:"__create_new__",children:"+ Create new"})]})]}),a.jsx(Bue,{destination:X}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Template",children:[a.jsx(_t,{control:B.control,name:"subject",render:({field:W})=>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",...W})}),a.jsx(Mt,{})]})}),a.jsx(_t,{control:B.control,name:"messageTemplate",render:({field:W})=>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(Yue,{value:$,onChange:H})]}),a.jsx(Ct,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:$==="markdown"?a.jsx(Kue,{value:W.value,onChange:ae=>{W.onChange(ae)},onBlur:W.onBlur,height:240,theme:M}):a.jsx(xM,{html:ge,loading:P,error:U,height:240})})}),a.jsx(xn,{children:a.jsx(Que,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Sending conditions",children:a.jsx(_t,{control:B.control,name:"reportCondition",render:({field:W})=>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(ca,{onValueChange:W.onChange,value:W.value,children:[a.jsx(Ct,{children:a.jsx(da,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ua,{})})}),a.jsx(fa,{children:Z.map(ae=>a.jsx(Gn,{value:ae.value,children:ae.label},ae.value))})]}),a.jsx(xn,{children:a.jsx(Jue,{})}),a.jsx(Mt,{})]})})}),a.jsx(Yr,{title:"Automate Report Runs",children:g!=null&&g.id?a.jsx(yC,{ref:x,dataMartId:g.id,reportId:t===_n.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:S}):a.jsx(W2,{})})]}),a.jsx(yM,{mode:t,isSubmitting:G,isDirty:D,triggersDirty:C,onRunAndSave:()=>{v.current=!0,B.handleSubmit(V)()},onCancel:i})]})}),a.jsx(CM,{isOpen:O,onClose:()=>{T(!1)},dataDestination:null,initialFormData:{title:"New Destination",type:(f==null?void 0:f[0])??Ne.EMAIL},allowedDestinationTypes:f,onSaveSuccess:W=>{j().then(()=>{B.setValue("dataDestinationId",W.id,{shouldDirty:!0,shouldTouch:!0}),T(!1)})}})]})});EM.displayName="EmailReportEditForm";function wM({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c}){const{projectId:u,id:f}=Yg(),{pathname:m}=Vs(),{showUnsavedDialog:y,setShowUnsavedDialog:g,handleClose:x,confirmClose:v,handleFormDirtyChange:C,handleFormSubmitSuccess:S}=Ic(t),E=h.useCallback(()=>{const R=u&&f?`/ui/${u}/data-marts/${f}/reports`:"/";m.includes("/reports")||d_("Report has been created",{closeButton:!0,description:a.jsxs(a.Fragment,{children:["You can view it in"," ",a.jsx(Wr,{to:R,className:"underline underline-offset-4",onClick:()=>d_.dismiss(),children:"Destinations"})," ","page"]}),duration:1/0}),S()},[S,u,f,m]);return h.useEffect(()=>(e?_I(90):ah(),()=>{ah()}),[e]),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:R=>{R||x()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(yl,{children:r===_n.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(Uh,{children:a.jsx(EM,{initialReport:n,mode:r,onDirtyChange:C,onSubmit:E,onCancel:x,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c})})]})}),a.jsx(br,{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 bde({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Ne.GOOGLE_SHEETS:return a.jsx(Lue,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ne.LOOKER_STUDIO:return a.jsx($ue,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ne.EMAIL:case Ne.SLACK:case Ne.GOOGLE_CHAT:case Ne.MS_TEAMS:return a.jsx(wM,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function Sde({destination:e,onEditReport:t}){switch(e.type){case Ne.GOOGLE_SHEETS:return a.jsx(lue,{destination:e,onEditReport:t});case Ne.EMAIL:case Ne.SLACK:case Ne.GOOGLE_CHAT:case Ne.MS_TEAMS:return a.jsx(fue,{destinationType:e.type,destination:e,onEditReport:t});case Ne.LOOKER_STUDIO:return a.jsx(bue,{destination:e,onEditReport:t});default:return null}}function RM(){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(Ur,{className:"h-4 w-4 rounded-full"}),a.jsx(Ur,{className:"h-4 w-40"}),a.jsx(Ur,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ur,{className:"h-6 w-16 rounded-full"}),a.jsx(Ur,{className:"h-4 w-4"})]})]})},t))})})}function vC({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=h.useRef(r);s.current=r;const i=h.useRef(null);h.useEffect(()=>{var f;if(!e)return;(f=i.current)==null||f.abort(),i.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const m=new AbortController;s.current(m.signal)}};c();const u=window.setInterval(c,t);return()=>{var m;window.clearInterval(u),(m=i.current)==null||m.abort()}},[e,t,n])}function Cde({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=vs(),{fetchReportsByDataMartId:r}=ts(),s=n==null?void 0:n.id;h.useEffect(()=>{s&&r(s)},[s,r]),vC({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function Ede(){const{dataMart:e}=vs(),{dataDestinations:t,isLoading:n}=CQ();return Cde({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(RM,{}):t.length===0?a.jsx(Sue,{}):t.map(r=>a.jsx(wue,{destination:r,dataMartStatus:e.status},r.id))}):null}function wde(){return a.jsx(Uh,{children:a.jsx(BS,{children:a.jsx(Ede,{})})})}function RN(){return a.jsxs(ul,{children:[a.jsx(go,{children:a.jsx(po,{icon:yP,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(yo,{children:a.jsx(Lre,{})}),a.jsx(ri,{})]})}function Rde(){const{dataMart:e}=Ss(),[t,n]=h.useState(!1),r=h.useCallback(()=>{n(!0)},[]),s=h.useCallback(()=>{n(!1)},[]);return a.jsxs(ul,{children:[a.jsxs(go,{children:[a.jsx(po,{icon:Xb,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(Wh,{children:a.jsxs(Ee,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(yo,{children:a.jsx(nd,{children:a.jsx(Loe,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(Cie,{dataMartId:e.id}),a.jsx(Y2,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(ri,{})]})}const jde={list:[],listLoadingStatus:bt.IDLE,activeInsight:null,activeInsightLoadingStatus:bt.IDLE,executionStatus:bt.IDLE,executionTriggerId:null,error:null};var ft=(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))(ft||{});class Tde extends bl{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 Zo=new Tde,If=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)}),_de=e=>e.data.map(If),Nde=e=>({title:e.title,template:e.template??null}),Ade=e=>({title:e.title,template:e.template??null}),jM=h.createContext(void 0);function TM(){const e=h.useContext(jM);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function bC(){const{state:e,dispatch:t}=TM(),{dataMart:n}=Ss();if(!n)throw new Error("useInsights must be used within a DataMart context");const r=h.useCallback(async()=>{t({type:ft.FETCH_INSIGHTS_START});try{const v=await Zo.getInsights(n.id),C=_de(v);t({type:ft.FETCH_INSIGHTS_SUCCESS,payload:C})}catch(v){throw t({type:ft.FETCH_INSIGHTS_ERROR,payload:un(v)}),v}},[n.id,t]),s=h.useCallback(async v=>{t({type:ft.GET_INSIGHT_START});try{const C=await Zo.getInsightById(n.id,v),S=If(C);return t({type:ft.GET_INSIGHT_SUCCESS,payload:S}),S}catch(C){throw t({type:ft.GET_INSIGHT_ERROR,payload:un(C)}),C}},[n.id,t]),i=h.useCallback(async v=>{t({type:ft.CREATE_INSIGHT_START});try{const C=Nde(v),S=await Zo.createInsight(n.id,C),E=If(S);return t({type:ft.CREATE_INSIGHT_SUCCESS,payload:E}),Le({event:"insight_created",category:"Insights",action:"Create",label:E.id}),Tt.success("Insight created"),E}catch(C){return t({type:ft.CREATE_INSIGHT_ERROR,payload:un(C)}),null}},[n.id,t]),c=h.useCallback(async(v,C)=>{t({type:ft.UPDATE_INSIGHT_START});try{const S=Ade(C),E=await Zo.updateInsight(n.id,v,S),R=If(E);return t({type:ft.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:ft.UPDATE_INSIGHT_ERROR,payload:un(S)}),null}},[n.id,t]),u=h.useCallback(async v=>{t({type:ft.DELETE_INSIGHT_START});try{await Zo.deleteInsight(n.id,v),t({type:ft.DELETE_INSIGHT_SUCCESS,payload:v}),Le({event:"insight_deleted",category:"Insights",action:"Delete",label:v}),Tt.success("Insight deleted")}catch(C){throw t({type:ft.DELETE_INSIGHT_ERROR,payload:un(C)}),C}},[n.id,t]),f=h.useCallback(async(v,C)=>{t({type:ft.UPDATE_INSIGHT_START});try{const S=await Zo.updateInsightTitle(n.id,v,{title:C}),E=If(S),R=e.list.find(_=>_.id===v)??e.activeInsight,j=R?{...E,template:R.template}:E;return t({type:ft.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:ft.UPDATE_INSIGHT_ERROR,payload:un(S)}),null}},[n.id,t,e.activeInsight,e.list]),m=h.useCallback(async v=>{t({type:ft.RUN_INSIGHT_START});try{const C=await Zo.startInsightExecution(n.id,v);t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:C.triggerId}})}catch(C){t({type:ft.RUN_INSIGHT_ERROR,payload:un(C)})}},[t,n.id]),y=h.useCallback(()=>{t({type:ft.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[t]),g=h.useCallback(v=>{t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:v}})},[t]),x=h.useCallback(async()=>{const v=e.activeInsight;if(!(!v||!n.id)&&!e.executionTriggerId&&!(!v.lastRun||XQ(v.lastRun.status)))try{const S=(await Zo.getInsightRunTriggers(n.id,v.id,{skipLoadingIndicator:!0})).data.sort((E,R)=>new Date(R.modifiedAt).getTime()-new Date(E.modifiedAt).getTime()).find(E=>!QQ(E.status));S!=null&&S.id&&(t({type:ft.RUN_INSIGHT_START}),t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:S.id}}))}catch(C){t({type:ft.RUN_INSIGHT_ERROR,payload:un(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:m,setTriggerId:g,resetTriggerId:y,ensureActiveRunPolling:x}}function Dde(){const{state:e}=TM(),t=h.useMemo(()=>e.list,[e.list]),n=h.useMemo(()=>e.listLoadingStatus===bt.LOADING,[e.listLoadingStatus]),r=h.useMemo(()=>e.listLoadingStatus===bt.LOADED||e.listLoadingStatus===bt.ERROR,[e.listLoadingStatus]),s=h.useMemo(()=>e.error,[e.error]),i=h.useMemo(()=>t.length>0,[t.length]);return{insights:t,isLoading:n,isLoaded:r,error:s,hasInsights:i}}function Ode(e,t){var n,r;switch(t.type){case ft.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:bt.LOADING,error:null};case ft.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:bt.LOADING,error:null};case ft.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:bt.LOADING,error:null};case ft.UPDATE_INSIGHT_START:return{...e,error:null};case ft.DELETE_INSIGHT_START:return{...e,listLoadingStatus:bt.LOADING,error:null};case ft.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:bt.LOADED,error:null};case ft.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:bt.LOADED,error:null};case ft.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:bt.LOADED,activeInsightLoadingStatus:bt.LOADED,error:null};case ft.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 ft.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 ft.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:bt.ERROR,error:t.payload};case ft.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:bt.ERROR,error:t.payload};case ft.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:bt.ERROR,activeInsightLoadingStatus:bt.ERROR,error:t.payload};case ft.UPDATE_INSIGHT_ERROR:case ft.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:bt.ERROR,error:t.payload};case ft.RUN_INSIGHT_START:return{...e,executionStatus:bt.LOADING,error:null};case ft.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case ft.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:bt.LOADED,executionTriggerId:null,error:null};case ft.CLEAR_ERROR:return{...e,error:null};default:return e}}function _M({children:e,initialState:t}){const[n,r]=h.useReducer(Ode,t??jde);return a.jsx(jM.Provider,{value:{state:n,dispatch:r},children:e})}function Ide(){return a.jsx(_M,{children:a.jsx(qb,{})})}function Mde({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 sa=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(sa||{}),Ns=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(Ns||{});const jN=(e,t,n=!1)=>{var c,u,f,m;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=g1(x);return{id:`log-${t.toString()}`,timestamp:vu(y),level:n?sa.ERROR:sa.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=g1(s[3]);return{id:`log-${t.toString()}`,timestamp:vu(s[1]),level:n?sa.ERROR:s[2],message:y.message,metadata:(f=y.metadata)!=null&&f.at?{...y.metadata,at:vu(y.metadata.at)}:y.metadata}}const i=g1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?sa.ERROR:sa.INFO,message:i.message,metadata:(m=i.metadata)!=null&&m.at?{...i.metadata,at:vu(i.metadata.at)}:i.metadata}},g1=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}},NM=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},kde=(e,t)=>{var i,c;let n="",r="";switch(e.type){case Pr.CONNECTOR:n=t??"",r="connector";break;case Pr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Pr.GOOGLE_SHEETS_EXPORT:case Pr.EMAIL:case Pr.SLACK:case Pr.MS_TEAMS:case Pr.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case Pr.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[AQ(`${e.triggerType} ${r} run`.trim()),n]},Lde=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)},Pde=e=>{const t=e.startedAt??e.createdAt;return Ry(t.toISOString())},Ude=e=>{const t=TN(e.startedAt),n=TN(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=_Q(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},TN=e=>e?Ry(e.toISOString()):"N/A";function zde({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),Dn.success("Data mart run cancelled successfully")}catch(g){Dn.error(g instanceof Error?g.message:"Failed to cancel data mart run")}},m=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(Ns.STRUCTURED)},className:`${m(e===Ns.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ns.RAW)},className:`${m(e===Ns.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ns.CONFIGURATION)},className:`${m(e===Ns.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==Ns.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(wc,{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(Ee,{variant:"destructive",size:"sm",onClick:y=>void f(y),children:[a.jsx(Zu,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(Ee,{variant:"outline",size:"sm",onClick:y=>{y.stopPropagation(),Lde(s)},className:"flex items-center gap-2",children:[a.jsx(VP,{className:"h-4 w-4"}),"JSON"]})]})]})}function Fde(e){switch(e){case sa.INFO:return a.jsx(Fr,{className:"h-3 w-3 text-blue-500"});case sa.WARNING:return a.jsx(xh,{className:"h-3 w-3 text-yellow-500"});case sa.ERROR:return a.jsx(ng,{className:"h-3 w-3 text-red-500"});case sa.SYSTEM:return a.jsx(gh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(Fr,{className:"text-muted-foreground h-3 w-3"})}}function Hde(e){switch(e){case sa.INFO:return"text-blue-600 dark:text-blue-400";case sa.WARNING:return"text-yellow-600 dark:text-yellow-400";case sa.ERROR:return"text-red-600 dark:text-red-400";case sa.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function $de(e){return e===$D.SCHEDULED?a.jsx(Xb,{size:18}):a.jsx(_A,{size:18})}function Vde({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:[Fde(r.level),a.jsx("span",{className:`text-xs font-medium ${Hde(r.level)}`,children:NM(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===sa.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 Fg=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Fg||{});function Hg({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",m=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return a.jsx("button",{onClick:y=>{s(e,t),y.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(oa,{className:"h-3 w-3"}):a.jsx(Ku,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(oa,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ku,{className:"h-3 w-3"}),"Copy"]})})}function Qy(){const[e,t]=h.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 Bde({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=Qy(),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(gh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx(Hg,{text:t.join(`
|
|
816
|
+
`),section:"errors",variant:Fg.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(Fr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx(Hg,{text:e.join(`
|
|
817
|
+
`),section:"logs",variant:Fg.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 Gde({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=Qy(),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(Hg,{text:JSON.stringify(e,null,2),section:"configuration",variant:Fg.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 ro=18;function qde({type:e,base64Icon:t}){switch(e){case Pr.CONNECTOR:return t?a.jsx(_c,{base64:t,size:ro}):a.jsx(lc,{className:"text-muted-foreground",size:ro});case Pr.GOOGLE_SHEETS_EXPORT:{const n=aa.getInfo(Ne.GOOGLE_SHEETS).icon;return a.jsx(n,{size:ro})}case Pr.LOOKER_STUDIO:{const n=aa.getInfo(Ne.LOOKER_STUDIO).icon;return a.jsx(n,{size:ro})}case Pr.EMAIL:{const n=aa.getInfo(Ne.EMAIL).icon;return a.jsx(n,{size:ro})}case Pr.SLACK:{const n=aa.getInfo(Ne.SLACK).icon;return a.jsx(n,{size:ro})}case Pr.MS_TEAMS:{const n=aa.getInfo(Ne.MS_TEAMS).icon;return a.jsx(n,{size:ro})}case Pr.GOOGLE_CHAT:{const n=aa.getInfo(Ne.GOOGLE_CHAT).icon;return a.jsx(n,{size:ro})}case Pr.INSIGHT:return a.jsx(Ji,{className:"text-brand-blue-500",size:ro});default:return a.jsx(lc,{className:"text-muted-foreground",size:ro})}}function Kde({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:y,handleCopy:g}=Qy(),x=h.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const j=e.logs.map((A,O)=>jN(A,O)),_=e.errors.map((A,O)=>jN(A,e.logs.length+O,!0));return[...j,..._].filter(A=>{const O=NM(A);return i===""||A.message.toLowerCase().includes(i.toLowerCase())||O.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=h.useCallback(()=>r===Ns.STRUCTURED?a.jsx(Vde,{logs:x}):r===Ns.RAW?a.jsx(Bde,{logs:e.logs,errors:e.errors}):a.jsx(Gde,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,x,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),C=Pde(e),S=Ude(e),[E,R]=kde(e,m==null?void 0:m.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(qde,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),a.jsxs(Et,{children:[a.jsx(wt,{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:[$de(e.triggerType),a.jsxs("span",{className:"inline-flex items-center",children:[E,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(XO,{userProjection:e.createdByUser})]}),R&&a.jsxs(a.Fragment,{children:[" • ",R]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Mde,{status:e.status}),a.jsx(_a,{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(Hg,{text:e.id,section:"run-id",onCopy:g,copiedSection:y,iconOnly:!0})]}),a.jsx(zde,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function Zde(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:i=[],isLoading:c}=vs(),[u,f]=h.useState(!1),[m,y]=h.useState(!0),[g,x]=h.useState(0),[v,C]=h.useState(null),[S,E]=h.useState(Ns.STRUCTURED),[R,j]=h.useState(""),_=h.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=h.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]);h.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=h.useMemo(()=>(t==null?void 0:t.definitionType)===$e.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(RM,{}):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(Kde,{run:T,isExpanded:v===T.id,onToggle:O,logViewType:S,setLogViewType:E,searchTerm:R,setSearchTerm:j,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},T.id)),m&&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(JU,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Yde=5e3,Wde=20;function Xde(){const{dataMart:e,getDataMartRuns:t}=Ss();return vC({enabled:!!(e!=null&&e.id),intervalMs:Yde,onTick:()=>{e!=null&&e.id&&t(e.id,Wde,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(ul,{collapsible:!1,name:"run-history",children:[a.jsx(go,{children:a.jsx(po,{icon:vU,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(yo,{children:a.jsx(Zde,{})})]})})}function Qde(){const e=AI(),{navigate:t}=mi(),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(C2,{children:a.jsx(r5,{children:a.jsx(Hne,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function AM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=zy();h.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(s2,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(o2,{children:[a.jsxs(i2,{children:[a.jsx(l2,{children:"Storage Details"}),a.jsx(c2,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(vX,{dataStorage:s,isLoading:i})})]})})}const Jde=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=h.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(Ee,{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(Gs,{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(CA,{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(ja,{}),a.jsxs(Nt,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},efe=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(xr,{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(xr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=Sl.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(xr,{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(Jde,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function tfe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(bA,{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(Ee,{variant:"outline",onClick:e,children:[a.jsx(ha,{className:"h-4 w-4"}),"New Storage"]})]})}function nfe({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,m]=h.useState([]),[y,g]=h.useState({}),[x,v]=h.useState(!1),[C]=h.useState(null),S=El({data:t,columns:[...e],getCoreRowModel:Cl(),getPaginationRowModel:Fh(),onSortingChange:i,getSortedRowModel:Nc(),onColumnFiltersChange:m,getFilteredRowModel:pd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),E=(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(AM,{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(wc,{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(Ee,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ha,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(wl,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:S.getHeaderGroups().map(j=>a.jsx(Hn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(Tl,{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(jl,{className:"dm-card-table-body",children:S.getRowModel().rows.length?S.getRowModel().rows.map(j=>a.jsx(Hn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const I=j.original.id;E(I,_)},children:j.getVisibleCells().map(_=>a.jsx($r,{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(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>{S.previousPage()},disabled:!S.getCanPreviousPage(),children:"Previous"}),a.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>{S.nextPage()},disabled:!S.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(tfe,{onOpenTypeDialog:r})})}const rfe=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=h.useState(e),[s,i]=h.useState(!1),{dataStorages:c,currentDataStorage:u,clearCurrentDataStorage:f,fetchDataStorages:m,getDataStorageById:y,deleteDataStorage:g,createDataStorage:x}=zy();h.useEffect(()=>{m()},[m]),h.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[C,S]=h.useState(!1),[E,R]=h.useState(!1),[j,_]=h.useState(null),[I,A]=h.useState(!1),[O,T]=h.useState(null),D=async H=>{i(!0);try{const oe=await x(H);v(),oe!=null&&oe.id&&(await y(oe.id),S(!0),i(!1))}catch(oe){console.error("Failed to create storage:",oe)}},k=H=>{T(H),A(!0)},B=()=>{A(!1),T(null)},G=async H=>{await y(H),S(!0)},Y=H=>{_(H),R(!0)},V=async()=>{if(j)try{await g(j),await m()}catch(H){console.error("Failed to delete storage:",H)}finally{R(!1),_(null)}},Z=async()=>{try{S(!1),await m()}catch(H){console.error("Failed to save storage:",H)}},F=()=>{S(!1),f()},M=c.map(H=>({id:H.id,title:H.title,type:H.type,createdAt:H.createdAt,modifiedAt:H.modifiedAt})),$=efe({onViewDetails:k,onEdit:G,onDelete:Y});return a.jsxs("div",{children:[a.jsx(nfe,{columns:$,data:M,onEdit:G,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(AM,{isOpen:I,onClose:B,id:O??""}),a.jsx(t6,{isOpen:n,onClose:v,onSelect:D,isCreatingDataStorage:s}),a.jsx(uI,{isOpen:C,onClose:F,dataStorage:u,onSaveSuccess:()=>void Z()}),a.jsx(br,{open:E,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:()=>{V()},onCancel:()=>{_(null)},variant:"destructive"})]})},afe=()=>{const[e,t]=h.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(C2,{children:a.jsx(rfe,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function sfe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(Wb,{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(Ee,{variant:"outline",onClick:e,children:[a.jsx(ha,{className:"h-4 w-4"}),"New Destination"]})]})}function ofe({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,m]=h.useState([]),[y,g]=h.useState({}),x=El({data:t,columns:[...e],getCoreRowModel:Cl(),getPaginationRowModel:Fh(),onSortingChange:i,getSortedRowModel:Nc(),onColumnFiltersChange:m,getFilteredRowModel:pd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),v=(S,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.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(wc,{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 E;return(E=x.getColumn("title"))==null?void 0:E.setFilterValue(S.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(Ee,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ha,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(wl,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:x.getHeaderGroups().map(S=>a.jsx(Hn,{className:"dm-card-table-header-row",children:S.headers.map(E=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.getSize())}%`},children:E.isPlaceholder?null:td(E.column.columnDef.header,E.getContext())},E.id))},S.id))}),a.jsx(jl,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(S=>a.jsx(Hn,{"data-state":S.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=S.original.id;v(R,E)},children:S.getVisibleCells().map(E=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${E.column.id==="actions"?"actions-cell":""} ${E.column.id==="createdAt"?"whitespace-nowrap":""}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},children:td(E.column.columnDef.cell,E.getContext())},E.id))},S.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),a.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(sfe,{onOpenTypeDialog:r})})}const ife=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=h.useState(!1),f=()=>{if(n&&xC(n)){const g=qS(n);navigator.clipboard.writeText(g),Tt.success("JSON Config copied to clipboard")}},m=t===Ne.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(Ee,{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(Gs,{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"})]}),m&&y&&a.jsxs(a.Fragment,{children:[a.jsx(ja,{}),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(N1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(ja,{}),a.jsxs(Nt,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},lfe=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(xr,{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(xr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=aa.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(xr,{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(ife,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}],cfe=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f}=zh(),m=h.useCallback(()=>{s(),g(!0),t==null||t()},[s,t]),[y,g]=h.useState(!1),[x,v]=h.useState(!1),[C,S]=h.useState(!1),[E,R]=h.useState(null),[j,_]=h.useState(null);h.useEffect(()=>{i()},[i]),h.useEffect(()=>{e&&m()},[e,m]);const I=async V=>{await c(V),g(!0)},A=V=>{R(V),v(!0)},O=V=>{_(V),S(!0)},T=async()=>{if(j)try{const V=await f(j);if(xC(V.credentials)){Tt.success("New JSON Config copied to clipboard");const Z=qS(V.credentials);navigator.clipboard.writeText(Z)}await i()}catch(V){console.error("Failed to rotate secret key:",V)}finally{S(!1),_(null)}},D=async()=>{if(E)try{await u(E),await i()}catch(V){console.error("Failed to delete destination:",V)}finally{v(!1),R(null)}},k=async()=>{try{g(!1),await i()}catch(V){console.error("Failed to save destination:",V)}},B=()=>{g(!1),s()},G=n.map(V=>({id:V.id,title:V.title,type:V.type,createdAt:V.createdAt,modifiedAt:V.modifiedAt,credentials:V.credentials})),Y=lfe({onEdit:I,onDelete:A,onRotateSecretKey:O});return a.jsxs("div",{children:[a.jsx(ofe,{columns:Y,data:G,onEdit:I,onDelete:A,onRotateSecretKey:O,onOpenTypeDialog:m}),a.jsx(CM,{isOpen:y,onClose:B,dataDestination:r,onSaveSuccess:()=>void k()}),a.jsx(br,{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(br,{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?"})]})})]})},ufe=()=>{const[e,t]=h.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(Uh,{children:a.jsx(cfe,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Ib({className:e,...t}){return a.jsx("div",{"data-slot":"empty",className:se("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 Mb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-header",className:se("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const dfe=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 kb({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:se(dfe({variant:t,className:e})),...n})}function Lb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-title",className:se("text-muted-foreground text-lg font-medium tracking-tight",e),...t})}function Pb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-description",className:se("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function ffe({className:e,...t}){return a.jsx("div",{"data-slot":"empty-content",className:se("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}const hfe=()=>{const e=Sc(),{createInsight:t,insightLoading:n}=bC(),r=()=>{(async()=>{const s=await t({title:"Untitled insight"});s&&e(s.id)})()};return a.jsxs(Ib,{children:[a.jsxs(Mb,{children:[a.jsx(kb,{variant:"icon",children:a.jsx(Ji,{})}),a.jsx(Lb,{children:"Create your first Insight"}),a.jsx(Pb,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(ffe,{children:a.jsxs(Ee,{variant:"outline",onClick:r,disabled:n,children:[a.jsx(ha,{className:"h-4 w-4"}),"New Insight"]})})]})};function mfe({id:e,onDelete:t}){const[n,r]=h.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(Ee,{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(Gs,{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(es,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})}const pfe=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(xr,{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(xr,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:iO(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(gd,{table:t}),cell:({row:t})=>a.jsx(mfe,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function gfe({items:e,onRowClick:t,onDelete:n}){const r=h.useMemo(()=>pfe({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:Cl(),getPaginationRowModel:Fh(),onSortingChange:i,getSortedRowModel:Nc(),getFilteredRowModel:pd(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),m=h.useCallback(()=>{f.previousPage()},[f]),y=h.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(wl,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(Rl,{className:"dm-card-table-header",children:f.getHeaderGroups().map(x=>a.jsx(Hn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(Tl,{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(jl,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((x,v)=>a.jsx(Hn,{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($r,{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(Hn,{children:a.jsx($r,{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(Ee,{variant:"outline",size:"sm",onClick:m,disabled:!f.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(Ee,{variant:"outline",size:"sm",onClick:y,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function yfe(){const e=Sc(),{fetchInsights:t,deleteInsight:n,createInsight:r,insightLoading:s}=bC(),{insights:i,isLoading:c,error:u,hasInsights:f}=Dde(),[m,y]=h.useState(null);h.useEffect(()=>{t()},[t]);const g=C=>{e(C)},x=()=>{(async()=>{const C=await r({title:"Untitled insight"});C&&e(C.id)})()},v=()=>{(async()=>{if(m)try{await n(m)}finally{y(null)}})()};return a.jsxs(ul,{children:[a.jsxs(go,{children:[a.jsx(po,{tooltip:"Manage and review your insights",icon:Ji,children:"Insights"}),f&&a.jsx(Wh,{children:a.jsxs(Ee,{variant:"outline","aria-label":"Add new insight",disabled:s,onClick:x,children:[a.jsx(ha,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})]}),a.jsxs(yo,{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(gfe,{items:i.map(C=>({id:C.id,title:C.title,lastRun:C.outputUpdatedAt})),onRowClick:g,onDelete:C=>{y(C)}}):a.jsx(hfe,{}),a.jsx(br,{open:!!m,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(ri,{})]})}function xfe(){return a.jsx(_M,{children:a.jsx(yfe,{})})}const Jy=h.createContext(null);Jy.displayName="PanelGroupContext";const Qn={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"},SC=10,ic=h.useLayoutEffect,_N=uh.useId,vfe=typeof _N=="function"?_N:()=>null;let bfe=0;function CC(e=null){const t=vfe(),n=h.useRef(e||t||null);return n.current===null&&(n.current=""+bfe++),e??n.current}function DM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:m,onExpand:y,onResize:g,order:x,style:v,tagName:C="div",...S}){const E=h.useContext(Jy);if(E===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:k,unregisterPanel:B}=E,G=CC(c),Y=h.useRef({callbacks:{onCollapse:m,onExpand:y,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:G,idIsFromProps:c!==void 0,order:x});h.useRef({didLogMissingDefaultSizeWarning:!1}),ic(()=>{const{callbacks:Z,constraints:F}=Y.current,M={...F};Y.current.id=G,Y.current.idIsFromProps=c!==void 0,Y.current.order=x,Z.onCollapse=m,Z.onExpand=y,Z.onResize=g,F.collapsedSize=n,F.collapsible=r,F.defaultSize=s,F.maxSize=u,F.minSize=f,(M.collapsedSize!==F.collapsedSize||M.collapsible!==F.collapsible||M.maxSize!==F.maxSize||M.minSize!==F.minSize)&&T(Y.current,M)}),ic(()=>{const Z=Y.current;return D(Z),()=>{B(Z)}},[x,G,D,B]),h.useImperativeHandle(i,()=>({collapse:()=>{R(Y.current)},expand:Z=>{j(Y.current,Z)},getId(){return G},getSize(){return _(Y.current)},isCollapsed(){return O(Y.current)},isExpanded(){return!O(Y.current)},resize:Z=>{k(Y.current,Z)}}),[R,j,_,O,G,k]);const V=I(Y.current,s);return h.createElement(C,{...S,children:e,className:t,id:G,style:{...V,...v},[Qn.groupId]:A,[Qn.panel]:"",[Qn.panelCollapsible]:r||void 0,[Qn.panelId]:G,[Qn.panelSize]:parseFloat(""+V.flexGrow).toFixed(1)})}const OM=h.forwardRef((e,t)=>h.createElement(DM,{...e,forwardedRef:t}));DM.displayName="Panel";OM.displayName="forwardRef(Panel)";let Ub=null,Xp=-1,Wi=null;function Sfe(e,t,n){const r=(t&PM)!==0,s=(t&UM)!==0,i=(t&zM)!==0,c=(t&FM)!==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 Cfe(){Wi!==null&&(document.head.removeChild(Wi),Ub=null,Wi=null,Xp=-1)}function y1(e,t,n){var r,s;const i=Sfe(e,t);if(Ub!==i){if(Ub=i,Wi===null&&(Wi=document.createElement("style"),document.head.appendChild(Wi)),Xp>=0){var c;(c=Wi.sheet)===null||c===void 0||c.removeRule(Xp)}Xp=(r=(s=Wi.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function IM(e){return e.type==="keydown"}function MM(e){return e.type.startsWith("pointer")}function kM(e){return e.type.startsWith("mouse")}function ex(e){if(MM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(kM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Efe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function wfe(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 Rfe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:DN(e),b:DN(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:AN(NN(n.a)),b:AN(NN(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 jfe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tfe(e){var t;const n=getComputedStyle((t=LM(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function _fe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Tfe(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"||jfe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function NN(e){let t=e.length;for(;t--;){const n=e[t];if(Ot(n,"Missing node"),_fe(n))return n}return null}function AN(e){return e&&Number(getComputedStyle(e).zIndex)||0}function DN(e){const t=[];for(;e;)t.push(e),e=LM(e);return t}function LM(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const PM=1,UM=2,zM=4,FM=8,Nfe=Efe()==="coarse";let Ps=[],Gu=!1,Xi=new Map,tx=new Map;const lh=new Set;function Afe(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=Xi.get(c))!==null&&i!==void 0?i:0;return Xi.set(c,f+1),lh.add(u),$g(),function(){var y;tx.delete(e),lh.delete(u);const g=(y=Xi.get(c))!==null&&y!==void 0?y:1;if(Xi.set(c,g-1),$g(),g===1&&Xi.delete(c),Ps.includes(u)){const x=Ps.indexOf(u);x>=0&&Ps.splice(x,1),nx(),s("up",!0,null)}}}function Dfe(e){const{target:t}=e,{x:n,y:r}=ex(e);Gu=!0,EC({target:t,x:n,y:r}),$g(),Ps.length>0&&(Vg("down",e),nx(),e.preventDefault(),HM(t)||e.stopImmediatePropagation())}function x1(e){const{x:t,y:n}=ex(e);if(Gu&&e.type!=="pointerleave"&&e.buttons===0&&(Gu=!1,Vg("up",e)),!Gu){const{target:r}=e;EC({target:r,x:t,y:n})}Vg("move",e),nx(),Ps.length>0&&e.preventDefault()}function v1(e){const{target:t}=e,{x:n,y:r}=ex(e);tx.clear(),Gu=!1,Ps.length>0&&(e.preventDefault(),HM(t)||e.stopImmediatePropagation()),Vg("up",e),EC({target:t,x:n,y:r}),nx(),$g()}function HM(e){let t=e;for(;t;){if(t.hasAttribute(Qn.resizeHandle))return!0;t=t.parentElement}return!1}function EC({target:e,x:t,y:n}){Ps.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),lh.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:m,right:y,top:g}=u,x=Nfe?c.coarse:c.fine;if(t>=m-x&&t<=y+x&&n>=g-x&&n<=f+x){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Rfe(r,i)>0){let C=r,S=!1;for(;C&&!C.contains(i);){if(wfe(C.getBoundingClientRect(),u)){S=!0;break}C=C.parentElement}if(S)return}Ps.push(s)}})}function b1(e,t){tx.set(e,t)}function nx(){let e=!1,t=!1;Ps.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;tx.forEach(r=>{n|=r}),e&&t?y1("intersection",n):e?y1("horizontal",n):t?y1("vertical",n):Cfe()}let S1;function $g(){var e;(e=S1)===null||e===void 0||e.abort(),S1=new AbortController;const t={capture:!0,signal:S1.signal};lh.size&&(Gu?(Ps.length>0&&Xi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",v1,t),s.addEventListener("pointerleave",x1,t),s.addEventListener("pointermove",x1,t))}),Xi.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",v1,t),s.addEventListener("pointercancel",v1,t)})):Xi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",Dfe,t),s.addEventListener("pointermove",x1,t))}))}function Vg(e,t){lh.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ps.includes(n);r(e,s,t)})}function Ofe(){const[e,t]=h.useState(0);return h.useCallback(()=>t(n=>n+1),[])}function Ot(e,t){if(!e)throw console.error(t),Error(t)}function vc(e,t,n=SC){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Qo(e,t,n=SC){return vc(e,t,n)===0}function $a(e,t,n){return vc(e,t,n)===0}function Ife(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(!$a(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(SC)),n}function Mf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if($a(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 m=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 E=t[g];if(Ot(E!=null,`Previous layout not found for panel index ${g}`),$a(E,v)){const R=S-E;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 E=t[g];if(Ot(E!=null,`Previous layout not found for panel index ${g}`),$a(E,S)){const R=E-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(m),C=t[x];Ot(C!=null,`Previous layout not found for panel index ${x}`);const S=C-v,E=Mu({panelConstraints:n,panelIndex:x,size:S});if(!$a(C,E)&&(m+=C-E,c[x]=E,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(Ife(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+m,C=Mu({panelConstraints:n,panelIndex:g,size:v});if(c[g]=C,!$a(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($a(j,I)||(S-=I-j,c[R]=I),$a(S,0))break;e>0?R--:R++}}}const y=c.reduce((g,x)=>x+g,0);return $a(y,100)?c:s}function Mfe({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),m=Math.max(r,100-c),y=e[u];return{valueMax:f,valueMin:m,valueNow:y}}function ch(e,t=document){return Array.from(t.querySelectorAll(`[${Qn.resizeHandleId}][data-panel-group-id="${e}"]`))}function $M(e,t,n=document){const s=ch(e,n).findIndex(i=>i.getAttribute(Qn.resizeHandleId)===t);return s??null}function VM(e,t,n){const r=$M(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function kfe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function BM(e,t=document){if(kfe(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function rx(e,t=document){const n=t.querySelector(`[${Qn.resizeHandleId}="${e}"]`);return n||null}function Lfe(e,t,n,r=document){var s,i,c,u;const f=rx(t,r),m=ch(e,r),y=f?m.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 Pfe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){h.useRef({didWarnAboutMissingResizeHandle:!1}),ic(()=>{if(!i)return;const u=ch(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:m,valueMin:y,valueNow:g}=Mfe({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(m)),x.setAttribute("aria-valuemin",""+Math.round(y)),x.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{u.forEach((f,m)=>{f.removeAttribute("aria-controls"),f.removeAttribute("aria-valuemax"),f.removeAttribute("aria-valuemin"),f.removeAttribute("aria-valuenow")})}},[n,r,s,i]),h.useEffect(()=>{if(!i)return;const u=t.current;Ot(u,"Eager values not found");const{panelDataArray:f}=u,m=BM(n,i);Ot(m!=null,`No group found for id "${n}"`);const y=ch(n,i);Ot(y,`No resize handles found for group id "${n}"`);const g=y.map(x=>{const v=x.getAttribute(Qn.resizeHandleId);Ot(v,"Resize handle element has no handle id attribute");const[C,S]=Lfe(n,v,f,i);if(C==null||S==null)return()=>{};const E=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=Mf({delta:$a(I,A)?T-A:A-I,initialLayout:r,panelConstraints:f.map(k=>k.constraints),pivotIndices:VM(n,v,i),prevLayout:r,trigger:"keyboard"});r!==D&&c(D)}}break}}};return x.addEventListener("keydown",E),()=>{x.removeEventListener("keydown",E)}});return()=>{g.forEach(x=>x())}},[i,e,t,n,r,s,c])}function ON(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 GM(e,t){const n=e==="horizontal",{x:r,y:s}=ex(t);return n?r:s}function Ufe(e,t,n,r,s){const i=n==="horizontal",c=rx(t,s);Ot(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(Qn.groupId);Ot(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const m=GM(n,e),y=BM(u,s);Ot(y,`No group element found for id "${u}"`);const g=y.getBoundingClientRect(),x=i?g.width:g.height;return(m-f)/x*100}function zfe(e,t,n,r,s,i){if(IM(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:Ufe(e,t,n,r,i)}function Ffe({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,m=s/f;r++,t[i]=m,s-=m}return t}function Eu(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:m=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||Qo(g,m))&&!Qo(r,m)&&v(),x&&(g==null||!Qo(g,m))&&Qo(r,m)&&x())}})}function Pp(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 Hfe({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 $fe(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function IN(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 qM(e){return`react-resizable-panels:${e}`}function KM(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 ZM(e,t){try{const n=qM(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function Vfe(e,t,n){var r,s;const i=(r=ZM(e,n))!==null&&r!==void 0?r:{},c=KM(t);return(s=i[c])!==null&&s!==void 0?s:null}function Bfe(e,t,n,r,s){var i;const c=qM(e),u=KM(t),f=(i=ZM(e,s))!==null&&i!==void 0?i:{};f[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(c,JSON.stringify(f))}catch(m){console.error(m)}}function MN({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(!$a(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(!$a(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,$a(s,0)))break}return n}const Gfe=100,kf={getItem:e=>(IN(kf),kf.getItem(e)),setItem:(e,t)=>{IN(kf),kf.setItem(e,t)}},kN={};function YM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=kf,style:m,tagName:y="div",...g}){const x=CC(i),v=h.useRef(null),[C,S]=h.useState(null),[E,R]=h.useState([]),j=Ofe(),_=h.useRef({}),I=h.useRef(new Map),A=h.useRef(0),O=h.useRef({autoSaveId:e,direction:r,dragState:C,id:x,keyboardResizeBy:u,onLayout:c,storage:f}),T=h.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});h.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),h.useImperativeHandle(s,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:z}=T.current;return z},setLayout:z=>{const{onLayout:X}=O.current,{layout:W,panelDataArray:ae}=T.current,J=MN({layout:z,panelConstraints:ae.map(le=>le.constraints)});ON(W,J)||(R(J),T.current.layout=J,X&&X(J),Eu(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}),Pfe({committedValuesRef:O,eagerValuesRef:T,groupId:x,layout:E,panelDataArray:T.current.panelDataArray,setLayout:R,panelGroupElement:v.current}),h.useEffect(()=>{const{panelDataArray:z}=T.current;if(e){if(E.length===0||E.length!==z.length)return;let X=kN[e];X==null&&(X=$fe(Bfe,Gfe),kN[e]=X);const W=[...z],ae=new Map(I.current);X(e,W,ae,E,f)}},[e,E,f]),h.useEffect(()=>{});const D=h.useCallback(z=>{const{onLayout:X}=O.current,{layout:W,panelDataArray:ae}=T.current;if(z.constraints.collapsible){const J=ae.map(Ve=>Ve.constraints),{collapsedSize:le=0,panelSize:ye,pivotIndices:Ce}=Xl(ae,z,W);if(Ot(ye!=null,`Panel size not found for panel "${z.id}"`),!Qo(ye,le)){I.current.set(z.id,ye);const De=Du(ae,z)===ae.length-1?ye-le:le-ye,et=Mf({delta:De,initialLayout:W,panelConstraints:J,pivotIndices:Ce,prevLayout:W,trigger:"imperative-api"});Pp(W,et)||(R(et),T.current.layout=et,X&&X(et),Eu(ae,et,_.current))}}},[]),k=h.useCallback((z,X)=>{const{onLayout:W}=O.current,{layout:ae,panelDataArray:J}=T.current;if(z.constraints.collapsible){const le=J.map(rt=>rt.constraints),{collapsedSize:ye=0,panelSize:Ce=0,minSize:Ve=0,pivotIndices:De}=Xl(J,z,ae),et=X??Ve;if(Qo(Ce,ye)){const rt=I.current.get(z.id),dn=rt!=null&&rt>=et?rt:et,On=Du(J,z)===J.length-1?Ce-dn:dn-Ce,yn=Mf({delta:On,initialLayout:ae,panelConstraints:le,pivotIndices:De,prevLayout:ae,trigger:"imperative-api"});Pp(ae,yn)||(R(yn),T.current.layout=yn,W&&W(yn),Eu(J,yn,_.current))}}},[]),B=h.useCallback(z=>{const{layout:X,panelDataArray:W}=T.current,{panelSize:ae}=Xl(W,z,X);return Ot(ae!=null,`Panel size not found for panel "${z.id}"`),ae},[]),G=h.useCallback((z,X)=>{const{panelDataArray:W}=T.current,ae=Du(W,z);return Hfe({defaultSize:X,dragState:C,layout:E,panelData:W,panelIndex:ae})},[C,E]),Y=h.useCallback(z=>{const{layout:X,panelDataArray:W}=T.current,{collapsedSize:ae=0,collapsible:J,panelSize:le}=Xl(W,z,X);return Ot(le!=null,`Panel size not found for panel "${z.id}"`),J===!0&&Qo(le,ae)},[]),V=h.useCallback(z=>{const{layout:X,panelDataArray:W}=T.current,{collapsedSize:ae=0,collapsible:J,panelSize:le}=Xl(W,z,X);return Ot(le!=null,`Panel size not found for panel "${z.id}"`),!J||vc(le,ae)>0},[]),Z=h.useCallback(z=>{const{panelDataArray:X}=T.current;X.push(z),X.sort((W,ae)=>{const J=W.order,le=ae.order;return J==null&&le==null?0:J==null?-1:le==null?1:J-le}),T.current.panelDataArrayChanged=!0,j()},[j]);ic(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:z,onLayout:X,storage:W}=O.current,{layout:ae,panelDataArray:J}=T.current;let le=null;if(z){const Ce=Vfe(z,J,W);Ce&&(I.current=new Map(Object.entries(Ce.expandToSizes)),le=Ce.layout)}le==null&&(le=Ffe({panelDataArray:J}));const ye=MN({layout:le,panelConstraints:J.map(Ce=>Ce.constraints)});ON(ae,ye)||(R(ye),T.current.layout=ye,X&&X(ye),Eu(J,ye,_.current))}}),ic(()=>{const z=T.current;return()=>{z.layout=[]}},[]);const F=h.useCallback(z=>{let X=!1;const W=v.current;return W&&window.getComputedStyle(W,null).getPropertyValue("direction")==="rtl"&&(X=!0),function(J){J.preventDefault();const le=v.current;if(!le)return()=>null;const{direction:ye,dragState:Ce,id:Ve,keyboardResizeBy:De,onLayout:et}=O.current,{layout:rt,panelDataArray:dn}=T.current,{initialLayout:zt}=Ce??{},On=VM(Ve,z,le);let yn=zfe(J,z,ye,Ce,De,le);const Me=ye==="horizontal";Me&&X&&(yn=-yn);const q=dn.map(Oe=>Oe.constraints),ne=Mf({delta:yn,initialLayout:zt??rt,panelConstraints:q,pivotIndices:On,prevLayout:rt,trigger:IM(J)?"keyboard":"mouse-or-touch"}),ce=!Pp(rt,ne);(MM(J)||kM(J))&&A.current!=yn&&(A.current=yn,!ce&&yn!==0?Me?b1(z,yn<0?PM:UM):b1(z,yn<0?zM:FM):b1(z,0)),ce&&(R(ne),T.current.layout=ne,et&&et(ne),Eu(dn,ne,_.current))}},[]),M=h.useCallback((z,X)=>{const{onLayout:W}=O.current,{layout:ae,panelDataArray:J}=T.current,le=J.map(rt=>rt.constraints),{panelSize:ye,pivotIndices:Ce}=Xl(J,z,ae);Ot(ye!=null,`Panel size not found for panel "${z.id}"`);const De=Du(J,z)===J.length-1?ye-X:X-ye,et=Mf({delta:De,initialLayout:ae,panelConstraints:le,pivotIndices:Ce,prevLayout:ae,trigger:"imperative-api"});Pp(ae,et)||(R(et),T.current.layout=et,W&&W(et),Eu(J,et,_.current))},[]),$=h.useCallback((z,X)=>{const{layout:W,panelDataArray:ae}=T.current,{collapsedSize:J=0,collapsible:le}=X,{collapsedSize:ye=0,collapsible:Ce,maxSize:Ve=100,minSize:De=0}=z.constraints,{panelSize:et}=Xl(ae,z,W);et!=null&&(le&&Ce&&Qo(et,J)?Qo(J,ye)||M(z,ye):et<De?M(z,De):et>Ve&&M(z,Ve))},[M]),H=h.useCallback((z,X)=>{const{direction:W}=O.current,{layout:ae}=T.current;if(!v.current)return;const J=rx(z,v.current);Ot(J,`Drag handle element not found for id "${z}"`);const le=GM(W,X);S({dragHandleId:z,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:le,initialLayout:ae})},[]),oe=h.useCallback(()=>{S(null)},[]),ge=h.useCallback(z=>{const{panelDataArray:X}=T.current,W=Du(X,z);W>=0&&(X.splice(W,1),delete _.current[z.id],T.current.panelDataArrayChanged=!0,j())},[j]),P=h.useMemo(()=>({collapsePanel:D,direction:r,dragState:C,expandPanel:k,getPanelSize:B,getPanelStyle:G,groupId:x,isPanelCollapsed:Y,isPanelExpanded:V,reevaluatePanelConstraints:$,registerPanel:Z,registerResizeHandle:F,resizePanel:M,startDragging:H,stopDragging:oe,unregisterPanel:ge,panelGroupElement:v.current}),[D,C,r,k,B,G,x,Y,V,$,Z,F,M,H,oe,ge]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return h.createElement(Jy.Provider,{value:P},h.createElement(y,{...g,children:t,className:n,id:i,ref:v,style:{...U,...m},[Qn.group]:"",[Qn.groupDirection]:r,[Qn.groupId]:x}))}const WM=h.forwardRef((e,t)=>h.createElement(YM,{...e,forwardedRef:t}));YM.displayName="PanelGroup";WM.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 qfe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){h.useEffect(()=>{if(e||n==null||r==null)return;const s=rx(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(Qn.groupId);Ot(u,`No group element found for id "${u}"`);const f=ch(u,r),m=$M(u,t,r);Ot(m!==null,`No resize element found for id "${t}"`);const y=c.shiftKey?m>0?m-1:f.length-1:m+1<f.length?m+1:0;f[y].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function XM({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:m,onPointerUp:y,style:g={},tabIndex:x=0,tagName:v="div",...C}){var S,E;const R=h.useRef(null),j=h.useRef({onClick:c,onDragging:u,onPointerDown:m,onPointerUp:y});h.useEffect(()=>{j.current.onClick=c,j.current.onDragging=u,j.current.onPointerDown=m,j.current.onPointerUp=y});const _=h.useContext(Jy);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:k}=_,B=CC(s),[G,Y]=h.useState("inactive"),[V,Z]=h.useState(!1),[F,M]=h.useState(null),$=h.useRef({state:G});ic(()=>{$.current.state=G}),h.useEffect(()=>{if(n)M(null);else{const P=O(B);M(()=>P)}},[n,B,O]);const H=(S=r==null?void 0:r.coarse)!==null&&S!==void 0?S:15,oe=(E=r==null?void 0:r.fine)!==null&&E!==void 0?E:5;h.useEffect(()=>{if(n||F==null)return;const P=R.current;Ot(P,"Element ref not attached");let U=!1;return Afe(B,P,I,{coarse:H,fine:oe},(X,W,ae)=>{if(!W){Y("inactive");return}switch(X){case"down":{Y("drag"),U=!1,Ot(ae,'Expected event to be defined for "down" action'),T(B,ae);const{onDragging:J,onPointerDown:le}=j.current;J==null||J(!0),le==null||le();break}case"move":{const{state:J}=$.current;U=!0,J!=="drag"&&Y("hover"),Ot(ae,'Expected event to be defined for "move" action'),F(ae);break}case"up":{Y("hover"),D();const{onClick:J,onDragging:le,onPointerUp:ye}=j.current;le==null||le(!1),ye==null||ye(),U||J==null||J();break}}})},[H,I,n,oe,O,B,F,T,D]),qfe({disabled:n,handleId:B,resizeHandler:F,panelGroupElement:k});const ge={touchAction:"none",userSelect:"none"};return h.createElement(v,{...C,children:e,className:t,id:s,onBlur:()=>{Z(!1),i==null||i()},onFocus:()=>{Z(!0),f==null||f()},ref:R,role:"separator",style:{...ge,...g},tabIndex:x,[Qn.groupDirection]:I,[Qn.groupId]:A,[Qn.resizeHandle]:"",[Qn.resizeHandleActive]:G==="drag"?"pointer":V?"keyboard":void 0,[Qn.resizeHandleEnabled]:!n,[Qn.resizeHandleId]:B,[Qn.resizeHandleState]:G})}XM.displayName="PanelResizeHandle";function Kfe({className:e,...t}){return a.jsx(WM,{"data-slot":"resizable-panel-group",className:se("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function LN({...e}){return a.jsx(OM,{"data-slot":"resizable-panel",...e})}function Zfe({withHandle:e,className:t,...n}){return a.jsx(XM,{"data-slot":"resizable-handle",className:se("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(EA,{className:"size-2.5"})})})}function Yfe({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=h.useMemo(()=>{const x=co.get(e);if(x!==null){const v=Number(x);if(!Number.isNaN(v))return C1(v,.1,.9)}return C1(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=C1(v/100,.1,.9);co.set(e,C)}return a.jsxs(Kfe,{direction:"horizontal",onLayout:g,className:se("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(LN,{defaultSize:u,minSize:y,className:"overflow-auto",children:t}),a.jsx(Zfe,{withHandle:!0}),a.jsx(LN,{defaultSize:f,minSize:y,className:"overflow-auto",children:n})]})}function C1(e,t,n){return Math.max(t,Math.min(n,e))}const Wfe=[{label:"prompt",insertText:`{{#prompt}}
|
|
818
|
+
$0
|
|
819
|
+
{{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],PN=new Set;function Xfe(e,t){PN.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),m={startLineNumber:s,endLineNumber:s,startColumn:u+2,endColumn:i},y=[];return Wfe.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:m,additionalTextEdits:[{range:{startLineNumber:s,endLineNumber:s,startColumn:u+1,endColumn:u+2},text:""}]})}),{suggestions:y}}return{suggestions:[]}}}),PN.add(t))}const Qfe=(e,t)=>{Xfe(t,"markdown")};function UN({value:e,onChange:t,height:n="60vh",className:r,readOnly:s}){const{resolvedTheme:i}=md();return a.jsx("div",{className:r,children:a.jsx(P2,{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 Jfe({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function ehe({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:se("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function zN({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:se("inline-flex items-center gap-1.5",e),...t})}function the({asChild:e,className:t,...n}){const r=e?ph:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:se("hover:text-foreground transition-colors",t),...n})}function nhe({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:se("[&>svg]:size-3.5",t),...n,children:e??a.jsx(_a,{})})}function rhe({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=h.useCallback(async c=>{if(!(!e||!t))try{const u=await Zo.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);vC({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const ahe=rn({title:Dt().min(1,"Title cannot be empty"),template:Dt().optional()}),she=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:m,dirtyFields:y}}=Ro({resolver:yi(ahe),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),g=s("title"),x=s("template"),v=!!y.template;h.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=h.useCallback(async E=>{if(!e)return;const R=E.trim();f("title",R,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,R),u("title",{defaultValue:R})},[e,u,f,n]),S=h.useCallback(async E=>{if(!e)return;const R={title:E.title.trim(),template:E.template&&E.template.trim().length>0?E.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:m,titleValue:g,templateValue:x,handleTitleUpdate:C,onSubmit:S}},E1=[{icon:Ji,text:"Initializing intelligence..."},{icon:bA,text:"Connecting to data sources..."},{icon:FU,text:"Mapping data relationships..."},{icon:sU,text:"Exploring dataset structure..."},{icon:iz,text:"Scanning available fields..."},{icon:mz,text:"Analyzing data patterns..."},{icon:tz,text:"Selecting optimal insight path..."},{icon:AA,text:"Preparing aggregated tables..."},{icon:EU,text:"Building visual model..."},{icon:XP,text:"Finalizing insight output..."},{icon:bz,text:"Validating field consistency..."},{icon:sz,text:"Checking for missing values..."},{icon:rU,text:"Detecting anomalies in data..."},{icon:RU,text:"Cross-referencing data sources..."},{icon:gz,text:"Verifying aggregation results..."},{icon:yU,text:"Ensuring data relationships are correct..."},{icon:pP,text:"Refining visual model parameters..."},{icon:fU,text:"Confirming data integrity..."},{icon:JP,text:"Preparing final output for insights..."},{icon:lU,text:"Performing final quality checks..."}],ohe=()=>{const[e,t]=h.useState(0);h.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%E1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=E1[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:E1[e].text},`${String(e)}-text`)]})})};function ihe(){const e=Sc(),{insightId:t}=Yg(),n=h.useMemo(()=>"insight_details_split",[]),[r,s]=h.useState(!1),{dataMart:i}=Ss(),{activeInsight:c,insightLoading:u,isRunning:f,triggerId:m,updateInsight:y,updateInsightTitle:g,getInsight:x,runInsight:v,deleteInsight:C,resetTriggerId:S,ensureActiveRunPolling:E}=bC(),{handleSubmit:R,setValue:j,isTemplateDirty:_,isSubmitting:I,titleValue:A,templateValue:O,handleTitleUpdate:T,onSubmit:D}=she(c,y,g),k=vM({markdown:(c==null?void 0:c.output)??"",enabled:!!(c!=null&&c.output),debounceMs:0}),[B,G]=h.useState(!1),[Y,V]=h.useState(!1),{copyToClipboard:Z}=Qy(),F=h.useCallback(async()=>{const ge=(c==null?void 0:c.output)??"";if(!ge)return;await Z(ge,"insight-output")?Tt.success("Markdown copied to clipboard"):Tt.error("Failed to copy to clipboard")},[c==null?void 0:c.output,Z]);h.useEffect(()=>{const ge=P=>{(P.metaKey||P.ctrlKey)&&P.shiftKey&&(P.key==="M"||P.key==="m")&&(P.preventDefault(),G(z=>!z))};return window.addEventListener("keydown",ge),()=>{window.removeEventListener("keydown",ge)}},[]);const M=h.useCallback(async()=>{c&&(await C(c.id),e(".."))},[c,C,e]),$=!u&&!(c!=null&&c.output);h.useEffect(()=>{t&&x(t)},[t,x]),h.useEffect(()=>{c!=null&&c.id&&E()},[c==null?void 0:c.id,E]),rhe({triggerId:m,dataMartId:(i==null?void 0:i.id)??"",insightId:(c==null?void 0:c.id)??"",onRunFinished:h.useCallback(()=>{S(),c!=null&&c.id&&x(c.id)},[c==null?void 0:c.id,x,S]),onError:h.useCallback(()=>{S()},[S])});const H=h.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]),oe=h.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(Ib,{children:[a.jsx(Mb,{children:a.jsx(kb,{variant:"icon",children:a.jsx(Ji,{})})}),a.jsx(Lb,{children:"Insight not found"}),a.jsx(Pb,{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(Jfe,{children:a.jsxs(ehe,{children:[a.jsx(zN,{children:a.jsx(the,{asChild:!0,children:a.jsx(Wr,{to:"..",children:"Insights"})})}),a.jsx(nhe,{}),a.jsx(zN,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(n6,{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(Ee,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(SA,{className:"h-4 w-4"})})}),a.jsx(Ar,{align:"end",children:a.jsxs(Nt,{onClick:()=>{s(!0)},className:"text-destructive",children:[a.jsx(es,{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(Yfe,{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(UN,{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(Ee,{variant:"default",size:"default",disabled:I||f,onClick:()=>void(_?oe():H()),children:f?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Ec,{className:"h-3 w-3 animate-spin"})," Running…"]}):_?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Ji,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Ji,{})," Run Insight"]})}),a.jsxs(Et,{delayDuration:1500,children:[a.jsx(wt,{asChild:!0,children:a.jsxs(Ee,{variant:"outline",size:"default",onClick:()=>{V(!0)},className:"gap-2",children:[a.jsx(uz,{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(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(Hs,{date:c.outputUpdatedAt})})}),a.jsx(Rt,{side:"top",children:a.jsxs("p",{children:["Last run: ",iO(c.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:f?a.jsx(ohe,{}):$?a.jsx(Ib,{className:"h-full",children:a.jsxs(Mb,{children:[a.jsx(kb,{variant:"icon",children:a.jsx(Ji,{})}),a.jsx(Lb,{children:"Even data needs a little spark"}),a.jsx(Pb,{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:B?a.jsx(UN,{value:c.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0}):k.error?a.jsx("div",{className:"text-destructive",children:k.error}):a.jsxs(a.Fragment,{children:[a.jsx(xM,{html:k.html,loading:k.loading,error:k.error,height:"100%"}),!!c.output&&!k.loading&&!k.error&&a.jsx("div",{className:"absolute top-2 right-2 z-10",children:a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(wt,{asChild:!0,children:a.jsx(Ee,{variant:"outline",size:"icon",className:"h-8 w-8","aria-label":"Copy markdown to clipboard",onClick:()=>void F(),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(br,{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(BS,{children:a.jsx(wM,{isOpen:Y,onClose:()=>{V(!1)},mode:_n.CREATE,preSelectedDestination:null,prefill:{title:c.title||A||"New report",subject:`Insight: ${c.title||A||""}`.trim(),messageTemplate:O??""},allowedDestinationTypes:[Ne.EMAIL,Ne.SLACK,Ne.MS_TEAMS,Ne.GOOGLE_CHAT]})})]})}const lhe=[{path:"overview",element:a.jsx(RN,{})},{path:"data-setup",element:a.jsx(rue,{})},{path:"insights",element:a.jsx(Ide,{}),children:[{index:!0,element:a.jsx(xfe,{})},{path:":insightId",element:a.jsx(ihe,{})}]},{path:"reports",element:a.jsx(wde,{})},{path:"triggers",element:a.jsx(Rde,{})},{path:"run-history",element:a.jsx(Xde,{})},{index:!0,element:a.jsx(RN,{})}];function che({to:e="/data-marts"}){const{user:t,status:n}=hi();if(n===Zr.LOADING)return a.jsx(Uu,{fullScreen:!0,message:"Loading..."});if(n===Zr.UNAUTHENTICATED||!t)return a.jsx(Uu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=hg(t.projectId,e);return a.jsx(lL,{to:r,replace:!0})}return a.jsx(Uu,{fullScreen:!0,message:"Project not found"})}const uhe=[{index:!0,path:"/",element:a.jsx(che,{})},{path:"/ui/:projectId",element:a.jsx(eX,{}),children:[{path:"about",element:a.jsx(tX,{})},{index:!0,element:a.jsx(S_,{})},{path:"data-marts",element:a.jsx(S_,{})},{path:"data-marts/create",element:a.jsx(Qde,{})},{path:"data-marts/:id",element:a.jsx(Wce,{}),children:lhe},{path:"data-storages",element:a.jsx(afe,{})},{path:"data-destinations",element:a.jsx(ufe,{})},{path:"*",element:a.jsx(p_,{})}]},{path:"*",element:a.jsx(p_,{})}],QM="gtm-script",JM="gtm-noscript",dhe="GOOGLE_TAG_MANAGER_CONTAINER_ID";function fhe(){return!!document.getElementById(QM)}function hhe(e){const t=document.createElement("script");return t.id=QM,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 mhe(e){const t=document.createElement("noscript");return t.id=JM,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 phe(e){if(fhe())return;const t=hhe(e);document.head.prepend(t)}function ghe(e){if(document.getElementById(JM))return;const t=mhe(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function yhe(e){try{phe(e),ghe(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function xhe(e){return(e[dhe]??"").trim()}function vhe(){const{flags:e,callState:t}=Dh();return h.useEffect(()=>{if(t!==bt.LOADED||!e)return;const n=xhe(e);n&&yhe(n)},[e,t]),null}const bhe="INTERCOM_APP_ID",e8="intercom-widget-script";function She(){return!!document.getElementById(e8)}function Che(e,t){if(She()){t();return}const n=document.createElement("script");n.id=e8,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Ehe(){try{return(await Ea.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function whe(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 Rhe(e,t){if(!t)return;const n=whe(e,t),r=await Ehe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function jhe(){const{flags:e,callState:t}=Dh(),{user:n}=hi(),r=h.useRef(!1);return h.useEffect(()=>{if(r.current||t!==bt.LOADED||!e)return;const s=e[bhe],i=(typeof s=="string"?s:"").trim();i&&Che(i,()=>{Rhe(i,n).then(()=>{r.current=!0,ah()})})},[e,t,n]),null}function The({initialState:e,reducer:t,children:n}){const[r,s]=h.useReducer(t,e),i=h.useMemo(()=>s,[s]);return a.jsx(V3.Provider,{value:r,children:a.jsx(B3.Provider,{value:i,children:n})})}function _he(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 FN={id:null,title:null},t8="project/SET_PROJECT",Nhe="project/CLEAR_PROJECT";function Ahe(e){return{type:t8,payload:e}}function Dhe(e=FN,t){switch(t.type){case t8:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Nhe:return{...FN};default:return e}}class Ohe extends bl{getFlags(){return this.get("/flags")}}const Ihe=new Ohe(""),n8={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"},Mhe={data:{...n8},callState:bt.IDLE},r8="settings/LOAD_FLAGS",a8="settings/LOAD_FLAGS_SUCCESS",s8="settings/LOAD_FLAGS_ERROR";function khe(){return{type:r8}}function Lhe(e){return{type:a8,payload:e}}function Phe(e){return{type:s8,payload:e}}function Uhe(e=Mhe,t){switch(t.type){case r8:return{...e,callState:bt.LOADING,error:void 0};case a8:return{...e,callState:bt.LOADED,data:{...n8,...t.payload}};case s8:return{...e,callState:bt.ERROR,error:t.payload};default:return e}}async function zhe(e){try{e(khe());const t=await Ihe.getFlags();e(Lhe(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Phe(n))}}const o8="app/SET_READY";function Fhe(e={ready:!1},t){switch(t.type){case o8:return{...e,ready:!!t.payload};default:return e}}const Hhe=_he({project:Dhe,flags:Uhe,app:Fhe});function $he({children:e}){return a.jsx(The,{reducer:Hhe,initialState:{project:{id:null,title:null},flags:{data:null,callState:bt.IDLE},app:{ready:!1}},children:e})}function Vhe({children:e}){const t=sq(),{user:n,status:r}=hi(),s=dg(f=>f.flags),i=s.callState,c=dg(f=>f.app.ready);h.useEffect(()=>{r===Zr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Ahe({id:n.projectId,title:n.projectTitle??null})),i===bt.IDLE&&zhe(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,i,t]),h.useEffect(()=>{const f=r===Zr.AUTHENTICATED&&!!(n!=null&&n.projectId)&&i===bt.LOADED;t({type:o8,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=h.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 Bhe(){const e=IL(uhe);return a.jsx(XK,{children:a.jsx($he,{children:a.jsxs(Vhe,{children:[a.jsx(vhe,{}),a.jsx(jhe,{}),a.jsx(GL,{router:e})]})})})}const i8=document.getElementById("root");if(!i8)throw new Error("Root element not found");R9.createRoot(i8).render(a.jsx(h.StrictMode,{children:a.jsx(Bhe,{})}));
|